/* KC Consulting Partners — Filing Portal design system */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
}
:root {
  /* Neutrals — cool slate scale */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #eef1f5;
  --surface3: #e4e8ee;
  --border: #e2e6ec;
  --border2: #ccd2db;
  --text: #10151f;
  --text2: #4b5566;
  --text3: #8993a4;

  /* Brand — true orange extracted from the logo, plus an accessible deep-amber for text/buttons */
  --accent: #b35a09;
  --accent-vivid: #f89810;
  --accent-bg: #fdf1e2;
  --accent-dark: #8f4707;

  /* Informational blue — kept separate from the brand accent for category/status variety */
  --blue: #1d5f9e;
  --blue-bg: #e6eef7;

  /* Semantic */
  --green: #157a4a;
  --green-bg: #e5f5ec;
  --amber: #a3660a;
  --amber-bg: #fdf1e0;
  --red: #b7362b;
  --red-bg: #fbeae8;
  --gray: #6b7385;
  --gray-bg: #eef1f5;
  --purple: #5b3ea3;
  --purple-bg: #efeafb;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 41, 66, .05);
  --shadow: 0 2px 8px rgba(15, 41, 66, .06), 0 1px 2px rgba(15, 41, 66, .04);
  --shadow-md: 0 8px 24px rgba(15, 41, 66, .10), 0 2px 6px rgba(15, 41, 66, .06);
  --shadow-lg: 0 20px 56px rgba(15, 41, 66, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-vivid); outline-offset: 2px; border-radius: 4px;
}

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.main { margin-left: 220px; flex: 1; }

/* Sidebar */
.sidebar-logo { padding: 18px; border-bottom: 1px solid var(--border); }
.sidebar-logo .logo-mark { display: flex; align-items: center; gap: 8px; }
.logo-chip { display: inline-flex; }
.logo-chip .logo-img { display: block; max-width: 100%; height: auto; max-height: 44px; object-fit: contain; }
.login-brand .logo-chip .logo-img { max-height: 46px; }
.logo-icon { width: 30px; height: 30px; background: var(--accent-vivid); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg { width: 16px; height: 16px; fill: #fff; }
.logo-text { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.logo-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-section { margin-bottom: 18px; }
.nav-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; padding: 0 10px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px 8px 9px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text2); font-size: 13px; font-weight: 500; border-left: 3px solid transparent; transition: background .15s, color .15s, border-color .15s; text-decoration: none; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); border-left-color: var(--accent-vivid); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }

.sidebar-user { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text3); }
.sidebar-user button[type=submit] { color: var(--text3); transition: color .15s, background .15s; }
.sidebar-user button[type=submit]:hover { color: var(--text); background: var(--surface2); }

/* Header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.topbar-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-right-group { display: flex; align-items: center; gap: 16px; }
.topbar-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.month-picker { display: flex; align-items: center; gap: 6px; }
.month-picker select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; background: var(--surface2); color: var(--text); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: -.005em; line-height: 1.3; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text2); transition: background .15s, box-shadow .15s, transform .1s, border-color .15s; text-decoration: none; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(180deg, #c2650b 0%, var(--accent) 100%); color: #fff; border-color: var(--accent-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(89, 45, 5, .18), 0 2px 6px rgba(89, 45, 5, .14); }
.btn-primary:hover { background: linear-gradient(180deg, #d0700e 0%, var(--accent-dark) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 20px rgba(89, 45, 5, .3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: inset 0 1px 3px rgba(89, 45, 5, .3); }
.btn-danger { background: linear-gradient(180deg, #c23e33 0%, var(--red) 100%); color: #fff; border-color: #8f2222; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 2px rgba(89, 20, 20, .18); }
.btn-danger:hover { background: linear-gradient(180deg, #cc453a 0%, #8f2222 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px rgba(89, 20, 20, .28); transform: translateY(-1px); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 12px; height: 12px; }

/* Topbar right cluster: search, notifications, avatar */
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-search { position: relative; display: flex; align-items: center; }
.topbar-search-icon { position: absolute; left: 11px; width: 14px; height: 14px; color: var(--text3); pointer-events: none; }
.topbar-search-input { width: 200px; height: 36px; box-sizing: border-box; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 0 12px 0 33px; font-size: 13px; color: var(--text); transition: border-color .15s, box-shadow .15s, width .15s; }
.topbar-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); width: 240px; }
.topbar-search-input::placeholder { color: var(--text3); }

.topbar-popover { position: relative; display: flex; }
.topbar-icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.topbar-icon-btn:hover { background: var(--surface2); border-color: var(--border2); }
.topbar-popover.open .topbar-icon-btn { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent); }
.topbar-icon-btn svg { width: 16px; height: 16px; }
.topbar-badge { position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }

.topbar-avatar-btn { border: none; background: none; padding: 2px; margin: -2px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background .15s; }
.topbar-avatar-btn:hover { background: var(--surface2); }
.topbar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar-avatar-caret { width: 9px; height: 9px; color: var(--text3); margin-right: 4px; transition: transform .15s; }
.topbar-popover.open .topbar-avatar-caret { transform: rotate(180deg); }

.topbar-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 320px; max-width: min(90vw, 340px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); z-index: 60; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: opacity .15s ease, transform .15s ease; overflow: hidden; }
.topbar-popover.open .topbar-dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.topbar-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.005em; border-bottom: 1px solid var(--border); }
.topbar-dropdown-count { font-size: 11px; font-weight: 700; color: var(--text3); background: var(--surface2); border-radius: 999px; padding: 1px 8px; }
.topbar-dropdown-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.topbar-dropdown-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: inherit; transition: background .12s; }
.topbar-dropdown-item + .topbar-dropdown-item { margin-top: 1px; }
.topbar-dropdown-item:hover { background: var(--surface2); }
.topbar-dropdown-icon { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--gray); }
.topbar-dropdown-icon.tone-red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.topbar-dropdown-icon.tone-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.topbar-dropdown-icon.tone-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.topbar-dropdown-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-dropdown-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.005em; }
.topbar-dropdown-sub { font-size: 12px; color: var(--text3); }
.topbar-dropdown-empty { padding: 32px 16px; text-align: center; font-size: 13px; color: var(--text3); }
.topbar-dropdown-empty svg { width: 24px; height: 24px; color: var(--green); background: var(--green-bg); border-radius: 50%; padding: 5px; box-sizing: content-box; margin-bottom: 10px; }

.topbar-dropdown-account { width: 240px; }
.topbar-account-header { display: flex; align-items: center; gap: 11px; padding: 16px; }
.topbar-account-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: 0; }
.topbar-account-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topbar-account-name { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account-role { font-size: 11.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.topbar-menu { padding: 6px; border-top: 1px solid var(--border); }
.topbar-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; text-align: left; font-family: inherit; transition: background .12s, color .12s; }
.topbar-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar-menu-item:hover { background: var(--surface2); color: var(--text); }
.topbar-menu-item-danger:hover { background: var(--red-bg); color: var(--red); }

@media (max-width: 1080px) {
  .topbar-search-input, .topbar-search-input:focus { width: 160px; }
}
@media (max-width: 860px) {
  .topbar-search { display: none; }
}

/* Content */
.content { padding: 26px 28px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stats-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border2); }
.stat-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-label { font-size: 12px; color: var(--text3); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 5px; }
.stat-green::before { background: var(--green); } .stat-green .stat-value { color: var(--green); } .stat-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-amber::before { background: var(--amber); } .stat-amber .stat-value { color: var(--amber); } .stat-amber .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-red::before { background: var(--red); } .stat-red .stat-value { color: var(--red); } .stat-red .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-blue::before { background: var(--blue); } .stat-blue .stat-value { color: var(--blue); } .stat-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }

/* Progress bar */
.progress-bar { height: 7px; background: var(--surface3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #17935c, #0f6e46); transition: width .5s ease; }
.progress-fill.amber { background: linear-gradient(90deg, #d98a12, #a3660a); }
.progress-fill.red { background: linear-gradient(90deg, #d1453a, #b7362b); }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-bottom: 24px; }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 15px 18px 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-body { padding: 16px 18px; }
.card-link { font-size: 12px; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.card-link:hover { color: var(--accent-dark); }

/* Staff workload */
.staff-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.staff-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.staff-name { font-size: 13px; font-weight: 500; flex: 1; }
.staff-count { font-size: 12px; color: var(--text3); width: 60px; text-align: right; }
.staff-bar { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.staff-bar-fill { height: 100%; border-radius: 3px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--border2); background: var(--surface2); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.table-row { cursor: pointer; transition: background .1s; }
tr.table-row:hover td { background: var(--surface2); }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Grid view (monthly / yearly audit) */
.grid-view { overflow: auto; max-height: calc(100vh - 170px); }
.grid-table { border-collapse: collapse; width: 100%; min-width: 900px; }
.grid-table th { font-size: 10px; font-weight: 700; color: var(--text3); padding: 7px 8px; text-align: center; border: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.grid-table thead th { position: sticky; z-index: 3; }
.grid-table thead tr:first-child th { top: -1px; }
.grid-table thead tr:nth-child(2) th { top: 28px; }
.grid-table th.client-col { text-align: left; min-width: 160px; top: -1px; z-index: 4; }
.grid-table td { border: 1px solid var(--border); padding: 5px 6px; text-align: center; font-size: 11px; }
.grid-table td.client-name { text-align: left; font-weight: 600; padding: 7px 10px; font-size: 12px; background: var(--surface); cursor: pointer; }
.cell-done { background: var(--green-bg); color: #106b43; font-weight: 700; cursor: pointer; }
.cell-pending { background: var(--amber-bg); color: var(--amber); cursor: pointer; }
.cell-na { background: var(--gray-bg); color: var(--gray); }
.cell-overdue { background: var(--red-bg); color: var(--red); font-weight: 700; cursor: pointer; }
.cell-client { background: var(--blue-bg); color: var(--blue); font-weight: 700; font-size: 10px; }
.cell-locked { background: var(--gray-bg); color: var(--gray); font-weight: 600; }
.grid-table td:hover:not(.cell-na):not(.cell-locked):not(.client-name) { filter: brightness(.95); }

/* Category headers */
.cat-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Section divider */
.section-label { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Alert items */
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: none; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.alert-dot.red { background: var(--red); }
.alert-dot.amber { background: var(--amber); }
.alert-dot.green { background: var(--green); }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* Tabs */
.tabs { display: flex; gap: 2px; background: var(--surface2); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 18px; }
.tab { padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text2); transition: background .15s, color .15s; text-decoration: none; }
.tab.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* Search */
.search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 8px 34px; font-size: 13px; background: var(--surface); color: var(--text); height: 36px; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 14px; pointer-events: none; }
.search-icon-svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text3); pointer-events: none; }

/* Task status selector */
.status-select { border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; font-size: 11px; font-weight: 600; cursor: pointer; background: var(--surface); }
.status-select:focus { outline: none; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text3); }

/* Compact icon-only row actions (e.g. My Tasks report/extension) */
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-action-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, border-color .12s, color .12s; flex-shrink: 0; }
.row-action-btn svg { width: 14px; height: 14px; }
.row-action-btn:hover { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--accent); }

/* Overdue highlight */
.overdue-row td { background: #fdf3f2 !important; }

/* Status dot */
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }

/* Detail grid (client profile) */
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.detail-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.detail-label { font-size: 11px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.detail-value { font-size: 15px; font-weight: 700; word-break: break-word; font-variant-numeric: tabular-nums; }

/* Settings template form */
.task-template-form { display: grid; grid-template-columns: 1.2fr 1fr .8fr .7fr auto; gap: 8px; margin-bottom: 14px; }
.form-input, .form-select { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; background: var(--surface); color: var(--text); }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.muted-note { font-size: 12px; color: var(--text3); }

/* Task category sections (client detail) */
.task-section { margin-bottom: 20px; }
.task-section-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; padding: 8px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.task-row { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 12px; }
.task-row:last-child { border-bottom: none; }
.task-name { font-size: 13px; font-weight: 600; flex: 1; }
.task-deadline { font-size: 12px; color: var(--text3); width: 80px; }
.task-deadline.overdue { color: var(--red); font-weight: 700; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 32, .45); backdrop-filter: blur(1px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 480px; max-width: 95vw; box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto; }
.modal-header { padding: 17px 20px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 7px; border: none; background: var(--surface2); color: var(--text2); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.modal-close:hover { background: var(--surface3); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Form elements */
label.form-label { font-size: 12px; font-weight: 700; color: var(--text2); display: block; margin-bottom: 5px; }
select.form-select, textarea.form-textarea, input.form-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; color: var(--text); background: var(--surface); margin-bottom: 14px; transition: border-color .15s, box-shadow .15s; }
select.form-select:focus, textarea.form-textarea:focus, input.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea.form-textarea { resize: vertical; min-height: 70px; font-family: inherit; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.form-check input { width: auto; margin: 0; }
.form-error { font-size: 12px; color: var(--red); margin: -10px 0 12px; }

/* Filter bar */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .form-select, .filter-bar .form-input { width: auto; margin-bottom: 0; }

/* Timeline */
.timeline { padding: 4px 0; }
.tl-item { display: flex; gap: 12px; margin-bottom: 14px; }
.tl-line { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.tl-connector { width: 1px; background: var(--border); flex: 1; margin-top: 4px; }
.tl-content { flex: 1; }
.tl-title { font-size: 13px; font-weight: 500; }
.tl-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-icon { font-size: 32px; margin-bottom: 10px; }

/* Page transitions kept for JS-toggled panels inside a page */
.page { display: none; }
.page.active { display: block; }

/* Login page — split brand / form layout */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-shell { display: flex; width: 920px; max-width: 100%; min-height: 100px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface); }
.login-brand { flex: 1; position: relative; background: linear-gradient(155deg, var(--accent-bg) 0%, var(--surface2) 100%); color: var(--text); padding: 44px 40px; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); }
.login-brand::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(15, 41, 66, .06) 1px, transparent 1px); background-size: 18px 18px; opacity: .8; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand .logo-chip { margin-bottom: 30px; }
.login-brand-heading { font-size: 23px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
.login-brand-sub { font-size: 13px; color: var(--text2); margin-top: 10px; max-width: 300px; line-height: 1.6; }
.login-features { margin-top: 34px; display: flex; flex-direction: column; gap: 15px; }
.login-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text2); }
.login-feature svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.login-brand-footer { margin-top: auto; padding-top: 30px; font-size: 11px; color: var(--text3); }
.login-form-panel { flex: 1; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-title { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text3); margin-bottom: 26px; }
@media (max-width: 820px) {
  .login-shell { flex-direction: column; width: 440px; }
  .login-brand { padding: 32px 30px 24px; }
  .login-features, .login-brand-footer { display: none; }
  .login-form-panel { padding: 36px 30px; }
}

/* File drop zone */
.drop-zone { display: block; width: 100%; box-sizing: border-box; border: 1.5px dashed var(--border2); border-radius: var(--radius-sm); padding: 18px; text-align: center; color: var(--text3); font-size: 12px; line-height: 1.5; cursor: pointer; margin-bottom: 14px; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-bg); }
.drop-zone input[type=file] { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 11px; margin: 2px; }
.file-chip .remove { cursor: pointer; color: var(--text3); font-weight: 700; }

/* Flash messages */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border-left: 3px solid transparent; }
.flash-success { background: var(--green-bg); color: var(--green); border-left-color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); border-left-color: var(--red); }
