:root { --accent: #185a9d; --accent-dark: #123f6e; }
body { background: #f3f5f8; font-size: 14px; }
body.signed-out { background: linear-gradient(135deg, #123f6e, #185a9d 60%, #2a7bc4); min-height: 100vh; }
.cr-nav { background: var(--accent-dark); }
.cr-nav .navbar-brand { font-weight: 600; }
.brand-mark { display: inline-block; background: #fff; color: var(--accent-dark); font-weight: 800; border-radius: 6px; padding: 1px 6px; font-size: 13px; letter-spacing: .5px; }
.brand-mark.lg { font-size: 22px; padding: 6px 12px; border-radius: 10px; background: var(--accent); color: #fff; }
.cr-main { padding-top: 16px; padding-bottom: 32px; }
.cr-error { position: sticky; top: 8px; z-index: 50; }
.cr-busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; overflow: hidden; }
.cr-busy .bar { width: 35%; height: 100%; background: #ffc107; animation: slide 1s linear infinite; }
@keyframes slide { from { transform: translateX(-100%);} to { transform: translateX(300%);} }

.login-wrap { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 32px); }
.login-card { width: 380px; max-width: 95vw; border: 0; border-radius: 12px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; }
.section { color: #6c757d; font-weight: 700; letter-spacing: .5px; margin: 14px 0 8px; }
.kpis .kpi { background: #fff; border: 1px solid #e3e7ed; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; min-height: 96px; }
.kpi .t { font-size: 11px; font-weight: 700; color: #6c757d; letter-spacing: .5px; }
.kpi .v { font-size: 22px; font-weight: 700; color: #1e1e1e; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 13px; font-weight: 600; color: #6c757d; }
.kpi .d { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .h { font-size: 11px; color: #8a929b; }
.delta { font-weight: 600; }

.panel { background: #fff; border: 1px solid #e3e7ed; border-radius: 8px; overflow: hidden; }
.panel .ph { padding: 8px 12px; font-weight: 600; border-bottom: 1px solid #eef1f5; background: #fafbfc; }
.panel .ph small { font-weight: 400; }
.chart-wrap { position: relative; height: 280px; padding: 8px; }
.scroll-300 { max-height: 300px; overflow: auto; }
.scroll-400 { max-height: 400px; overflow: auto; }
.table-sm td, .table-sm th { padding: .3rem .5rem; vertical-align: middle; }
.table.clickable tbody tr { cursor: pointer; }
.table thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: #6c757d; white-space: nowrap; }
.table th.sortable { cursor: pointer; text-decoration: underline dotted; }
.filters { background: #fff; border: 1px solid #e3e7ed; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.filters label.small { margin-bottom: 2px; color: #6c757d; }
.kv td:first-child { color: #6c757d; }

@media print {
  .cr-nav, .no-print, .cr-busy { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; }
}

/* ---- phase 5 ---- */
.qr-box svg { width: 180px; height: 180px; }
.user-select-all { user-select: all; }
.print-sheet { background: #fff; border: 1px solid #e3e7ed; border-radius: 8px; padding: 24px 28px; max-width: 900px; margin: 0 auto; }
.print-lines th, .print-lines td { font-size: 13px; }
.print-lines td.check-box { text-align: center; font-size: 18px; line-height: 1; }
.sign-line { border-bottom: 1px solid #333; height: 36px; margin-bottom: 4px; }
.schedule-box label.small { margin-bottom: 0; }
body.print-mode .cr-main { padding-top: 8px; }
@media print {
  body.print-mode { background: #fff; }
  .print-sheet { border: 0; padding: 0; max-width: none; }
  .print-lines { page-break-inside: auto; }
  .print-lines tr { page-break-inside: avoid; }
  .badge { border: 1px solid #333; color: #000 !important; background: none !important; }
  a[href]:after { content: none !important; }
}
.cr-nav .nav-link { white-space: nowrap; }

/* ---- phase 6: grouped, collapsible navigation ---- */
.cr-nav .dropdown-menu { margin-top: 0; border-radius: 6px; }
.cr-nav .nav-item.active > .nav-link { font-weight: 600; }
.cr-nav .dropdown-item.active, .cr-nav .dropdown-item:active { background: var(--accent); color: #fff; }
@media (max-width: 991.98px) {
  .cr-nav .navbar-collapse { padding: 8px 0 12px; }
  .cr-nav .dropdown-menu { position: static; float: none; background: rgba(255,255,255,.06); border: 0; margin: 0 0 4px 8px; padding: 0 0 4px; }
  .cr-nav .dropdown-item { color: rgba(255,255,255,.85); padding: 6px 16px; }
  .cr-nav .dropdown-item:hover { background: rgba(255,255,255,.1); color: #fff; }
  .cr-nav .navbar-text { display: block; margin: 6px 0; }
}
.my-card { border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; padding: 18px 20px; position: relative; overflow: hidden; }
.my-card.inactive { background: linear-gradient(135deg, #6c757d, #343a40); }
.my-card .number { letter-spacing: 2px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; }
.my-card .bal { font-size: 2rem; font-weight: 600; line-height: 1; }
.my-card .tag { position: absolute; top: 12px; right: 14px; font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.tx-items { font-size: .85rem; color: #6c757d; }
