/* ==================================================================
   GesTi — folha de estilo principal
   ================================================================== */

:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --border: #dde4ed;
  --border-strong: #c3cedb;
  --text: #16202e;
  --text-soft: #47566b;
  --muted: #7a889c;

  --primary: #1668a8;
  --primary-dark: #0f4f81;
  --primary-soft: #e4f0fa;
  --accent: #0d9488;
  --accent-soft: #dcf5f2;

  --danger: #d13b3b;
  --danger-soft: #fdeaea;
  --warning: #b7791f;
  --warning-soft: #fdf3e0;
  --success: #178a4e;
  --success-soft: #e3f6ec;
  --info: #1d7fbe;
  --info-soft: #e6f3fb;
  --purple: #6b4fbb;
  --purple-soft: #efeafb;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .06), 0 1px 3px rgba(16, 30, 54, .05);
  --shadow: 0 4px 14px rgba(16, 30, 54, .08);
  --shadow-lg: 0 18px 48px rgba(16, 30, 54, .18);
  --sidebar-w: 250px;
  --topbar-h: 60px;
  --font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Courier New", monospace;
}

html[data-theme="dark"] {
  --bg: #0a111c;
  --surface: #111b2b;
  --surface-2: #162234;
  --surface-3: #1d2b40;
  --border: #23334a;
  --border-strong: #33475f;
  --text: #e7eef8;
  --text-soft: #b7c4d6;
  --muted: #8698ae;

  --primary: #3f97d6;
  --primary-dark: #2b7bb8;
  --primary-soft: #12293f;
  --accent: #2bbfae;
  --accent-soft: #10312f;

  --danger: #ef6464;
  --danger-soft: #3a1c1e;
  --warning: #e0a23c;
  --warning-soft: #382a13;
  --success: #35b877;
  --success-soft: #10301f;
  --info: #4aa8e0;
  --info-soft: #10293a;
  --purple: #a78bfa;
  --purple-soft: #241d40;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- */
/* Boot                                                              */
/* ---------------------------------------------------------------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot-logo {
  width: 58px; height: 58px; border-radius: 16px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px;
  box-shadow: var(--shadow);
}
.boot-text { color: var(--muted); }

/* ---------------------------------------------------------------- */
/* Login                                                             */
/* ---------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 620px at 10% -10%, rgba(22,104,168,.22), transparent 60%),
    radial-gradient(1000px 580px at 90% 110%, rgba(13,148,136,.22), transparent 60%),
    radial-gradient(800px 400px at 50% 50%, rgba(63,151,214,.08), transparent 70%),
    var(--bg);
  position: relative;
}
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 34px 30px 28px;
  backdrop-filter: blur(6px);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .boot-logo { width: 46px; height: 46px; border-radius: 13px; font-size: 17px; }
.login-brand h1 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.login-hint {
  margin-top: 18px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12.5px; border: 1px solid rgba(22,104,168,.18);
}
html[data-theme="dark"] .login-hint { color: var(--info); }

/* ---------------------------------------------------------------- */
/* Estrutura                                                         */
/* ---------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  padding: 16px 16px 14px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head .boot-logo { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.sidebar-head h2 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.sidebar-head p { margin: 0; font-size: 11px; color: var(--muted); }

.nav { flex: 1; overflow-y: auto; padding: 10px 9px 18px; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted); padding: 14px 10px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-soft); cursor: pointer; user-select: none; font-size: 13.6px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
html[data-theme="dark"] .nav-item.active { color: var(--info); }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item .nav-count {
  margin-left: auto; background: var(--surface-3); color: var(--text-soft);
  border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.nav-item.active .nav-count { background: var(--primary); color: #fff; }
.nav-item .nav-count.alert { background: var(--danger); color: #fff; }

.sidebar-foot { padding: 10px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.topbar {
  height: var(--topbar-h); flex: none; background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 12px; padding: 0 18px;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }
.topbar-spacer { flex: 1; }
.menu-toggle { display: none; }

.global-search {
  position: relative; width: min(340px, 34vw);
}
.global-search input {
  width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); padding: 0 12px 0 32px; outline: none; font-size: 13.5px;
}
.global-search input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.global-search svg { position: absolute; left: 9px; top: 9px; width: 16px; height: 16px; color: var(--muted); }

.content { flex: 1; overflow-y: auto; padding: 20px 22px 60px; }
.content-inner { max-width: 1500px; margin: 0 auto; }

/* ---------------------------------------------------------------- */
/* Componentes                                                       */
/* ---------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .grow { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.sm { gap: 9px; }

/* KPI */
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  display: flex; gap: 12px; align-items: flex-start;
}
.kpi::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary);
  opacity: .85;
}
.kpi.danger::after { background: var(--danger); }
.kpi.warning::after { background: var(--warning); }
.kpi.success::after { background: var(--success); }
.kpi.accent::after { background: var(--accent); }
.kpi.info::after { background: var(--info); }
.kpi-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); flex: none;
}
.kpi.danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi.warning .kpi-icon { background: var(--warning-soft); color: var(--warning); }
.kpi.success .kpi-icon { background: var(--success-soft); color: var(--success); }
.kpi.accent .kpi-icon { background: var(--accent-soft); color: var(--accent); }
.kpi.info .kpi-icon { background: var(--info-soft); color: var(--info); }
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-body { min-width: 0; }
.kpi-value { font-size: 23px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.kpi-label { font-size: 12.3px; color: var(--muted); font-weight: 500; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi.clickable { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.kpi.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Botoes */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 13.4px; font-weight: 550;
  transition: background .12s, border-color .12s, transform .06s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: var(--(--danger)); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.4px; border-radius: 7px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text-soft); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field > label { font-size: 12.4px; font-weight: 600; color: var(--text-soft); }
.field .req { color: var(--danger); }
.field .hint { font-size: 11.8px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 37px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); padding: 7px 11px; outline: none; font-size: 13.6px;
}
textarea.input { min-height: 88px; resize: vertical; line-height: 1.45; }
select.input { cursor: pointer; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled, .input[readonly] { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.field-error .input { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.4px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 13px; }
legend { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; padding: 0 6px; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.4px; }
table.data th {
  text-align: left; padding: 9px 12px; font-size: 11.4px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions .icon-btn { width: 28px; height: 28px; }
table.data .actions .icon-btn svg { width: 15px; height: 15px; }
.rowlink { cursor: pointer; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .35; margin-bottom: 10px; }
.empty h4 { margin: 0 0 5px; color: var(--text-soft); font-size: 15px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.6px; font-weight: 650; white-space: nowrap; border: 1px solid transparent;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-gray   { background: var(--surface-3); color: var(--text-soft); border-color: var(--border); }
.b-blue   { background: var(--primary-soft); color: var(--primary); border-color: rgba(22,104,168,.18); }
.b-green  { background: var(--success-soft); color: var(--success); border-color: rgba(23,138,78,.2); }
.b-red    { background: var(--danger-soft); color: var(--danger); border-color: rgba(209,59,59,.2); }
.b-yellow { background: var(--warning-soft); color: var(--warning); border-color: rgba(183,121,31,.2); }
.b-teal   { background: var(--accent-soft); color: var(--accent); border-color: rgba(13,148,136,.2); }
.b-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(107,79,187,.2); }
html[data-theme="dark"] .b-blue { color: var(--info); }
html[data-theme="dark"] .b-purple { color: var(--purple); }

.chip {
  display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-3);
  color: var(--text-soft); font-size: 11.5px; font-weight: 600; margin-right: 4px;
}

/* Filtros */
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { min-height: 34px; width: auto; }
.filters .search { min-width: 230px; flex: 1; max-width: 340px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer;
  font-size: 12.6px; font-weight: 600; color: var(--text-soft);
}
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .seg button.on { color: var(--info); }

/* Barra de progresso */
.bar { height: 7px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 10px; background: var(--primary); }
.bar.thin { height: 5px; }
.bar > i.green { background: var(--success); }
.bar > i.red { background: var(--danger); }
.bar > i.yellow { background: var(--warning); }
.bar > i.teal { background: var(--accent); }
.bar > i.purple { background: var(--purple); }

/* Listas */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item .li-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-soft); flex: none;
}
.list-item .li-icon svg { width: 15px; height: 15px; }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item .li-title { font-weight: 600; font-size: 13.4px; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.li-right { text-align: right; flex: none; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 20, 35, .5); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; z-index: 90; animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  border: 1px solid var(--border); animation: pop .16s ease;
}
.modal.wide { width: min(940px, 100%); }
.modal.xwide { width: min(1200px, 100%); }
.modal-head {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 650; flex: 1; }
.modal-head .sub { font-size: 12px; color: var(--muted); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap;
}

/* Toast */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 13px; font-size: 13.3px;
  animation: slidein .18s ease; display: flex; gap: 9px; align-items: flex-start;
}
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }

/* Diversos */
.muted { color: var(--muted); }
.small { font-size: 12.3px; }
.mono { font-family: var(--mono); font-size: 12.6px; }
.strong { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--border); margin: 14px 0; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 8px 14px; cursor: pointer; font-size: 13.3px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
html[data-theme="dark"] .tab.on { color: var(--info); }

.tabs-box { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  background: var(--surface); min-width: 150px; cursor: pointer; flex: 1;
}
.tab-card:hover { border-color: var(--primary); }
.tab-card.on { border-color: var(--primary); background: var(--primary-soft); }
.tab-card .tc-label { font-size: 11.6px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.tab-card .tc-value { font-size: 20px; font-weight: 700; }

.spinner {
  width: 26px; height: 26px; border: 2.5px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { padding: 40px; display: grid; place-items: center; }

.drawer-overlay { display: none; }
.sidebar.open { transform: translateX(0); }

kbd {
  font-family: var(--mono); font-size: 11px; background: var(--surface-3);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px;
}

details.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 9px; background: var(--surface); }
details.acc > summary { padding: 10px 13px; cursor: pointer; font-weight: 600; font-size: 13.4px; list-style: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: '▸ '; color: var(--muted); }
details.acc[open] > summary::before { content: '▾ '; }
details.acc .acc-body { padding: 0 13px 13px; }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 7px; }
.check-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  cursor: pointer; font-size: 13.3px;
}
.check-item:hover { border-color: var(--border-strong); }
.check-item input { margin-top: 2px; accent-color: var(--success); width: 16px; height: 16px; }
.check-item.done { background: var(--success-soft); border-color: rgba(23,138,78,.25); }
.check-item.done span { text-decoration: line-through; color: var(--text-soft); }
.check-item .check-text { flex: 1; }

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--surface);
}
.tl-time { font-size: 11.6px; color: var(--muted); }
.tl-body { font-size: 13.3px; white-space: pre-wrap; }
.tl-author { font-weight: 650; }

/* Donut / grafico de barras */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex: none; }
.donut::after {
  content: ''; position: absolute; inset: 21px; background: var(--surface); border-radius: 50%;
}
.donut-center {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  font-size: 19px; font-weight: 700;
}
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.8px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 92px; }
.spark-bar { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.spark-bar > i { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; }

/* Seguranca / cofre */
.secret-box {
  font-family: var(--mono); font-size: 13px; background: var(--surface-3); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 9px 12px; word-break: break-all; user-select: all;
}
.lock-screen { text-align: center; padding: 40px 20px; }
.lock-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px; background: var(--warning-soft); color: var(--warning); display: grid; place-items: center; }
.lock-icon svg { width: 28px; height: 28px; }

/* Timeline de rua */
.route-line { position: relative; padding-left: 26px; }
.route-line::before { content: ''; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px; background: var(--border-strong); }
.route-stop { position: relative; padding-bottom: 14px; }
.route-stop::before {
  content: ''; position: absolute; left: -23px; top: 6px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--primary);
}

/* Impressao */
@media print {
  .sidebar, .topbar, .filters, .btn { display: none !important; }
  .content { overflow: visible; padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ---------------------------------------------------------------- */
/* Responsivo                                                        */
/* ---------------------------------------------------------------- */
@media (max-width: 1200px) {
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 80;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .drawer-overlay { display: block; position: fixed; inset: 0; background: rgba(10,20,35,.45); z-index: 79; }
  .drawer-overlay.hidden { display: none; }
  .menu-toggle { display: grid; }
  .g-2, .g-3, .g-4, .g-6, .g-2-1, .g-1-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .content { padding: 14px 12px 60px; }
  .g-2, .g-3, .g-4, .g-6, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .global-search { width: auto; flex: 1; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar h1 { font-size: 15.5px; }
  .modal-foot { justify-content: stretch; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .toasts { left: 12px; right: 12px; max-width: none; }
}
