/* ==========================================================================
   LACRE · Portal dos Pais — design system
   Mobile-first. Cores da marca: bordeaux #8f0921 · rosa #d694a0 · cinza #aeaeae
   ========================================================================== */

:root {
  --brand: #8f0921;
  --brand-700: #74071a;
  --brand-600: #a10e2a;
  --brand-100: #f8e3e7;
  --brand-50: #fcf2f4;
  --rose: #d694a0;

  --bg: #f6f4f3;
  --surface: #ffffff;
  --surface-2: #faf8f7;
  --border: #e9e4e2;
  --border-strong: #d8d1ce;
  --text: #1f1a1b;
  --text-2: #5d5557;
  --text-3: #8b8385;

  --success: #17803d;   --success-bg: #e7f6ec;
  --warning: #a15c00;   --warning-bg: #fff3dc;
  --danger:  #c0262d;   --danger-bg:  #fde9ea;
  --info:    #1d5fb8;   --info-bg:    #e7f0fc;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(31, 26, 27, .05);
  --shadow: 0 1px 2px rgba(31, 26, 27, .04), 0 4px 16px rgba(31, 26, 27, .06);
  --shadow-lg: 0 12px 40px rgba(31, 26, 27, .16);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 64px;
  --topbar-h: 60px;
  --sidebar-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #e0566e; --brand-700: #f07b8f; --brand-600: #e86a80;
    --brand-100: #3a1a20; --brand-50: #2a1418; --rose: #d694a0;
    --bg: #141112; --surface: #1d191a; --surface-2: #231f20;
    --border: #322c2d; --border-strong: #433b3d;
    --text: #f3eeef; --text-2: #c2b8ba; --text-3: #8e8486;
    --success: #4cc77a; --success-bg: #12301d;
    --warning: #f0b14a; --warning-bg: #352710;
    --danger: #ff6b70;  --danger-bg: #3a1618;
    --info: #6aa8ff;    --info-bg: #13243d;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 40px; height: 40px; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100vh; }
.main-col { min-width: 0; }
.content {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); padding: 0 12px 0 16px;
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-logo img { height: 30px; display: block; }
.topbar-spacer { flex: 1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar-logo img,
  :root:not([data-theme="light"]) .sidebar-logo img,
  :root:not([data-theme="light"]) .login-logo { filter: brightness(1.6) saturate(.8); }
}

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 8px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 20px 12px;
  }
  .sidebar-logo { padding: 4px 12px 16px; }
  .sidebar-logo img { height: 40px; display: block; }
  .topbar-logo { display: none; }
  .tabbar { display: none !important; }
  .content { padding: 28px 32px 48px; }
}

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a.is-active { background: var(--brand-50); color: var(--brand); font-weight: 700; }
.sidenav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidenav .dot-count { margin-left: auto; }

.dot-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* Barra inferior (telemóvel) */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a, .tabbar button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 600 11px/1 var(--font); color: var(--text-3); text-decoration: none;
  background: none; border: 0; cursor: pointer;
}
.tabbar a.is-active { color: var(--brand); }
.tabbar a.is-active .ic { stroke-width: 2.4; }
.tabbar .dot-count { position: absolute; top: 8px; left: calc(50% + 4px); }

/* Seletor de educando */
.kid-switch { position: relative; }
.kid-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font: 600 14px var(--font); color: var(--text); cursor: pointer;
}
.kid-btn:hover { border-color: var(--border-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--rose));
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
[data-menu].is-open .menu-pop { display: block; animation: pop .14s ease-out; }
.menu-pop a, .menu-pop button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  font: 500 14px var(--font); color: var(--text); text-align: left; cursor: pointer; text-decoration: none;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .is-current { font-weight: 700; }
.menu-pop .is-current .ic { margin-left: auto; color: var(--brand); }
.menu-pop .danger { color: var(--danger); }
.menu-pop form { margin: 0; }
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Gaveta "Mais" */
.drawer {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%;
  border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer[open] { animation: up .2s ease-out; }
.drawer::backdrop { background: rgba(20, 10, 12, .45); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px 20px; }
.drawer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 12px 20px; }
.drawer-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px;
  font-size: 11.5px; font-weight: 600; color: var(--text); text-align: center; text-decoration: none; border-radius: 12px;
}
.drawer-grid a:active { background: var(--surface-2); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: none;
  display: inline-grid; place-items: center; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.section-title h2 { font-size: 1.05rem; }

/* ---------- Cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card.pad { padding: 16px; }
.card-accent { border-left: 4px solid var(--brand); }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Mosaico do início ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 6px 14px; min-height: 104px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-weight: 600; font-size: 13px; text-align: center; text-decoration: none;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile:active { transform: scale(.98); }
.tile-ic {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand);
}
.tile-ic .ic { width: 22px; height: 22px; }
.tile .badge { position: absolute; top: 8px; right: 8px; }

/* Cartão de destaque (hero) */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, #b0213f 60%, var(--rose) 140%);
  color: #fff; border-radius: 20px; padding: 20px; margin-bottom: 16px;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,255,255,.08);
}
.hero h1 { font-size: 1.45rem; color: #fff; }
.hero p { color: rgba(255,255,255,.85); margin: 4px 0 0; }
.hero .row { position: relative; z-index: 1; }

/* ---------- Listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.grow, .list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: .85rem; color: var(--text-2); }
.list-item .lead {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.list-item .lead.brand { background: var(--brand-50); color: var(--brand); }

/* ---------- Linha temporal (horário) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 0 0 12px; }
.timeline li::before { content: ""; position: absolute; left: 75px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .t-time { font-weight: 700; font-size: .85rem; color: var(--text-2); padding-top: 9px; text-align: right; font-variant-numeric: tabular-nums; }
.timeline .t-card {
  position: relative; margin-left: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
}
.timeline .t-card::before {
  content: ""; position: absolute; left: -16px; top: 14px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline .t-card .ic { color: var(--text-3); }
.timeline .t-card.is-transport { background: var(--info-bg); border-color: transparent; }
.timeline .t-card.is-transport .ic { color: var(--info); }
.timeline .t-card.is-support { background: var(--brand-50); border-color: transparent; }
.timeline .t-card.is-support .ic { color: var(--brand); }
.timeline .t-card.is-done { background: var(--success-bg); border-color: transparent; }
.timeline .t-card.is-done::before { background: var(--success); border-color: var(--success); }
.timeline .t-card.is-done .ic { color: var(--success); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap;
}
.badge-neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-brand   { background: var(--brand-100); color: var(--brand); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--info-bg); color: var(--info); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.hero .btn { background: #fff; border-color: #fff; color: var(--brand); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),
.field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font: 400 15px var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea, .textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.field input[readonly] { background: var(--surface-2); color: var(--text-2); }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-grid .span-2 { grid-column: span 2; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.input-group { position: relative; }
.input-group .icon-btn { position: absolute; right: 2px; top: 2px; }

/* Interruptor */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---------- Segmentos / separadores ---------- */
.segmented {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto;
}
.segmented a, .segmented button {
  padding: 7px 14px; border-radius: 9px; border: 0; background: none; white-space: nowrap;
  font: 600 13px var(--font); color: var(--text-2); cursor: pointer; text-decoration: none;
}
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
[data-tab-panel]:not(.is-active) { display: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  font: 600 13px var(--font); color: var(--text-2); white-space: nowrap; cursor: pointer; text-decoration: none;
}
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Tabelas (empilham no telemóvel) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
@media (max-width: 639px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.stack-sm td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); font-weight: 600; color: var(--text-3); text-align: left; }
}

/* ---------- Calendário mensal ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-5 { grid-template-columns: repeat(5, 1fr); }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: center; text-transform: uppercase; padding: 4px 0; }
.cal-day {
  min-height: 64px; padding: 6px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); font-size: 12px; display: flex; flex-direction: column; gap: 4px;
}
.cal-day .n { font-weight: 700; font-size: 13px; }
.cal-day.is-out { background: transparent; border-style: dashed; opacity: .5; }
.cal-day.is-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-day.is-sel { background: var(--brand-50); }

/* ---------- Alertas, vazio, toasts ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  font-weight: 500; font-size: 14px;
}
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }

.empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.empty .ic { color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { color: var(--text-2); margin-bottom: 4px; }
.empty p { margin: 0; font-size: 14px; }

.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 12px; background: #231d1e; color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: up .2s ease-out;
}
.toast.error { background: var(--danger); }
.toast.success .ic { color: #6ee7a0; }

/* ---------- Modal ---------- */
.modal {
  border: 0; padding: 0; width: min(440px, calc(100% - 32px));
  border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal[open] { animation: pop .16s ease-out; }
.modal::backdrop { background: rgba(20, 10, 12, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-body { padding: 12px 20px 8px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 20px; }
@media (max-width: 639px) {
  .modal { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal[open] { animation: up .2s ease-out; }
  .modal-foot .btn { flex: 1; }
}

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 120px); min-height: 360px; }
@media (min-width: 960px) { .chat { height: calc(100vh - var(--topbar-h) - 160px); } }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.4; word-wrap: break-word; }
.bubble .time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.bubble.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.chat-day { align-self: center; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; margin: 8px 0; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--border-strong); font: 400 15px var(--font); background: var(--surface); color: var(--text); }
.chat-form .btn { border-radius: 50%; width: 44px; padding: 0; }

/* ---------- Estado / passos (Click'n Go) ---------- */
.status-big { text-align: center; padding: 28px 16px; }
.status-big .ring {
  width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2);
}
.status-big .ring .ic { width: 42px; height: 42px; }
.status-big.waiting .ring { background: var(--warning-bg); color: var(--warning); animation: pulse 1.8s ease-in-out infinite; }
.status-big.ready .ring { background: var(--success-bg); color: var(--success); }
.status-big.cancelled .ring { background: var(--danger-bg); color: var(--danger); }
.status-big.message .ring { background: var(--info-bg); color: var(--info); }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--warning) 12%, transparent); } }

.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.steps span.on { background: var(--brand); }

/* ---------- Login ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 110% -10%, color-mix(in srgb, var(--rose) 35%, transparent), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
    var(--bg);
}
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px 24px 24px; box-shadow: var(--shadow-lg); }
.login-logo { display: block; height: 56px; margin: 0 auto 18px; }
.auth-card h1 { text-align: center; font-size: 1.3rem; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-2); margin-bottom: 22px; font-size: 14px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-3); }

/* ---------- Utilitários ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.w-100 { width: 100%; }
.hide-sm { display: none; } @media (min-width: 640px) { .hide-sm { display: initial; } }
.kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

@media print {
  .sidebar, .topbar, .tabbar, .page-actions, .btn { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
