/* CA Work OS: the live ca-ops stylesheet (first part) plus the compatibility layer for this version's markup (second part). */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #f8f9fb;
  --border: #e2e6ed;
  --border2: #d0d6e0;
  --accent: #1a56db;
  --accent-light: #eff4ff;
  --accent3: #059669;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warn: #d97706;
  --warn-light: #fffbeb;
  --text: #111827;
  --text2: #374151;
  --muted: #6b7280;
  --muted2: #9ca3af;
  --sidebar-bg: #1e2535;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #64748b;
  --sidebar-border: rgba(255,255,255,0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; overflow: hidden; }

/* ── LOGIN SCREEN ────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px;
  width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.login-logo {
  margin-bottom: 0;
}
.login-firm { font-size: 12px; color: var(--muted); margin-bottom: 32px; }
.login-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; display: block; }
.login-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; font-family: 'DM Sans', sans-serif;
  outline: none; transition: border-color 0.12s, box-shadow 0.12s; margin-bottom: 16px;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.login-btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600;
  font-family: 'DM Sans', sans-serif; cursor: pointer; transition: background 0.13s;
  margin-top: 4px;
}
.login-btn:hover { background: #1648c0; }
.login-btn:disabled { background: var(--muted2); cursor: not-allowed; }
.login-error {
  background: var(--danger-light); border: 1px solid #fecaca; border-radius: 6px;
  padding: 10px 12px; font-size: 12px; color: var(--danger); margin-bottom: 16px; display: none;
}
.pw-wrap { position: relative; margin-bottom: 16px; }
.pw-wrap .login-input { margin-bottom: 0; padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--muted); font-size: 14px; user-select: none;
}

/* ── CHANGE PASSWORD SCREEN ──────────────────────────────── */
#change-pw-screen {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  display: none; align-items: center; justify-content: center; z-index: 900;
}
.change-pw-card {
  background: #fff; border-radius: 16px; padding: 36px;
  width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: 224px; min-width: 224px; background: var(--sidebar-bg);
  display: flex; flex-direction: column; z-index: 100;
}
.logo { padding: 16px 16px 14px; border-bottom: 1px solid var(--sidebar-border); display: flex; align-items: center; }
.logo-mark { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 13px; color: #fff; letter-spacing: 0.02em; line-height: 1.3; }
.logo-sub { font-size: 9px; color: var(--sidebar-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }
.sidebar-section { padding: 14px 12px 6px; }
.sidebar-section-label { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sidebar-muted); padding: 0 8px; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--sidebar-text); transition: all 0.13s; user-select: none; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon { font-size: 13px; width: 17px; text-align: center; }
.sidebar-divider { height: 1px; background: var(--sidebar-border); margin: 8px 12px; }
#sidebar-work-types { padding: 0 0 4px; }

.user-info {
  margin-top: auto; border-top: 1px solid var(--sidebar-border);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 12px; color: #fff; font-weight: 600; }
.user-role { font-size: 10px; color: var(--sidebar-muted); }
.logout-btn { margin-left: auto; font-size: 11px; color: var(--sidebar-muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ── MAIN ────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 54px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; color: var(--text); flex: 1; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-owner   { background: #eff4ff; color: #1a56db; border: 1px solid #c7d7fa; }
.badge-manager { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-senior  { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-employee{ background: #f0fdf4; color: #059669; border: 1px solid #bbf7d0; }

.btn { padding: 7px 14px; border-radius: 6px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500; transition: all 0.13s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1648c0; }
.btn-ghost { background: var(--surface); color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface2); }
.btn-sm { padding: 5px 11px; font-size: 11px; }
.btn-danger-soft { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }

.content { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg); }
.view { display: none; }
.view.active { display: block; }

/* ── KPI CARDS ───────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
/* A fixed-2-column variant for rows that are meant to stay wider "alert" cards
   (e.g. Pulse's Overdue/Waiting row) rather than join the main 4-up grid. Used
   with onclick-filtered tiles that render conditionally, so sometimes only one
   of the two exists — :only-child lets that lone tile take the full row instead
   of sitting next to dead space. */
.kpi-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 24px; }
.kpi-grid-2 > *:only-child { grid-column: 1 / -1; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; position: relative; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: box-shadow 0.15s, transform 0.15s; }
.kpi-card[onclick]:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-1px); }
.kpi-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; border-radius: 10px 10px 0 0; }
.kpi-card.kpi-info::before { background: var(--accent); }
.kpi-card.kpi-warn::before { background: var(--warn); }
.kpi-card.kpi-danger::before { background: var(--danger); }
.kpi-card.kpi-ok::before { background: var(--accent3); }
/* The most urgent tile in any row — Overdue — gets a tinted background instead
   of plain white, so it reads as "needs attention" at a glance instead of
   looking identical to every other card except for a 3px strip of colour. */
.kpi-card.kpi-danger { background: var(--danger-light); border-color: #fecaca; }
.kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.kpi-value { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.kpi-sub { font-size: 11px; color: var(--muted); }

/* ── SKELETON LOADING ────────────────────────────────────── */
.skeleton { position: relative; color: transparent !important; background: linear-gradient(90deg, var(--surface2) 25%, #e9edf3 37%, var(--surface2) 63%); background-size: 400% 100%; animation: skeleton-pulse 1.4s ease infinite; border-radius: 6px; }
.skeleton * { visibility: hidden; }
@keyframes skeleton-pulse { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── TABS ────────────────────────────────────────────────── */
.tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab { padding: 8px 16px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.13s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── FILTER BAR ──────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-select { background: var(--surface); border: 1px solid var(--border2); color: var(--text2); border-radius: 7px; padding: 7px 10px; font-size: 12px; font-family: 'DM Sans', sans-serif; cursor: pointer; outline: none; }
.search-input { background: var(--surface); border: 1px solid var(--border2); color: var(--text); border-radius: 7px; padding: 7px 12px; font-size: 12px; font-family: 'DM Sans', sans-serif; outline: none; width: 220px; }
.search-input:focus { border-color: var(--accent); }

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.table-wrap table { width: 100%; border-collapse: collapse; }
thead th { padding: 11px 16px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface2); }
thead th:hover { color: var(--accent); background: var(--accent-light); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f5ff; }
tbody td { padding: 12px 16px; font-size: 13px; vertical-align: middle; color: var(--text2); }

/* ── STATUS + PRIORITY CHIPS ─────────────────────────────── */
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.s-not-started  { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.s-waiting      { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.s-waiting-manager { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.s-waiting-client  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.s-in-progress  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.s-review       { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.s-done         { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.s-billing      { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.s-billed       { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.s-nonbillable  { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.s-paid         { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; font-weight:700; }
.priority-chip  { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.p-high   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.p-medium { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.p-low    { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.wt-chip  { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-family: 'DM Mono', monospace; font-weight: 500; background: #eff4ff; border: 1px solid #c7d7fa; color: #1a56db; }
.overdue  { color: var(--danger) !important; font-weight: 600; }

/* ── DETAIL PANEL ────────────────────────────────────────── */
.panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 200; display: none; align-items: flex-start; justify-content: flex-end; }
.panel-overlay.open { display: flex; }
.detail-panel { width: 520px; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.2s ease; box-shadow: -4px 0 24px rgba(0,0,0,0.08); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--surface2); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.close-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.close-btn:hover { color: var(--text); border-color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.field-value { font-size: 13px; color: var(--text2); font-weight: 500; }
.task-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; transition: border-color 0.12s; }
.task-item:hover { border-color: var(--accent); }
.task-check { width: 16px; height: 16px; min-width: 16px; border-radius: 4px; border: 1.5px solid var(--border2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; transition: all 0.12s; background: white; margin-top: 1px; }
.task-check.checked { background: var(--accent3); border-color: var(--accent3); color: #fff; }
.task-name { font-size: 13px; color: var(--text2); }
.task-name.done { text-decoration: line-through; color: var(--muted2); }
.task-note-text { font-size: 10px; color: #6b7280; margin-top: 2px; font-style: italic; }
.task-meta { font-size: 10px; color: var(--muted2); margin-top: 1px; }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 400; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); animation: modalIn 0.18s ease; }
@keyframes modalIn { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border-radius: 12px 12px 0 0; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface2); border-radius: 0 0 12px 12px; }
.modal-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); }
.form-group { margin-bottom: 14px; }
.form-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; display: block; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.form-input, .form-select { width: 100%; background: var(--surface); border: 1px solid var(--border2); border-radius: 7px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.12s, box-shadow 0.12s; }
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.form-input { resize: vertical; min-height: 60px; }

/* ── WORK TYPE CARDS ─────────────────────────────────────── */
.wt-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }

/* ── DASH CARDS ──────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.dash-card-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.stuck-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text2); }
.stuck-item:last-child { border-bottom: none; }
.workload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.workload-name { width: 130px; color: var(--text2); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workload-bar-wrap { flex: 1; background: var(--surface2); border-radius: 3px; height: 6px; overflow: hidden; border: 1px solid var(--border); }
.workload-bar { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.4s; }
.workload-count { width: 20px; text-align: right; font-size: 11px; font-weight: 600; font-family: 'DM Mono', monospace; }

/* ── ACTIVITY LOG ────────────────────────────────────────── */
.activity-entry { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.activity-entry:last-child { border-bottom: none; }
.activity-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.activity-text { font-size: 12px; color: var(--text); font-weight: 500; }
.activity-detail { font-size: 11px; color: var(--muted); margin-top: 1px; font-style: italic; }
.activity-meta { font-size: 10px; color: var(--muted2); margin-top: 2px; }

/* ── MISC ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 32px; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; }
.notif-dot { width: 6px; height: 6px; background: var(--danger); border-radius: 50%; display: inline-block; margin-left: 4px; vertical-align: middle; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.section-count { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MOBILE RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  body { flex-direction: row; overflow: hidden; }
  .main { width: 100vw; height: 100vh; flex-direction: column; overflow: hidden; }
  .topbar { padding: 0 12px; height: 52px; flex-shrink: 0; }
  .topbar-title { font-size: 13px; }
  .badge { font-size: 9px; padding: 2px 7px; }
  .content { padding: 12px; height: calc(100vh - 52px - 60px); overflow-y: auto; overflow-x: hidden; }
  #mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px; background: var(--sidebar-bg);
    display: flex; align-items: center; justify-content: space-around;
    border-top: 1px solid var(--sidebar-border); z-index: 500;
    /* A role with many nav items (owner/manager) can out-run the bar's width;
       this lets it scroll instead of clipping the last item off the edge —
       same fix as the status tabs, applied to the other bar that had it. */
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  #mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    cursor: pointer; padding: 6px 12px; border-radius: 8px;
    color: var(--sidebar-muted); font-size: 9px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    flex: 0 0 auto;
  }
  .mobile-nav-item .nav-icon { font-size: 20px; }
  .mobile-nav-item.active { color: #fff; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 12px; }
  .kpi-grid .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-value { font-size: 22px; }
  .dash-grid { grid-template-columns: 1fr; gap: 12px; }
  .filter-bar { flex-direction: column; gap: 8px; }
  .search-input { width: 100%; }
  .filter-select { width: 100%; }
  .tabs-scroll { position: relative; margin: 0 -12px 20px; padding: 0 12px; }
  .tabs-scroll .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; margin-bottom: 0; scrollbar-width: none; }
  .tabs-scroll .tabs::-webkit-scrollbar { display: none; }
  .tabs-scroll .tab { white-space: nowrap; }
  .tabs-scroll::after { content: ''; position: absolute; top: 0; right: 0; bottom: 2px; width: 28px; background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; }
  .table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 580px; }
  .table-wrap::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 20px; background: linear-gradient(to right, transparent, rgba(255,255,255,0.85)); pointer-events: none; }
  .panel-overlay { align-items: flex-end; }
  .detail-panel { width: 100vw; max-height: 92vh; height: auto; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid var(--border); animation: slideUp 0.22s ease; position: relative; }
  /* A small centered grabber bar — the standard "this sheet swipes down to
     close" affordance, so the panel doesn't rely on the X button alone. */
  .detail-panel::before { content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 3px; background: var(--border2); }
  .panel-header { padding-top: 22px; }
  @keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .modal { width: calc(100vw - 24px); margin: 12px; }
  .form-row { grid-template-columns: 1fr; gap: 8px; }
  #new-ticket-btn { font-size: 11px; padding: 5px 10px; }
  .user-row { flex-wrap: wrap; gap: 6px; }
  .wt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
}

/* ── ADMIN PANEL ─────────────────────────────────────────── */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.user-row-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-row-info { flex: 1; }
.user-row-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-row-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.user-row-badge { font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ── CATEGORY REPORTS — PRINT/PDF (Step 8) ──────────────────
   Scoped to a body class toggled only by printReport(), so printing from any
   other view in the app is never affected by this. */
@media print {
  body.print-report-mode * { visibility: hidden; }
  body.print-report-mode #reports-printable,
  body.print-report-mode #reports-printable * { visibility: visible; }
  body.print-report-mode #reports-printable { position: absolute; left: 0; top: 0; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Above this line: the live ca-ops stylesheet, as it is. Below: the same look for the markup this Cloudflare version draws,
   plus the phone "More" sheet. Keep both parts in step with the live app when its look changes.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
html, body { height: 100%; }
#app { display: flex; width: 100%; height: 100vh; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { font-family: 'Syne', sans-serif; }
code, .mono, .ticket-number, .money { font-family: 'DM Mono', monospace; }
@media (min-width: 769px) { #mobile-nav { display: none; } }
.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1200; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
.toast.error { background: var(--danger); }

/* login: the live app's card */
.login-screen { position: fixed; inset: 0; background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card img.login-logo-img { display: block; max-width: 100%; height: auto; margin: 0 auto 18px; background: #fff; border-radius: 8px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
.login-card .field input { width: 100%; background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 10px 14px; font-size: 13px; outline: none; }
.login-card .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 14px; font-weight: 600; border-radius: 8px; }
.login-card .hint { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.login-card .error { background: var(--danger-light); border: 1px solid #fecaca; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: var(--danger); margin-bottom: 16px; }

/* sidebar (logo, workspace list, work types, user block) */
.sidebar { overflow-y: auto; }
.sidebar .logo img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }
.sidebar .logo .logo-mark { color: #fff; }
.sidebar-section-label { cursor: default; justify-content: space-between; }
.sidebar-section-label[data-collapse-section] { cursor: pointer; }
.nav-item { text-decoration: none; }
.user-info .user-name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .role-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; background: #eff4ff; color: #1a56db; border: 1px solid #c7d7fa; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-tools { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.topbar-title { flex: 0 1 auto; }
.topbar .spacer { flex: 1; }

/* controls the Cloudflare views draw with bare elements: look like the live ones */
.btn { border: 1px solid var(--border2); background: var(--surface); color: var(--text2); }
.btn:hover { border-color: var(--muted); background: var(--surface2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1648c0; border-color: #1648c0; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[hidden], .nav-item[hidden], .tab[hidden] { display: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .content select, .content textarea,
.modal input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .modal select, .modal textarea,
.detail-panel input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .detail-panel select, .detail-panel textarea {
  background: var(--surface); border: 1px solid var(--border2); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; max-width: 100%; }
.content input:focus, .content select:focus, .content textarea:focus, .modal input:focus, .modal select:focus, .modal textarea:focus, .detail-panel input:focus, .detail-panel select:focus, .detail-panel textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }
.filter-bar input, .filter-bar select { font-size: 12px; }
.filter-bar input[type=search] { min-width: 200px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; min-height: 60px; }
.hint { color: var(--muted); font-size: 12px; }

/* summary cards: the Cloudflare views still using .kpi-row / .label / .value get the live card look */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-row .kpi-card .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px; font-weight: 600; }
.kpi-row .kpi-card .value { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.kpi-row .kpi-card { cursor: pointer; }
.kpi-card.kpi-selected { outline: 2px solid var(--accent); outline-offset: -1px; }

/* tabs */
.tab-strip { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab-strip::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

/* tables (the Cloudflare table helper draws .table-wrap > table) */
.table-wrap { overflow-x: auto; }
.table-wrap th { padding: 11px 16px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.table-wrap th .th-sort { background: none; border: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; padding: 0; cursor: pointer; }
.table-wrap td { padding: 12px 16px; font-size: 13px; vertical-align: middle; color: var(--text2); border-bottom: 1px solid var(--border); }
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap td.num, .table-wrap th.num { text-align: right; }
.table-wrap tbody tr[data-open] { cursor: pointer; }
.table-wrap tbody tr[data-open]:hover { background: #f0f5ff; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; margin-top: -20px; margin-bottom: 20px; }
.field-input { width: 100px !important; text-align: right; }
.field-input[type="text"] { width: 100% !important; text-align: left; }

/* chips for the views that still draw .badge-status-* / .badge-priority-*: same look as the live status and priority chips */
.badge-status-billed, .badge-status-paid, .badge-status-nonbillable, .badge-status-pending, .badge-status-review, .badge-status-default, .badge-status-billing,
.badge-priority-high, .badge-priority-medium, .badge-priority-low { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.badge-status-billed { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-status-paid { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.badge-status-nonbillable, .badge-status-default { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.badge-status-pending, .badge-status-billing { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-status-review { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-priority-high { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-priority-medium { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-priority-low { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

/* modal: the live look (centre card, header band) */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 12px; }
.overlay .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 520px; max-width: 100%; max-height: calc(100vh - 24px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); padding: 0; animation: modalIn 0.18s ease; }
.overlay .modal > h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; color: var(--text); padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--border); background: var(--surface2); border-radius: 12px 12px 0 0; }
.overlay .modal > :not(h3) { margin-left: 20px; margin-right: 20px; }
.overlay .modal > :nth-child(2) { margin-top: 16px; }
.overlay .modal > :last-child { margin-bottom: 20px; }
.overlay .modal .modal-body { margin: 0; padding: 20px; }

/* detail panel: the live look (side sheet; full-width sheet on a phone) */
.detail-panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 200; display: flex; align-items: flex-start; justify-content: flex-end; }
.detail-panel { width: 520px; max-width: 100vw; height: 100vh; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; animation: slideIn 0.22s ease; position: relative; padding: 0; }
.detail-panel > .panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-shrink: 0; background: var(--surface2); }
.detail-panel > .panel-header h3 { font-family: 'Syne', sans-serif; font-size: 15px; margin: 0; }
.detail-panel > .panel-header .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.detail-panel > .panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.detail-panel .section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.detail-panel .section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.detail-panel .section h4 { margin: 0 0 8px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.detail-panel-close { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; flex-shrink: 0; }
.detail-panel-close:hover { color: var(--text); border-color: var(--muted); }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; }
.task-row.done .task-name { text-decoration: line-through; color: var(--muted2); }
.progress-bar { height: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress-bar > div { height: 100%; background: var(--accent3); }
.activity-item { padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 12px; }
.activity-item .when { color: var(--muted2); font-size: 10px; margin-top: 2px; }
.lock-msg { color: var(--muted); font-size: 12px; padding: 8px 0; }
.notes-banner { background: var(--warn-light); color: #92400e; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.chip-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--accent-light); color: var(--accent); border: 1px solid #c7d7fa; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip button { background: none; border: none; color: inherit; font-size: 13px; padding: 0; cursor: pointer; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; vertical-align: middle; }
.autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border2); border-radius: 7px; margin-top: 2px; max-height: 220px; overflow: auto; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.autocomplete-row { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.autocomplete-row:hover { background: var(--surface2); }
.section { margin-bottom: 18px; }

/* phone: five bottom items plus "More" (the same pattern as the live Attendance app) */
@media (max-width: 768px) {
  #mobile-nav { padding: 0 4px; gap: 0; }
  #mobile-nav .mobile-nav-item { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 9px; }
  #mobile-nav .mobile-nav-item .nav-icon { font-size: 19px; width: auto; }
  #mobile-nav .mobile-nav-item.active { color: #fff; background: rgba(26,86,219,.35); }
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; row-gap: 6px; }
  .topbar-title { flex: 1 1 auto; }
  .topbar-tools { margin-left: 0; width: 100%; order: 3; flex-wrap: wrap; }
  .topbar-tools select, .topbar-tools .btn { flex: 1 1 auto; }
  .content { height: auto; flex: 1; padding: 12px 12px 76px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
  .kpi-row .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi-row .kpi-card .value { font-size: 22px; }
  .filter-bar input[type=search] { min-width: 0; width: 100%; }
  .filter-bar > * { flex: 1 1 140px; min-width: 0; }
  .filter-bar .btn { flex: 0 0 auto; }
  .detail-panel-overlay { align-items: flex-end; }
  .detail-panel { width: 100vw; max-height: 92vh; height: auto; border-radius: 20px 20px 0 0; border-left: none; border-top: 1px solid var(--border); }
  .detail-panel::before { content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 3px; background: var(--border2); z-index: 2; }
  .detail-panel > .panel-header { padding-top: 22px; }
  .login-card { width: 100%; padding: 28px 22px; }
}
#more-sheet-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 600; display: flex; align-items: flex-end; }
#more-sheet { background: var(--surface); width: 100%; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; overflow-y: auto; animation: slideUp 0.22s ease; }
#more-sheet h3 { font-size: 14px; margin: 0 0 12px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--text2); text-align: center; cursor: pointer; background: var(--surface2); }
.more-grid-item .nav-icon { font-size: 22px; width: auto; }
.more-grid-item.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.kpi-card.kpi-purple::before { background: #7e22ce; }
.kpi-card.kpi-darkgreen::before { background: #14532d; }
.kpi-card.kpi-selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.kpi-grid { cursor: default; }
.tabs-scroll { position: relative; }
.tabs-scroll .tabs { overflow-x: auto; scrollbar-width: none; }
.tabs-scroll .tabs::-webkit-scrollbar { display: none; }
.topbar-tools .filter-select { font-size: 11px; padding: 5px 8px; }
.topbar-tools .btn { font-size: 11px; }
.wt-chip { background: #eff4ff; border: 1px solid #c7d7fa; color: #1d4ed8; }
@media (max-width: 768px) {
  .topbar-tools select { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .topbar-tools .btn-primary { flex: 1 1 100%; }
  .topbar-tools #export-csv { display: none; }
  .topbar-tools .btn { flex: 1 1 auto; }
  .topbar .role-badge { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
}

.phone-head { display: none; }
@media (max-width: 768px) {
  .phone-head { display: flex; align-items: center; background: var(--sidebar-bg); padding: 8px 14px; flex-shrink: 0; }
  .phone-head img { height: 28px; background: #fff; border-radius: 5px; padding: 3px 5px; }
  .filter-bar > * { flex: 0 0 auto !important; width: 100%; }
  .filter-bar .btn { width: auto; }
  .filter-bar input, .filter-bar select { height: 40px; }
}
@media (max-width: 768px) { #app { flex-direction: column !important; height: 100dvh; } .main { min-height: 0; flex: 1; } }

/* line icons */
.icon { display: block; flex-shrink: 0; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.logout-btn { display: inline-flex; align-items: center; }
.more-grid-item .nav-icon { width: auto; }

/* ===== phone: bigger tap areas, folding filters, full-screen details with a Back link ===== */
.fb-toggle { display: none; }
@media (max-width: 768px) {
  .fb-toggle { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 40px; font-weight: 600; }
  .filter-bar.fb-collapsed > *:not(.fb-toggle):not([type=search]) { display: none !important; }
  .btn, .btn-sm { min-height: 40px; }
  .nav-item, .more-grid-item { min-height: 44px; }
  select, .filter-select, .form-select, input[type=text], input[type=search], input[type=date], input[type=number] { min-height: 40px; font-size: 16px; }
  table td, table th { padding-top: 12px; padding-bottom: 12px; }
  .tab, .tabs .tab { padding-top: 12px; padding-bottom: 12px; }
  /* detail panels: whole screen, Back link on top-left instead of a small cross */
  .detail-panel { width: 100vw !important; max-width: 100vw; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
  .detail-panel::before { display: none !important; }
  .detail-panel .panel-header { padding-top: 14px; flex-direction: row-reverse; justify-content: flex-end; gap: 12px; align-items: center; }
  .detail-panel .panel-header .close-btn, .detail-panel .panel-header [data-action=close-panel], .detail-panel .panel-header #panel-close {
    width: auto !important; height: 40px !important; padding: 0 14px; border-radius: 20px; font-size: 0 !important; display: inline-flex; align-items: center; flex-shrink: 0;
  }
  .detail-panel .panel-header .close-btn::before, .detail-panel .panel-header [data-action=close-panel]::before, .detail-panel .panel-header #panel-close::before { content: '‹ Back'; font-size: 14px; font-weight: 600; color: var(--accent); }
}
@media (max-width: 768px) { .filter-bar .fb-toggle { flex: 1 1 100% !important; width: 100%; } }

/* ===== phone: tables become cards ===== */
@media (max-width: 768px) {
  table.rt-cards { min-width: 0 !important; width: 100%; border-collapse: separate; border-spacing: 0; }
  table.rt-cards thead { display: none; }
  table.rt-cards tbody { display: block; }
  table.rt-cards tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 0 0 10px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
  table.rt-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 !important; border: none !important; white-space: normal !important; text-align: right; min-height: 0; background: transparent !important; }
  table.rt-cards td:first-child { display: block; text-align: left; font-weight: 700; font-size: 15px; padding: 2px 0 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border) !important; position: static; box-shadow: none; }
  table.rt-cards td::before { content: attr(data-label); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; flex-shrink: 0; }
  table.rt-cards td:first-child::before { content: none; }
  table.rt-cards td.rt-empty { display: none; }
  table.rt-cards td.rt-span { display: block; text-align: center; }
  table.rt-cards td.rt-span::before { content: none; }
  .table-wrap:has(table.rt-cards), .table-scroll:has(table.rt-cards), .card:has(> table.rt-cards) { background: transparent; border: none; box-shadow: none; overflow: visible; }
}
@media (max-width: 768px) {
  table.rt-cards td.rt-lead { display: none; }
  table.rt-cards td.rt-title { display: block; text-align: left; font-weight: 700; font-size: 15px; padding: 2px 0 8px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border) !important; }
  table.rt-cards td.rt-title::before { content: none; }
}
