/* ═══════════════════════════════════════════════════════
   BLINK CONTROLL — Design System
   Tema: Branco & Azul — Fonte: Plus Jakarta Sans
   Ícones: Phosphor Icons (ver assets/js/app.js / _header.php)
   ═══════════════════════════════════════════════════════ */

:root {
  --principal:         #2A8FE2;
  --principal-dark:    #1565C0;
  --principal-rgb:     42, 143, 226;
  --bg-dark:           #F1F5F9;
  --surface:           #FFFFFF;
  --surface-2:         #F6F8FB;
  --border:            #E4E9F0;
  --text:              #1B2536;
  --text-muted:        #7C8AA0;
  --sidebar-width:     240px;
  --sidebar-collapsed: 64px;
  --radius-card:       12px;
  --radius-btn:        8px;
  --shadow-card:       0 1px 2px rgba(20,32,54,.04), 0 8px 24px rgba(20,32,54,.06);
  --shadow-pop:        0 12px 32px rgba(20,32,54,.14);

  --success: #0EA36E;
  --warning: #D97706;
  --danger:  #DC2626;
  --info:    #0284C7;
  --purple:  #7C3AED;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

/* Icones (Phosphor) — herdam tamanho/cor do elemento pai */
.ico, [class^="ph-"], [class*=" ph-"] { line-height: 1; }
.ico { font-size: 17px; display: inline-flex; }

/* ─────────────── Layout ─────────────── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .2s ease;
}

body.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed); }

.app-content {
  padding: 24px 28px 60px;
  flex: 1;
}

/* ─────────────── Sidebar (tema escuro, isolado do resto do app) ─────────────── */

.sidebar {
  /* Variaveis locais — só a sidebar usa estas; o resto do app continua claro. */
  --sb-bg:          #0D1117;
  --sb-surface-2:   #171D2B;
  --sb-border:      rgba(255,255,255,.08);
  --sb-text:        #E9EDF3;
  --sb-text-muted:  rgba(233,237,243,.52);

  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width .2s ease;
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sb-border);
  white-space: nowrap;
}

.sidebar-brand .logo-dot {
  width: 32px; height: 32px;
  min-width: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--principal), var(--principal-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  box-shadow: 0 4px 10px rgba(var(--principal-rgb), .35);
}

.sidebar-brand .sb-brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.sidebar-brand span.sb-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
  color: var(--sb-text);
}

.sidebar-brand span.sb-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--principal);
  text-transform: uppercase;
}

body.sidebar-collapsed .sidebar-brand .sb-brand-text { display: none; }

/* Card de usuário + card de empresa ativa, no topo da navegação */
.sidebar-user-card,
.sidebar-company-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 0;
  padding: 10px;
  border-radius: var(--radius-btn);
  background: var(--sb-surface-2);
  border: 1px solid var(--sb-border);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-company-card { margin-top: 8px; margin-bottom: 4px; cursor: pointer; color: inherit; }
.sidebar-company-card:hover { border-color: rgba(var(--principal-rgb),.4); }
.sidebar-user-card { cursor: pointer; }
.sidebar-user-card:hover { border-color: rgba(var(--principal-rgb),.4); }

.sidebar-user-card .avatar { width: 34px; height: 34px; font-size: 13px; flex-shrink: 0; }

.sidebar-user-card .su-name,
.sidebar-company-card .sc-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}

.sidebar-user-card .su-role,
.sidebar-company-card .sc-label {
  font-size: 11px;
  color: var(--sb-text-muted);
}

.sidebar-company-card .sc-icon {
  width: 28px; height: 28px;
  min-width: 28px;
  border-radius: 7px;
  background: rgba(var(--principal-rgb), .18);
  color: var(--principal);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.sidebar-company-card .sc-chevron { margin-left: auto; color: var(--sb-text-muted); font-size: 12px; }

body.sidebar-collapsed .sidebar-user-card .su-name,
body.sidebar-collapsed .sidebar-user-card .su-role,
body.sidebar-collapsed .sidebar-company-card .sc-name,
body.sidebar-collapsed .sidebar-company-card .sc-label,
body.sidebar-collapsed .sidebar-company-card .sc-chevron { display: none; }

body.sidebar-collapsed .sidebar-user-card,
body.sidebar-collapsed .sidebar-company-card { justify-content: center; padding: 8px; margin-left: 8px; margin-right: 8px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sb-border); border-radius: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 9px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-btn);
  color: var(--sb-text-muted);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item .ico { font-size: 18px; min-width: 20px; justify-content: center; }

.nav-item:hover { background: var(--sb-surface-2); color: var(--sb-text); }

.nav-item.active {
  background: rgba(var(--principal-rgb), .16);
  border-left-color: var(--principal);
  color: #6FB6EF;
}

.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--sb-text-muted);
  padding: 16px 12px 6px;
  font-weight: 700;
}

body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-item span.label,
body.sidebar-collapsed .nav-chevron { display: none; }

.nav-sub {
  padding-left: 30px;
  overflow: hidden;
  max-height: 0;
  transition: max-height .2s ease;
}

.nav-group.open .nav-sub { max-height: 500px; }

.nav-chevron { margin-left: auto; transition: transform .2s; font-size: 12px; }
.nav-group.open .nav-chevron { transform: rotate(90deg); }

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--sb-border);
}

.sidebar-footer .nav-item { color: var(--sb-text-muted); }

.sidebar-toggle-btn {
  width: 100%;
  background: var(--sb-surface-2);
  border: 1px solid var(--sb-border);
  color: var(--sb-text-muted);
  border-radius: var(--radius-btn);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.sidebar-toggle-btn:hover { color: var(--principal); border-color: rgba(var(--principal-rgb),.4); }

/* ─────────────── Topbar ─────────────── */

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 800; }
.topbar-title small { display:block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top:2px; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-size: 16px;
}
.topbar-icon-btn:hover { color: var(--principal); border-color: rgba(var(--principal-rgb),.4); background: #fff; }

.badge-dot {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--surface);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
}

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--principal), var(--principal-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-chip .u-name { font-weight: 700; font-size: 13px; }
.user-chip .u-role { font-size: 11px; color: var(--text-muted); }

/* ─────────────── Cards ─────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

a.kpi-card {
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(27, 37, 54, .08);
  border-color: rgba(var(--principal-rgb), .35);
}
a.kpi-card .kpi-arrow {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
a.kpi-card:hover .kpi-arrow { opacity: 1; transform: translateX(0); }

/* Cards de KPI com fundo colorido cheio (ex.: Contas a Receber / Contas a Pagar) */
.kpi-card-green, .kpi-card-red {
  border-color: transparent;
}
.kpi-card-green { background: linear-gradient(135deg, #0EA36E, #0C8F60); }
.kpi-card-red   { background: linear-gradient(135deg, #DC2626, #B91C1C); }
.kpi-card-green .kpi-value, .kpi-card-green .kpi-label, .kpi-card-green .kpi-arrow,
.kpi-card-red .kpi-value, .kpi-card-red .kpi-label, .kpi-card-red .kpi-arrow {
  color: #fff;
}
.kpi-card-green .kpi-label, .kpi-card-red .kpi-label { color: rgba(255, 255, 255, .82); }
.kpi-card-green .kpi-icon, .kpi-card-red .kpi-icon { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }
a.kpi-card-green:hover { border-color: transparent; box-shadow: 0 10px 24px rgba(14, 163, 110, .35); }
a.kpi-card-red:hover   { border-color: transparent; box-shadow: 0 10px 24px rgba(220, 38, 38, .35); }

/* Top produtos — ranking com faturamento */
.top-produtos-lista { display: flex; flex-direction: column; }
.tp-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.tp-row:last-child { border-bottom: none; }
.tp-rank {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
  background: var(--surface-2); color: var(--text-muted);
}
.tp-rank-1 { background: rgba(217, 119, 6, .15); color: #B45309; }
.tp-rank-2 { background: rgba(100, 116, 139, .15); color: #475569; }
.tp-rank-3 { background: rgba(180, 83, 9, .12); color: #92400E; }
.tp-info { flex: 1; min-width: 0; }
.tp-nome { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-codigo { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.tp-bar-track { height: 6px; background: var(--surface-2); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.tp-bar-fill { height: 100%; border-radius: 4px; background: var(--principal); transition: width .5s ease; }
.tp-metrics { flex-shrink: 0; text-align: right; min-width: 108px; }
.tp-qtd { font-size: 13px; font-weight: 700; color: var(--text); }
.tp-fat { font-size: 11.5px; color: var(--success); font-weight: 600; margin-top: 1px; }
@media (max-width: 560px) { .tp-metrics { min-width: 80px; } }

/* "OS que precisam de atencao" — lista curta no card de Status das OS */
.osa-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: background .15s;
}
a.osa-row:hover { background: var(--surface-2); }
.osa-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.osa-info { flex: 1; min-width: 0; }
.osa-titulo { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osa-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osa-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; flex-shrink: 0; }

/* Toggle de tipo de grafico (barras / linha) no cabecalho de um card */
.chart-type-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}
.ctt-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 28px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ctt-btn:hover { color: var(--text); }
.ctt-btn.active { background: var(--surface); color: var(--principal); box-shadow: 0 1px 3px rgba(27,37,54,.1); }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1100px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ─────────────── Buttons ─────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn-primary { background: var(--principal); color: #fff; box-shadow: 0 2px 8px rgba(var(--principal-rgb),.28); }
.btn-primary:hover { background: var(--principal-dark); box-shadow: 0 4px 12px rgba(var(--principal-rgb),.36); }

.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--principal); color: var(--principal); background: rgba(var(--principal-rgb),.06); }

.btn-danger { background: rgba(220,38,38,.08); color: var(--danger); border-color: rgba(220,38,38,.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─────────────── Forms ─────────────── */

.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 800px) { .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted);
}
label .req { color: var(--danger); }

.form-control, select.form-control, textarea.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus { border-color: var(--principal); background: var(--surface); box-shadow: 0 0 0 3px rgba(var(--principal-rgb),.14); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--danger); margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--principal); }

/* ─────────────── Tables ─────────────── */

.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.table-empty .ico { font-size: 34px; display: block; margin-bottom: 10px; opacity: .45; justify-content: center; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ─────────────── Badges / Status ─────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-success { background: rgba(14,163,110,.1); color: var(--success); }
.badge-warning { background: rgba(217,119,6,.1); color: var(--warning); }
.badge-danger  { background: rgba(220,38,38,.1); color: var(--danger); }
.badge-info    { background: rgba(2,132,199,.1); color: var(--info); }
.badge-purple  { background: rgba(124,58,237,.1); color: var(--purple); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); }

/* ─────────────── Filters bar ─────────────── */

.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

/* ─────────────── Filtro de período (pills) ─────────────── */

.periodo-filtro {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.periodo-filtro .pf-icon {
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  margin-right: 2px;
}

.periodo-filtro .pf-pill {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.periodo-filtro .pf-pill:hover { color: var(--text); border-color: rgba(var(--principal-rgb),.35); }

.periodo-filtro .pf-pill.active {
  background: var(--principal);
  border-color: var(--principal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--principal-rgb),.28);
}

.periodo-filtro .pf-custom {
  display: none;
  align-items: center;
  gap: 8px;
}

.periodo-filtro .pf-custom.show { display: flex; }

.periodo-filtro .pf-custom input.form-control {
  max-width: 150px;
  padding: 7px 10px;
}

@media (max-width: 700px) {
  .periodo-filtro { padding: 10px; }
  .periodo-filtro .pf-custom { width: 100%; }
}

.search-input {
  position: relative;
  min-width: 240px;
  flex: 1;
}
.search-input input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 13px;
}
.search-input input:focus { outline: none; border-color: var(--principal); background: var(--surface); }
.search-input .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; }

/* ─────────────── Pagination ─────────────── */

.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
}
.pagination a:hover { border-color: var(--principal); color: var(--principal); }
.pagination .active { background: var(--principal); color: #fff; border-color: var(--principal); }

/* ─────────────── Kanban (OS) ─────────────── */

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-col {
  min-width: 280px;
  max-width: 280px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 6px 12px;
}

.kanban-col-header .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-header .count {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.kanban-cards { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
  cursor: grab;
  box-shadow: var(--shadow-card);
}
.kanban-card:hover { border-color: rgba(var(--principal-rgb),.4); }
.kanban-card .kc-num { font-size: 11px; color: var(--principal); font-weight: 700; }
.kanban-card .kc-title { font-weight: 700; font-size: 13px; margin: 4px 0; }
.kanban-card .kc-meta { font-size: 11.5px; color: var(--text-muted); display:flex; justify-content: space-between; margin-top:8px; }

/* ─────────────── Modal ─────────────── */

.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box.modal-lg { max-width: 800px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { cursor: pointer; color: var(--text-muted); font-size: 20px; background: none; border: none; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ─────────────── Toast ─────────────── */

.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--principal);
  border-radius: 9px;
  padding: 12px 16px;
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  min-width: 260px;
  animation: toast-in .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─────────────── Login Page ─────────────── */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 15% 15%, rgba(var(--principal-rgb),.10), transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(21,101,192,.08), transparent 40%),
              var(--bg-dark);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 36px 32px;
}

.login-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-bottom: 26px;
}
.login-logo .logo-dot {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--principal), var(--principal-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 22px;
  box-shadow: 0 8px 20px rgba(var(--principal-rgb), .35);
}
.login-logo h1 { font-size: 19px; margin: 0; font-weight: 800; }
.login-logo p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }

.login-alert {
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.22);
  color: #B91C1C;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  font-size: 12.5px;
  margin-bottom: 16px;
}
.login-alert.ok {
  background: rgba(14,163,110,.08);
  border-color: rgba(14,163,110,.22);
  color: #047857;
}

.login-footer { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-muted); }

/* ─────────────── Utility ─────────────── */

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.d-flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}
.empty-state .ico { font-size: 44px; opacity: .35; margin-bottom: 14px; display:flex; justify-content: center; }
.empty-state h3 { color: var(--text); font-size: 16px; margin: 0 0 6px; }

.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin: 26px 0 12px;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab-item {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-item.active { color: var(--principal); border-bottom-color: var(--principal); }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-pop); }
  body.sidebar-mobile-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .app-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}
