/* ===== TurboText CRM — New Space Design Theme ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg-2: #0f0f16;
  --surface: #121218;
  --surface-2: #17171f;
  --surface-3: #1c1c26;
  --border: #24242e;
  --border-2: #2e2e3a;
  --text: #f4f4f8;
  --text-2: #b5b5c2;
  --text-3: #7a7a88;
  --muted: #5a5a66;
  --accent: #e11d48;
  --accent-2: #f43f5e;
  --accent-soft: rgba(225,29,72,.12);
  --ring: rgba(225,29,72,.35);
  --good: #10b981;
  --good-soft: rgba(16,185,129,.14);
  --info: #3b82f6;
  --info-soft: rgba(59,130,246,.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245,158,11,.14);
}

html, body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* ===== Stars background ===== */
.stars-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(1px 1px at 22% 72%, rgba(255,255,255,.22), transparent 50%),
    radial-gradient(1.5px 1.5px at 38% 34%, rgba(255,255,255,.4), transparent 50%),
    radial-gradient(1px 1px at 51% 82%, rgba(255,255,255,.18), transparent 50%),
    radial-gradient(1px 1px at 67% 12%, rgba(255,255,255,.28), transparent 50%),
    radial-gradient(1.2px 1.2px at 78% 58%, rgba(255,255,255,.32), transparent 50%),
    radial-gradient(1px 1px at 88% 28%, rgba(255,255,255,.2), transparent 50%),
    radial-gradient(1px 1px at 6% 46%, rgba(255,255,255,.24), transparent 50%),
    radial-gradient(1px 1px at 45% 6%, rgba(255,255,255,.18), transparent 50%),
    radial-gradient(1px 1px at 94% 88%, rgba(255,255,255,.22), transparent 50%),
    radial-gradient(1.2px 1.2px at 30% 95%, rgba(255,255,255,.28), transparent 50%),
    radial-gradient(1px 1px at 60% 50%, rgba(255,255,255,.16), transparent 50%);
  background-repeat: no-repeat;
  opacity: .5;
}
.stars-layer::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 500px at 12% -10%, rgba(225,29,72,.07), transparent 60%),
    radial-gradient(700px 500px at 95% 110%, rgba(59,130,246,.04), transparent 60%);
}

/* ===== Login screen override ===== */
.login-screen {
  background: transparent !important;
  position: relative; z-index: 1;
}
.login-box {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04) !important;
  padding: 36px !important;
}
.login-box h2 { color: var(--text) !important; font-weight: 600; }
.login-logo {
  background: radial-gradient(120% 120% at 30% 20%, #ff4d72, var(--accent) 55%, #7a0f28) !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 28px -10px rgba(225,29,72,.7) !important;
  margin: 0 auto 24px !important;
  display: block !important;
  width: fit-content !important;
}
.input-group label { color: var(--text-2) !important; font-size: 12px; font-weight: 500; letter-spacing: .03em; }
.input-group input {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  padding: 10px 12px !important;
}
.input-group input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  outline: none !important;
}
.login-btn {
  background: linear-gradient(180deg, var(--accent), #b3153a) !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 22px -8px rgba(225,29,72,.8) !important;
  font-weight: 600 !important;
  border: none !important;
}
.login-btn:hover { filter: brightness(1.08) !important; }

/* ===== App layout ===== */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.app.layout-top {
  grid-template-columns: 1fr;
}
.app.layout-top .crm-sidebar { display: none; }
.app.layout-top .crm-topnav { display: flex; }
.app.layout-top .crm-page { padding-top: 22px; }

/* ===== Sidebar ===== */
.crm-sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0d0d14 0%, #0a0a10 100%);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 18px;
  z-index: 20; overflow-y: auto; overflow-x: hidden;
  box-sizing: border-box;
}
.crm-sidebar::-webkit-scrollbar { width: 4px; }
.crm-sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* Brand */
.crm-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.crm-brand-mark {
  position: relative; width: 48px; height: 48px;
  display: grid; place-items: center; flex: none;
}
.crm-brand-mark .core {
  width: 36px; height: 36px; border-radius: 10px;
  background: radial-gradient(120% 120% at 30% 20%, #ff4d72, var(--accent) 55%, #7a0f28);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px; letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 28px -10px rgba(225,29,72,.7);
  position: relative; z-index: 2;
}
.crm-brand-mark .orbit {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(225,29,72,.28);
  animation: crm-spin 18s linear infinite;
}
.crm-brand-mark .orbit.o2 {
  inset: 6px; border: 1px dotted rgba(255,255,255,.14);
  animation: crm-spin 11s linear infinite reverse;
}
.crm-brand-mark .orbit .sat {
  position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: #ffd6e0;
  box-shadow: 0 0 8px rgba(255,90,130,.9);
}
.crm-brand-mark .orbit.o2 .sat {
  width: 4px; height: 4px; background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,.9);
}
@keyframes crm-spin { to { transform: rotate(360deg); } }
.crm-brand-name { font-weight: 600; font-size: 15px; letter-spacing: .01em; color: var(--text); }
.crm-brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }

/* Nav groups */
.crm-nav-group-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 6px 10px; margin-top: 6px;
}
.crm-nav { display: flex; flex-direction: column; gap: 2px; }
.crm-sidebar .nav-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px !important; border-radius: 10px !important;
  color: var(--text-2) !important; font-size: 13.5px !important; font-weight: 500 !important;
  cursor: pointer; position: relative;
  transition: background .15s, color .15s;
  background: transparent !important;
  border: none !important;
  width: 100%;
  text-align: left;
}
.crm-sidebar .nav-tab:hover { background: #15151d !important; color: var(--text) !important; }
.crm-sidebar .nav-tab.active {
  background: linear-gradient(180deg, rgba(225,29,72,.18), rgba(225,29,72,.08)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(225,29,72,.25) !important;
}
.crm-sidebar .nav-tab.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.crm-sidebar .nav-tab svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; pointer-events: none; }
.crm-sidebar .nav-tab span { pointer-events: none; }
.crm-nav-badge {
  margin-left: auto; font-size: 11px; color: var(--text-3);
  background: #1a1a22; padding: 2px 7px; border-radius: 999px;
  pointer-events: none;
}

/* Sidebar footer */
.crm-side-footer {
  margin-top: auto; padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--text-3);
  flex-shrink: 0;
}
.crm-side-planet {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(120% 120% at 30% 25%, #ff8aa5, var(--accent) 60%, #5c0c20);
  box-shadow: 0 0 0 2px rgba(225,29,72,.12), 0 0 18px -2px rgba(225,29,72,.5);
  position: relative;
}
.crm-side-planet::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(225,29,72,.25); transform: rotate(-18deg) scaleY(.45);
}

/* ===== Mobile scrim ===== */
.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 55; display: none;
}
.sidebar-scrim.on { display: block; }

/* ===== Main content area ===== */
.crm-main { min-width: 0; display: flex; flex-direction: column; }

/* ===== Topbar ===== */
.crm-topbar {
  height: 64px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,.75);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 15;
  min-width: 0;
}
.crm-burger {
  display: none; width: 36px; height: 36px; border-radius: 10px;
  background: #14141c; border: 1px solid var(--border); color: var(--text-2);
  align-items: center; justify-content: center; flex: none; cursor: pointer;
}
.crm-burger:hover { border-color: var(--border-2); color: var(--text); }
.crm-burger svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; pointer-events: none; }
.crm-crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.crm-crumbs b { color: var(--text); font-weight: 600; }
.crm-crumbs .sep { opacity: .5; }
.crm-search {
  display: flex; align-items: center; gap: 10px;
  background: #14141c; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; color: var(--text-3); font-size: 13px;
  flex: 1; max-width: 400px; min-width: 0;
  position: relative;
  transition: border-color .15s;
}
.crm-search:focus-within { border-color: var(--border-2); }
.crm-search svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.crm-search input {
  background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
  flex: 1; min-width: 0; padding: 0;
}
.crm-search input::placeholder { color: var(--text-3); }
.crm-search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #1a1922; border: 1px solid var(--border-2); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); z-index: 999; overflow: hidden;
}
.crm-search-dropdown.open { display: block; }
.crm-search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .1s;
  color: var(--text-2); font-size: 13px;
}
.crm-search-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.crm-search-item svg { flex: none; opacity: .55; }
.crm-search-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-search-item-sub { font-size: 11px; color: var(--muted); white-space: nowrap; margin-left: auto; padding-left: 8px; }
.crm-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.crm-pill {
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: #14141c; border: 1px solid var(--border);
  color: var(--text-2) !important; font-size: 13px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  cursor: pointer; transition: border-color .15s, color .15s;
  text-decoration: none;
}
.crm-pill:hover { border-color: var(--border-2); color: var(--text) !important; }
.crm-pill.primary {
  background: linear-gradient(180deg, var(--accent), #b3153a) !important;
  color: white !important; border-color: transparent !important;
  box-shadow: 0 6px 22px -8px rgba(225,29,72,.8);
}
.crm-pill.primary:hover { filter: brightness(1.05) !important; }
.crm-pill svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; pointer-events: none; }
.crm-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2b2b3a, #1a1a22);
  border: 1px solid var(--border-2);
  display: grid; place-items: center; font-size: 12px; color: var(--text-2);
  flex: none;
}
.crm-layout-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: #14141c; border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer;
}
.crm-layout-toggle:hover { border-color: var(--border-2); color: var(--text); }
.crm-layout-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; pointer-events: none; }

/* Keep existing logout-btn style override */
.crm-topbar .logout-btn {
  height: 36px !important; padding: 0 12px !important;
  background: linear-gradient(180deg, var(--accent), #b3153a) !important;
  color: white !important; border: none !important; border-radius: 10px !important;
  font-size: 13px !important; font-weight: 600 !important; cursor: pointer !important;
  box-shadow: 0 6px 22px -8px rgba(225,29,72,.8) !important;
  transition: filter .15s !important; transform: none !important;
  white-space: nowrap;
}
.crm-topbar .logout-btn:hover { filter: brightness(1.05) !important; transform: none !important; box-shadow: none !important; }

/* Currency selector in topbar */
.crm-topbar .currency-selector {
  height: 36px; padding: 0 10px;
  background: #14141c !important; border: 1px solid var(--border) !important;
  border-radius: 10px !important; color: var(--text-2) !important; font-size: 13px;
  cursor: pointer;
}
.crm-topbar .current-datetime {
  background: transparent !important; padding: 0 !important;
  font-size: 12px !important; color: var(--text-3) !important; border-radius: 0 !important;
  white-space: nowrap;
}
.crm-topbar #currentUser {
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}

/* ===== Top navigation (layout-top mode) ===== */
.crm-topnav {
  display: none;
  align-items: center; gap: 4px;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,.65);
  backdrop-filter: blur(8px);
  position: sticky; top: 64px; z-index: 14;
  overflow-x: auto; overflow-y: hidden;
  white-space: nowrap;
}
.crm-topnav::-webkit-scrollbar { height: 0; }
.crm-topnav-group {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 0 4px; position: relative;
}
.crm-topnav-group::after {
  content: ""; display: inline-block; width: 1px; height: 18px;
  background: var(--border); margin: 0 6px;
}
.crm-topnav-group:last-child::after { display: none; }
.crm-topnav .nav-tab {
  display: inline-flex !important; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px !important; border-radius: 8px !important;
  font-size: 13px !important; color: var(--text-2) !important; font-weight: 500 !important;
  cursor: pointer; position: relative;
  transition: background .15s, color .15s;
  background: transparent !important; border: none !important;
  white-space: nowrap;
}
.crm-topnav .nav-tab:hover { background: #14141c !important; color: var(--text) !important; }
.crm-topnav .nav-tab.active {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(225,29,72,.2), rgba(225,29,72,.08)) !important;
  box-shadow: inset 0 0 0 1px rgba(225,29,72,.3) !important;
}
.crm-topnav .nav-tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -9px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
  box-shadow: 0 0 10px var(--accent);
}
.crm-topnav .nav-tab svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; pointer-events: none; }
.crm-topnav .nav-tab span { pointer-events: none; }

/* ===== Page content area ===== */
.crm-page {
  padding: 28px 32px 56px;
  min-width: 0;
}
/* Old container stays with its padding but we override via crm-page parent */
.crm-page .container {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* Hide old nav-tabs bar */
.crm-page .nav-tabs {
  display: none !important;
}

/* ===== Override old header ===== */
.header { display: none !important; }

/* ===== Cards dark override ===== */
.card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  color: var(--text) !important;
}
.card h2, .card h3 { color: var(--text) !important; }

/* Stats grid cards — planet KPI style */
.stat-card {
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 20px !important;
  min-height: 140px !important;
  background: var(--surface) !important;
}
.stat-card > *:not(.kpi-orbit) { position: relative; z-index: 1; }
.stat-card .stat-label {
  font-size: 11px !important; letter-spacing: .14em !important;
  text-transform: uppercase !important; color: var(--text-3) !important;
  font-weight: 600 !important; padding-right: 68px !important;
}
.stat-card .stat-icon { display: none !important; }
.stat-card .stat-value {
  font-size: 26px !important; font-weight: 700 !important;
  letter-spacing: -.02em !important; margin-top: 10px !important;
  color: var(--text) !important; font-variant-numeric: tabular-nums !important;
}
.stat-card .stat-delta {
  margin-top: 8px !important; display: inline-flex !important;
  align-items: center !important; gap: 6px !important;
  font-size: 12px !important; color: var(--good) !important;
  background: var(--good-soft) !important;
  padding: 4px 8px !important; border-radius: 999px !important;
}
.stat-card .kpi-progress-note {
  font-size: 11px !important; color: var(--text-3) !important; margin-top: 12px !important;
}
/* tonal border */
.stat-card.income { border-color: rgba(225,29,72,.3) !important; }
.stat-card.margin { border-color: rgba(16,185,129,.3) !important; }
.stat-card.expenses { border-color: rgba(245,158,11,.3) !important; }
.stat-card.employees { border-color: rgba(59,130,246,.3) !important; }
.stat-card.forecast { border-color: rgba(139,92,246,.3) !important; }

/* ===== KPI planet orbit ring ===== */
.kpi-orbit {
  position: absolute !important; right: 16px; top: 16px;
  width: 58px; height: 58px;
  pointer-events: none;
}
.kpi-orbit .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.08);
}
.kpi-orbit .ring.progress {
  border: 0;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, black 60%);
          mask: radial-gradient(circle, transparent 58%, black 60%);
  filter: drop-shadow(0 0 8px rgba(225,29,72,.4));
}
.kpi-orbit .kpi-planet {
  position: absolute; inset: 10px; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 25%, #2b2b3a, #13131b 70%);
  display: grid; place-items: center; color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.kpi-orbit .kpi-planet svg {
  width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6;
}
/* color variants */
.kpi-orbit.income .ring.progress { background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), transparent 0); filter: drop-shadow(0 0 8px rgba(225,29,72,.4)); }
.kpi-orbit.margin .ring.progress { background: conic-gradient(var(--good) calc(var(--p, 0) * 1%), transparent 0); filter: drop-shadow(0 0 8px rgba(16,185,129,.4)); }
.kpi-orbit.expenses .ring.progress { background: conic-gradient(var(--warn) calc(var(--p, 0) * 1%), transparent 0); filter: drop-shadow(0 0 8px rgba(245,158,11,.4)); }
.kpi-orbit.employees .ring.progress { background: conic-gradient(var(--info) calc(var(--p, 0) * 1%), transparent 0); filter: drop-shadow(0 0 8px rgba(59,130,246,.4)); }
.kpi-orbit.forecast .ring.progress { background: conic-gradient(#8b5cf6 calc(var(--p, 0) * 1%), transparent 0); filter: drop-shadow(0 0 8px rgba(139,92,246,.4)); }

/* Tables */
table thead th {
  background: var(--surface-3) !important;
  color: var(--text-3) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 11px !important; letter-spacing: .08em !important; text-transform: uppercase !important;
}
table tbody tr { background: transparent !important; }
table tbody tr:hover td { background: rgba(255,255,255,.03) !important; }
table tbody td {
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
  background: transparent !important;
}
table tbody tr:last-child td { border-bottom: 0 !important; }

/* Forms */
.form-group label { color: var(--text-2) !important; font-size: 12px !important; }
.form-group input,
.form-group select,
.form-group textarea,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="month"],
input[type="date"],
select, textarea {
  background: var(--bg-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-family: inherit !important;
}
input::placeholder, textarea::placeholder { color: var(--text-3) !important; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  outline: none !important;
}
select option { background: var(--surface-2) !important; color: var(--text) !important; }

/* Calendar/date picker icon — invisible (dark on dark) by default in the theme.
   Note: filter and background-color must not be combined here — invert() also
   inverts an opaque/tinted background, which turned the icon into an unreadable
   dark teal blob. drop-shadow only outlines the icon's own pixels, so it is safe
   to combine with invert(). */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.6) !important;
  cursor: pointer !important;
  border-radius: 5px !important;
  padding: 3px !important;
  transition: filter .15s !important;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) brightness(1.6) drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 3px var(--accent)) !important;
}

/* Buttons */
.btn {
  background: linear-gradient(180deg, var(--accent), #b3153a) !important;
  border: none !important; border-radius: 8px !important;
  color: white !important; font-family: inherit !important;
  box-shadow: 0 4px 14px -4px rgba(225,29,72,.6) !important;
  transition: filter .15s !important;
}
.btn:hover { filter: brightness(1.08) !important; background: linear-gradient(180deg, var(--accent), #b3153a) !important; }
.btn-edit {
  background: linear-gradient(180deg, #10b981, #059669) !important;
  box-shadow: 0 4px 14px -4px rgba(16,185,129,.5) !important;
}
.btn-edit:hover { filter: brightness(1.08) !important; background: linear-gradient(180deg, #10b981, #059669) !important; }
.btn-small { padding: 6px 12px !important; font-size: 12px !important; }

/* Modals */
.modal { background: rgba(0,0,0,.7) !important; }
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: 16px !important;
  color: var(--text) !important;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7) !important;
}
.modal-content h2 { color: var(--text) !important; }
.modal-content .close { color: var(--text-3) !important; }
.modal-content .close:hover { color: var(--text) !important; }

/* Progress bars */
.progress-bar { background: var(--surface-3) !important; border-radius: 999px !important; }
.progress-fill { border-radius: 999px !important; }

/* Goals section */
.goals-section { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; }
.goals-section h3 { color: var(--text) !important; }
.goal-item { background: var(--surface-3) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; }

/* CEO notes */
.ceo-notes { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; }
.ceo-notes h3 { color: var(--text) !important; }
.ceo-notes-content { color: var(--text-2) !important; }

/* Error/success messages */
.error-message { color: var(--accent-2) !important; }
.success-message { color: var(--good) !important; }

/* Chart containers */
.chart-container { background: transparent !important; }

/* AI period/group buttons */
.ai-period-btn, .ai-group-btn {
  background: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
  border-radius: 8px !important;
}
.ai-period-btn.active, .ai-group-btn.active {
  background: var(--accent-soft) !important;
  border-color: rgba(225,29,72,.4) !important;
  color: #fff !important;
}

/* Date filter buttons */
.date-filter-btn {
  background: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
  border-radius: 8px !important;
}
.date-filter-btn.active {
  background: var(--accent-soft) !important;
  border-color: rgba(225,29,72,.4) !important;
  color: #fff !important;
}

/* Chart filter selects */
.chart-filter-select {
  background: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-2) !important;
  border-radius: 8px !important;
}

/* Card headers */
.card-header { border-bottom: 1px solid var(--border) !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Profile redesign (Личный кабинет) ===== */
@keyframes pfSpin { to { transform: rotate(360deg); } }
@keyframes pfHeroIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.pfc-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 24px 28px; border-radius: 18px;
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(225,29,72,.22), transparent 55%),
    linear-gradient(180deg, rgba(22,22,30,.92), rgba(12,12,18,.95));
  border: 1px solid var(--border-2);
  margin-bottom: 20px;
  animation: pfHeroIn .5s cubic-bezier(.22,1,.36,1) both;
}
.pfc-orbit {
  position: absolute; right: -80px; top: 50%; width: 300px; height: 300px; border-radius: 50%;
  border: 1px dashed rgba(225,29,72,.22);
  transform: translateY(-50%);
  animation: pfSpin 60s linear infinite; pointer-events: none;
}
.pfc-orbit.o2 {
  width: 200px; height: 200px; right: -30px;
  border-color: rgba(255,255,255,.06);
  animation: pfSpin 35s linear infinite reverse;
}
.pfc-hero-l { position: relative; z-index: 1; }
.pfc-name { font-size: 26px; font-weight: 600; letter-spacing: -.015em; line-height: 1.1; color: var(--text); }
.pfc-role { font-size: 11.5px; color: var(--accent-2); letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; font-weight: 500; }
.pfc-since { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.pfc-month-bar {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.pfc-month-bar svg { color: var(--text-3); flex-shrink: 0; }
.pfc-month-bar select {
  background: transparent; border: none; color: var(--text); font: inherit;
  cursor: pointer; outline: none; padding: 0;
}
.pfc-month-bar select option { background: #0f0f17; }
.pfc-hero-r {
  position: relative; z-index: 1;
  display: flex; gap: 28px; align-items: flex-start;
  padding: 14px 22px;
  background: rgba(0,0,0,.25); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 14px;
}
.pfc-kv { display: flex; flex-direction: column; }
.pfc-kv .k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.pfc-kv .v { font-size: 18px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text); }
.pfc-kv .v.accent { color: var(--good); }
.pfc-kv .t { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.pfc-ach-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.pfc-ach {
  position: relative; overflow: hidden;
  padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(20,20,28,.7), rgba(10,10,15,.85));
  border: 1px solid var(--border-2);
  display: flex; flex-direction: column;
  transition: border-color .25s ease, transform .25s ease;
}
.pfc-ach:hover { border-color: rgba(225,29,72,.4); transform: translateY(-1px); }
.pfc-ach::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 65%); opacity: .12; pointer-events: none;
}
.pfc-ach .ic {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border-2); color: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.pfc-ach .ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pfc-ach .lab { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-top: 12px; }
.pfc-ach .big { font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text); }
.pfc-ach .big .u { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: 0; text-transform: none; }
.pfc-ach .sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.4; }

.pfc-chart {
  background: linear-gradient(180deg, rgba(20,20,28,.7), rgba(12,12,18,.85));
  border: 1px solid var(--border-2);
  border-radius: 14px; padding: 16px 18px 8px; margin-bottom: 20px;
}
.pfc-chart-h { display: flex; align-items: center; gap: 10px 14px; margin-bottom: 8px; flex-wrap: wrap; }
.pfc-chart-h .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex-shrink: 0; }
.pfc-chart-h h4 { margin: 0; font-size: 13.5px; font-weight: 600; }
.pfc-chart-h .sub { font-size: 11.5px; color: var(--text-3); }

.info-table {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px 0; overflow: hidden; margin-top: 0; margin-bottom: 20px;
}
.info-row {
  display: grid; grid-template-columns: 220px 1fr;
  padding: 14px 22px; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--text-2); align-self: center; }
.info-row .v { color: var(--text); font-weight: 500; }

@media (max-width: 1100px) {
  .pfc-ach-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .pfc-hero { grid-template-columns: 1fr; padding: 18px 20px; }
  .pfc-hero-r { padding: 12px 16px; gap: 18px; flex-wrap: wrap; }
  .pfc-orbit { display: none; }
  .pfc-name { font-size: 22px; }
  .pfc-ach .big { font-size: 20px; }
}
@media (max-width: 600px) {
  .pfc-hero-r { flex-direction: column; gap: 10px; align-items: stretch; }
  .pfc-kv { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
  .pfc-kv .k { margin: 0; }
  .pfc-kv .v { font-size: 15px; margin-top: 0; }
  .pfc-kv .t { display: none; }
  .pfc-ach { padding: 14px; }
  .info-row { grid-template-columns: 1fr; padding: 12px 16px; gap: 4px; }
}

/* ===== Mobile responsive ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr !important; }
  .crm-sidebar {
    position: fixed !important; left: 0; top: 0; height: 100vh; width: 280px;
    transform: translateX(-100%); transition: transform .25s ease;
    z-index: 60 !important; box-shadow: 0 20px 60px -10px rgba(0,0,0,.7);
  }
  .crm-sidebar.open { transform: translateX(0); }
  .crm-burger { display: inline-flex !important; }
  .crm-topbar { padding: 0 14px !important; gap: 10px !important; height: 58px !important; }
  .crm-search { display: none !important; }
  .crm-topbar .current-datetime { display: none !important; }
  .crm-layout-toggle { display: none !important; }
  .crm-page { padding: 16px 14px 48px !important; }
  .app.layout-top .crm-topnav { display: none !important; }
}
@media (max-width: 520px) {
  .crm-crumbs span:first-child, .crm-crumbs .sep { display: none; }
  .stats-grid { grid-template-columns: 1fr !important; }
}

/* Inline-редактируемые ячейки таблиц (долги, поступления) */
.inline-edit {
  display: inline-block;
  min-width: 40px;
  padding: 2px 6px;
  border-radius: 4px;
  outline: none;
  cursor: text;
}
.inline-edit:hover { background: rgba(255,255,255,0.06); }
.inline-edit:focus { background: rgba(99,102,241,0.15); box-shadow: 0 0 0 1px rgba(99,102,241,0.5); }
.rate-mismatch .inline-edit, td.rate-mismatch {
  background: rgba(255,152,0,0.12);
  box-shadow: 0 0 0 1px rgba(255,152,0,0.4) inset;
}
