/* ══════════════════════════════════════════════════════════════
   COLDASH — Estilos
   Organização:
   1. Tokens (variáveis CSS) e reset
   2. Login
   3. App shell (topbar, bottom-nav, páginas)
   4. AlertBell (sino de alertas)
   5. Filtro de filial (dropdown)
   6. Home (KPIs, grid de filiais, anel de progresso)
   7. Home Funcionário (grupos de tarefas)
   8. Checklist (filiais sem atividades, divisores)
   9. Configurações (filial-row, user-row)
  10. Pedidos (Kanban)
  11. Stats / Cards / Badges / Avatares
  12. Forms / Modais
  13. Componentes utilitários (chips, tabs, progress, etc.)
  14. Animações
  ══════════════════════════════════════════════════════════════ */

/* ═══ 1. TOKENS & RESET ═══ */
:root {
    --primary: #0EA5E9;
    --primary-dk: #0284C7;
    --primary-lt: #E0F2FE;
    --accent: #F97316;
    --accent-lt: #FFF7ED;
    --success: #22C55E;
    --success-lt: #F0FDF4;
    --danger: #EF4444;
    --danger-lt: #FEF2F2;
    --warn: #F59E0B;
    --warn-lt: #FFFBEB;
    --purple: #8B5CF6;
    --purple-lt: #F5F3FF;
    --amber: #F59E0B;
    --amber-lt: #FFFBEB;
    --oggi: #d20083;          /* magenta da marca oggi (medido na logo) */
    --bg: #F8FAFC;
    --surf: #FFFFFF;
    --surf2: #F1F5F9;
    --border: #E2E8F0;
    --border2: #CBD5E1;
    --text: #0F172A;
    --text2: #475569;
    --text3: #94A3B8;
    --r: 14px;
    --rsm: 8px;
    --sh: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    --sh-md: 0 4px 16px rgba(0, 0, 0, .10);
    --nav: 64px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

/* ═══ 2. LOGIN ═══
   Redesenho OggiRotina (handoff do Claude Design): logo oggi como prefixo e
   a palavra do sistema ("Rotina") em preto logo abaixo, encostada na logo.
   Cores e medidas seguem o handoff; no celular o cartão some. */
#login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: #f7f8fa;
    font-family: 'Source Serif 4', Georgia, serif;
}
.login-card {
    width: 100%; max-width: 396px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(32, 30, 29, .08);
    padding: 40px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; }
.login-logo { display: block; width: 133px; height: auto; margin-top: 22px; }
.login-wordmark {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 44px; line-height: 1; font-weight: 600;
    letter-spacing: -.02em;
    color: #201e1d;
    margin-top: 7px;
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-label { display: block; font-size: 14px; line-height: 1; color: #4a4644; margin-bottom: 8px; }
.login-input {
    width: 100%; height: 46px;
    padding: 0 14px;
    border: 1px solid #dcd9d4; border-radius: 6px;
    background: #fff;
    font: 400 15px/1 'Source Serif 4', Georgia, serif;
    color: #201e1d;
    outline: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
.login-input::placeholder { color: #a8a29c; }
.login-input:focus { border-color: #17a2dc; box-shadow: 0 0 0 3px rgba(23, 162, 220, .15); }
.login-btn {
    width: 100%; height: 48px;
    border: 0; border-radius: 6px;
    background: #17a2dc; color: #fff;
    font: 600 16px/1 'Source Serif 4', Georgia, serif;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
@media (hover: hover) { .login-btn:hover { background: #0f8bbf; } }
.login-btn:active { background: #0b7aa8; }
.login-btn:focus-visible { outline: 2px solid #0b7aa8; outline-offset: 2px; }
.login-btn:disabled { opacity: .45; background: #17a2dc; cursor: default; }

/* Erro de login: mensagem acima do botão + bordas vermelhas (classe posta pelo auth.js) */
.login-err { display: none; font-size: 14px; line-height: 1.3; color: #DC2626; }
.login-card.tem-erro .login-err { display: block; }
.login-card.tem-erro .login-input { border-color: var(--danger); }
.login-card.tem-erro .login-input:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }

/* Celular: sem cartão, conteúdo direto sobre o fundo (mock mobile) */
@media (max-width: 420px) {
    #login-screen { padding: 24px 26px; }
    .login-card { max-width: none; background: transparent; border-radius: 0; box-shadow: none; padding: 0; }
    .login-brand { margin-bottom: 38px; }
    .login-logo { width: 130px; }
    .login-wordmark { font-size: 42px; }
}

/* ═══ 3. APP SHELL ═══ */
#app { display: none; padding-bottom: calc(var(--nav) + 16px); }

.topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--surf);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 56px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
/* Marca "oggiRotina" em uma linha: prefixo oggi magenta + palavra do sistema em preto */
.topbar-wordmark {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 22px; line-height: 1; font-weight: 600;
    letter-spacing: -.015em;
    color: #201e1d;
}
.topbar-wordmark .oggi { font-weight: 400; color: var(--oggi); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.user-pill {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    background: var(--surf2);
    border-radius: 99px;
    border: 1px solid var(--border);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
}

.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--surf);
    border-top: 1px solid var(--border);
    display: flex;
    height: var(--nav);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    cursor: pointer;
    border: none; background: none;
    color: var(--text3);
    font-size: 10px;
    font-family: 'DM Sans';
    font-weight: 500;
    transition: color .2s;
    padding-top: 8px;
}
.nav-item svg { width: 22px; height: 22px; transition: transform .2s; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { transform: scale(1.1); }
.nav-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 2px;
    opacity: 0;
    transition: opacity .2s;
}
.nav-item.active .nav-dot { opacity: 1; }

/* Ponto vermelho de pendência: algo naquela tela espera validação/aprovação.
   Fica ancorado no ÍCONE (não no botão) — o .nav-dot acima é outra coisa:
   é o indicador de página ativa. */
.nav-ico { position: relative; display: inline-flex; }
.nav-pend {
    position: absolute; top: -2px; right: -4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    /* Anel na cor da barra: destaca o ponto por cima do desenho do ícone. */
    box-shadow: 0 0 0 2px var(--surf);
}
.nav-pend[hidden] { display: none; }

/* Mesmo ponto vermelho, agora dentro de uma aba (Validar, Depósitos,
   Movimentações). Continua a trilha: ícone da barra → tela → aba. */
.tab-pend {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.page { display: none; padding: 16px; }
.page.active { display: block; }

/* ═══ 4. ALERT BELL ═══ */
.alert-bell {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--surf2);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text2);
    transition: background .15s;
}
.alert-bell:hover { background: var(--border); }
.alert-bell .alert-badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    font-size: 10px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--surf);
}
.alert-bell .alert-badge.empty { display: none; }

.alerts-dropdown {
    position: fixed;
    top: calc(56px + 4px); right: 12px; left: auto;
    width: min(420px, calc(100vw - 24px));
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, .18);
    z-index: 200;
    display: none;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    flex-direction: column;
}
.alerts-dropdown.open { display: flex; }

.alerts-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}
.alerts-head .a-title { font-size: 15px; font-weight: 700; }
.alerts-head .a-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.alerts-head .a-actions { display: flex; gap: 6px; }
.alerts-head .a-btn {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px; font-weight: 500;
    color: var(--text2);
    cursor: pointer;
}
.alerts-head .a-btn:hover { background: var(--surf2); }

.alerts-list { overflow-y: auto; flex: 1; padding: 6px 8px; }
.alerts-empty { padding: 32px 16px; text-align: center; color: var(--text3); font-size: 13px; }

.alert-card {
    position: relative;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 12px 12px 16px;
    border-radius: 10px;
    margin: 6px 4px;
    border: 1px solid var(--border);
    background: var(--surf);
}
.alert-card::before {
    content: ''; position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 4px;
    border-radius: 4px;
}
.alert-card.crit::before { background: var(--danger); }
.alert-card.warn::before { background: var(--warn); }
.alert-card.soon::before { background: var(--text3); }

.alert-body { flex: 1; min-width: 0; }
.alert-pill {
    display: inline-block;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    margin-bottom: 4px;
}
.alert-card.crit .alert-pill { background: var(--danger-lt); color: #B91C1C; }
.alert-card.warn .alert-pill { background: var(--warn-lt); color: #B45309; }
.alert-card.soon .alert-pill { background: var(--surf2); color: var(--text2); }
.alert-fil { font-size: 11px; color: var(--text3); margin-left: 6px; }
.alert-title { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }
.alert-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }
.alert-action {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px; font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.alert-action:hover { background: var(--primary-lt); }

.alerts-foot {
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: 11px; color: var(--text3);
}
.alerts-foot .legend { display: inline-flex; align-items: center; gap: 5px; }
.alerts-foot .ldot { width: 9px; height: 9px; border-radius: 2px; }

/* ═══ 5. FILTRO DE FILIAL (DROPDOWN) ═══ */
.filial-filter {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 12px;
}
.ff-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-height: 38px;
    padding: 8px 12px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--text);
    text-align: left;
}
.ff-btn:hover { background: var(--surf2); }
.ff-btn .ff-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--ff-color, var(--text3));
    flex-shrink: 0;
}
.ff-btn .ff-label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ff-btn .ff-arrow { flex-shrink: 0; transition: transform .15s; color: var(--text3); }
.filial-filter.open .ff-arrow { transform: rotate(180deg); }

.ff-menu {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    padding: 4px;
}
.filial-filter.open .ff-menu { display: block; }
.ff-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.ff-opt:hover { background: var(--surf2); }
.ff-opt.selected { background: var(--primary-lt); color: var(--primary); font-weight: 600; }
.ff-opt .ff-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ═══ 6. HOME GERENTE: KPIs + GRID DE FILIAIS ═══ */
.home-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.kpi-card {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 16px;
    box-shadow: var(--sh);
}
.kpi-card.warn { background: #FEF2F2; border-color: #FECACA; }
.kpi-card.amber { background: #FFFBEB; border-color: #FDE68A; }
.kpi-card.success { background: #F0FDF4; border-color: #BBF7D0; }
.kpi-card .kpi-label { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 4px; }
.kpi-card.warn .kpi-label { color: #B91C1C; }
.kpi-card.amber .kpi-label { color: #B45309; }
.kpi-card.success .kpi-label { color: #166534; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 700; font-family: 'Outfit'; line-height: 1.1; }
.kpi-card.warn .kpi-value { color: #991B1B; }
.kpi-card.amber .kpi-value { color: #92400E; }
.kpi-card.success .kpi-value { color: #15803D; }

.home-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 10px;
}
.home-section-head h3 { font-size: 15px; font-weight: 700; }
.home-section-head .h-sub { font-size: 12px; color: var(--text3); }

.filiais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.filial-mini {
    position: relative;
    display: flex; align-items: center; gap: 14px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px 12px 18px;
    box-shadow: var(--sh);
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
    overflow: hidden;
}
.filial-mini:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.filial-mini::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--filial-color, var(--primary));
}
.filial-mini-body { flex: 1; min-width: 0; }
.filial-mini-nome { font-size: 13px; font-weight: 700; line-height: 1.25; }
.filial-mini-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Anel de progresso (SVG — circular em qualquer navegador/dispositivo) */
.ring {
    --ring-color: var(--text3);
    width: 56px; height: 56px;
    flex: 0 0 56px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}
.ring-svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}
.ring-svg circle {
    fill: none;
    stroke-width: 3.2;
}
.ring-track { stroke: var(--border); }
.ring-progress {
    stroke: var(--ring-color);
    stroke-linecap: round;
    transition: stroke-dasharray .35s ease;
}
.ring .ring-text {
    position: absolute;
    font-size: 12px; font-weight: 700; font-family: 'Outfit';
    color: var(--ring-color);
}
.ring.success { --ring-color: var(--success); }
.ring.warn { --ring-color: var(--warn); }
.ring.danger { --ring-color: var(--danger); }
.ring.empty { --ring-color: var(--text3); }
.ring.empty .ring-progress { stroke: transparent; }

.home-legend {
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
    font-size: 11px; color: var(--text3);
    margin-top: 14px; padding: 8px;
}
.home-legend .legend { display: inline-flex; align-items: center; gap: 5px; }
.home-legend .ldot { width: 8px; height: 8px; border-radius: 50%; }

/* ═══ 7. HOME FUNCIONÁRIO ═══ */
.home-date-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--sh);
}
.home-date-bar .date-nav {
    background: var(--surf2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
}
.home-date-bar .date-nav:hover { background: var(--border); }
.home-date-center { text-align: center; flex: 1; }
.home-date-center .d-main { font-size: 15px; font-weight: 700; }
.home-date-center .d-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.home-date-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--surf2);
    color: var(--text3);
}

.home-group {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--sh);
}
.home-group-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
}
.home-group-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}
.home-group-title { font-size: 15px; font-weight: 700; flex: 1; }
.home-group-count { font-size: 12px; color: var(--text3); }

.home-task {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.home-task:hover { background: #FAFBFC; }
.home-task-check {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: var(--surf);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
}
.home-task-check:hover:not(:disabled) { border-color: var(--primary); }
.home-task-check.done { background: var(--success); border-color: var(--success); }
.home-task-check.done svg { color: #fff; width: 16px; height: 16px; }
.home-task-check.aguardando { background: #FEF3C7; border-color: var(--warn); }
.home-task-check:disabled { cursor: not-allowed; opacity: .6; }
.home-task-icon-wrap {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surf2);
    flex-shrink: 0;
}
.home-task-body { flex: 1; min-width: 0; }
.home-task-name { font-size: 14px; font-weight: 600; color: var(--text); }
.home-task-name.done { text-decoration: line-through; color: var(--text3); font-weight: 500; }
.home-task-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }
.home-task-status {
    font-size: 11px; font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
}
.hs-pendente { background: #FEE2E2; color: #B91C1C; }
.hs-concluida { background: #DCFCE7; color: #15803D; }
.hs-aguardando { background: #FEF3C7; color: #B45309; }
.hs-justificada { background: var(--surf2); color: var(--text2); }

/* ═══ 8. CHECKLIST: FILIAIS SEM ATIVIDADES ═══ */
.filial-empty-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--border2);
    border-radius: var(--rsm);
    color: var(--text3);
    font-size: 13px;
    background: transparent;
}
.filial-empty-row .fe-icon {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--border2);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text3);
    font-size: 11px;
    flex-shrink: 0;
}
.filiais-empty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.section-divider-soft {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    margin: 18px 0 8px;
}
.section-divider-soft::after {
    content: '';
    flex: 1; height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

/* ═══ 9. CONFIGURAÇÕES: AGRUPAMENTO ═══ */
.config-group-head {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    margin: 16px 0 8px;
}
.config-group-head:first-child { margin-top: 0; }
.config-group-count { font-weight: 500; color: var(--text3); }

.filial-list { display: flex; flex-direction: column; gap: 6px; }

.filial-row {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--rsm);
    padding: 10px 12px 10px 16px;
    box-shadow: var(--sh);
    overflow: hidden;
}
.filial-row::before {
    content: ''; position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--filial-color, var(--primary));
}
.filial-row-body { flex: 1; min-width: 0; }
.filial-row-nome { font-size: 14px; font-weight: 600; line-height: 1.3; }
.filial-row-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.user-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--rsm);
    padding: 10px 12px;
    box-shadow: var(--sh);
}
.user-row-body { flex: 1; min-width: 0; }

/* ═══ 10. PEDIDOS · KANBAN ═══ */
.kanban-board {
    display: flex; gap: 12px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
}
.kanban-col {
    flex: 1; min-width: 280px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}
.kanban-col-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}
.kanban-col-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.kanban-col-dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban-col-count {
    background: var(--surf2);
    color: var(--text2);
    font-size: 11px; font-weight: 700;
    padding: 2px 9px;
    border-radius: 99px;
}
.kanban-col-empty { text-align: center; padding: 28px 8px; color: var(--text3); font-size: 12px; }

.kanban-card {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: var(--sh);
    transition: all .15s;
}
.kanban-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.kanban-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.kanban-card-num { font-size: 13px; font-weight: 700; color: var(--text2); }
.kanban-card-nome { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.25; }
.kanban-card-rows { display: flex; flex-direction: column; gap: 5px; }
.kanban-card-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text2);
}
.kanban-card-row svg { flex-shrink: 0; }
.kanban-card-foot {
    margin-top: 10px; padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 11px; color: var(--text3);
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}

.ocasiao-tag {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    white-space: nowrap;
}
.oc-aniversario { background: #FFF7ED; color: #C2410C; }
.oc-festa { background: #FEF3C7; color: #92400E; }
.oc-casamento { background: #FCE7F3; color: #BE185D; }
.oc-corporativo { background: #E0F2FE; color: #0369A1; }
.oc-outro { background: var(--surf2); color: var(--text2); }

.pedidos-toolbar {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.pedidos-toolbar .search-wrap { flex: 1; min-width: 200px; position: relative; }
.pedidos-toolbar .search-wrap input { padding-left: 36px; }
.pedidos-toolbar .search-wrap .search-icon {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
}

/* ═══ 11. STATS / CARDS / BADGES / AVATARES ═══ */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-title { font-size: 20px; font-weight: 700; }
.section-sub { font-size: 13px; color: var(--text3); margin-top: 2px; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    border-radius: var(--rsm);
    font-family: 'DM Sans';
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .18s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dk); transform: scale(.97); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn-outline { background: transparent; border: 1.5px solid var(--border2); color: var(--text); }
.btn-outline:active { background: var(--surf2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-icon { padding: 8px; border-radius: 8px; }

.card {
    background: var(--surf);
    border-radius: var(--r);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--sh);
}
.card + .card { margin-top: 10px; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
    box-shadow: var(--sh);
}
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; font-family: 'Outfit'; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--success-lt); color: #15803D; }
.badge-danger { background: var(--danger-lt); color: #DC2626; }
.badge-warn { background: var(--warn-lt); color: #B45309; }
.badge-info { background: var(--primary-lt); color: #0369A1; }
.badge-gray { background: var(--surf2); color: var(--text2); }
.badge-purple { background: var(--purple-lt); color: #6D28D9; }
.badge-amber { background: var(--amber-lt); color: #92400E; }

.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: 'Outfit';
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* Role badges */
.role-dono { background: #F5F3FF; color: #5B21B6; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.role-gerente_geral { background: #EFF6FF; color: #1D4ED8; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.role-gerente_filial { background: #ECFDF5; color: #065F46; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.role-supervisor { background: #FFFBEB; color: #92400E; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.role-funcionario { background: #F1F5F9; color: #334155; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ═══ 12. FORMS / MODAIS ═══ */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; display: block; }
.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--rsm);
    font-family: 'DM Sans';
    font-size: 15px;
    color: var(--text);
    background: var(--surf);
    outline: none;
    transition: border .18s;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.form-grid .form-group { margin-bottom: 0; }

.modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 23, 42, .5);
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surf);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0));
    animation: slideUp .25s ease;
}
.modal-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: var(--border2);
    margin: 0 auto 18px;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.modal-section-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    margin: 14px 0 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.modal-section-title:first-child { border-top: none; padding-top: 0; }

.color-chip {
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s;
}
.color-chip.selected { border-color: var(--text); transform: scale(1.25); }

/* ═══ 13. UTILITÁRIOS (chips, tabs, progress, activity-row, etc.) ═══ */
.progress {
    height: 8px;
    background: var(--surf2);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 99px; transition: width .4s; }
.progress-success { background: var(--success); }
.progress-warn { background: var(--warn); }
.progress-danger { background: var(--danger); }

.activity-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }

.check-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .18s;
}
.check-btn.done { background: var(--success); border-color: var(--success); }
.check-btn svg { width: 14px; height: 14px; color: #fff; }
.check-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty { text-align: center; padding: 48px 24px; color: var(--text3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 13px; font-weight: 500;
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: var(--surf);
    transition: all .15s;
}
.chip.active { background: var(--primary-lt); border-color: var(--primary); color: var(--primary-dk); }

.tabs {
    display: flex;
    background: var(--surf2);
    border-radius: var(--rsm);
    padding: 3px;
    margin-bottom: 16px;
}
.tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 13px; font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text2);
    transition: all .15s;
}
.tab.active { background: var(--surf); color: var(--text); box-shadow: var(--sh); }

/* Variante para barras com muitas abas (Caixa): rola na horizontal em vez de
   espremer o texto. O `flex:1` do .tab quebraria "Movimentações" no celular. */
.tabs.tabs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs.tabs-scroll .tab { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; }

.today-header {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 16px;
    color: #fff;
}
.today-header h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.today-big { font-size: 40px; font-weight: 800; font-family: 'Outfit'; }

.search-box { position: relative; margin-bottom: 14px; }
.search-box input { padding-left: 38px; }
.search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    pointer-events: none;
}

.filial-bar {
    width: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: stretch;
}

.section-divider {
    font-size: 11px; font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 16px 0 8px;
}

.access-denied {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 200px;
    text-align: center;
    color: var(--text3);
    padding: 32px;
}

/* ═══ 14. ANIMAÇÕES ═══ */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media print {
    button { display: none !important; }
}
