/* =====================================================================
   Escala Inteligente — Design system
   ===================================================================== */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e7ee;
  --border-strong: #cfd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-700: #3730a3;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;

  --success: #059669;
  --success-50: #ecfdf5;
  --warning: #b45309;
  --warning-500: #d97706;
  --warning-50: #fffbeb;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --info: #2563eb;
  --info-50: #eff6ff;
  --pending: #7c3aed;
  --pending-50: #f5f3ff;

  --side: #0b1220;
  --side-2: #131c2e;
  --side-text: #cbd5e1;
  --side-muted: #64748b;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", ui-monospace, monospace;
  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
:where(svg) { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
h4 { font-size: 13px; font-weight: 650; }
p { margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; }
.stack.lg { gap: 20px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ----------------------------------------------------------------- Layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--side) 0 var(--sidebar-w), var(--bg) var(--sidebar-w)); }

/* Layout de configurações (título e descrição à esquerda, campos à direita) */
.settings { display: flex; flex-direction: column; }
.set-sec { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.set-sec:first-child { padding-top: 6px; }
.set-sec:last-of-type { border-bottom: none; }
.set-sec h3 { font-size: 15px; }
.set-sec .desc { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; }
.set-sec .desc .badge { margin-top: 10px; }
.set-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px 26px; box-shadow: var(--shadow-sm); }
.set-card .form-grid { gap: 18px 18px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 0; margin-top: 4px; background: linear-gradient(to top, var(--bg) 70%, rgba(245, 246, 250, 0)); }
.save-bar .small { margin-right: auto; }
.option-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.option-row strong { font-size: 13.5px; display: block; }
.option-row span.d { font-size: 12.5px; color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2563eb, #06b6d4); flex: none; }
@media (max-width: 960px) { .set-sec { grid-template-columns: 1fr; gap: 14px; } .app { background: var(--bg); } }
.sidebar {
  background: var(--side);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #111a2b;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .45);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--side-muted); }
.org-switch {
  margin: 4px 12px 10px; padding: 9px 10px; border-radius: 10px;
  background: var(--side-2); border: 1px solid #1e293b; color: #e2e8f0;
  display: flex; align-items: center; gap: 8px; cursor: pointer; width: calc(100% - 24px);
  font: inherit; text-align: left;
}
.org-switch:hover { border-color: #334155; }
.org-switch > svg { width: 16px; height: 16px; color: var(--side-muted); }
.org-avatar { width: 26px; height: 26px; border-radius: 7px; background: #312e81; color: #c7d2fe; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.org-switch .org-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch .org-role { font-size: 11px; color: var(--side-muted); }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--side-text);
  font-weight: 500; font-size: 13.5px; text-decoration: none; margin-bottom: 1px;
}
.nav a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: rgba(99, 102, 241, .18); color: #fff; }
.nav a.active svg { opacity: 1; color: #a5b4fc; }
.nav .count { margin-left: auto; background: #1e293b; color: #cbd5e1; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.nav .count.danger { background: #7f1d1d; color: #fecaca; }
.side-foot { padding: 12px; border-top: 1px solid #1e293b; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 999px; background: #1e293b; color: #e2e8f0; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.user-chip .name { color: #e2e8f0; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .email { color: var(--side-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.side-foot .icon-btn { color: var(--side-muted); }
.side-foot .icon-btn:hover { color: #fff; background: var(--side-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs strong { color: var(--text); font-weight: 600; }
.menu-btn { display: none; }
.demo-pill { background: var(--warning-50); color: var(--warning); border: 1px solid #fde68a; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
  text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #b8c0cf; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef1f6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-secondary.loading::after, .btn-ghost.loading::after { border-color: rgba(79, 70, 229, .25); border-top-color: var(--primary); }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: #eef1f6; color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .label svg { width: 15px; height: 15px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.kpi.danger .value { color: var(--danger); }
.kpi.warning .value { color: var(--warning); }
.kpi.success .value { color: var(--success); }

/* ----------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.badge svg { width: 12px; height: 12px; }
.badge.primary { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }
.badge.success { background: var(--success-50); color: #047857; border-color: #a7f3d0; }
.badge.warning { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.badge.danger { background: var(--danger-50); color: #b91c1c; border-color: #fecaca; }
.badge.info { background: var(--info-50); color: #1d4ed8; border-color: #bfdbfe; }
.badge.pending { background: var(--pending-50); color: #6d28d9; border-color: #ddd6fe; }
.badge.dark { background: #0f172a; color: #fff; border-color: #0f172a; }
.badge.outline { background: #fff; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: none; }

/* ----------------------------------------------------------------- Forms */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.col-9 { grid-column: span 9; } .col-10 { grid-column: span 10; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: #1e293b; }
.field .req { color: var(--danger); }
.field .help { font-size: 12px; color: var(--muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.field .error { font-size: 12px; color: var(--danger); }
/* Todos os campos de texto (inclusive <input> sem atributo type) seguem o mesmo padrão da tela de login.
   :where() mantém especificidade zero para que ajustes locais (.input-sm, matrizes, tabelas) prevaleçam. */
.input, :where(input:not([type=checkbox], [type=radio], [type=color], [type=hidden], [type=range], [type=file], [type=submit], [type=button])), select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  height: 42px; padding: 0 13px; border-radius: 10px;
  border: 1px solid #dbe2ec; background-color: #f8fafc;
  transition: border-color .12s, box-shadow .12s, background-color .12s; width: 100%; min-width: 0;
}
:where(input, textarea)::placeholder { color: #a0abbe; }
:where(input:not([type=checkbox], [type=radio]), select, textarea):hover { border-color: #c3cddb; }
textarea { height: auto; min-height: 88px; padding: 10px 13px; resize: vertical; line-height: 1.5; }
select { padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; background-color: #fff; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .13); }
input:disabled, select:disabled, textarea:disabled { background-color: #f1f5f9; color: var(--muted); border-color: #e2e8f0; cursor: not-allowed; }
input[type=color] { width: 42px; height: 38px; padding: 3px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; }
.input-sm { height: 32px !important; font-size: 13px !important; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.days-picker label { position: relative; }
.days-picker input { position: absolute; opacity: 0; }
.days-picker span {
  display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer; background: #fff; user-select: none;
}
.days-picker input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.days-picker.danger input:checked + span { background: var(--danger); border-color: var(--danger); }
.days-picker.soft input:checked + span { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); }
.days-picker input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-select label { position: relative; }
.chips-select input { position: absolute; opacity: 0; }
.chips-select > label > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12.5px; cursor: pointer; background: #fff; }
.chips-select input:checked + span { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); font-weight: 600; }
.input-group { display: flex; align-items: stretch; }
.input-group > :first-child { border-radius: 8px 0 0 8px; }
.input-group > :last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.input-addon { display: grid; place-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 12.5px; color: var(--muted); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search input { padding-left: 34px; }

/* ----------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: none; border: none; padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .tab-count { background: #eef1f6; color: var(--text-2); border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.tabs .tab-count.danger { background: var(--danger-50); color: var(--danger); }
.segmented { display: inline-flex; background: #eef1f6; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button { font: inherit; font-size: 12.5px; font-weight: 600; border: none; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented button svg { width: 14px; height: 14px; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* ----------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbff; }
.table tr.clickable { cursor: pointer; }
.table .cell-title { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--muted); }
.table input, .table select { height: 32px; }

/* ----------------------------------------------------------------- Feedback */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.info { background: var(--info-50); border-color: #bfdbfe; color: #1e3a8a; }
.alert.warning { background: var(--warning-50); border-color: #fde68a; color: #78350f; }
.alert.danger { background: var(--danger-50); border-color: #fecaca; color: #7f1d1d; }
.alert.success { background: var(--success-50); border-color: #a7f3d0; color: #064e3b; }
.alert.pending { background: var(--pending-50); border-color: #ddd6fe; color: #4c1d95; }
.alert.neutral { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.alert strong { font-weight: 650; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 440px; margin: 0 auto 16px; }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fb 37%, #eef1f5 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-page { display: grid; gap: 16px; }
.progress { height: 8px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.success > span { background: var(--success); }
.progress.warning > span { background: var(--warning-500); }
.progress.danger > span { background: var(--danger); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: 420px; }
.toast {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; animation: toastIn .2s ease;
}
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success svg { color: #34d399; } .toast.error svg { color: #f87171; } .toast.info svg { color: #93c5fd; } .toast.warning svg { color: #fbbf24; }
.toast strong { color: #fff; display: block; }
.toast .t-body { white-space: pre-line; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ----------------------------------------------------------------- Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s ease; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1100px; }
.modal.sm { max-width: 440px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { padding: 18px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal .tabs { margin: -4px 0 16px; }

/* ----------------------------------------------------------------- Auth */
.auth {
  min-height: 100vh; position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: 48px; padding: 24px clamp(24px, 7vw, 120px);
  background:
    radial-gradient(900px 700px at 78% 45%, rgba(37, 99, 235, .55) 0%, rgba(37, 99, 235, 0) 60%),
    radial-gradient(600px 500px at 95% 5%, rgba(14, 165, 233, .25) 0%, rgba(14, 165, 233, 0) 60%),
    radial-gradient(700px 600px at 0% 100%, rgba(30, 64, 175, .35) 0%, rgba(30, 64, 175, 0) 60%),
    linear-gradient(160deg, #070d24 0%, #0a1535 45%, #0b1a44 100%);
  color: #e2e8f0;
}
.auth::before, .auth::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(96, 165, 250, .14);
}
.auth::before { width: 980px; height: 980px; right: -260px; top: 50%; transform: translateY(-50%); }
.auth::after { width: 1400px; height: 1400px; right: -480px; top: 50%; transform: translateY(-50%); border-color: rgba(96, 165, 250, .08); }
.auth > * { position: relative; z-index: 1; }

.auth-intro { max-width: 520px; }
.auth-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #60a5fa; }
.auth-title { font-size: clamp(36px, 4.2vw, 54px); font-weight: 700; line-height: 1.06; letter-spacing: -.035em; color: #fff; margin-top: 18px; }
.auth-title span { background: linear-gradient(90deg, #60a5fa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-lead { font-size: 17px; line-height: 1.6; color: #b6c2d9; margin-top: 20px; max-width: 460px; }
.auth-tags { display: inline-flex; align-items: center; gap: 10px; margin-top: 32px; padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, .35); font-size: 12px; font-weight: 600; letter-spacing: .08em; color: #e2e8f0; }
.auth-tags i { width: 4px; height: 4px; border-radius: 50%; background: #60a5fa; display: inline-block; }
.auth-points { display: grid; gap: 14px; margin-top: 36px; }
.auth-point { display: flex; gap: 12px; align-items: center; font-size: 14.5px; color: #cbd5e1; }
.auth-point .pi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(59, 130, 246, .14); border: 1px solid rgba(96, 165, 250, .25); color: #93c5fd; }
.auth-point .pi svg { width: 16px; height: 16px; }

.auth-side { display: flex; justify-content: center; }
.auth-card {
  width: 100%; max-width: 520px; background: #fff; color: var(--text);
  border-radius: 20px; padding: 28px 36px 22px;
  box-shadow: 0 40px 80px -20px rgba(2, 6, 23, .7), 0 0 0 1px rgba(255, 255, 255, .6) inset, 0 0 120px rgba(37, 99, 235, .25);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .bm { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.auth-brand .bm svg { width: 19px; height: 19px; }
.auth-brand strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: #0f172a; }
.auth-brand span { font-size: 14px; color: #94a3b8; font-weight: 500; }
.auth-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: #0f172a; }
.auth-card .sub { font-size: 13.5px; color: #64748b; margin: 4px 0 16px; line-height: 1.5; }
.auth-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; }
.auth-form .full { grid-column: 1 / -1; }
.auth-form .field { gap: 5px; }
.auth-form .field > label { font-size: 13px; font-weight: 600; color: #1e293b; display: flex; justify-content: space-between; align-items: baseline; }
.auth-form .field > label .opt { color: #94a3b8; font-weight: 500; }
.auth-form .field > label a { font-size: 12.5px; font-weight: 600; }
.auth-form input:not([type=checkbox]), .auth-form select {
  height: 42px; padding: 0 13px; font-size: 14px; border-radius: 10px;
  border: 1px solid #dbe2ec; background-color: #f8fafc; color: #0f172a;
}
.auth-form select { padding-right: 36px; background-position: right 14px center; }
.auth-form input::placeholder { color: #a0abbe; }
.auth-form input:hover, .auth-form select:hover { border-color: #c3cddb; }
.auth-form input:focus, .auth-form select:focus { background-color: #fff; border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.auth-form .hint { grid-column: 1 / -1; margin-top: -6px; font-size: 12px; color: #64748b; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: none; border-radius: 8px; color: #94a3b8; cursor: pointer; display: grid; place-items: center; }
.pw-wrap button:hover { color: #334155; background: #eef2f7; }
.pw-wrap button svg { width: 18px; height: 18px; }
.auth-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #334155; cursor: pointer; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.auth-check input { width: 18px; height: 18px; accent-color: #2563eb; flex: none; }
.auth-check small { display: block; color: #64748b; font-size: 12px; }
@media (max-height: 760px) and (min-width: 1021px) { .auth-points { display: none; } .auth-card .sub { display: none; } .auth-brand { margin-bottom: 12px; } }
.auth-submit {
  height: 46px; border: none; border-radius: 11px; cursor: pointer; width: 100%;
  font: inherit; font-size: 15.5px; font-weight: 700; color: #fff; letter-spacing: .01em;
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .6);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, box-shadow .12s, filter .12s; margin-top: 2px; position: relative;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 14px 28px -8px rgba(37, 99, 235, .7); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit svg { width: 18px; height: 18px; }
.auth-submit.loading { color: transparent; pointer-events: none; }
.auth-submit.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.auth-foot { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth-foot svg { width: 14px; height: 14px; }
.auth-switch { text-align: center; margin-top: 10px; font-size: 13.5px; color: #64748b; }
.auth-switch a { font-weight: 700; }
.auth-card .alert { font-size: 13px; }
.auth-copy { position: absolute; left: clamp(24px, 7vw, 120px); bottom: 12px; font-size: 12.5px; color: #64748b; z-index: 1; }

@media (max-width: 1020px) {
  .auth { grid-template-columns: 1fr; padding: 40px 20px 64px; gap: 32px; }
  .auth-intro { max-width: 520px; margin: 0 auto; text-align: center; }
  .auth-lead { margin-left: auto; margin-right: auto; }
  .auth-points { display: none; }
  .auth-title { font-size: 34px; }
  .auth-copy { left: 0; right: 0; text-align: center; }
}
@media (max-width: 520px) {
  .auth-card { padding: 28px 22px 24px; border-radius: 18px; }
  .auth-form { grid-template-columns: 1fr; }
  .auth-tags { display: none; }
}

/* ----------------------------------------------------------------- Stepper / wizard */
.stepper { display: flex; gap: 0; margin-bottom: 22px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 6px; overflow-x: auto; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: none; background: none; font: inherit; text-align: left; min-width: 170px; }
.step .num { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #eef1f6; color: var(--muted); flex: none; }
.step .num svg { width: 15px; height: 15px; }
.step .t { font-weight: 600; font-size: 13.5px; color: var(--muted); line-height: 1.2; }
.step .d { font-size: 11.5px; color: var(--faint); }
.step.active { background: var(--primary-50); }
.step.active .num { background: var(--primary); color: #fff; }
.step.active .t { color: var(--primary-700); }
.step.done .num { background: var(--success); color: #fff; }
.step.done .t { color: var(--text); }
.step[disabled] { cursor: not-allowed; }
.wizard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 12px; }

.status-flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.status-flow .sf { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.status-flow .sf .b { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #d5dbe6; display: grid; place-items: center; background: #fff; }
.status-flow .sf .b svg { width: 12px; height: 12px; }
.status-flow .sf.done { color: var(--text-2); }
.status-flow .sf.done .b { background: var(--success); border-color: var(--success); color: #fff; }
.status-flow .sf.current { color: var(--primary-700); }
.status-flow .sf.current .b { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.status-flow .sf.current .b::after { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--primary); }
.status-flow .sf.blocked .b { border-color: var(--danger); background: var(--danger-50); color: var(--danger); }
.status-flow .line { width: 34px; height: 2px; background: #e2e8f0; margin: 0 8px; }
.status-flow .line.done { background: var(--success); }

/* ----------------------------------------------------------------- Schedule grid */
.sched-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 22px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.sched-scroll { overflow: auto; max-height: calc(100vh - 290px); min-height: 280px; position: relative; }
table.sched { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sched th, .sched td { border-right: 1px solid #edf0f5; border-bottom: 1px solid #edf0f5; padding: 0; }
.sched thead th { position: sticky; top: 0; z-index: 3; background: #fff; }
.sched .emp-col { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 210px; max-width: 210px; border-right: 1px solid var(--border); }
.sched thead .emp-col { z-index: 4; }
.sched .emp-cell { padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; height: 40px; }
.sched .emp-cell .n { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.sched .emp-cell .s { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched .emp-cell .warn { color: var(--danger); display: inline-flex; }
.sched .emp-cell .warn svg { width: 13px; height: 13px; }
.sched .day-h { width: 38px; min-width: 38px; text-align: center; padding: 6px 0 5px; cursor: pointer; }
.sched .day-h .dn { font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.1; }
.sched .day-h .dw { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.sched .day-h.we { background: #f6f7ff; }
.sched .day-h.closed { background: #f1f5f9; }
.sched .day-h.closed .dn { color: var(--faint); }
.sched .day-h.hol .dw { color: var(--pending); }
.sched .day-h.today .dn { color: #fff; background: var(--primary); border-radius: 6px; padding: 1px 5px; display: inline-block; }
.sched .day-h:hover { background: var(--primary-50); }
.sched .day-h .hol-dot { width: 5px; height: 5px; border-radius: 9px; background: var(--pending); display: block; margin: 2px auto 0; }
.sched .tot-col { min-width: 64px; text-align: center; font-weight: 600; font-size: 12px; position: sticky; right: 0; background: #fff; border-left: 1px solid var(--border); z-index: 2; }
.sched thead .tot-col { z-index: 4; }
.sched td.c { width: 38px; height: 40px; text-align: center; position: relative; cursor: default; }
.sched td.c.editable { cursor: pointer; }
.sched td.c.we { background: #fafaff; }
.sched td.c.closed { background: repeating-linear-gradient(135deg, #f8fafc 0 6px, #f1f5f9 6px 12px); }
.sched td.c .pill {
  width: 30px; height: 26px; margin: auto; border-radius: 6px; display: grid; place-items: center;
  font-weight: 700; font-size: 11.5px; border: 1px solid transparent; position: relative;
}
.sched td.c .pill.off { color: #94a3b8; font-weight: 600; background: transparent; }
.sched td.c .pill.leave { background: #fff7ed; color: #c2410c; border-color: #fed7aa; font-size: 10px; }
.sched td.c .pill.unav { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; font-size: 10px; }
.sched td.c.editable:hover .pill { box-shadow: 0 0 0 2px var(--primary-100); }
.sched td.c.sel .pill { box-shadow: 0 0 0 2px var(--primary); }
.sched td.c.has-issue .pill::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 99px; background: var(--danger); border: 1.5px solid #fff; }
.sched td.c.has-warn .pill::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 99px; background: var(--warning-500); border: 1.5px solid #fff; }
.sched td.c.manual .pill { outline: 1px dashed rgba(15, 23, 42, .25); outline-offset: 1px; }
.sched td.c.flash .pill { animation: flash 1s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(79, 70, 229, .5); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }
.sched tr.emp-row:hover td { background-color: #fbfcff; }
.sched tr.emp-row:hover .emp-col { background: #fbfcff; }
.sched tfoot td { background: var(--surface-2); position: sticky; bottom: 0; z-index: 1; }
.sched tfoot .emp-col { background: var(--surface-2); z-index: 3; }
.sched tfoot .cov { height: 28px; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.sched tfoot .cov.bad { background: var(--danger-50); color: var(--danger); }
.sched tfoot .cov.over { background: var(--warning-50); color: var(--warning); }
.sched tfoot .cov.ok { color: #047857; }
.sched tfoot .cov-label { padding: 0 12px; font-size: 11.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; height: 28px; }
.sched .week-sep { border-left: 2px solid #dfe3ec !important; }

.cell-menu {
  position: fixed; z-index: 90; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); width: 270px; padding: 6px; animation: pop .12s ease;
}
.cell-menu .cm-head { padding: 8px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.cell-menu .cm-head strong { font-size: 13px; display: block; }
.cell-menu .cm-head span { font-size: 12px; color: var(--muted); }
.cell-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: none; background: none; font: inherit; font-size: 13px; cursor: pointer; text-align: left; color: var(--text); }
.cell-menu button:hover, .cell-menu button:focus { background: var(--surface-2); outline: none; }
.cell-menu button.current { background: var(--primary-50); }
.cell-menu button .sw { width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }
.cell-menu button .meta { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.cell-menu button .warn-txt { color: var(--danger); font-size: 11px; display: block; }
.cell-menu .sep { height: 1px; background: var(--border); margin: 4px 0; }
.cell-menu .cm-issues { padding: 6px 10px; font-size: 12px; color: #991b1b; background: var(--danger-50); border-radius: 8px; margin: 4px 0; }

/* Timeline (visão diária) */
.timeline { padding: 12px 16px 16px; overflow-x: auto; }
.tl-grid { min-width: 860px; }
.tl-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; min-height: 34px; border-bottom: 1px solid #f1f4f8; }
.tl-row .tl-name { font-size: 12.5px; font-weight: 600; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 26px; background-image: linear-gradient(to right, #eef1f5 1px, transparent 1px); background-size: calc(100% / 24) 100%; border-radius: 4px; }
.tl-open { position: absolute; top: 0; bottom: 0; background: rgba(79, 70, 229, .05); border-left: 1px dashed #c7d2fe; border-right: 1px dashed #c7d2fe; }
.tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; }
.tl-hours { display: grid; grid-template-columns: 200px 1fr; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.tl-hours .hs { display: grid; grid-template-columns: repeat(24, 1fr); }
.cov-chart { display: grid; grid-template-columns: 200px 1fr; align-items: end; margin-top: 10px; }
.cov-bars { display: flex; align-items: flex-end; gap: 1px; height: 70px; position: relative; }
.cov-bars span { flex: 1; background: #c7d2fe; border-radius: 2px 2px 0 0; min-height: 1px; position: relative; }
.cov-bars span.bad { background: #fca5a5; }
.cov-bars span.closed { background: transparent; }
.cov-bars .minline { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--danger); }

/* Calendário por funcionário */
.month-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 16px; }
.month-cal .wd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; padding-bottom: 2px; }
.month-cal .mc { min-height: 82px; border: 1px solid var(--border); border-radius: 10px; padding: 7px 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.month-cal .mc.empty { background: transparent; border: 1px dashed #e9edf3; }
.month-cal .mc.closed { background: repeating-linear-gradient(135deg, #fbfcfd 0 6px, #f3f5f8 6px 12px); }
.month-cal .mc .d { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; }
.month-cal .mc .ev { border-radius: 6px; padding: 4px 6px; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.month-cal .mc .ev small { display: block; font-weight: 500; opacity: .85; font-size: 10.5px; }

/* Visão por turno */
.shift-board { display: grid; gap: 0; }
.shift-board .sb-row { display: grid; grid-template-columns: 110px 1fr; border-bottom: 1px solid var(--border); }
.shift-board .sb-date { padding: 10px 12px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); border-right: 1px solid var(--border); }
.shift-board .sb-date small { display: block; font-weight: 500; color: var(--muted); }
.shift-board .sb-cells { display: grid; gap: 0; }
.shift-board .sb-cell { padding: 8px 10px; border-right: 1px solid #f1f4f8; font-size: 12px; }
.shift-board .sb-cell .names { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.shift-board .sb-cell .names span { background: #f1f5f9; border-radius: 5px; padding: 1px 6px; font-size: 11.5px; }

/* Issues */
.issue-list { display: flex; flex-direction: column; }
.issue { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eef1f5; align-items: flex-start; }
.issue:last-child { border-bottom: none; }
.issue .sev-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.issue .sev-ic svg { width: 15px; height: 15px; }
.issue .sev-ic.bloqueante { background: var(--danger-50); color: var(--danger); }
.issue .sev-ic.alerta { background: var(--warning-50); color: var(--warning-500); }
.issue .sev-ic.pendente { background: var(--pending-50); color: var(--pending); }
.issue .sev-ic.informativo { background: var(--info-50); color: var(--info); }
.issue .i-title { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.issue .i-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); align-items: center; }
.issue .i-details { margin-top: 6px; font-size: 13px; color: var(--text-2); white-space: pre-line; }
.issue .i-sugg { margin-top: 8px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; white-space: pre-line; color: var(--text-2); }
.issue .i-sugg strong { color: var(--text); }
.issue .i-ack { margin-top: 8px; font-size: 12px; color: #047857; display: flex; gap: 6px; align-items: flex-start; }
.issue .i-ack svg { width: 14px; height: 14px; margin-top: 2px; flex: none; }
.issue.acked { background: #fcfdfc; }
.issue.acked .i-title { color: var(--text-2); }
.sev-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.sev-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: #fff; cursor: pointer; min-width: 130px; text-align: left; font: inherit; }
.sev-card .n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.sev-card .l { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sev-card .l svg { width: 14px; height: 14px; }
.sev-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.sev-card.bloqueante .n { color: var(--danger); } .sev-card.alerta .n { color: var(--warning-500); } .sev-card.pendente .n { color: var(--pending); } .sev-card.informativo .n { color: var(--info); }

/* Rules */
.rule { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #eef1f5; }
.rule:last-child { border-bottom: none; }
.rule .r-title { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule .r-desc { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.rule .r-src { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rule .r-src svg { width: 13px; height: 13px; }
.rule .r-params { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.rule .r-params .field { width: 210px; }
.rule .r-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 190px; }
.rule.disabled .r-title, .rule.disabled .r-desc { opacity: .55; }

/* Misc */
.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #eef1f5; color: var(--text); text-decoration: none !important; }
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: var(--surface-2); }
.check-item .ci { width: 24px; height: 24px; border-radius: 999px; border: 2px solid #d5dbe6; display: grid; place-items: center; flex: none; }
.check-item .ci svg { width: 13px; height: 13px; }
.check-item.done .ci { background: var(--success); border-color: var(--success); color: #fff; }
.check-item.done .ct { color: var(--muted); text-decoration: line-through; }
.check-item .go { margin-left: auto; color: var(--faint); }
.check-item .go svg { width: 16px; height: 16px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #eef1f5; }
.list-item:last-child { border-bottom: none; }
.loc-card { padding: 16px 18px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.loc-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.loc-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.hours-table td { padding: 8px 10px; }
.cov-matrix input { width: 54px; text-align: center; height: 32px !important; padding: 0 4px !important; font-weight: 600; }
.cov-matrix input[data-k=max] { background-color: #fff; border-style: dashed; font-weight: 500; color: var(--muted); }
.cov-matrix td, .cov-matrix th { padding: 8px 6px; }
.cov-matrix td:first-child, .cov-matrix th:first-child { padding-left: 14px; }
.cov-legend { display: block; font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--faint); margin-top: 2px; }
.cov-matrix th, .cov-matrix td { text-align: center; }
.cov-matrix td:first-child, .cov-matrix th:first-child { text-align: left; }
.metric-bar { display: grid; grid-template-columns: 180px 1fr 70px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.timeline-list { position: relative; padding-left: 22px; }
.timeline-list::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: #e8ecf2; }
.tli { position: relative; padding: 0 0 16px; }
.tli::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 99px; background: #fff; border: 2px solid var(--primary); }
.tli.success::before { border-color: var(--success); background: var(--success); }
.tli.danger::before { border-color: var(--danger); }
.tli .tt { font-weight: 600; font-size: 13px; }
.tli .tm { font-size: 12px; color: var(--muted); }
.tli .td { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
details.meta summary { cursor: pointer; color: var(--primary); font-size: 12px; }
details.meta pre { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 8px; font-size: 11.5px; overflow: auto; max-height: 260px; white-space: pre-wrap; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.notice-legal { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.notice-legal svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatches button { width: 26px; height: 26px; border-radius: 7px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.color-swatches button.active { box-shadow: 0 0 0 2px var(--text); }
.diff-new { color: var(--success); font-weight: 600; }
.diff-old { color: var(--danger); text-decoration: line-through; }
.pill-inline { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ----------------------------------------------------------------- Responsivo */
@media (max-width: 1180px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 25; }
  .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 14px; }
  .grid.c3, .grid.c2, .grid.split { grid-template-columns: 1fr; }
  .demo-pill { display: none; }
  .col-8, .col-6, .col-4, .col-3, .col-2 { grid-column: span 12; }
  .rule { grid-template-columns: 1fr; }
  .rule .r-side { align-items: flex-start; }
  .compare-grid { grid-template-columns: 1fr; }
  .sched-scroll { max-height: none; }
}
@media (max-width: 560px) {
  .grid.c4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .sched .emp-col { min-width: 140px; max-width: 140px; }
  .kv { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .sched-scroll { max-height: none; overflow: visible; }
}

/* ----------------------------------------------------------------- Licença de acesso */
.lic-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  font: inherit; font-size: 12.5px; cursor: pointer; border: 1px solid; white-space: nowrap;
}
.lic-pill svg { width: 15px; height: 15px; }
.lic-pill strong { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.lic-pill .lic-label { font-weight: 600; }
.lic-pill.ok { background: var(--success-50); color: #047857; border-color: #a7f3d0; }
.lic-pill.warn { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.lic-pill.danger { background: var(--danger-50); color: #b91c1c; border-color: #fecaca; animation: licPulse 2s ease-in-out infinite; }
@keyframes licPulse { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); } }
.lic-count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 16px; }
.lic-count > div { background: #0f172a; color: #fff; border-radius: 12px; padding: 14px 6px 10px; text-align: center; }
.lic-count strong { display: block; font-size: 30px; font-weight: 700; font-family: var(--mono); line-height: 1; letter-spacing: -.02em; }
.lic-count span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-top: 6px; }
.lic-modal.warn .lic-count > div { background: #78350f; }
.lic-modal.danger .lic-count > div { background: #7f1d1d; }
.lic-support { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.lic-support a, .lic-support span { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.lic-support svg { width: 15px; height: 15px; color: var(--muted); }
.lic-block-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; }
.lic-block-icon svg { width: 26px; height: 26px; }
.lic-block-icon.pendente { background: var(--pending-50); color: var(--pending); }
.lic-block-icon.expirada, .lic-block-icon.suspensa { background: var(--danger-50); color: var(--danger); }
@media (max-width: 560px) { .lic-pill .lic-label { display: none; } }

.auth-admin-link { position: absolute; right: clamp(24px, 7vw, 120px); bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748b; opacity: .7; text-decoration: none !important; transition: opacity .15s, color .15s; }
.auth-admin-link svg { width: 13px; height: 13px; }
.auth-admin-link:hover, .auth-admin-link:focus-visible { opacity: 1; color: #cbd5e1; }
@media (max-width: 1020px) { .auth-admin-link { position: static; justify-content: center; } .auth-copy { position: static; text-align: center; margin-top: -16px; } }
