/* EscalaPro — estilo único, sem dependências. Celular primeiro. */
:root {
    --brand: #2563eb; --brand-d: #1d4ed8; --brand-soft: #eff6ff;
    --bg: #f1f5f9; --surface: #fff; --surface-2: #f8fafc; --line: #e2e8f0; --line-2: #cbd5e1;
    --text: #0f172a; --muted: #64748b; --nav: #0f172a; --nav-2: #1e293b; --nav-text: #cbd5e1;
    --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --err: #dc2626; --err-soft: #fee2e2; --info-soft: #e0f2fe;
    --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.05);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
h3 .ic { color: var(--brand); }
.mt { margin-top: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.ic { flex: none; vertical-align: middle; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 12.5px; }

/* ---------- layout ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; }
.sidebar nav { padding: 6px 10px 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 17px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.brand.big { font-size: 22px; padding: 0 0 18px; }
.brand.big .logo { width: 42px; height: 42px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--nav-text); font-weight: 500; }
.nav-link:hover { background: var(--nav-2); color: #fff; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link .pill { margin-left: auto; background: var(--err); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; display: none; }
body.nav-open .sidebar { transform: none; }
body.nav-open .backdrop { display: block; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 62px; }
.top-title { min-width: 0; flex: 1; }
.top-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.nav-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn .dot { position: absolute; top: 3px; right: 2px; background: var(--err); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 4px 6px; border-radius: 12px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.user-btn:hover { background: var(--surface-2); }
.user-btn small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.user-btn b { display: block; line-height: 1.2; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(15,23,42,.15); width: 250px; padding: 6px; display: none; }
.user-menu.open .dropdown { display: block; }
.dd-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-head small { display: block; color: var(--muted); word-break: break-all; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); border: 0; background: none; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.main { padding: 16px; max-width: 1500px; }
.no-nav .main { max-width: none; padding: 0; }
.popup-main { padding: 0; background: var(--surface); }
.popup-main .card.form { box-shadow: none; border: 0; padding: 18px; margin: 0; }
.page-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.only-mobile { display: inline-grid; }
@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .has-nav .topbar, .has-nav .main { margin-left: 250px; }
    .only-mobile, .backdrop { display: none !important; }
    .main { padding: 24px 28px; }
}
@media (max-width: 640px) { .hide-mobile { display: none; } }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 42px 18px; color: var(--muted); }
.card.empty .ic { color: var(--line-2); }
.card.empty h2 { color: var(--text); margin: 10px 0 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; }
.card-body { padding: 14px 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--brand); background: var(--brand); color: #fff; font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #15803d; }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; height: 44px; }
.btn.del:hover { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.btn.edit:hover { background: color-mix(in srgb, #2563eb 10%, transparent); color: #2563eb; border-color: color-mix(in srgb, #2563eb 30%, transparent); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #166534; border-color: #bbf7d0; }
.badge.warn { background: var(--warn-soft); color: #92400e; border-color: #fde68a; }
.badge.danger, .badge.err { background: var(--err-soft); color: #991b1b; border-color: #fecaca; }
.badge.info { background: var(--info-soft); color: #075985; border-color: #bae6fd; }
.badge.muted { opacity: .8; }
.dot-color { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 14px; border: 1px solid; background: var(--info-soft); border-color: #bae6fd; color: #0c4a6e; }
.alert.ok { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.alert.warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert.err { background: var(--err-soft); border-color: #fecaca; color: #7f1d1d; }
.alert ul { margin: 6px 0 10px; padding-left: 18px; }
.alert li.alerta { color: #92400e; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; color: #fff; background: hsl(var(--h, 220) 55% 48%); }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.who small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.who b { display: block; font-weight: 600; line-height: 1.25; }

/* ---------- formulários ---------- */
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 11px; min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 38px; }
input[type=file] { padding: 6px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.grid > * { grid-column: span 12; }
@media (min-width: 720px) {
    .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
}
.field label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: #334155; }
.field .req { color: var(--err); font-style: normal; }
.help { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.form-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; padding-top: 6px; }
.field .check { margin: 0; }
.sel-row { display: flex; gap: 6px; }
.sel-row select { flex: 1; min-width: 0; }
.sel-row .btn { height: 38px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; }
.chip input { display: none; }
.chip span { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); cursor: pointer; font-size: 12.5px; background: var(--surface); }
.chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-d); font-weight: 600; }
.img-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.img-field > div { flex: 1; min-width: 200px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border: 1px dashed #fecaca; border-radius: var(--r); color: #991b1b; background: #fff7f7; }

/* ---------- toolbars e tabelas ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; max-width: 100%; }
.toolbar .push { margin-left: auto; }
.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.search { position: relative; display: inline-flex; align-items: center; flex: 1 1 200px; max-width: 340px; }
.search .ic { position: absolute; left: 10px; color: var(--muted); }
.search input { padding-left: 34px; width: 100%; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover td { background: #f8fafc; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); }
.tbl-1l th, .tbl-1l td { padding: 5px 14px; white-space: nowrap; }
.tbl-1l .row-actions .btn.sm { height: 28px; padding: 0 9px; }
.tbl-1l td .badge { vertical-align: middle; }
.tbl-1l .row-actions { margin-top: 0; flex-wrap: nowrap; }
.tbl-1l .who b, .tbl-1l .who small { display: inline; }
.tbl-1l .who small { margin-left: 6px; }
.tbl-1l .avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
@media (max-width: 1599px) { .tbl-1l .row-actions .btn span { display: none; } }
@media (min-width: 721px) and (max-width: 1499px) { .tbl .hide-lg { display: none; } }
.trunc { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* celular: tabelas de cadastro viram cartões */
@media (max-width: 720px) {
    .tbl.tbl-1l thead { display: none; }
    .tbl.tbl-1l, .tbl.tbl-1l tbody, .tbl.tbl-1l tr, .tbl.tbl-1l td { display: block; width: 100%; }
    .tbl.tbl-1l tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
    .tbl.tbl-1l td { border: 0; padding: 5px 12px; white-space: normal; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .tbl.tbl-1l td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
    .tbl.tbl-1l td:first-child { text-align: left; }
    .tbl.tbl-1l td:first-child::before { display: none; }
    .tbl.tbl-1l td.right:last-child { justify-content: flex-end; }
    .tbl.tbl-1l td.right:last-child::before { display: none; }
    .row-actions { margin-top: 4px; }
    .tbl.tbl-1l .trunc { max-width: 60vw; }
}

/* ---------- painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(6, 1fr); } .kpis.mini { grid-template-columns: repeat(4, 1fr); } }
.kpis.mini { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kpis.mini { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; color: inherit; border-left: 4px solid var(--brand); }
.kpi span { font-size: 24px; font-weight: 700; line-height: 1.1; }
.kpi small { color: var(--muted); }
.kpi.good { border-left-color: var(--ok); }
.kpi.warn { border-left-color: var(--warn); }
.kpi.bad { border-left-color: var(--err); }
.kpi.bad span { color: var(--err); }
.mini .kpi span { font-size: 20px; }
.cols-2 { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cols-2 { grid-template-columns: 1fr 1fr; align-items: start; } .cols-2-1 { grid-template-columns: 2fr 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow small { display: block; color: var(--muted); }
.list .empty-li { color: var(--muted); justify-content: center; padding: 22px; }
.sev { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn); }
.sev.erro { background: var(--err); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; padding: 8px 18px 0; }
.bars .bar { background: color-mix(in srgb, var(--brand) 80%, #fff); border-radius: 6px 6px 0 0; min-height: 3px; position: relative; }
.bars .bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.bars-lbl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 4px 18px 14px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------- grade da escala ---------- */
.sched-bar .week-nav { display: inline-flex; align-items: center; gap: 4px; }
.sched-bar .week-nav input { width: 150px; }
.sched-status { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions-bar .btn span { display: none; }
@media (min-width: 900px) { .actions-bar .btn span { display: inline; } }
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sched { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
.sched th, .sched td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; }
.sched thead th { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; color: var(--muted); text-align: center; font-weight: 600; }
.sched thead th b { display: block; color: var(--text); font-size: 14px; text-transform: none; }
.sched thead th small { display: block; color: var(--err); text-transform: none; }
.sched th.today, .sched td.today { background: #eff6ff; }
.sched th.holiday { background: #fff1f2; }
.sched .sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; text-align: left; min-width: 190px; max-width: 220px; font-weight: 400; }
.sched thead .sticky { background: var(--surface-2); }
.sched .sticky .who b { font-size: 13px; }
.sched td.cell { min-width: 122px; cursor: copy; height: 56px; }
.sched td.cell:hover { background: #f8fafc; }
.sched td.off { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px); }
.chip-shift { display: flex; flex-wrap: nowrap; white-space: nowrap; align-items: center; gap: 5px; width: 100%; padding: 4px 7px; margin-bottom: 4px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c, #64748b) 45%, transparent); border-left: 4px solid var(--c, #64748b); background: color-mix(in srgb, var(--c, #64748b) 12%, #fff); font: 600 11.5px var(--font); color: var(--text); cursor: pointer; text-align: left; }
.chip-shift span { font-weight: 500; color: #334155; white-space: nowrap; }
.chip-shift .ic { margin-left: auto; color: var(--warn); }
.chip-shift.err { box-shadow: 0 0 0 2px var(--err); }
.chip-shift.err .ic { color: var(--err); }
.chip-shift.warn { box-shadow: 0 0 0 1.5px var(--warn); }
.chip-shift.st-cancelado { opacity: .45; text-decoration: line-through; }
.chip-shift.st-falta { background: var(--err-soft); }
.chip-shift.st-falta span::after { content: " · falta"; color: var(--err); }
.chip-shift.st-realizado b::after { content: " ✓"; color: var(--ok); }
.chip-shift.sample { display: inline-flex; width: auto; margin: 0 2px; padding: 0 6px; vertical-align: middle; --c: #f59e0b; }
.leave { display: block; font-size: 11.5px; font-weight: 600; color: #475569; text-align: center; padding: 4px; border-radius: 6px; background: #e2e8f0; margin-bottom: 4px; }
.unav { display: inline-block; font-size: 10.5px; color: #9a3412; background: #ffedd5; border-radius: 5px; padding: 0 5px; margin-bottom: 4px; }
.sched td.hours { white-space: nowrap; vertical-align: middle; }
.sched td.hours small { display: block; color: var(--muted); }
.sched td.hours.over b { color: var(--warn); }
.sched tfoot th, .sched tfoot td { background: var(--surface-2); }
.cov { font-size: 11px; }
.cov-item { display: block; border-radius: 5px; padding: 1px 6px; margin-bottom: 3px; white-space: nowrap; }
.cov-item.ok { background: var(--ok-soft); color: #166534; }
.cov-item.bad { background: var(--err-soft); color: #991b1b; }
.legend { margin-top: -6px; }
.issues { list-style: none; padding: 0; margin: 0 0 12px; }
.issues li { padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: #78350f; margin-bottom: 4px; font-size: 12.5px; }
.seg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.seg-pick label { cursor: pointer; }
.seg-pick input { display: none; }
.seg-pick span { display: block; border: 1px solid var(--line-2); border-left: 4px solid var(--c, var(--line-2)); border-radius: 9px; padding: 6px 9px; font-size: 13px; }
.seg-pick small { display: block; color: var(--muted); font-size: 11.5px; }
.seg-pick input:checked + span { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.model-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.model-row > div { flex: 1; min-width: 160px; }
.model-row small { display: block; color: var(--muted); }
.model-row select { width: auto; }
.model-new { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.model-new input { flex: 1; min-width: 180px; }

/* mês */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.month .mh { background: var(--surface-2); padding: 8px; text-align: center; font-size: 11.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.month .md { background: var(--surface); min-height: 108px; padding: 6px; color: inherit; display: block; }
.month .md:hover { background: #f8fafc; }
.month .md.out { background: var(--surface-2); opacity: .55; }
.month .md.today { box-shadow: inset 0 0 0 2px var(--brand); }
.month .md .n { font-weight: 700; display: flex; justify-content: space-between; }
.month .md .n small { color: var(--err); font-weight: 600; font-size: 10.5px; }
.month .tag { display: flex; justify-content: space-between; font-size: 11px; border-radius: 5px; padding: 0 5px; margin-top: 3px; background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c); }
.month .tag.bad { background: var(--err-soft); }
@media (max-width: 720px) { .month .md { min-height: 72px; padding: 4px; } .month .tag { font-size: 10px; padding: 0 3px; } .month .tag em { display: none; } }

/* minha área */
.shift-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .shift-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.shift-card { border: 1px solid var(--line); border-left: 5px solid var(--c, var(--brand)); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.shift-card .d { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.shift-card .h { font-size: 20px; font-weight: 700; }
.shift-card .s { color: var(--muted); font-size: 12.5px; }
.shift-card .row-actions { margin-top: 8px; justify-content: flex-start; }
.day-list .day { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.day-list .day:last-child { border-bottom: 0; }
.day-list .dt { width: 54px; text-align: center; flex: none; }
.day-list .dt b { display: block; font-size: 20px; line-height: 1; }
.day-list .dt small { color: var(--muted); text-transform: uppercase; font-size: 11px; }
.day-list .day.today { background: #eff6ff; }
.day-list .day.folga { color: var(--muted); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: flex-end; justify-content: center; z-index: 60; padding: 0; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: 22px 22px 0 0; width: 100%; max-height: 92vh; overflow-y: auto; padding: 18px; box-shadow: 0 24px 64px rgba(15,23,42,.3); }
@media (min-width: 720px) { .modal { align-items: center; padding: 20px; } .modal-box { border-radius: 22px; width: min(720px, 100%); padding: 22px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.modal-head h2 { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .del { margin-right: auto; }
.modal-actions.one { display: grid; grid-template-columns: 1fr; }
.qa-box { background: var(--surface); width: min(640px, 100%); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 64px rgba(15,23,42,.3); display: flex; flex-direction: column; max-height: 90vh; }
.qa-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.qa-head h2 { font-size: 16px; }
.qa-box iframe { border: 0; width: 100%; height: 300px; display: block; }
.demo-box { width: min(500px, 100%); text-align: center; }
.demo-box p { margin: 0 0 12px; line-height: 1.55; }
.demo-box h2 { margin: 8px 0 12px; }
.demo-box .demo-obs { font-size: 13px; background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 20px; }
.demo-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }

/* login */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth.single { grid-template-columns: 1fr; place-items: center; padding: 16px; }
.auth-side { display: none; background: linear-gradient(150deg, #0f172a, #1e3a8a); color: #e2e8f0; padding: 56px; flex-direction: column; justify-content: center; }
@media (min-width: 900px) { .auth-side { display: flex; } }
.auth-side h2 { font-size: 30px; color: #fff; margin-bottom: 22px; max-width: 440px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 460px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; }
.auth-side li .ic { color: #93c5fd; margin-top: 2px; }
.auth-card { width: min(420px, 100%); margin: auto; padding: 32px 22px; display: grid; gap: 14px; }
.auth.single .auth-card { background: var(--surface); border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; }
.auth-card .muted { margin: -8px 0 4px; }
.link.center { display: block; text-align: center; }
.demo-hint { display: flex; gap: 10px; background: var(--brand-soft); border: 1px solid #bfdbfe; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #1e3a8a; }

/* ajuda */
.rel-grid { display: grid; gap: 12px; margin-bottom: 22px; }
@media (min-width: 720px) { .rel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .rel-grid { grid-template-columns: repeat(3, 1fr); } }
.rel-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; color: inherit; box-shadow: var(--shadow); }
.rel-card .ic-box { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.rel-card b { display: block; margin-bottom: 3px; }
.rel-card p { margin: 0; color: #475569; font-size: 13px; }
.rel-card .open { display: inline-block; margin-top: 6px; font-weight: 600; font-size: 12.5px; }
a.rel-card:hover { border-color: var(--brand); }
.help-sec { font-size: 15px; margin: 6px 0 10px; color: #334155; }

/* auditoria */
.diff { font-size: 12px; display: grid; gap: 2px; }
.diff del { color: #991b1b; background: #fef2f2; text-decoration: none; padding: 0 3px; border-radius: 3px; }
.diff ins { color: #166534; background: #f0fdf4; text-decoration: none; padding: 0 3px; border-radius: 3px; }
.wrap td { white-space: normal; }

/* impressão */
@media print {
    .sidebar, .topbar, .toolbar, .legend, .page-actions, .alert, .kpis, .modal, .backdrop { display: none !important; }
    .has-nav .main { margin: 0; padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; }
    .sched { min-width: 0; font-size: 10px; }
    .sched .sticky { position: static; }
}
@media (max-width: 720px) {
    .sched .sticky { min-width: 118px; max-width: 130px; }
    .sched .sticky .avatar { display: none; }
    .sched .sticky .who small { display: none; }
    .sched td.cell { min-width: 112px; }
    .sched-status { margin-left: 0; }
}
