/* ============================================================
   Checklist do Prédio — "Console de Operações"
   Cromo escuro premium + área de trabalho clara + dados em mono.
   Só estilo: todas as classes geradas pelo app.js são preservadas.
   ============================================================ */

:root {
  /* superfícies */
  --bg:        #EEF2F4;   /* slate bem claro (área de trabalho) */
  --card:      #FFFFFF;
  --chrome:    #0E1A24;   /* cromo escuro (topo / login) */
  --chrome-2:  #11242C;   /* fim do gradiente do cromo (teal-tinted) */

  /* tinta */
  --ink:       #0E1A24;
  --muted:     #5C6B76;
  --line:      #E3E9ED;   /* hairline */
  --line-strong:#D5DDE2;

  /* acento (teal evoluído) */
  --accent:      #0D9488;
  --accent-2:    #14B8A6;
  --accent-deep: #0F766E;
  --accent-glow: #2DD4BF;
  --accent-wash: #ECFBF8;

  /* estados */
  --green:    #10B981;  --green-bg: #DCFCE7;  --green-ink:#0F7A52;
  --amber:    #D97706;  --amber-bg: #FEF3C7;  --amber-ink:#92560C;
  --red:      #E11D48;  --red-bg:   #FEE4E9;  --red-ink: #9F1239;

  --radius:    16px;
  --radius-sm: 11px;
  --radius-xs: 9px;

  --shadow-sm: 0 1px 2px rgba(14, 26, 36, .06);
  --shadow:    0 6px 20px -8px rgba(14, 26, 36, .18), 0 1px 2px rgba(14, 26, 36, .05);
  --shadow-lg: 0 18px 44px -14px rgba(14, 26, 36, .30);

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* números/telemetria em mono tabular */
.num, .big, .meta, .ps-info, .room-badge, .pill, .tag, .focus-count, .hist-row .d, .summary .date {
  font-variant-numeric: tabular-nums;
}

.loading { padding: 56px 24px; text-align: center; color: var(--muted); font-size: .92rem; letter-spacing: .01em; }

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Botões / inputs ---------- */
button { font-family: inherit; font-size: 1rem; cursor: pointer; border: none; color: inherit; }

input, select, textarea {
  font-family: inherit; font-size: 1rem; width: 100%;
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}
input:disabled { background: #F4F7F8; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-xs);
  font-weight: 600; font-size: .98rem; letter-spacing: .005em; text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 1px solid rgba(6, 78, 72, .35);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: filter .15s, transform .06s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

.btn.secondary {
  background: #fff; color: var(--accent-deep);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { border-color: var(--accent); background: var(--accent-wash); filter: none; }

.btn.ghost { background: transparent; color: var(--muted); border: 1px solid transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(14, 26, 36, .05); filter: none; }

.btn.danger { background: linear-gradient(180deg, #f43f5e, var(--red)); border-color: rgba(159, 18, 57, .4); }

.btn.small { padding: 7px 12px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn.big { font-size: 1.12rem; padding: 17px; border-radius: var(--radius-sm); }

/* ============================================================
   LOGIN — hero atmosférico (cromo escuro + grade técnica)
   ============================================================ */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 560px at 50% -8%, rgba(20, 184, 166, .22), transparent 60%),
    linear-gradient(180deg, var(--chrome) 0%, #0A141B 100%);
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 32%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 32%, #000, transparent 72%);
}
.login-card {
  position: relative; z-index: 1;
  background: var(--card); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 36px 28px; width: 100%; max-width: 392px;
  border: 1px solid rgba(255, 255, 255, .6);
}
.login-card h1 { margin: 0 0 6px; font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); margin: 0 0 24px; font-size: .92rem; }
.brand-logo {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(150deg, var(--accent-2), var(--accent-deep));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 18px;
  box-shadow: 0 8px 20px -6px rgba(13, 148, 136, .6), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 7px; color: var(--muted); }
.form-error { color: var(--red-ink); font-size: .87rem; margin: 6px 0 0; min-height: 1.1em; }

.google-btn { background: #fff; color: #1f2937; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.google-btn:hover { background: #F7FAFB; filter: none; border-color: var(--line-strong); }
.google-btn svg { width: 18px; height: 18px; }

/* ============================================================
   APP — cromo + área de trabalho
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; color: #EAF2F1;
  background: linear-gradient(180deg, var(--chrome), var(--chrome-2));
  border-bottom: 1px solid rgba(45, 212, 191, .22);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 6px 18px -10px rgba(0, 0, 0, .6);
}
.topbar .title {
  font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 9px;
}
.topbar .user { font-size: .82rem; color: #9FB2B5; display: flex; align-items: center; gap: 10px; }
.topbar .user > span { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user button {
  background: rgba(255, 255, 255, .08); color: #EAF2F1; padding: 6px 12px;
  border-radius: 8px; font-size: .8rem; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .12); transition: background .15s;
}
.topbar .user button:hover { background: rgba(255, 255, 255, .16); }

.tabs {
  display: flex; background: #fff; position: sticky; top: 52px; z-index: 25;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tabs button {
  flex: 1; min-width: max-content; padding: 14px 16px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: .95rem;
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent-deep); border-bottom-color: var(--accent); }

.content { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------- Barra de progresso fixa (telemetria) ---------- */
.progress-strip {
  position: sticky; z-index: 24; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line); padding: 9px 16px;
}
.progress-strip .ps-info {
  display: flex; justify-content: space-between; font-family: var(--font-mono);
  font-size: .76rem; color: var(--muted); margin-bottom: 7px; letter-spacing: .01em;
}
.progress-strip .ps-info span:first-child { color: var(--ink); font-weight: 600; }
.ps-bar, .progress-bar { height: 7px; background: #E3E9ED; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 1px rgba(14, 26, 36, .06); }
.ps-bar > span, .progress-bar > span {
  display: block; height: 100%; border-radius: 999px; transition: width .45s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  box-shadow: 0 0 10px rgba(45, 212, 191, .5);
}
.ps-bar.ok > span { background: linear-gradient(90deg, var(--green), #34D399); box-shadow: 0 0 10px rgba(16, 185, 129, .5); }

/* ---------- Cartão de resumo ---------- */
.summary {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--line);
}
.summary .date {
  font-family: var(--font-mono); font-size: .74rem; color: var(--accent-deep);
  text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
}
.summary .big { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 16px; }
.summary .progress-bar { height: 10px; }
.summary .meta { display: flex; justify-content: space-between; margin-top: 11px; font-size: .85rem; color: var(--muted); font-family: var(--font-mono); }

/* ---------- Banners ---------- */
.banner {
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 16px; font-weight: 600;
  font-size: .94rem; display: flex; align-items: center; gap: 10px; border: 1px solid transparent;
}
.banner.ok { background: var(--green-bg); color: var(--green-ink); border-color: rgba(16, 185, 129, .25); }
.banner.pending { background: var(--amber-bg); color: var(--amber-ink); border-color: rgba(217, 119, 6, .22); }

/* ---------- Andar / salas ---------- */
.floor-title {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted); margin: 24px 4px 10px;
  display: flex; align-items: center; gap: 9px;
}
.floor-title::before { content: ""; width: 18px; height: 2px; background: var(--accent); border-radius: 2px; }

.room {
  background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.room:hover { border-color: var(--line-strong); }
.room.open { box-shadow: var(--shadow); border-color: var(--line-strong); }
.room-head { display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; }
.room-head .name { font-weight: 600; flex: 1; letter-spacing: -.01em; }
.room-badge {
  font-family: var(--font-mono); font-size: .76rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: #EEF3F5; color: var(--muted); border: 1px solid var(--line);
}
.room-badge.done { background: var(--green-bg); color: var(--green-ink); border-color: rgba(16, 185, 129, .3); }
.chevron { color: var(--muted); transition: transform .2s; font-size: .8rem; }
.room.open .chevron { transform: rotate(90deg); color: var(--accent); }
.room-body { display: none; padding: 2px 16px 16px; border-top: 1px solid var(--line); }
.room.open .room-body { display: block; }

.check-row {
  display: flex; align-items: center; gap: 13px; padding: 13px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.check-row:last-child { border-bottom: none; }
.check-row .box {
  width: 26px; height: 26px; min-width: 26px; border-radius: 8px; border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
  transition: background .15s, border-color .15s;
}
.check-row.checked .box { background: linear-gradient(180deg, #34D399, var(--green)); border-color: var(--green); box-shadow: 0 2px 6px -1px rgba(16, 185, 129, .45); }
.check-row.checked .label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.room-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }

/* ---------- Observações ---------- */
.obs-list { margin-top: 12px; }
.obs { background: var(--amber-bg); border: 1px solid rgba(217, 119, 6, .2); border-radius: var(--radius-xs); padding: 11px 13px; margin-bottom: 8px; font-size: .9rem; }
.obs .who { color: var(--amber-ink); font-size: .76rem; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.obs img { max-width: 100%; border-radius: var(--radius-xs); margin-top: 8px; display: block; }
.obs-form { margin-top: 12px; display: none; }
.obs-form.open { display: block; }
.obs-form textarea { min-height: 66px; resize: vertical; margin-bottom: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .85rem; color: var(--muted); }

/* ---------- Iniciar modo foco ---------- */
.focus-start {
  margin-bottom: 18px; font-size: 1.06rem; padding: 17px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* ---------- Modo foco (sala por sala) ---------- */
.focus-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.focus-count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .04em; }
.focus-dots { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-bottom: 16px; }
.focus-dots .dot {
  width: 15px; height: 15px; border-radius: 50%; background: #D7DEE3;
  border: 2px solid transparent; padding: 0; transition: transform .15s, background .15s;
}
.focus-dots .dot.done { background: var(--green); }
.focus-dots .dot.cur { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(45, 212, 191, .22); transform: scale(1.18); }

.focus-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px; border: 1px solid var(--line); }
.focus-floor { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-deep); font-weight: 600; }
.focus-name { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 18px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.focus-or { text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .02em; margin: 18px 0 4px; }

.focus-item { display: flex; align-items: center; gap: 15px; padding: 17px 6px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.focus-item:last-child { border-bottom: none; }
.focus-item .box {
  width: 32px; height: 32px; min-width: 32px; border-radius: 9px; border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px;
  transition: background .15s, border-color .15s;
}
.focus-item.checked .box { background: linear-gradient(180deg, #34D399, var(--green)); border-color: var(--green); box-shadow: 0 2px 8px -1px rgba(16, 185, 129, .5); }
.focus-item .label { font-size: 1.06rem; }
.focus-item.checked .label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.focus-nav { display: flex; gap: 10px; margin-top: 18px; }
.focus-nav .btn { flex: 1; padding: 16px; font-size: 1.04rem; }

/* ---------- Histórico ---------- */
.hist-row {
  background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); padding: 15px 16px; margin-bottom: 9px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: border-color .15s, transform .06s;
}
.hist-row:hover { border-color: var(--line-strong); }
.hist-row:active { transform: translateY(1px); }
.hist-row .d { font-weight: 700; letter-spacing: -.01em; }
.hist-row .info { flex: 1; }
.hist-row .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.pill { font-family: var(--font-mono); font-size: .72rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pill.ok { background: var(--green-bg); color: var(--green-ink); border-color: rgba(16, 185, 129, .3); }
.pill.no { background: var(--red-bg); color: var(--red-ink); border-color: rgba(225, 29, 72, .25); }
.pill.partial { background: var(--amber-bg); color: var(--amber-ink); border-color: rgba(217, 119, 6, .25); }

/* ---------- Admin ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 12px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs button { padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; font-size: .9rem; transition: all .15s; }
.subtabs button:hover { border-color: var(--accent); color: var(--accent-deep); }
.subtabs button.active { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 150px; }
.list-item .tag { font-family: var(--font-mono); font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-deep); border: 1px solid rgba(13, 148, 136, .2); }
.list-item .tag.off { background: var(--red-bg); color: var(--red-ink); border-color: rgba(225, 29, 72, .2); }
.muted { color: var(--muted); font-size: .85rem; line-height: 1.55; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt { margin-top: 12px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(14, 26, 36, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: #fff; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 22px; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head .x { background: #EEF3F5; width: 34px; height: 34px; border-radius: 50%; color: var(--ink); font-size: 18px; transition: background .15s; }
.modal-head .x:hover { background: var(--line-strong); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(160%);
  background: var(--chrome); color: #EAF2F1; padding: 12px 18px; border-radius: 12px;
  font-size: .9rem; z-index: 100; transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  max-width: 90%; text-align: center; box-shadow: var(--shadow-lg); border: 1px solid rgba(45, 212, 191, .25);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: linear-gradient(180deg, #f43f5e, var(--red)); border-color: rgba(159, 18, 57, .4); }
.toast:empty { display: none; }

@media (min-width: 600px) {
  .modal { border-radius: 20px; align-self: center; }
  .modal-bg { align-items: center; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
