/* ============================================================
   DISO TASKS - PORTAL EDITION
   Editorial / Refined Luxury · Gold + Cream + Near-Black
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:       #050505;
  --bg-2:     #050505;
  --s0:       #080808;
  --s1:       #0e0e0e;
  --s2:       #141414;
  --s3:       #1c1c1c;

  /* Borders */
  --b0:       #161616;
  --b1:       #202020;
  --b2:       #2a2a2a;
  --b3:       #363636;

  /* Gold */
  --gold:     #D4A843;
  --gl:       #EAC86A;
  --gd:       #8A6D1A;
  --gbg:      rgba(212,168,67,0.09);

  /* Text */
  --tx:       #EDE6D6;
  --t2:       #847D72;
  --t3:       #42403C;

  /* Semantic */
  --gr:       #2E9E68;
  --rd:       #C94C4C;
  --bl:       #3D7FC4;
  --pu:       #8B7FC7;
  --am:       #E08B3A;

  /* Map old token names to new palette so the existing markup
     works without changes. */
  --surface:       var(--s1);
  --surface-2:     var(--s2);
  --surface-3:     var(--s3);
  --border:        var(--b1);
  --border-2:      var(--b2);
  --border-3:      var(--b3);
  --text:          var(--tx);
  --text-2:        var(--tx);
  --text-muted:    var(--t2);
  --text-dim:      var(--t3);
  --primary:       var(--gold);
  --primary-dim:   var(--gd);
  --primary-fade:  var(--gbg);
  --secondary:     var(--gold);
  --secondary-dim: var(--gd);
  --secondary-fade:var(--gbg);
  --cta:           var(--gold);
  --cta-dim:       var(--gd);
  --danger:        var(--rd);
  --danger-fade:   rgba(201,76,76,0.10);
  --warning:       var(--am);
  --warning-fade:  rgba(224,139,58,0.10);
  --info:          var(--bl);

  /* Typography */
  --fd:            "Cormorant Garamond", serif;
  --fb:            "DM Sans", sans-serif;
  --font-display:  var(--fd);
  --font-body:     var(--fb);
  --font-mono:     var(--fb);

  /* Spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px;

  /* Radii */
  --r:   10px;
  --rs:  7px;
  --r-1: 4px;
  --r-2: var(--rs);
  --r-3: var(--r);
  --r-4: 12px;

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  64px;

  /* Motion */
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 240ms var(--ease);
}

/* ============================================================
   RESET
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus { outline: none; }
*:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

html, body { height: 100%; }
body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "tnum" on, "lnum" on;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   BOOT SCREEN
   ============================================================ */
.boot-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: var(--s-8);
  z-index: 9999;
}
.boot-logo {
  text-align: center;
}
.boot-name {
  font-family: var(--fd);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  line-height: 1;
}
.boot-suffix {
  font-family: var(--fb);
  font-size: 10px;
  font-weight: 400;
  color: var(--t3);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 8px;
}
.boot-spinner {
  width: 18px; height: 18px;
  border: 1px solid var(--b2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden;
}
.login-bg-grid {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(212,168,67,0.07), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(212,168,67,0.04), transparent 50%);
  pointer-events: none;
}
.login-panel {
  position: relative;
  width: 100%; max-width: 420px;
  padding: var(--s-12) var(--s-8) var(--s-8);
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  animation: panelIn 450ms var(--ease);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.login-brand {
  text-align: center;
  margin-bottom: var(--s-2);
}
.login-brand-name {
  font-family: var(--fd);
  font-size: 38px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.14em;
  line-height: 1;
}
.login-brand-sub {
  font-family: var(--fb);
  font-size: 9px;
  font-weight: 400;
  color: var(--t3);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 6px;
}

.login-tagline {
  text-align: center;
  color: var(--t2);
  font-size: 13px;
  margin-bottom: var(--s-10);
  margin-top: var(--s-5);
}
.login-form { display: flex; flex-direction: column; gap: var(--s-4); }
.login-footer {
  margin-top: var(--s-8);
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 11px; color: var(--t3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--b1);
}
.status-dot {
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
}
.link-btn {
  background: none; color: var(--t2);
  font-size: 13px; text-align: center;
  margin-top: var(--s-2);
  padding: var(--s-2);
  transition: color var(--t-fast);
}
.link-btn:hover { color: var(--gold); }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.field-hint {
  font-size: 12px;
  color: var(--t3);
  margin-top: 2px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="tel"], input[type="time"],
select, textarea {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--rs);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--tx);
  transition: border-color var(--t-fast), background var(--t-fast);
  width: 100%;
  font-family: var(--fb);
}
input[type="date"], input[type="datetime-local"], input[type="time"] { color-scheme: dark; }
input:hover, select:hover, textarea:hover { border-color: var(--b3); }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  background: var(--s3);
}
input::placeholder { color: var(--t3); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23847D72' stroke-width='2'%3e%3cpolyline points='6,9 12,15 18,9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
input[type="color"] { padding: 4px; height: 38px; cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-3); }

.form-error {
  background: rgba(201,76,76,0.10);
  border: 1px solid rgba(201,76,76,0.25);
  color: #e07070;
  padding: 10px 14px;
  border-radius: var(--rs);
  font-size: 13px;
}

.checkbox-row {
  display: flex; align-items: center; gap: var(--s-2);
  cursor: pointer;
  padding: var(--s-2) 0;
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Chips (multi-select) */
.chip-group {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-2);
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--rs);
  min-height: 44px;
  align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 4px 10px;
  background: var(--gbg);
  color: var(--gold);
  border: 1px solid rgba(212,168,67,0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.chip-remove {
  background: none; padding: 0;
  color: inherit; opacity: 0.7;
  font-size: 14px; line-height: 1;
}
.chip-remove:hover { opacity: 1; }
.chip-add-btn {
  font-size: 12px; color: var(--t2);
  padding: 4px 12px;
  border: 1px dashed var(--b3);
  border-radius: 999px;
}
.chip-add-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 9px 16px;
  border-radius: var(--rs);
  font-size: 13px; font-weight: 500;
  font-family: var(--fb);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  min-height: 36px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gd));
  color: #000;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gl), var(--gold));
}
.btn-secondary {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--b2);
}
.btn-secondary:hover:not(:disabled) {
  color: var(--tx);
  border-color: var(--b3);
  background: rgba(255,255,255,0.02);
}
.btn-ghost {
  background: transparent;
  color: var(--t2);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--tx);
  background: rgba(255,255,255,0.04);
}
.btn-danger {
  background: rgba(201,76,76,0.15);
  color: #e07070;
  border: 1px solid rgba(201,76,76,0.30);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(201,76,76,0.25);
}
.btn-cta {
  background: linear-gradient(135deg, var(--gold), var(--gd));
  color: #000;
  font-weight: 600;
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; min-height: 30px; font-size: 12px; }
.btn-lg { padding: 12px 22px; min-height: 44px; font-size: 14px; }

.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--rs);
  color: var(--t2);
  transition: background var(--t-fast), color var(--t-fast);
  font-size: 14px;
}
.icon-btn:hover { background: rgba(255,255,255,0.04); color: var(--tx); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--s0);
  border-right: 1px solid var(--b0);
  display: flex; flex-direction: column;
  padding-bottom: var(--s-5);
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--b0);
  margin-bottom: var(--s-2);
}
.sidebar-brand-name {
  font-family: var(--fd);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  line-height: 1;
}
.sidebar-brand-sub {
  font-family: var(--fb);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--t3);
  margin-top: 4px;
}

.sidebar-nav {
  display: flex; flex-direction: column;
  flex: 1;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 14px;
  font-size: 13px; font-weight: 400;
  color: var(--t2);
  border-left: 2px solid transparent;
  margin: 1px 0;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.nav-item:hover {
  color: var(--tx);
  background: rgba(255,255,255,0.02);
  border-left-color: var(--b3);
}
.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gbg);
  font-weight: 500;
}
.nav-item.active .nav-icon { color: var(--gold); }
.nav-icon {
  font-size: 14px;
  color: var(--t3);
  width: 18px; text-align: center;
}
.nav-label { flex: 1; }
.nav-count {
  background: var(--s3);
  color: var(--t2);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 22px; text-align: center;
}
.nav-item.active .nav-count {
  background: var(--gold);
  color: #000;
  font-weight: 600;
}
.nav-badge {
  font-size: 8px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.12em;
  padding: 2px 6px;
  background: var(--gbg);
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 3px;
}
.nav-divider {
  height: 1px;
  background: var(--b0);
  margin: var(--s-3) var(--s-4);
}

.sidebar-bottom {
  margin-top: auto;
  padding: var(--s-4) var(--s-4) 0;
  border-top: 1px solid var(--b0);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.user-block {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gd), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.role-member .admin-only { display: none !important; }

/* ============================================================
   TOPBAR
   ============================================================ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--b0);
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s-8);
  position: sticky; top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: baseline; gap: var(--s-4); }
.page-title {
  font-family: var(--fd);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--tx);
}
.page-meta {
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-right { display: flex; align-items: center; gap: var(--s-3); }
.search-wrap { position: relative; }
.search-input {
  width: 240px;
  padding-right: 32px;
  background: var(--s1);
  border-color: var(--b1);
}
.search-shortcut {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 10px;
  color: var(--t3);
  padding: 1px 5px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 3px;
  pointer-events: none;
}

/* ============================================================
   VIEW CONTAINER
   ============================================================ */
.view-container {
  flex: 1;
  padding: var(--s-8);
  overflow-y: auto;
}
.view-container > * { animation: viewIn 320ms var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-8);
}
.stat-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 18px 20px;
  position: relative;
  transition: border-color var(--t-base);
}
.stat-card:hover { border-color: var(--b2); }
.stat-card::before { display: none; }
.stat-card.stat-warning { border-left: 2px solid var(--am); }
.stat-card.stat-danger { border-left: 2px solid var(--rd); }
.stat-card.stat-success { border-left: 2px solid var(--gr); }

.stat-label {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--fd);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  color: var(--tx);
}
.stat-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--t3);
}

.section-title {
  font-family: var(--fd);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: var(--s-4);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--tx);
}
.section-title-meta {
  font-family: var(--fb);
  font-size: 11px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 400;
}
.dash-section { margin-bottom: var(--s-8); }

/* ============================================================
   TASK TABLE
   ============================================================ */
.task-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-4);
  gap: var(--s-3);
  flex-wrap: wrap;
}
.filter-group {
  display: flex; align-items: center; gap: var(--s-2);
  flex-wrap: wrap;
}
.filter-group select {
  width: auto;
  min-width: 130px;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  min-height: 32px;
}
.filter-label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.task-table {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
}
.task-table-header {
  display: grid;
  grid-template-columns: 32px 1fr 140px 140px 120px 100px 80px;
  gap: var(--s-3);
  padding: 12px 16px;
  background: var(--s0);
  border-bottom: 1px solid var(--b1);
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.task-row {
  display: grid;
  grid-template-columns: 32px 1fr 140px 140px 120px 100px 80px;
  gap: var(--s-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--b0);
  align-items: center;
  cursor: pointer;
  transition: background var(--t-fast);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: rgba(255,255,255,0.02); }
.task-row.task-complete .task-title { color: var(--t2); text-decoration: line-through; }
.task-row.task-overdue { background: rgba(201,76,76,0.04); }

.task-check {
  width: 17px; height: 17px;
  border: 1px solid var(--b3);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.task-check:hover { border-color: var(--gold); }
.task-check.checked {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}
.task-check.checked::after { content: '✓'; font-size: 11px; font-weight: 700; }

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta-row {
  font-size: 11px;
  color: var(--t3);
  margin-top: 2px;
  display: flex; gap: var(--s-3);
  align-items: center;
}
.task-client-tag {
  font-size: 11px;
  color: var(--t2);
}
.task-client-tag.has-client { color: var(--gold); }

.assignees { display: flex; }
.assignee-pill {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--s3);
  color: var(--tx);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--s1);
  margin-left: -8px;
}
.assignee-pill:first-child { margin-left: 0; }

.task-date {
  font-size: 12px;
  color: var(--t2);
  font-feature-settings: "tnum" on;
}
.task-date.date-overdue { color: var(--rd); }
.task-date.date-today { color: var(--am); }

.status-pill, .priority-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--s2);
  border: 1px solid var(--b2);
  color: var(--status-color, var(--t2));
}
.status-pill::before, .priority-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.task-actions {
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity var(--t-fast);
  justify-content: flex-end;
}
.task-row:hover .task-actions { opacity: 1; }

/* ============================================================
   CLIENTS GRID
   ============================================================ */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-4);
}
.client-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 20px;
  transition: border-color var(--t-base), transform var(--t-base);
  cursor: pointer;
}
.client-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.client-card-header {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.client-color-dot {
  width: 32px; height: 32px;
  border-radius: var(--rs);
  background: var(--c, var(--gold));
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.client-color-dot::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0,0,0,0.3));
}
.client-name {
  font-family: var(--fd);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tx);
}
.client-niche {
  font-size: 11px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.client-stats {
  display: flex; gap: var(--s-5);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--b1);
}
.client-stat { flex: 1; }
.client-stat-value {
  font-family: var(--fd);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--tx);
}
.client-stat-label {
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ============================================================
   TEAM TABLE
   ============================================================ */
.team-table {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
}
.team-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 120px 130px;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--b0);
  align-items: center;
}
.team-row:last-child { border-bottom: none; }
.team-row-header {
  background: var(--s0);
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--s-16) var(--s-8);
  color: var(--t2);
}
.empty-icon {
  font-size: 44px;
  margin-bottom: var(--s-4);
  color: var(--t3);
  font-family: var(--fd);
}
.empty-title {
  font-family: var(--fd);
  font-size: 20px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: var(--s-2);
}
.empty-text {
  color: var(--t2);
  margin-bottom: var(--s-5);
  font-size: 13px;
}

/* ============================================================
   PERSONAL VIEW
   ============================================================ */
.personal-banner {
  background: var(--gbg);
  border: 1px solid rgba(212,168,67,0.20);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: var(--s-5);
  display: flex; align-items: center; gap: var(--s-3);
  font-size: 13px;
  color: var(--tx);
}
.personal-banner-icon {
  font-size: 18px;
  color: var(--gold);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(3px);
  animation: fadeIn 220ms;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r);
  width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: modalIn 260ms var(--ease);
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-header {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--b1);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 {
  font-family: var(--fd);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--tx);
}
.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-4);
}
.modal-footer {
  padding: 16px 26px 20px;
  border-top: 1px solid var(--b1);
  display: flex; gap: var(--s-3); justify-content: flex-end;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; bottom: var(--s-5); right: var(--s-5);
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--s-3);
  pointer-events: none;
}
.toast {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--rs);
  padding: 11px 16px;
  font-size: 13px;
  min-width: 240px; max-width: 380px;
  display: flex; align-items: center; gap: var(--s-3);
  animation: toastIn 280ms var(--ease);
  pointer-events: auto;
  color: var(--tx);
}
.toast.toast-success { border-left: 2px solid var(--gr); }
.toast.toast-error { border-left: 2px solid var(--rd); }
.toast.toast-info { border-left: 2px solid var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ============================================================
   TASK DETAILS / META
   ============================================================ */
.task-detail-section { margin-bottom: var(--s-5); }
.task-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
}
.meta-block { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.meta-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
}

/* Comments */
.comments-list {
  display: flex; flex-direction: column; gap: var(--s-3);
  margin-bottom: var(--s-4);
  max-height: 320px;
  overflow-y: auto;
}
.comment {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
  padding: 12px 14px;
}
.comment-header {
  display: flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-2);
  font-size: 12px;
}
.comment-author { font-weight: 600; color: var(--tx); }
.comment-time {
  font-size: 11px;
  color: var(--t3);
}
.comment-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--tx);
  white-space: pre-wrap;
}
.comment-composer { display: flex; gap: var(--s-2); }
.comment-composer textarea { flex: 1; min-height: 60px; }

/* ============================================================
   CLOCK-IN MODAL + TIMER
   ============================================================ */
.clock-in-panel {
  background: var(--s1);
  border: 1px solid var(--b2);
  overflow: hidden;
  position: relative;
}
.clock-in-glow {
  position: absolute;
  top: -40%; left: 50%;
  transform: translateX(-50%);
  width: 200%; height: 180px;
  background: radial-gradient(ellipse at center, rgba(212,168,67,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.clock-in-icon {
  font-family: var(--fd);
  font-size: 64px;
  color: var(--gold);
  margin-bottom: var(--s-2);
  line-height: 1;
}

.clock-timer-wrap {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 4px 4px 4px 12px;
  background: var(--gbg);
  border: 1px solid rgba(212,168,67,0.30);
  border-radius: var(--rs);
}
.clock-timer-wrap .btn {
  color: var(--gold);
}
.clock-timer-wrap .btn:hover {
  color: var(--gl);
  background: rgba(212,168,67,0.12);
}
.clock-dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: clockBlink 2.5s ease-in-out infinite;
}
@keyframes clockBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.clock-label {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.clock-value {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  min-width: 68px;
  font-feature-settings: "tnum" on;
}

/* ============================================================
   ATTENDANCE
   ============================================================ */
.attendance-toolbar {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.attendance-date-picker {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 6px 10px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--rs);
}
.attendance-date-picker input {
  border: none; background: none;
  padding: 0; min-height: 0;
  width: 130px;
  font-size: 12px;
  color: var(--tx);
}
.attendance-date-picker input:focus { background: none; }

.attendance-table-header {
  display: grid;
  grid-template-columns: 1fr 110px 110px 110px 90px 70px;
  gap: var(--s-3);
  padding: 12px 16px;
  background: var(--s0);
  border-bottom: 1px solid var(--b1);
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.attendance-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 110px 90px 70px;
  gap: var(--s-3);
  padding: 14px 16px;
  border-bottom: 1px solid var(--b0);
  align-items: center;
  font-size: 13px;
}
.attendance-row:last-child { border-bottom: none; }
.attendance-status {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex; align-items: center; gap: 5px;
}
.attendance-status.status-working {
  background: rgba(46,158,104,0.12);
  color: var(--gr);
  border: 1px solid rgba(46,158,104,0.25);
}
.attendance-status.status-done {
  background: var(--s2);
  color: var(--t2);
  border: 1px solid var(--b2);
}
.att-time {
  font-feature-settings: "tnum" on;
  font-weight: 500;
  font-size: 13px;
  color: var(--tx);
}
.att-time-meta {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.muted { color: var(--t2); }
.dim { color: var(--t3); }
.mono { font-family: var(--fb); font-feature-settings: "tnum" on; }
.danger { color: var(--rd); }
.success { color: var(--gr); }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }

.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

.divider {
  height: 1px;
  background: var(--b1);
  margin: var(--s-4) 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; height: auto;
    border-right: none; border-top: 1px solid var(--b0);
    flex-direction: row;
    padding: 6px 8px; padding-bottom: 6px;
    align-items: center;
    z-index: 90;
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; flex: 1; gap: 0; }
  .nav-item {
    flex-direction: column; gap: 4px;
    padding: 6px 8px;
    min-width: 56px;
    border-left: none;
    border-top: 2px solid transparent;
    font-size: 10px;
  }
  .nav-item.active { border-left: none; border-top-color: var(--gold); }
  .nav-label { font-size: 10px; }
  .nav-divider, .nav-count, .nav-badge { display: none; }
  .sidebar-bottom { display: none; }

  .topbar { padding: 0 var(--s-4); }
  .view-container { padding: var(--s-5) var(--s-4) calc(var(--s-16) + var(--s-10)); }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 140px; }
  .task-table-header, .task-row { grid-template-columns: 32px 1fr 80px; }
  .task-table-header > *:nth-child(n+4),
  .task-row > *:nth-child(n+4):not(.task-actions) { display: none; }
  .attendance-table-header, .attendance-row {
    grid-template-columns: 1fr 90px 90px 60px;
  }
  .attendance-table-header > *:nth-child(n+5),
  .attendance-row > *:nth-child(n+5):not(:last-child) { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
