/* ==========================================================
   Daily Work Tracker — stylesheet (plain CSS, no framework)
   ========================================================== */
:root {
  --brand-900: #172c48; --brand-800: #1e3a5f; --brand-700: #244678; --brand-600: #2b5694; --brand-500: #3b6db0;
  --brand-100: #d9e6f5; --brand-50: #eef4fb;
  --bg: #f6f8fb; --card: #ffffff; --line: #e5e9f0; --line-2: #f0f2f6;
  --text: #1e293b; --text-2: #475569; --muted: #64748b; --faint: #94a3b8;
  --green: #059669; --green-bg: #ecfdf5; --amber: #b45309; --amber-bg: #fffbeb; --red: #dc2626; --red-bg: #fef2f2;
  --blue: #1d4ed8; --blue-bg: #eff6ff; --violet: #6d28d9; --violet-bg: #f5f3ff; --sky: #0369a1; --sky-bg: #f0f9ff; --rose: #be123c; --rose-bg: #fff1f2;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 1px 3px rgb(16 24 40 / .06);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / .16);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 12px; } .faint { color: var(--faint); }
.bold { font-weight: 600; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.6; color: var(--text-2); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none !important; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn-primary { background: var(--brand-800); color: #fff; } .btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-outline { background: #fff; border-color: #cbd5e1; color: var(--text-2); } .btn-outline:hover:not(:disabled) { background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--text-2); } .btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: var(--text); }
.btn-danger { background: var(--red); color: #fff; } .btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { height: 44px; padding: 0 20px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 500; color: #334155; font-size: 13.5px; }
.req::after { content: ' *'; color: var(--red); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff;
  font: 14px var(--font); color: var(--text); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 9px 12px; line-height: 1.55; resize: vertical; min-height: 90px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.6'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgb(59 109 176 / .18); }
.input:disabled { background: #f8fafc; color: var(--muted); }
.input.invalid { border-color: #f87171; } .input.invalid:focus { box-shadow: 0 0 0 3px rgb(220 38 38 / .15); }
.err { color: var(--red); font-size: 12px; min-height: 0; }
.hint { color: var(--muted); font-size: 12px; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; height: 32px; width: 34px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand-700); }
.switch-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: .2s; }
.switch input:checked + span { background: var(--brand-700); } .switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.strength { margin-top: 6px; } .strength-bars { display: flex; gap: 4px; } .strength-bars i { flex: 1; height: 4px; border-radius: 4px; background: #e2e8f0; }
.strength-bars i.on-1 { background: var(--red); } .strength-bars i.on-2 { background: #f59e0b; } .strength-bars i.on-3 { background: #10b981; }
.strength-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11px; color: var(--faint); } .strength-list .ok { color: var(--green); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 14px; border: 2px dashed #cbd5e1; border-radius: var(--radius-sm);
  text-align: center; cursor: pointer; color: var(--text-2); transition: .15s; }
.dropzone:hover { border-color: var(--brand-500); background: #f8fafc; }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfd; }
.file-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { display: flex; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-500); }
.choice input { margin-top: 3px; accent-color: var(--brand-700); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 12px; border-radius: 99px; border: 1px solid #cbd5e1; background: #fff; font: 600 12px var(--font); text-transform: uppercase; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }

/* ---------------- layout grid helpers ---------------- */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 20px; } .stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .row-wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .end { justify-content: flex-end; }
.flex1 { flex: 1; min-width: 0; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 84px; }

/* ---------------- cards ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-pad0 { padding: 0; }
.stat { padding: 18px 20px; display: flex; justify-content: space-between; gap: 12px; }
.stat-label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--muted); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon .icon { width: 20px; height: 20px; }
.tone-brand { background: var(--brand-50); color: var(--brand-700); } .tone-green { background: var(--green-bg); color: var(--green); }
.tone-amber { background: var(--amber-bg); color: var(--amber); } .tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-sky { background: var(--sky-bg); color: var(--sky); } .tone-rose { background: var(--rose-bg); color: var(--rose); } .tone-gray { background: #f1f5f9; color: #475569; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; }
.callout-amber { background: var(--amber-bg); border-color: #fde68a; color: #78350f; }
.callout-green { background: var(--green-bg); border-color: #a7f3d0; color: #065f46; }
.callout-red { background: var(--red-bg); border-color: #fecaca; color: #991b1b; }
.callout-blue { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.callout-gray { background: #f8fafc; border-color: var(--line); color: var(--text-2); }

/* ---------------- badges & avatars ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; } .badge-blue { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }
.badge-green { background: var(--green-bg); color: var(--green); border-color: #a7f3d0; } .badge-amber { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.badge-violet { background: var(--violet-bg); color: var(--violet); border-color: #ddd6fe; } .badge-sky { background: var(--sky-bg); color: var(--sky); border-color: #bae6fd; }
.badge-rose { background: var(--rose-bg); color: var(--rose); border-color: #fecdd3; font-weight: 600; font-size: 11px; }
.pulse::before { animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 2px #fff; display: inline-block; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-100); color: var(--brand-800); font-weight: 600; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-name { font-weight: 500; color: var(--text); } .person-sub { font-size: 12px; color: var(--muted); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; } .table th.sortable:hover { color: var(--text); }
.table th .arrow { font-size: 10px; margin-left: 3px; opacity: .6; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; color: var(--text-2); }
.table tbody tr:hover { background: #fafbfd; }
.table tr.clickable { cursor: pointer; }
.actions { display: flex; justify-content: flex-end; gap: 2px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--text-2); flex-wrap: wrap; }
.pager-ctl { display: flex; align-items: center; gap: 8px; }
.pager select { height: 32px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0 6px; font: 12px var(--font); background: #fff; }
.mobile-cards { display: none; }
.m-card { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.filters { padding: 16px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.search { position: relative; flex: 1; } .search .icon { position: absolute; left: 11px; top: 11px; color: var(--faint); } .search .input { padding-left: 36px; }

/* ---------------- empty / loader ---------------- */
.empty { padding: 48px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: #f1f5f9; color: var(--faint); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.empty-title { font-weight: 600; } .empty-desc { color: var(--muted); max-width: 360px; } .empty .btn { margin-top: 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--brand-100); border-top-color: var(--brand-600); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader { min-height: 60vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--muted); }

/* ---------------- app shell ---------------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; background: var(--brand-900); color: #cbd5e1; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; background: rgb(255 255 255 / .1); display: flex; align-items: center; justify-content: center; color: #fff; }
.brand-name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; } .brand-sub { font-size: 11px; color: #94a3b8; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #cbd5e1; font: 500 14px var(--font);
  text-decoration: none; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.nav a:hover, .nav button:hover { background: rgb(255 255 255 / .06); color: #fff; }
.nav a.active { background: rgb(255 255 255 / .12); color: #fff; }
.nav .icon { color: #94a3b8; } .nav a.active .icon { color: #fff; }
.nav .count { margin-left: auto; background: #f43f5e; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.side-foot { border-top: 1px solid rgb(255 255 255 / .1); padding: 14px 16px; display: flex; gap: 10px; align-items: center; }
.side-foot .avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / .2); }
.side-foot .n { color: #fff; font-weight: 500; font-size: 13.5px; } .side-foot .s { color: #94a3b8; font-size: 12px; }
.main { margin-left: 256px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; background: rgb(255 255 255 / .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.topbar .welcome { flex: 1; color: var(--muted); min-width: 0; } .topbar .welcome b { color: var(--text); font-weight: 600; }
.menu-btn { display: none; }
.content { max-width: 1400px; margin: 0 auto; padding: 24px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-head .row { flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; background: none; border: 0; cursor: pointer; font-size: 14px; padding: 0; }
.db-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--text-2); background: #fff; cursor: pointer; }
.db-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.db-pill.ok .dot { background: #10b981; } .db-pill.warn .dot { background: #f59e0b; } .db-pill.err .dot { background: var(--red); }
.overlay { display: none; }

/* notifications dropdown */
.bell { position: relative; }
.bell-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bell-btn:hover { background: #f1f5f9; }
.bell-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #f43f5e; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dropdown { position: absolute; right: 0; top: 46px; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.dropdown-list { max-height: 380px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; font: inherit; color: inherit; }
.notif:hover { background: #f8fafc; } .notif.unread { background: var(--brand-50); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; } .notif.unread .dot { background: var(--brand-600); }
.notif-title { font-weight: 600; font-size: 13.5px; } .notif-msg { font-size: 12.5px; color: var(--text-2); } .notif-time { font-size: 11px; color: var(--faint); margin-top: 2px; }
.dropdown-foot { display: block; text-align: center; padding: 10px; font-size: 12.5px; font-weight: 600; }

/* profile card */
.profile-card { overflow: hidden; }
.profile-cover { height: 64px; background: linear-gradient(90deg, var(--brand-800), var(--brand-600)); }
.profile-inner { padding: 0 20px 20px; margin-top: -36px; }
.profile-inner .avatar { box-shadow: 0 0 0 4px #fff; }
.profile-inner h2 { font-size: 17px; margin-top: 10px; } .role-line { color: var(--brand-600); font-weight: 500; }
.dl { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; color: var(--text-2); }
.dl div { display: flex; gap: 8px; align-items: center; } .dl .icon { color: var(--faint); width: 16px; height: 16px; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kv dt { color: var(--muted); font-size: 12.5px; } .kv dd { margin: 2px 0 0; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.section-label { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.progress { height: 8px; background: #eef2f7; border-radius: 99px; overflow: hidden; } .progress > span { display: block; height: 100%; background: #10b981; border-radius: 99px; }
.status-list { max-height: 330px; overflow-y: auto; } .status-list li { list-style: none; display: flex; gap: 10px; align-items: center; padding: 7px 20px; }
.status-list ul { margin: 0; padding: 6px 0; }
.list { margin: 0; padding: 0; list-style: none; } .list > li { border-bottom: 1px solid var(--line-2); } .list > li:last-child { border-bottom: 0; }
.list-link { display: block; padding: 12px 20px; color: inherit; text-decoration: none !important; } .list-link:hover { background: #f8fafc; }
.list-link.row { display: flex; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #eef2f7; border-radius: 10px; overflow-x: auto; max-width: 100%; margin-bottom: 20px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font: 500 13.5px var(--font); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: #e2e8f0; stroke-dasharray: 3 3; } .chart .axis { fill: #64748b; font-size: 11px; font-family: var(--font); }
.chart .bar { cursor: pointer; } .chart .bar:hover rect:last-of-type { opacity: .8; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.hbar:hover .hbar-fill { opacity: .85; } .hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 16px; background: #f1f5f9; border-radius: 5px; overflow: hidden; } .hbar-fill { display: block; height: 100%; background: var(--brand-500); border-radius: 5px; }
.hbar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-direction: column; gap: 8px; } .legend div { display: flex; justify-content: space-between; gap: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.donut-wrap { display: flex; align-items: center; gap: 24px; } .donut { width: 170px; height: 170px; flex-shrink: 0; }
.donut path { cursor: pointer; } .donut path:hover { opacity: .85; }

/* ---------------- auth pages ---------------- */
.auth { display: flex; min-height: 100vh; }
.auth-side { width: 46%; background: var(--brand-900); color: #e2e8f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; inset: 0; opacity: .07; background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 22px 22px; }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: 30px; line-height: 1.25; color: #fff; font-weight: 650; max-width: 440px; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-side li { display: flex; align-items: center; gap: 12px; } .auth-side li span { width: 32px; height: 32px; border-radius: 8px; background: rgb(255 255 255 / .1); display: flex; align-items: center; justify-content: center; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 24px; font-weight: 650; } .auth-box > p { color: var(--muted); margin-top: 6px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.demo-box { margin-top: 28px; padding: 12px; border: 1px dashed #fcd34d; background: var(--amber-bg); border-radius: var(--radius-sm); font-size: 12.5px; color: #78350f; }
.demo-box button { border: 0; background: none; color: var(--brand-600); font: 500 12.5px var(--font); cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------------- modals ---------------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(15 23 42 / .5); }
.modal { position: relative; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-height: 92vh; display: flex; flex-direction: column; animation: pop .16s ease-out; outline: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.modal-sm { max-width: 440px; } .modal-md { max-width: 560px; } .modal-lg { max-width: 760px; } .modal-xl { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); }

/* ---------------- toasts ---------------- */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 32px); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; transition: opacity .2s; }
.toast.out { opacity: 0; } .toast-error { border-left-color: var(--red); } .toast-info { border-left-color: var(--brand-500); }
.toast-icon { color: var(--green); } .toast-error .toast-icon { color: var(--red); } .toast-info .toast-icon { color: var(--brand-500); }
.toast-body { flex: 1; min-width: 0; } .toast-title { font-weight: 600; font-size: 13.5px; } .toast-desc { font-size: 12.5px; color: var(--text-2); }
.toast-action { border: 0; background: none; color: var(--brand-600); font: 600 12.5px var(--font); cursor: pointer; }
.toast-close { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0; }

/* ---------------- responsive ---------------- */
@media (max-width: 1200px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-left { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 272px; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgb(15 23 42 / .45); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-side { display: none; }
}
@media (max-width: 760px) {
  .content { padding: 18px 14px 40px; } .topbar { padding: 0 12px; }
  .g2, .g3, .g4, .g5, .choice-grid { grid-template-columns: minmax(0, 1fr); } .span2, .span3 { grid-column: auto; }
  .desktop-table { display: none; } .mobile-cards { display: block; }
  .hide-sm { display: none !important; }
  .page-head h1 { font-size: 19px; }
  .donut-wrap { flex-direction: column; align-items: stretch; } .donut { margin: 0 auto; }
  .hbar { grid-template-columns: 96px 1fr 30px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .modal-wrap { align-items: flex-end; padding: 0; } .modal { border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-foot { flex-direction: column-reverse; } .modal-foot .btn { width: 100%; }
}
@media print {
  .sidebar, .topbar, .page-head .row, .actions, .btn { display: none !important; }
  .main { margin: 0; } .card { box-shadow: none; }
}

/* ================= Campaign Execution Tracker additions ================= */
.badge-red { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.badge-sms { background: #eef4fb; color: #244678; border-color: #c9d9ee; }
.badge-email { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-wa { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-sms::before, .badge-email::before, .badge-wa::before { display: none; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.range-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.range-bar .input { width: auto; min-width: 150px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 600; background: #f8fafc; border-top: 1px solid var(--line); }
.type-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-pick label { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; transition: .15s; }
.type-pick label:hover { border-color: #cbd5e1; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick label:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-600); }
.type-pick .ti { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.type-pick b { display: block; font-size: 14px; } .type-pick small { color: var(--muted); font-size: 12px; }
.cost-box { background: linear-gradient(180deg, #f8fbff, #eef4fb); border: 1px solid var(--brand-100); border-radius: 12px; padding: 16px; }
.cost-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.cost-row b { font-variant-numeric: tabular-nums; }
.cost-total { border-top: 1px dashed #b5cdea; margin-top: 6px; padding-top: 10px; font-size: 16px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; }
details.more { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
details.more[open] summary { margin-bottom: 12px; }
.rate-card { background: linear-gradient(135deg, var(--brand-800), var(--brand-600)); color: #fff; border: 0; }
.rate-card .stat-label, .rate-card .stat-hint { color: #cbd5e1; } .rate-card .stat-icon { background: rgb(255 255 255 / .14); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-500); }
.timeline .who { font-size: 12px; color: var(--muted); }
.logo-img { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; }
.kv2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.kv2 dt { color: var(--muted); font-size: 12px; } .kv2 dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.profile-menu { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 10px; font: inherit; color: inherit; }
.profile-btn:hover { background: #f1f5f9; }
.profile-btn .meta { text-align: left; line-height: 1.2; } .profile-btn .meta b { display: block; font-size: 13px; } .profile-btn .meta span { font-size: 11.5px; color: var(--muted); }
.menu { position: absolute; right: 0; top: 48px; min-width: 200px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: 500 13.5px var(--font); color: var(--text-2); cursor: pointer; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: #f1f5f9; color: var(--text); }
.idle-warn { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 150; }
@media (max-width: 1024px) { .kv2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .type-pick { grid-template-columns: 1fr; } .kv2 { grid-template-columns: 1fr; } .profile-btn .meta { display: none; } .range-bar .input { flex: 1; min-width: 0; } }
