/* ═══════════════════════════════════════════════════════
   PracticeHub — Finexy Theme
   Activate: add class="theme-finexy" to <body>
   Deactivate: remove the class
   ═══════════════════════════════════════════════════════ */

body.theme-finexy {

  /* ── Core palette ── */
  --lt-bg:       #f4f4f0;
  --lt-ink:      #1a1a18;
  --lt-ink2:     #3a3a38;
  --lt-ink3:     #999;

  --dk-surface:  #ffffff;
  --dk-surface2: #f8f6f2;
  --dk-surface3: #f2efe9;
  --dk-border:   #f0ede8;
  --dk-border2:  #e4e1db;
  --dk-ink:      #1a1a18;
  --dk-ink2:     #3a3a38;
  --dk-ink3:     #999999;

  /* ── Accent — warm orange instead of lime ── */
  --lime:        #E85D26;
  --lime-glow:   rgba(232,93,38,.12);
  --lime-glow2:  rgba(232,93,38,.06);

  /* ── Amber / warning unchanged ── */
  --amber-warn:  #d97706;

  /* ── Border radius — rounder ── */
  --r-sm:        6px;
  --r-md:        8px;
  --r-lg:        14px;
  --r-xl:        18px;
  --r-pill:      40px;
}

/* ── TOPBAR ── */
body.theme-finexy .topbar {
  background: #ffffff;
  border-bottom: 1px solid #f0ede8;
  box-shadow: none;
  height: 52px;
}

body.theme-finexy .topbar-brand {
  font-size: 13px;
  font-weight: 800;
  color: #1a1a18;
  letter-spacing: -.02em;
}

body.theme-finexy .brand-dot {
  background: #E85D26;
}

body.theme-finexy .topbar-nav a {
  color: #999;
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
}

body.theme-finexy .topbar-nav a:hover {
  background: #FEF0EB;
  color: #E85D26;
}

body.theme-finexy .topbar-nav a.active {
  background: #1a1a18;
  color: #ffffff;
}

/* ── BUTTONS ── */
body.theme-finexy .btn-lime {
  background: #E85D26;
  color: #ffffff;
  border-radius: 20px;
  border: none;
  font-size: 11px;
  font-weight: 700;
}

body.theme-finexy .btn-lime:hover {
  background: #d44e1a;
}

body.theme-finexy .btn-dark {
  background: #1a1a18;
  color: #ffffff;
  border-radius: 20px;
  border: none;
}

body.theme-finexy .btn-dark:hover {
  background: #333;
}

body.theme-finexy .btn-ghost-dk {
  border: 1px solid #e4e1db;
  color: #1a1a18;
  border-radius: 20px;
  background: #ffffff;
}

body.theme-finexy .btn-ghost-dk:hover {
  background: #f8f6f2;
  border-color: #ccc;
}

/* ── PAGE HERO (light zone) ── */
body.theme-finexy .page-hero,
body.theme-finexy .light-zone {
  background: #f4f4f0;
}

body.theme-finexy .page-hero-title,
body.theme-finexy .hero-title {
  color: #1a1a18;
  font-size: 24px;
}

body.theme-finexy .page-hero-sub,
body.theme-finexy .hero-sub {
  color: #999;
}

/* ── MAIN BACKGROUND ── */
body.theme-finexy body,
body.theme-finexy {
  background: #f4f4f0;
}

/* ── CARDS & SURFACES ── */
body.theme-finexy .proj-table,
body.theme-finexy .inv-table,
body.theme-finexy .perm-table,
body.theme-finexy .fee-calc,
body.theme-finexy .kpi-c,
body.theme-finexy .inv-detail,
body.theme-finexy .user-card,
body.theme-finexy .modal,
body.theme-finexy .time-entry-card,
body.theme-finexy [style*="background:var(--dk-surface)"] {
  border-radius: 14px;
  border-color: #f0ede8;
}

/* ── TABLE STYLES ── */
body.theme-finexy .proj-table th,
body.theme-finexy .inv-table th {
  background: #f8f6f2;
  color: #bbb;
  font-size: 9px;
  letter-spacing: .07em;
  border-bottom: 1px solid #f0ede8;
}

body.theme-finexy .proj-table tr.pr:hover td,
body.theme-finexy .inv-table tr.clickable:hover td {
  background: #fef9f7;
}

/* ── KPI STRIP ── */
body.theme-finexy .kpi-strip {
  background: transparent;
  gap: 10px;
}

body.theme-finexy .kpi-c {
  background: #ffffff;
  border: 1px solid #f0ede8;
  border-radius: 14px;
}

body.theme-finexy .kpi-lbl {
  color: #bbb;
  font-size: 9px;
  letter-spacing: .06em;
}

body.theme-finexy .kpi-val {
  color: #1a1a18;
  font-size: 22px;
}

body.theme-finexy .kpi-val.lime {
  color: #E85D26;
}

body.theme-finexy .kpi-val.warn {
  color: #d97706;
}

body.theme-finexy .kpi-sub {
  color: #bbb;
  font-size: 10px;
}

/* ── TOOLBAR ── */
body.theme-finexy .toolbar {
  background: #ffffff;
  border-bottom: 1px solid #f0ede8;
}

body.theme-finexy .filter-sel {
  background: #f8f6f2;
  border: 1px solid #e8e5df;
  color: #3a3a38;
  border-radius: 20px;
}

body.theme-finexy .search-input {
  background: #f8f6f2;
  border: 1px solid #e8e5df;
  color: #1a1a18;
}

body.theme-finexy .search-input:focus {
  border-color: #E85D26;
  box-shadow: 0 0 0 3px rgba(232,93,38,.1);
}

/* ── FORM FIELDS ── */
body.theme-finexy input[type="text"],
body.theme-finexy input[type="email"],
body.theme-finexy input[type="number"],
body.theme-finexy input[type="date"],
body.theme-finexy input[type="password"],
body.theme-finexy textarea,
body.theme-finexy select {
  background: #f8f6f2;
  border: 1px solid #e8e5df;
  color: #1a1a18;
  border-radius: 8px;
}

body.theme-finexy input:focus,
body.theme-finexy textarea:focus,
body.theme-finexy select:focus {
  border-color: #E85D26;
  box-shadow: 0 0 0 3px rgba(232,93,38,.1);
}

/* ── STAGE TAGS & BADGES ── */
body.theme-finexy .stage-tag,
body.theme-finexy .uc-role,
body.theme-finexy .status-tag {
  border-radius: 6px;
}

body.theme-finexy .role-principal {
  background: rgba(232,93,38,.12);
  color: #E85D26;
  border-color: rgba(232,93,38,.25);
}

/* ── TABS (project file, timelog) ── */
body.theme-finexy .tab-btn.active {
  background: #E85D26;
  color: #ffffff;
}

body.theme-finexy .tab-btn {
  border-radius: 20px;
  border: 1px solid #e8e5df;
  color: #999;
}

body.theme-finexy .tab-btn:hover:not(.active) {
  background: #FEF0EB;
  color: #E85D26;
  border-color: #E85D26;
}

/* ── VIEW TABS (finance) ── */
body.theme-finexy .view-tab.active {
  background: #1a1a18;
  color: #E85D26;
}

body.theme-finexy .view-tab {
  color: #999;
}

body.theme-finexy .view-tab:hover:not(.active) {
  color: #E85D26;
  background: #FEF0EB;
}

/* ── SECTION TITLES ── */
body.theme-finexy .sec-title {
  color: #bbb;
  letter-spacing: .07em;
}

body.theme-finexy .sec-title::before {
  background: #E85D26;
}

/* ── SORTED COLUMN INDICATOR ── */
body.theme-finexy .proj-table th.sorted {
  color: #E85D26;
}

/* ── STAGE BAR (project page) ── */
body.theme-finexy .stage-step.completed .step-circle {
  background: #E85D26;
  border-color: #E85D26;
}

body.theme-finexy .stage-step.current .step-circle {
  border-color: #E85D26;
  color: #E85D26;
}

body.theme-finexy .stage-step.current .step-label {
  color: #E85D26;
}

/* ── TOAST ── */
body.theme-finexy .toast.success {
  border-color: #E85D26;
  color: #E85D26;
}

/* ── USER CARD ── */
body.theme-finexy .user-card {
  background: #ffffff;
  border-color: #f0ede8;
  border-radius: 14px;
}

body.theme-finexy .user-avatar,
body.theme-finexy .uc-avatar {
  background: #FEF0EB;
  color: #E85D26;
}

/* ── MODAL ── */
body.theme-finexy .modal {
  background: #ffffff;
  border-color: #e8e5df;
  border-radius: 18px;
}

body.theme-finexy .modal-overlay {
  background: rgba(0,0,0,.5);
}

/* ── SETTINGS TOGGLE ── */
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--dk-border);
}

.theme-toggle-label {
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  color: var(--dk-ink);
}

.theme-toggle-sub {
  font-size: 11px;
  color: var(--dk-ink3);
  margin-top: 2px;
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s;
  flex-shrink: 0;
}

.theme-swatch.active {
  border-color: var(--lime);
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--dk-surface2);
  border: 1px solid var(--dk-border2);
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #aaa;
  transition: transform .2s, background .2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(232,93,38,.15);
  border-color: #E85D26;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #E85D26;
}

body.theme-finexy .toggle-switch input:checked + .toggle-slider {
  background: rgba(232,93,38,.15);
  border-color: #E85D26;
}
