:root{
  --steel-900:#20242A;
  --steel-800:#2B3138;
  --paper:#E7E6DD;
  --paper-2:#F2F1EA;
  --ink:#20241F;
  --ink-soft:#5B5F56;
  --brass:#B4884F;
  --brass-light:#D9B679;
  --line:#C9C4B4;

  --green:#3F6E54;
  --green-bg:#DCE7DE;
  --amber:#A97324;
  --amber-bg:#EFE1C6;
  --red:#9C4033;
  --red-bg:#EAD6D1;
  --neutral:#8B8A7E;
  --neutral-bg:#DEDCD0;
}

*{box-sizing:border-box; margin:0; padding:0;}
html, body{height:100%;}
body{background:var(--paper-2); font-family:'Inter', sans-serif; -webkit-tap-highlight-color: transparent;}

.app{
  max-width:520px; margin:0 auto; min-height:100vh;
  background:var(--paper-2);
  display:flex; flex-direction:column;
  position:relative; overflow:hidden;
}

.platebar{
  background:linear-gradient(180deg, var(--steel-800) 0%, var(--steel-900) 100%);
  color:var(--paper-2);
  padding:16px 18px 14px;
  padding-top:calc(16px + env(safe-area-inset-top));
  display:flex; align-items:center; justify-content:space-between;
  position:relative;
  border-bottom:3px solid var(--brass);
  flex-shrink:0;
}

.plate-left{display:flex; align-items:center; gap:10px;}
.back-btn{width:30px; height:30px; border-radius:8px; background:rgba(255,255,255,0.08); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--paper-2);}
.back-btn:hover{background:rgba(255,255,255,0.16);}
.back-btn svg{width:16px; height:16px;}
.back-btn.hidden{visibility:hidden;}

.plate-title{font-family:'Oswald', sans-serif; font-weight:600; font-size:15px; letter-spacing:0.04em; text-transform:uppercase;}
.plate-sub{font-family:'IBM Plex Mono', monospace; font-size:10px; color:var(--brass-light); letter-spacing:0.06em; margin-top:1px;}

.plate-user{display:flex; align-items:center; gap:8px; font-family:'IBM Plex Mono', monospace; font-size:11px; color:#c8ccd2;}
.user-dot{width:7px; height:7px; border-radius:50%; background:#6fbf8b; box-shadow:0 0 6px #6fbf8b;}

.screens{flex:1; position:relative; overflow:hidden;}
.screen{position:absolute; inset:0; overflow-y:auto; padding:20px 18px 40px; opacity:0; transform:translateX(24px); pointer-events:none; transition:opacity 0.28s ease, transform 0.28s ease;}
.screen.active{opacity:1; transform:translateX(0); pointer-events:auto;}

.login-head{margin-bottom:22px;}
.login-eyebrow{font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:0.14em; text-transform:uppercase; color:var(--brass); margin-bottom:6px;}
.login-title{font-family:'Oswald', sans-serif; font-size:26px; font-weight:600; color:var(--ink); line-height:1.15;}
.login-desc{font-size:13px; color:var(--ink-soft); margin-top:8px; line-height:1.5;}

.name-list{display:flex; flex-direction:column; gap:9px; margin-top:20px;}
.name-pill{display:flex; align-items:center; gap:12px; background:var(--paper-2); border:1.5px solid var(--line); border-radius:12px; padding:13px 15px; cursor:pointer; text-align:left; font-family:'Inter', sans-serif; font-size:14.5px; font-weight:600; color:var(--ink); transition:border-color 0.15s ease, background 0.15s ease, transform 0.1s ease; opacity:0; animation:riseIn 0.4s ease forwards;}
.name-pill:hover{border-color:var(--brass); background:#fff;}
.name-pill:active{transform:scale(0.98);}
.name-avatar{width:34px; height:34px; border-radius:50%; background:var(--steel-900); color:var(--brass-light); display:flex; align-items:center; justify-content:center; font-family:'Oswald', sans-serif; font-size:13px; font-weight:600; flex-shrink:0;}

@keyframes riseIn{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);}}

.section-label{font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-soft); margin-bottom:12px;}

.empty-state{font-size:13px; color:var(--ink-soft); background:var(--paper); border:1px dashed var(--line); border-radius:10px; padding:16px; text-align:center; margin-top:8px;}

.building-card{background:var(--paper-2); border:1.5px solid var(--line); border-radius:14px; padding:16px; margin-bottom:12px; cursor:pointer; transition:border-color 0.15s ease, transform 0.1s ease; opacity:0; animation:riseIn 0.4s ease forwards;}
.building-card:active{transform:scale(0.98);}
.building-card:hover{border-color:var(--brass);}

.bc-top{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px;}
.bc-number{font-family:'Oswald', sans-serif; font-weight:700; font-size:12px; color:#fff; background:var(--steel-900); padding:4px 9px; border-radius:6px; letter-spacing:0.05em;}
.bc-arrow{color:var(--ink-soft);}
.bc-arrow svg{width:16px; height:16px;}

.bc-address{font-family:'Inter', sans-serif; font-weight:600; font-size:15px; color:var(--ink); margin-bottom:3px;}
.bc-meta{font-size:12px; color:var(--ink-soft); margin-bottom:12px;}

.bc-progress-row{display:flex; align-items:center; gap:8px;}
.bc-bar{flex:1; height:6px; background:var(--neutral-bg); border-radius:4px; overflow:hidden;}
.bc-bar-fill{height:100%; background:var(--green); border-radius:4px;}
.bc-progress-text{font-family:'IBM Plex Mono', monospace; font-size:11px; color:var(--ink-soft); flex-shrink:0;}

.detail-head{margin-bottom:16px;}
.detail-address{font-family:'Oswald', sans-serif; font-size:19px; font-weight:600; color:var(--ink);}
.detail-meta{font-size:12.5px; color:var(--ink-soft); margin-top:4px;}

.legend{display:flex; flex-wrap:wrap; gap:10px; margin:16px 0 18px; padding:12px 13px; background:var(--paper); border-radius:10px; border:1px solid var(--line);}
.legend-item{display:flex; align-items:center; gap:6px; font-size:11px; color:var(--ink-soft); font-weight:500;}
.legend-dot{width:9px; height:9px; border-radius:3px; flex-shrink:0;}

.floor-row{margin-bottom:14px;}
.floor-label{font-family:'IBM Plex Mono', monospace; font-size:11px; font-weight:500; color:var(--ink-soft); margin-bottom:7px; letter-spacing:0.04em;}
.depto-grid{display:flex; flex-wrap:wrap; gap:8px;}

.depto-btn{min-width:52px; height:52px; border-radius:10px; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-family:'IBM Plex Mono', monospace; font-weight:600; font-size:13px; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.08); transition:transform 0.1s ease;}
.depto-btn:active{transform:scale(0.92);}
.depto-btn.pendiente{background:var(--neutral-bg); color:var(--ink-soft);}
.depto-btn.predicado{background:var(--green-bg); color:var(--green);}
.depto-btn.no_atendio{background:var(--amber-bg); color:var(--amber);}
.depto-btn.no_molestar{background:var(--red-bg); color:var(--red);}
.depto-btn svg{width:14px; height:14px;}

.scrim{position:fixed; inset:0; background:rgba(20,23,27,0.45); opacity:0; pointer-events:none; transition:opacity 0.2s ease; z-index:50;}
.scrim.show{opacity:1; pointer-events:auto;}

.sheet{position:fixed; left:50%; bottom:0; transform:translate(-50%, 100%); width:100%; max-width:520px; background:var(--paper-2); border-radius:20px 20px 0 0; padding:10px 20px calc(26px + env(safe-area-inset-bottom)); transition:transform 0.28s cubic-bezier(.32,.72,0,1); z-index:51; box-shadow:0 -10px 30px rgba(0,0,0,0.2);}
.sheet.show{transform:translate(-50%, 0);}

.sheet-handle{width:36px; height:4px; background:var(--line); border-radius:4px; margin:0 auto 16px;}
.sheet-title{font-family:'Oswald', sans-serif; font-size:18px; font-weight:600; color:var(--ink); text-align:center; margin-bottom:2px;}
.sheet-sub{text-align:center; font-size:12px; color:var(--ink-soft); margin-bottom:18px;}

.sheet-options{display:flex; flex-direction:column; gap:9px;}
.sheet-opt{display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:12px; border:1.5px solid var(--line); background:#fff; cursor:pointer; font-family:'Inter', sans-serif; font-weight:600; font-size:14px; color:var(--ink); transition:transform 0.1s ease, border-color 0.15s ease;}
.sheet-opt:active{transform:scale(0.98);}
.sheet-opt-icon{width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.sheet-opt-icon svg{width:16px; height:16px;}
.opt-predicado .sheet-opt-icon{background:var(--green-bg); color:var(--green);}
.opt-predicado:hover{border-color:var(--green);}
.opt-no_atendio .sheet-opt-icon{background:var(--amber-bg); color:var(--amber);}
.opt-no_atendio:hover{border-color:var(--amber);}
.opt-no_molestar .sheet-opt-icon{background:var(--red-bg); color:var(--red);}
.opt-no_molestar:hover{border-color:var(--red);}

.toast{position:fixed; left:50%; bottom:24px; transform:translate(-50%, 12px); background:var(--steel-900); color:var(--paper-2); padding:11px 18px; border-radius:10px; font-size:12.5px; font-weight:500; display:flex; align-items:center; gap:8px; opacity:0; pointer-events:none; transition:opacity 0.2s ease, transform 0.2s ease; z-index:52; box-shadow:0 8px 20px rgba(0,0,0,0.25); white-space:nowrap;}
.toast.show{opacity:1; transform:translate(-50%, 0);}
.toast-dot{width:7px; height:7px; border-radius:50%; flex-shrink:0;}

.change-link{text-align:center; margin-top:22px; font-size:12px; color:var(--ink-soft); text-decoration:underline; cursor:pointer;}
