:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #617386;
  --green: #0c79d8;
  --green-2: #2e9eff;
  --cream: #f2f7fb;
  --paper: #ffffff;
  --amber: #68c4ff;
  --navy: #080b12;
  --line: #d7e4ef;
  --danger: #a43d3d;
  --shadow: 0 18px 55px rgba(4, 61, 103, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: linear-gradient(180deg, rgba(242,247,251,.93), rgba(242,247,251,.985)), url('/tucuman-it-circuit-bg.jpg') center / cover fixed, var(--cream); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.shell { width: min(1080px, 100%); min-height: 100vh; margin: 0 auto; padding: 28px clamp(18px, 5vw, 54px) 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 44px; padding: 12px 14px; border: 1px solid rgba(104,196,255,.2); border-radius: 20px; background: rgba(8,11,18,.95); box-shadow: 0 18px 45px rgba(0,39,70,.18); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: white; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border: 1px solid rgba(104,196,255,.45); border-radius: 12px; background: white; box-shadow: 0 7px 18px rgba(0,72,126,.3); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: .98rem; font-weight: 850; letter-spacing: -.025em; }
.brand-copy small { color: #9bdcff; font-size: .62rem; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; gap: 8px; }
.nav a { padding: 9px 13px; border-radius: 999px; color: #aeb9c5; font-size: .9rem; text-decoration: none; }
.nav a:hover, .nav a.active { color: white; background: rgba(42,174,255,.17); }

.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -22px 0 28px; padding: 13px 16px; border: 1px solid #e9c896; border-radius: 14px; background: #fff4d9; color: #664518; font-size: .88rem; }
.demo-banner strong { display: block; }
.hero { max-width: 700px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 10px; color: var(--green-2); font-size: .75rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { max-width: 750px; margin: 0; font-size: clamp(2.25rem, 7vw, 4.4rem); line-height: .98; letter-spacing: -.065em; }
.lede { max-width: 600px; margin: 18px 0 0; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.2rem); line-height: 1.6; }

.doorbell { display: grid; gap: 15px; padding: clamp(18px, 4vw, 32px); border: 1px solid rgba(12,121,216,.15); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.floor { display: grid; grid-template-columns: minmax(78px, .55fr) 2fr; gap: 16px; align-items: center; }
.floor-label { color: var(--green); font-size: .9rem; font-weight: 800; }
.floor-label span { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.apartment-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.apt-button { min-height: 78px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; font-size: 1.35rem; font-weight: 850; box-shadow: 0 6px 15px rgba(4,61,103,.06); transition: transform .16s, border-color .16s, background .16s; }
.apt-button small { display: block; margin-top: 3px; color: var(--muted); font-size: .65rem; font-weight: 650; }
.apt-button:hover { transform: translateY(-2px); border-color: var(--green-2); background: #edf7ff; }
.apt-button:active { transform: scale(.98); }
.apt-button:disabled { cursor: wait; opacity: .5; transform: none; }
.apt-button.paused { cursor: not-allowed; color: #7a4747; border-color: #e7caca; background: #f9eeee; opacity: 1; }
.apt-button.paused small { color: #a43d3d; }
.privacy-note { display: flex; align-items: center; gap: 9px; margin: 18px 3px 0; color: var(--muted); font-size: .78rem; }
.request-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 28px; padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(104,196,255,.25); border-radius: 24px; color: white; background: linear-gradient(135deg, #07111f, #0b3154); }
.request-cta h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -.04em; }
.request-cta p:not(.eyebrow) { margin: 0; color: #b8cce0; line-height: 1.5; }
.request-cta .eyebrow { color: var(--amber); }
.request-cta .btn-primary { color: #03101a; background: var(--amber); white-space: nowrap; }
.request-hero { max-width: 820px; }
.request-card { width: min(760px, 100%); }
.request-submit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.card { padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(12,121,216,.14); border-radius: 25px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.narrow { width: min(480px, 100%); margin: 6vh auto 0; }
.card h2 { margin: 0 0 8px; font-size: 1.65rem; letter-spacing: -.04em; }
.card-subtitle { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.form-grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; }
.field label { font-size: .78rem; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; outline: none; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(46,158,255,.14); }
.field-wide { grid-column: 1 / -1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 0; border-radius: 12px; font-weight: 780; }
.btn-primary { color: white; background: var(--green); }
.btn-primary:hover { background: var(--green-2); }
.btn-secondary { border: 1px solid var(--line); color: var(--green); background: white; }
.btn-danger { color: var(--danger); background: #faeaea; }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: .78rem; }
.btn:disabled { cursor: wait; opacity: .55; }
.link-button { padding: 0; border: 0; color: var(--green-2); background: none; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.separator { height: 1px; margin: 25px 0; background: var(--line); }

.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dashboard-head h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--green); background: #e7f4ff; font-size: .76rem; font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(12,121,216,.14); }
.status-pill.status-overdue { color: #87560b; background: #fff0ca; }
.status-pill.status-paused { color: var(--danger); background: #faeaea; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; }
.big-apartment { display: grid; place-items: center; min-height: 225px; border-radius: 21px; color: var(--cream); background: var(--green); text-align: center; }
.big-apartment strong { display: block; font-size: 4.5rem; letter-spacing: -.08em; }
.big-apartment span { color: #c7e8ff; font-size: .78rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.list { display: grid; gap: 10px; }
.call-item, .resident-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.call-item-stack { align-items: stretch; flex-direction: column; }
.call-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reply-panel { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.reply-panel > span, .resident-response span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quick-replies { display: grid; gap: 7px; }
.reply-option { padding: 9px 11px; border: 1px solid #c8deef; border-radius: 10px; color: var(--green); background: #f1f8fe; font-size: .78rem; font-weight: 700; line-height: 1.35; text-align: left; }
.reply-option:hover { border-color: var(--green-2); background: #e7f4ff; }
.reply-option-free { border-style: dashed; background: white; }
.resident-response { display: grid; gap: 5px; padding: 11px 12px; border-radius: 11px; background: #eaf6ff; }
.resident-response strong { font-size: .86rem; line-height: 1.4; }
.item-main { min-width: 0; }
.item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.item-main span { color: var(--muted); font-size: .78rem; }
.empty { padding: 28px 15px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 15px; }
.section-title h2 { margin: 0; }
.admin-layout { display: grid; gap: 20px; }
.resident-meta { display: flex; align-items: center; gap: 9px; }
.apt-chip { flex: 0 0 auto; padding: 6px 9px; border-radius: 9px; color: var(--green); background: #e7f4ff; font-size: .72rem; font-weight: 850; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.error-text { margin: 12px 0 0; color: var(--danger); font-size: .83rem; }
.demo-credentials { display: grid; gap: 4px; margin-top: 18px; padding: 13px 15px; border: 1px solid #e9c896; border-radius: 12px; color: #664518; background: #fff4d9; font-size: .8rem; }
.demo-credentials strong { margin-bottom: 2px; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(4,18,32,.68); backdrop-filter: blur(6px); }
.dialog { width: min(430px, 100%); padding: 28px; border-radius: 24px; background: var(--paper); box-shadow: 0 30px 90px rgba(0,0,0,.25); text-align: center; }
.dialog-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 17px; border-radius: 50%; color: white; background: var(--green); font-size: 1.8rem; }
.dialog h2 { margin: 0 0 9px; font-size: 1.75rem; }
.dialog p { margin: 0; color: var(--muted); line-height: 1.55; }
.dialog .actions { justify-content: center; }
.waiting-icon { letter-spacing: .12em; animation: waiting-pulse 1.5s ease-in-out infinite; }
.waiting-status { display: inline-flex; align-items: center; gap: 9px; margin-top: 20px; padding: 9px 12px; border-radius: 999px; color: var(--green); background: #e7f4ff; font-size: .8rem; font-weight: 800; }
.visitor-response { margin: 20px 0 0; padding: 18px; border: 0; border-radius: 14px; color: var(--ink); background: #e7f4ff; font-size: 1.05rem; font-weight: 750; line-height: 1.5; }
.ring-form { margin-top: 20px; text-align: left; }
.ring-form .actions { margin-top: 4px; }
.entry-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.entry-option { display: grid; place-items: center; gap: 7px; min-height: 94px; padding: 10px 7px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; font-size: .76rem; font-weight: 800; line-height: 1.15; text-align: center; }
.entry-option:hover, .entry-option.active { border-color: var(--green-2); background: #e7f4ff; box-shadow: 0 0 0 2px rgba(46,158,255,.12); }
.entry-option > span:last-child { display: grid; min-height: 2.3em; place-items: center; }
.entry-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: white; background: var(--green); }
.entry-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.entry-hint { margin: -7px 0 0 !important; color: var(--muted); font-size: .72rem; text-align: center; }
.visitor-name-field[hidden] { display: none; }
.dialog-form { text-align: left; }
.dialog-form h2 { margin-bottom: 20px; }
.instruction-list { display: grid; gap: 10px; margin: 20px 0; text-align: left; }
.instruction-list span { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); line-height: 1.4; }
.instruction-list strong { display: grid; flex: 0 0 25px; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: var(--green); font-size: .72rem; }
.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 10px; width: min(370px, calc(100% - 36px)); }
.toast { padding: 14px 16px; border-radius: 13px; color: white; background: var(--green); box-shadow: 0 15px 35px rgba(4,61,103,.25); animation: toast-in .25s ease-out; }
.toast.error { background: var(--danger); }
.central-nav-label { padding: 8px 12px; border: 1px solid rgba(104,196,255,.25); border-radius: 999px; color: #9bdcff; font-size: .75rem; font-weight: 750; }
.central-head h1 { max-width: 780px; }
.central-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { display: grid; gap: 8px; padding: 20px; border: 1px solid rgba(12,121,216,.14); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.stat-card span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.stat-card strong { font-size: clamp(1.45rem, 4vw, 2.15rem); letter-spacing: -.04em; }
.central-building-list, .central-apartment-list { display: grid; gap: 12px; }
.central-building-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(170px, .7fr) auto; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.central-building-main { display: grid; justify-items: start; gap: 7px; }
.central-building-main h3 { margin: 0; font-size: 1.15rem; }
.central-building-main p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.central-building-plan { display: grid; gap: 3px; }
.central-building-plan strong { font-size: 1rem; }
.central-building-plan span { color: var(--muted); font-size: .72rem; }
.central-building-plan em { margin-top: 4px; color: var(--danger); font-size: .72rem; font-style: normal; font-weight: 750; }
.central-detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .5fr); gap: 20px; margin-bottom: 20px; }
.central-links-card { align-content: start; display: grid; gap: 10px; }
.central-links-card .card-subtitle { margin-bottom: 4px; }
.central-apartment-row { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(160px, .7fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.central-apartment-name { display: flex; align-items: center; gap: 10px; }
.central-apartment-name strong, .central-apartment-name span, .central-payment span, .central-payment small { display: block; }
.central-apartment-name span:not(.apt-chip), .central-payment small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.central-payment { display: grid; justify-items: start; gap: 5px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--green); font-size: .82rem; font-weight: 750; text-decoration: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes waiting-pulse { 50% { transform: scale(.94); opacity: .72; } }

@media (max-width: 720px) {
  .shell { padding-top: 18px; }
  .topbar { align-items: flex-start; margin-bottom: 32px; }
  .nav { gap: 2px; }
  .nav a { padding: 8px; font-size: .76rem; }
  .brand span:last-child { display: none; }
  .demo-banner { align-items: flex-start; }
  .floor { grid-template-columns: 1fr; gap: 8px; }
  .floor-label span { display: inline; margin-right: 5px; }
  .apt-button { min-height: 68px; }
  .dashboard-grid, .two-col { grid-template-columns: 1fr; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .resident-item { align-items: flex-start; }
  .central-stats { grid-template-columns: 1fr; }
  .central-building-card, .central-apartment-row, .central-detail-grid { grid-template-columns: 1fr; }
  .central-building-card .btn { width: 100%; }
  .central-apartment-row .actions { width: 100%; }
  .central-apartment-row .actions .btn { flex: 1 1 auto; }
  .request-cta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 400px) {
  .nav a { padding: 7px 6px; font-size: .66rem; }
  .apartment-row { gap: 7px; }
  .apt-button { border-radius: 14px; }
}
