/* ═══════════════════════════════════════════════════
   Larry HQ — Apple Liquid Glass UI  (by REED)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Root ── */
:root {
  --glass-bg:      rgba(255,255,255,0.05);
  --glass-border:  rgba(255,255,255,0.10);
  --glass-shine:   rgba(255,255,255,0.06);
  --accent:        #a78bfa;
  --accent-glow:   rgba(167,139,250,0.35);
  --accent-dim:    rgba(167,139,250,0.12);
  --text:          #f0f0f8;
  --text-2:        #9090b0;
  --text-3:        #40405a;
  --success:       #34d399;
  --warn:          #fbbf24;
  --info:          #60a5fa;
  --danger:        #f87171;
  --purple:        #c084fc;
  --sidebar-w:     230px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  /* Deep space gradient background */
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%,   rgba(88,56,186,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%,  rgba(14,80,160,0.20) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #07070f 0%, #060610 100%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #c4b5fd; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  padding: 22px 0;
  background: rgba(10,8,25,0.65);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid rgba(255,255,255,0.07);
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  z-index: 100;
}

.logo {
  padding: 4px 22px 26px;
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.6px; color: #fff;
}
.logo span {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-section {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,0.18); padding: 16px 22px 5px; font-weight: 700;
}

.sidebar a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 22px; color: rgba(255,255,255,0.45);
  font-size: 13.5px; font-weight: 500;
  transition: all .18s ease; position: relative;
}
.sidebar a:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}
.sidebar a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(167,139,250,0.18), rgba(167,139,250,0.04));
  border-right: 2px solid var(--accent);
}
.sidebar a.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 0; border-left: 2px solid rgba(167,139,250,0.3);
  filter: blur(2px);
}
.sidebar a .ic {
  font-size: 13px; width: 18px; text-align: center;
  opacity: .6; transition: opacity .18s;
}
.sidebar a:hover .ic, .sidebar a.active .ic { opacity: 1; }

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  padding: 32px 40px;
  flex: 1; width: 100%;
}

h1 {
  font-size: 22px; font-weight: 800;
  letter-spacing: -.5px; color: #fff;
  margin-bottom: 3px;
}
.sub {
  color: var(--text-3); font-size: 12px; margin-bottom: 20px;
  font-weight: 500;
}
.sec {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .1em; margin: 32px 0 14px;
}

/* ── Glass Panel (base) ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 var(--glass-shine);
}

/* ── Stats ── */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.stat {
  min-width: 130px; padding: 20px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), inset 0 1px 0 var(--glass-shine);
  transition: transform .2s, box-shadow .2s;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(167,139,250,0.2), inset 0 1px 0 var(--glass-shine);
}
.stat .n {
  font-size: 32px; font-weight: 800; color: #fff;
  letter-spacing: -1.5px; line-height: 1;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat .l {
  font-size: 10.5px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .08em; margin-top: 6px; font-weight: 600;
}

/* ── Tables ── */
.tbl {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 var(--glass-shine);
  overflow: hidden; margin-bottom: 4px;
}
table { width: 100%; border-collapse: collapse; }
thead { background: rgba(255,255,255,0.03); }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3); font-weight: 700;
  padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
td {
  padding: 10px 16px; font-size: 13.5px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,0.8);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.s-active, .s-assigned  { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.s-in_progress          { background: rgba(251,191,36,0.10); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.s-delivered,.s-hired,.s-completed,.s-profiled
                        { background: rgba(96,165,250,0.10); color: #60a5fa; border: 1px solid rgba(96,165,250,0.25); }
.s-pending              { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }
.s-closed,.s-cancelled,.s-on_hold
                        { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.08); }
.s-researching          { background: rgba(192,132,252,0.10); color: #c084fc; border: 1px solid rgba(192,132,252,0.25); }

/* ── Forms ── */
.add-box {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 var(--glass-shine);
  padding: 24px 28px; margin-top: 16px;
}
.add-box h3 {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  align-items: end;
}
.form-row label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.form-row label.full { grid-column: 1 / -1; }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: 10px;
  padding: 10px 14px; font-size: 14px;
  font-family: inherit;
  backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: rgba(255,255,255,0.18); }
.form-row select option { background: #12101e; color: #e0e0f0; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: rgba(167,139,250,0.6);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.12), 0 0 16px rgba(167,139,250,0.1);
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-row-btn { align-self: end; }

.btn {
  background: linear-gradient(135deg, rgba(167,139,250,0.9), rgba(139,92,246,0.9));
  color: #fff; border: 1px solid rgba(167,139,250,0.5);
  border-radius: 9px; padding: 9px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(167,139,250,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all .2s; backdrop-filter: blur(8px);
}
.btn:hover {
  background: linear-gradient(135deg, rgba(192,132,252,0.95), rgba(167,139,250,0.95));
  box-shadow: 0 6px 24px rgba(167,139,250,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

/* ── Empty ── */
.empty {
  padding: 52px; text-align: center;
  color: var(--text-3); font-size: 14px; font-weight: 500;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 14px;
}

/* ── Profile Cards ── */
.profiles { display: flex; flex-direction: column; gap: 14px; }
.pcard {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 var(--glass-shine);
  display: grid; grid-template-columns: 80px 1fr;
  gap: 22px; padding: 24px 28px; align-items: start;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.pcard:hover {
  transform: translateY(-2px);
  border-color: rgba(167,139,250,0.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(167,139,250,0.1), inset 0 1px 0 var(--glass-shine);
}
.av {
  width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 2px rgba(255,255,255,0.1);
}
.av svg { width: 64px; height: 64px; display: block; }
.pname { font-size: 17px; font-weight: 700; color: #fff; }
.prole {
  display: inline-block;
  background: rgba(167,139,250,0.12);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.2);
  font-size: 11.5px; font-weight: 500; padding: 3px 11px;
  border-radius: 20px; margin-left: 10px; vertical-align: middle;
}
.pjoin { font-size: 12px; color: var(--text-3); margin: 5px 0 12px; }
.pbio  { font-size: 14px; color: var(--text-2); line-height: 1.7; max-width: 640px; }

/* ── Flash ── */
.flash {
  padding: 13px 18px; border-radius: 10px; margin-bottom: 24px;
  font-size: 14px; font-weight: 500;
  background: rgba(52,211,153,0.1);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.25);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(52,211,153,0.1);
}

/* ── Row action buttons ── */
.row-actions { white-space: nowrap; width: 1%; padding-right: 16px !important; }
.act-btn {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; border: 1px solid transparent;
  transition: all .15s; text-decoration: none;
  margin-left: 4px;
}
.act-btn.edit {
  background: rgba(96,165,250,0.1); color: #60a5fa;
  border-color: rgba(96,165,250,0.2);
}
.act-btn.edit:hover {
  background: rgba(96,165,250,0.2); border-color: rgba(96,165,250,0.4);
  color: #93c5fd;
}
.act-btn.delete {
  background: rgba(248,113,113,0.08); color: #f87171;
  border-color: rgba(248,113,113,0.15);
}
.act-btn.delete:hover {
  background: rgba(248,113,113,0.18); border-color: rgba(248,113,113,0.35);
  color: #fca5a5;
}

/* ── Edit page ── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); margin-bottom: 20px;
  transition: color .15s;
}
.back-link:hover { color: var(--accent); }

.edit-box {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 var(--glass-shine);
  padding: 32px 36px; max-width: 780px;
}
.edit-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 28px;
}
.edit-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}
.edit-grid label.full { grid-column: 1 / -1; }
.edit-grid input,
.edit-grid select,
.edit-grid textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: 10px;
  padding: 10px 14px; font-size: 14px;
  font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.edit-grid input::placeholder,
.edit-grid textarea::placeholder { color: rgba(255,255,255,0.18); }
.edit-grid input:focus,
.edit-grid select:focus,
.edit-grid textarea:focus {
  border-color: rgba(167,139,250,0.6);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.12), 0 0 16px rgba(167,139,250,0.1);
}
.edit-grid select option { background: #12101e; color: #e0e0f0; }
.edit-grid textarea { resize: vertical; min-height: 100px; }
.edit-actions { display: flex; align-items: center; gap: 14px; }
.btn-ghost {
  padding: 9px 20px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: var(--text-2); border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); cursor: pointer;
  transition: all .15s; text-decoration: none; display: inline-block;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* ── Dashboard grid ── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* ── Clickable rows ── */
tbody tr.clickable-row { cursor: pointer; }
tbody tr.clickable-row:hover td { background: rgba(167,139,250,0.07); }

/* ── Email unread highlight ── */
tr.email-unread td { color: #fff !important; }
.unread-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ── State tabs (GitHub / Outlook) ── */
.gh-toolbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.state-tabs { display: flex; gap: 4px; }
.state-tab {
  padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); border: 1px solid transparent; transition: all .15s;
  text-decoration: none;
}
.state-tab:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.state-tab.active {
  background: rgba(167,139,250,0.15); color: var(--accent);
  border-color: rgba(167,139,250,0.3);
}


/* ── Filter bar ── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.filter-input {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); border-radius: 8px;
  padding: 7px 14px; font-size: 13px;
  font-family: inherit; outline: none;
  transition: border-color .2s;
}
.filter-input:focus {
  border-color: rgba(167,139,250,0.5);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.1);
}
.filter-input::placeholder { color: var(--text-3); }
.filter-count {
  font-size: 12px; color: var(--text-3);
  margin-left: auto; white-space: nowrap;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════
   Light Mode
   ══════════════════════════════════════ */
body.light {
  --glass-bg:      rgba(255,255,255,0.72);
  --glass-border:  rgba(0,0,0,0.08);
  --glass-shine:   rgba(255,255,255,0.9);
  --accent:        #7c3aed;
  --accent-glow:   rgba(124,58,237,0.25);
  --accent-dim:    rgba(124,58,237,0.08);
  --text:          #1a1a2e;
  --text-2:        #4a4a6a;
  --text-3:        #8888a8;
  --success:       #059669;
  --warn:          #d97706;
  --info:          #2563eb;
  --danger:        #dc2626;
  --purple:        #7c3aed;

  background:
    radial-gradient(ellipse 80% 60% at 10% 0%,   rgba(167,139,250,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%,  rgba(96,165,250,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #f4f2ff 0%, #eeeef8 100%);
  color: var(--text);
}

body.light .sidebar {
  background: rgba(248,246,255,0.85);
  border-right: 1px solid rgba(0,0,0,0.08);
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
body.light .logo { color: #1a1a2e; }
body.light .nav-section { color: rgba(0,0,0,0.3); }
body.light .sidebar a { color: rgba(0,0,0,0.45); }
body.light .sidebar a:hover { color: rgba(0,0,0,0.8); background: rgba(0,0,0,0.04); }
body.light .sidebar a.active { color: var(--accent); background: rgba(124,58,237,0.08); border-right-color: var(--accent); }
body.light .sidebar a.active::before { border-left-color: rgba(124,58,237,0.3); }

body.light h1 { color: #1a1a2e; }
body.light a { color: var(--accent); }
body.light a:hover { color: #5b21b6; }

body.light .glass,
body.light .stat,
body.light .tbl,
body.light .add-box,
body.light .edit-box,
body.light .pcard {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
body.light .stat:hover,
body.light .pcard:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(124,58,237,0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}
body.light .stat .n {
  background: linear-gradient(135deg, #1a1a2e, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light thead { background: rgba(0,0,0,0.02); }
body.light th { color: var(--text-3); border-bottom-color: rgba(0,0,0,0.06); }
body.light td { color: rgba(0,0,0,0.75) !important; border-bottom-color: rgba(0,0,0,0.04); }
body.light tr.email-unread td { color: rgba(0,0,0,0.92) !important; }
body.light tbody tr:hover td { background: rgba(0,0,0,0.02); }
body.light tbody tr.clickable-row:hover td { background: rgba(124,58,237,0.05); }

body.light .badge { }
body.light .s-active, body.light .s-assigned  { background: rgba(5,150,105,0.08); color: #059669; border-color: rgba(5,150,105,0.2); }
body.light .s-in_progress                     { background: rgba(217,119,6,0.08); color: #d97706; border-color: rgba(217,119,6,0.2); }
body.light .s-delivered,.s-hired,.s-completed,.s-profiled
                                              { background: rgba(37,99,235,0.08); color: #2563eb; border-color: rgba(37,99,235,0.2); }
body.light .s-pending                         { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.2); }
body.light .s-closed,.s-cancelled,.s-on_hold  { background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.3); border-color: rgba(0,0,0,0.08); }
body.light .s-researching                     { background: rgba(124,58,237,0.08); color: #7c3aed; border-color: rgba(124,58,237,0.2); }

body.light .form-row input,
body.light .form-row select,
body.light .form-row textarea,
body.light .edit-grid input,
body.light .edit-grid select,
body.light .edit-grid textarea {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.12);
  color: var(--text);
}
body.light .form-row input::placeholder,
body.light .form-row textarea::placeholder,
body.light .edit-grid input::placeholder,
body.light .edit-grid textarea::placeholder { color: rgba(0,0,0,0.25); }
body.light .form-row select option,
body.light .edit-grid select option { background: #fff; color: #1a1a2e; }
body.light .form-row input:focus,
body.light .form-row select:focus,
body.light .form-row textarea:focus,
body.light .edit-grid input:focus,
body.light .edit-grid select:focus,
body.light .edit-grid textarea:focus {
  border-color: rgba(124,58,237,0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.10);
}

body.light .flash {
  background: rgba(5,150,105,0.08); color: #059669;
  border-color: rgba(5,150,105,0.2);
}

body.light .empty {
  background: rgba(255,255,255,0.5);
  border-color: rgba(0,0,0,0.08);
  color: var(--text-3);
}

body.light .btn-ghost {
  color: var(--text-2); border-color: rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.03);
}
body.light .btn-ghost:hover { background: rgba(0,0,0,0.07); color: var(--text); }

body.light .act-btn.edit { background: rgba(37,99,235,0.08); color: #2563eb; border-color: rgba(37,99,235,0.2); }
body.light .act-btn.edit:hover { background: rgba(37,99,235,0.15); }
body.light .act-btn.delete { background: rgba(220,38,38,0.07); color: #dc2626; border-color: rgba(220,38,38,0.15); }
body.light .act-btn.delete:hover { background: rgba(220,38,38,0.15); }

body.light .state-tab:hover { background: rgba(0,0,0,0.05); color: var(--text); }
body.light .state-tab.active { background: rgba(124,58,237,0.1); color: var(--accent); border-color: rgba(124,58,237,0.25); }

body.light .filter-input {
  background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.1); color: var(--text);
}
body.light .filter-input option { background: #fff; color: #1a1a2e; }
body.light .filter-input::placeholder { color: var(--text-3); }
body.light .filter-input:focus { border-color: rgba(124,58,237,0.4); box-shadow: 0 0 0 3px rgba(124,58,237,0.08); }

body.light .unread-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }

body.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
body.light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ── Project Hub light mode overrides ── */
body.light .ph-brief-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(37,99,235,0.03));
  border-color: rgba(124,58,237,0.2);
}
body.light .ph-brief-empty { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.07); }
body.light .ph-brief-text { color: var(--text) !important; }
body.light .ph-task-table thead tr { background: rgba(0,0,0,0.03); }
body.light .ph-task-table th { border-bottom-color: rgba(0,0,0,0.07); }
body.light .ph-task-row { border-bottom-color: rgba(0,0,0,0.05); }
body.light .ph-task-row:hover { background: rgba(0,0,0,0.02); }
body.light .ph-task-table-wrap { border-color: rgba(0,0,0,0.08); }
body.light .ph-status-sel {
  background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.12); color: var(--text);
}
body.light .ph-chip { background: rgba(0,0,0,0.05); color: var(--text-2); border-color: rgba(0,0,0,0.08); }
body.light .mini-input {
  background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.12); color: var(--text);
}
body.light .mini-input option { background: #fff; color: #1a1a2e; }
body.light .mini-input:focus { border-color: rgba(124,58,237,0.45); }
body.light .collapse-form { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
body.light .ph-tabs { border-bottom-color: rgba(0,0,0,0.1); }
body.light .ph-tab:hover { background: rgba(0,0,0,0.03); color: var(--text); }
body.light .ph-tab.active { background: rgba(124,58,237,0.06); }
body.light .ph-team-row { border-bottom-color: rgba(0,0,0,0.06); }
body.light .ei-select-all-row { border-bottom-color: rgba(0,0,0,0.07); }
body.light .email-card {
  background: rgba(124,58,237,0.04); border-color: rgba(124,58,237,0.12);
}
body.light .email-card:hover { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.22); }
body.light .email-card--linked { background: rgba(5,150,105,0.04); border-color: rgba(5,150,105,0.14); }
body.light .email-card--linked:hover { background: rgba(5,150,105,0.08); }
body.light .ei-preview { color: var(--text-2) !important; }
body.light .ei-thread-select { color: var(--text-2); }
body.light .ei-conv-group { background: rgba(37,99,235,0.04); border-color: rgba(37,99,235,0.14); }
body.light .ei-conv-label { color: #2563eb; }
body.light .ei-bulk-bar { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.2); }
body.light .gantt-wrap { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.light .gantt-labels { border-right-color: rgba(0,0,0,0.07); }
body.light .gantt-label-row { border-bottom-color: rgba(0,0,0,0.05); }
body.light .gantt-hdr { background: rgba(0,0,0,0.03); border-bottom-color: rgba(0,0,0,0.07); }
body.light .gantt-bar-row { border-bottom-color: rgba(0,0,0,0.04); }
body.light .edit-panel {
  background: #f8f6ff; border-left-color: rgba(0,0,0,0.1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}
body.light .email-reader-panel {
  background: #f8f6ff; border-left-color: rgba(0,0,0,0.1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.12);
}
body.light .email-reader-body {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08);
  color: var(--text) !important;
}
body.light .email-reader-close { border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.04); color: var(--text); }
body.light .email-reader-overlay { background: rgba(0,0,0,0.3); }
body.light .suggestion-card { background: rgba(217,119,6,0.04); border-color: rgba(217,119,6,0.15); }
body.light .sug-chip { background: rgba(0,0,0,0.05); color: var(--text-3); border-color: rgba(0,0,0,0.08); }
/* Project hub contact/file row backgrounds use rgba(0,0,0,0.15) inline — override via wrapper */
body.light .ph-tab-panel [style*="background:rgba(0,0,0"] { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.07) !important; }
body.light .ph-header [style*="background:rgba(0,0,0"],
body.light .ph-panel [style*="background:rgba(0,0,0"] { background: rgba(0,0,0,0.03) !important; }

/* ── Theme toggle button ── */
.theme-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; cursor: pointer;
  color: rgba(255,255,255,0.45); font-size: 13.5px; font-weight: 500;
  transition: all .18s; border: none; background: none;
  font-family: inherit; width: 100%; text-align: left;
}
.theme-toggle:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05); }
body.light .theme-toggle { color: rgba(0,0,0,0.45); }
body.light .theme-toggle:hover { color: rgba(0,0,0,0.8); background: rgba(0,0,0,0.04); }

/* ══════════════════════════════════════════════════════════
   MOBILE — max-width: 768px
   Desktop layout is completely untouched above this point.
   ══════════════════════════════════════════════════════════ */

/* ── Mobile top bar ── */
.mobile-topbar {
  display: none;
}

/* ── Hamburger button ── */
.hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; padding: 8px; width: 44px; height: 44px;
  border-radius: 10px; transition: background .15s;
}
.hamburger span {
  display: block; height: 2px; width: 22px; border-radius: 2px;
  background: rgba(255,255,255,0.7); transition: all .25s ease;
}
body.light .hamburger span { background: rgba(0,0,0,0.6); }
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s;
}
.mobile-nav-overlay.mobile-open { opacity: 1; }

/* ── Sidebar desktop logo visible, mobile logo hidden (by default) ── */
.mobile-logo { display: none; }

@media (max-width: 768px) {

  /* ── Body: stack vertically, no horizontal overflow ── */
  body {
    flex-direction: column;
    overflow-x: hidden;
  }

  /* ── Show mobile top bar ── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: 56px; padding: 0 16px;
    background: rgba(10,8,25,0.85);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
  }
  body.light .mobile-topbar {
    background: rgba(248,246,255,0.92);
    border-bottom-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
  .mobile-logo { display: flex; padding: 0; margin: 0; font-size: 18px; font-weight: 800; }

  /* ── Overlay: activate on mobile ── */
  .mobile-nav-overlay { display: block; pointer-events: none; }
  .mobile-nav-overlay.mobile-open { pointer-events: auto; }

  /* ── Sidebar: slide in from left as drawer ── */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 101;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Hide the desktop logo inside sidebar on mobile — we show mobile-topbar logo instead */
  .sidebar-logo { display: none; }

  /* ── Main content: full width, pad for top bar ── */
  .main {
    margin-left: 0;
    padding: 72px 16px 32px; /* 72px = 56px topbar + 16px gap */
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  /* ── Typography ── */
  h1 { font-size: 20px; }

  /* ── Stats: 2-column grid on mobile ── */
  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat {
    min-width: 0;
    padding: 14px 16px;
  }
  .stat .n { font-size: 26px; }

  /* ── Table wrapper: horizontal scroll ── */
  .tbl {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  table {
    min-width: 520px; /* prevents columns collapsing too far */
  }
  th, td {
    padding: 10px 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  /* Allow text cells to wrap when they're the main content column */
  td[style*="white-space:normal"],
  td[style*="white-space: normal"] {
    white-space: normal !important;
    min-width: 120px;
  }

  /* ── Filter bar: stack on mobile ── */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .filter-input {
    width: 100% !important;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    min-height: 44px;
    padding: 10px 14px;
  }
  .filter-count { margin-left: 0; }

  /* ── Buttons: thumb-friendly ── */
  .btn, .btn-ghost {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 14px;
  }
  .act-btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* ── Form inputs: no zoom on iOS ── */
  .form-row input,
  .form-row select,
  .form-row textarea,
  .edit-grid input,
  .edit-grid select,
  .edit-grid textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .form-row textarea,
  .edit-grid textarea {
    min-height: 80px;
  }

  /* ── Form grid: single column ── */
  .form-row {
    grid-template-columns: 1fr;
  }
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .edit-grid label.full { grid-column: 1; }

  /* ── Add/edit boxes ── */
  .add-box { padding: 18px 16px; }
  .edit-box { padding: 20px 16px; max-width: 100%; }

  /* ── Edit actions ── */
  .edit-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* ── Profile cards: single column ── */
  .pcard {
    grid-template-columns: 60px 1fr;
    padding: 18px 16px;
    gap: 14px;
  }

  /* ── Dash grid ── */
  .dash-grid { grid-template-columns: 1fr; }

  /* ── Dashboard: inline grid stacks ── */
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Project cards: single column ── */
  .project-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .proj-card { height: auto; min-height: 200px; }

  /* ── Project hub header ── */
  .ph-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ph-meta-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── Contact grid: single column ── */
  .ct-grid { grid-template-columns: 1fr !important; }

  /* ── Contact filter row ── */
  .ct-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ct-search { min-width: 0; font-size: 16px; min-height: 44px; }
  .ct-select { min-width: 0; font-size: 16px; min-height: 44px; }

  /* ── Projects page header ── */
  .proj-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .proj-page-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
  .proj-page-header .btn {
    flex: 1;
    text-align: center;
  }

  /* ── Inbox ── */
  .flash { font-size: 13px; padding: 10px 14px; }

  /* ── Pagination ── */
  .pg-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
    min-width: 40px;
  }

  /* ── State tabs wrap ── */
  .gh-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .state-tabs { flex-wrap: wrap; }
  .state-tab { padding: 8px 14px; font-size: 13px; min-height: 40px; }

  /* ── Modal: full-width on mobile ── */
  .modal-box {
    width: calc(100vw - 24px) !important;
    padding: 20px 18px;
    border-radius: 14px;
  }

  /* ── Edit slide-in panel becomes a bottom sheet / full-screen ── */
  .edit-panel {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0;
    top: auto !important;
    bottom: -100vh;
    max-height: 90vh;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    transition: bottom .28s cubic-bezier(.4,0,.2,1) !important;
  }
  .edit-panel.open {
    bottom: 0 !important;
    right: 0 !important;
  }

  /* ── Email reader panel: full screen on mobile ── */
  .email-reader-panel {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    top: auto !important;
    bottom: -100vh;
    height: 90vh;
    border-radius: 18px 18px 0 0;
    transition: bottom .28s cubic-bezier(.4,0,.2,1) !important;
  }
  .email-reader-panel.open {
    bottom: 0 !important;
    right: 0 !important;
  }

  /* ── Row actions: don't shrink to nothing ── */
  .row-actions {
    width: auto;
    white-space: nowrap;
  }

  /* ── Sub text and section labels ── */
  .sub { font-size: 11px; }
  .sec { font-size: 10px; }

  /* ── Gantt: scroll horizontally ── */
  .gantt-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

} /* end @media (max-width: 768px) */
