/* =============================================
   Catalyst CRM — Main Stylesheet
   Modern dark theme · 2026
   ============================================= */

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

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

:root {
  --bg:          #07070f;
  --surface:     #0d0d1a;
  --surface2:    #13132200;
  --surface2-solid: #131322;
  --border:      #1c1c2e;
  --border-bright: #282840;
  --accent:      #e8820c;
  --accent-h:    #f59332;
  --accent-dim:  rgba(232, 130, 12, 0.12);
  --accent-glow: rgba(232, 130, 12, 0.25);
  --danger:      #f43f5e;
  --success:     #10b981;
  --warn:        #f59e0b;
  --text:        #e4e4f0;
  --text-2:      #9898b4;
  --muted:       #55557a;
  --sidebar-w:   232px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,.55);
  --shadow-lg:   0 8px 48px rgba(0,0,0,.7);
  --glass-bg:    rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.06);
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-h); }

/* ──────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* ──────────────────────────────────────────
   SIDEBAR
   ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Ambient glow at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(232,130,12,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), #b85e00);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.05em;
}

.sidebar-tenant {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.sidebar-tenant .tenant-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 2px;
}

.sidebar-tenant .tenant-user {
  color: var(--text-2);
  font-size: 12px;
}

/* Sidebar user avatar row */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #b85e00);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info .user-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-info .user-role { font-size: 10px; color: var(--muted); }

nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

nav a, nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: color .15s, background .15s;
  border-left: 2px solid transparent;
  margin: 1px 0;
}

nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); border-left-color: transparent; }

nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  border-left: 2px solid var(--accent);
}

nav a .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

nav .nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 8px 18px 4px;
  margin-top: 4px;
}

nav .nav-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

nav > div { white-space: nowrap; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ──────────────────────────────────────────
   MAIN CONTENT
   ────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,7,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.topbar .actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 28px; flex: 1; }

/* ──────────────────────────────────────────
   CARDS
   ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s;
}

.card:hover { border-color: var(--border-bright); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text); letter-spacing: -0.1px; }

/* Glass variant */
.card-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ──────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: opacity .15s, background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-bright);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 12px rgba(244,63,94,0.3);
}

.btn-danger:hover:not(:disabled) {
  background: #fb5370;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ──────────────────────────────────────────
   FORMS
   ────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input::placeholder, textarea::placeholder { color: var(--muted); }

input:hover, select:hover, textarea:hover {
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.05);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { resize: vertical; min-height: 80px; }
select option { background: var(--surface2-solid); }

/* ──────────────────────────────────────────
   TABLE
   ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  cursor: pointer;
  transition: background .12s;
}

tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ──────────────────────────────────────────
   BADGES
   ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-blue   { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-green  { background: rgba(16,185,129,.15); color: #34d399; }
.badge-red    { background: rgba(244,63,94,.15);  color: #fb7185; }
.badge-orange { background: rgba(232,130,12,.18); color: #f59332; }
.badge-gray   { background: rgba(255,255,255,.07); color: var(--text-2); }
.badge-purple { background: rgba(168,85,247,.15);  color: #c084fc; }

/* ──────────────────────────────────────────
   ALERTS
   ────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  border-width: 1px;
  border-style: solid;
}

.alert-error   { background: rgba(244,63,94,.1);   border-color: rgba(244,63,94,.25);  color: #fb7185; }
.alert-success { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.25); color: #34d399; }
.alert-warn    { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.25); color: #fbbf24; }

/* ──────────────────────────────────────────
   STAT CARDS
   ────────────────────────────────────────── */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }

.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background .2s;
}

.stat-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

.stat-card:hover::after {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.green .stat-value  { color: var(--success); }
.stat-card.blue .stat-value   { color: #818cf8; }

/* ──────────────────────────────────────────
   PIPELINE
   ────────────────────────────────────────── */
.pipeline {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}

.pipeline-col {
  min-width: 230px;
  width: 230px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.pipeline-col-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-col-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.pipeline-col-header .col-meta { font-size: 11px; color: var(--muted); }

.pipeline-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 60px;
}

.deal-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.deal-card:hover {
  border-color: var(--accent);
  background: rgba(232,130,12,0.05);
  box-shadow: 0 2px 12px rgba(232,130,12,0.12);
}

.deal-card .deal-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.deal-card .deal-meta  { font-size: 11px; color: var(--text-2); }
.deal-card .deal-value { font-size: 13px; font-weight: 700; color: var(--success); margin-top: 6px; }

/* ──────────────────────────────────────────
   LOGIN PAGE
   ────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Ambient orbs */
.login-wrap::before,
.login-wrap::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-wrap::before {
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  background: radial-gradient(circle, rgba(232,130,12,0.08) 0%, transparent 60%);
}

.login-wrap::after {
  width: 400px; height: 400px;
  bottom: -100px; right: -50px;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 60%);
}

.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  z-index: 1;
}

.login-left-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 60px;
}

.login-left-brand .brand-mark {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #b85e00);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.login-left-brand .brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-left-brand .brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.login-headline {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  max-width: 440px;
  margin-bottom: 20px;
}

.login-headline span { color: var(--accent); }

.login-tagline {
  font-size: 15px;
  color: var(--text-2);
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.login-feature-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

.login-right {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.login-right::before {
  content: '';
  position: absolute;
  inset: 0;
  border-left: 1px solid var(--border);
  pointer-events: none;
}

.login-box {
  width: 100%;
  max-width: 380px;
}

.login-box-header {
  margin-bottom: 32px;
}

.login-box-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-box-header p {
  font-size: 14px;
  color: var(--text-2);
}

.login-box .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.login-box input {
  padding: 11px 14px;
  font-size: 14px;
  background: rgba(255,255,255,0.04);
}

.login-box .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
}

.login-footer-note {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ──────────────────────────────────────────
   DETAIL VIEW
   ────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.detail-field label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.detail-field .val { font-size: 14px; }

/* ──────────────────────────────────────────
   SEARCH BAR
   ────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input { max-width: 300px; }

/* ──────────────────────────────────────────
   EMPTY STATE
   ────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}

.empty .empty-icon {
  font-size: 36px;
  margin-bottom: 14px;
  opacity: 0.5;
}

.empty h3 { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty p { font-size: 13px; }

/* ──────────────────────────────────────────
   MODAL
   ────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.modal-body { padding: 20px 22px; }

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ──────────────────────────────────────────
   TABS
   ────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ──────────────────────────────────────────
   TOGGLE SWITCH
   ────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

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

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

.toggle-switch input:checked + .toggle-slider { background: rgba(34,197,94,.2); border-color: rgba(34,197,94,.4); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: #4ade80; }

/* ──────────────────────────────────────────
   STATUS PILL
   ────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-pill.active   { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.status-pill.inactive { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* ──────────────────────────────────────────
   MODAL CLOSE BUTTON
   ────────────────────────────────────────── */
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  font-family: inherit;
  transition: color .15s;
  flex-shrink: 0;
}

.modal-close:hover { color: var(--text); }

/* ──────────────────────────────────────────
   BULK ACTION TOOLBAR
   ────────────────────────────────────────── */
.bulk-toolbar {
  display: none;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-count { font-size: 13px; font-weight: 600; color: var(--accent); }

/* Compact inputs inside bulk toolbar */
.bulk-toolbar select,
.bulk-toolbar input[type="text"] {
  width: auto;
  min-width: 100px;
  padding: 5px 10px;
  font-size: 12px;
}

/* ──────────────────────────────────────────
   ACTIVITY FEED
   ────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.act-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--surface2);
}

.act-icon.note  { background: rgba(99,102,241,.15); }
.act-icon.call  { background: rgba(34,197,94,.15); }
.act-icon.email { background: rgba(245,158,11,.15); }

.act-body { flex: 1; min-width: 0; }
.act-subject { font-size: 13px; font-weight: 600; }
.act-content { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.act-meta    { font-size: 11px; color: var(--muted); margin-top: 3px; }

.act-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
}

.act-del:hover { color: var(--danger); }

/* Log activity form */
.log-form { display: flex; flex-direction: column; gap: 10px; }
.log-type-row { display: flex; gap: 8px; flex-wrap: wrap; }

.type-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.type-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ──────────────────────────────────────────
   QUICK LINKS
   ────────────────────────────────────────── */
.quick-link-row { display: flex; flex-wrap: wrap; gap: 10px; }

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}

.quick-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ──────────────────────────────────────────
   SECTION TITLE (text label above content)
   ────────────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

/* ──────────────────────────────────────────
   SECTION ROW (title + action)
   ────────────────────────────────────────── */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-row h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; }

/* ──────────────────────────────────────────
   BREADCRUMB
   ────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--muted); }

/* ──────────────────────────────────────────
   SCROLLBAR
   ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }

/* ──────────────────────────────────────────
   RESPONSIVE — TABLET
   ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .topbar { padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .content { padding: 20px; }
  .login-right { width: 420px; padding: 32px; }
  .login-left { padding: 40px; }
  .login-headline { font-size: 32px; }
  .modal { width: 90vw; }
}

@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right {
    width: 100%;
    border-left: none;
    padding: 40px 24px;
  }
  .login-right::before { display: none; }
  .login-box { max-width: 400px; margin: 0 auto; }
}

/* ──────────────────────────────────────────
   RESPONSIVE — MOBILE
   ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }

  .sidebar { width: 60px; }
  .sidebar-logo { padding: 14px 10px; }
  .sidebar-logo .logo-text, .sidebar-logo .logo-sub,
  .sidebar-tenant, nav a span:last-child, .sidebar-footer .btn span { display: none; }
  .sidebar-tenant { display: none; }
  .sidebar-user .user-info { display: none; }
  nav a { justify-content: center; padding: 10px 8px; }
  nav a .nav-icon { font-size: 17px; width: 22px; }
  nav .nav-section-label, nav .nav-divider { display: none; }

  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar .actions { flex-wrap: wrap; }

  .content { padding: 16px; }

  .detail-grid { grid-template-columns: 1fr; }
  .stats { gap: 12px; }
  .stat-card { min-width: 80px; padding: 14px 16px; }
  .stat-card .stat-value { font-size: 22px; }

  .card { padding: 14px; }
  .card + .card { margin-top: 12px; }

  .btn { padding: 7px 12px; font-size: 12px; }
  .btn-sm { padding: 4px 8px; font-size: 11px; }

  table { font-size: 12px; }
  th { padding: 8px 10px; font-size: 10px; }
  td { padding: 10px 10px; }

  .search-bar { flex-wrap: wrap; }
  .search-bar input { max-width: 100%; }

  .modal { width: 95vw; }
}

/* ──────────────────────────────────────────
   RESPONSIVE — SMALL MOBILE
   ────────────────────────────────────────── */
@media (max-width: 599px) {
  body { font-size: 13px; }

  :root { --sidebar-w: 50px; }

  .sidebar { width: 50px; }
  .sidebar-logo { padding: 12px 6px; }
  nav a { padding: 8px 6px; }
  nav a .nav-icon { font-size: 16px; width: 20px; }

  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; padding: 0; }
  .sidebar::before { display: none; }
  .sidebar-logo { border-right: 1px solid var(--border); border-bottom: none; padding: 10px 12px; }
  .sidebar-tenant { display: none; }
  nav { flex: 0; padding: 0; overflow-x: auto; display: flex; }
  nav a {
    border-left: none !important;
    border-bottom: 2px solid transparent;
    padding: 10px 12px;
    white-space: nowrap;
  }
  nav a.active {
    border-left: none !important;
    border-bottom: 2px solid var(--accent);
    background: transparent;
  }
  nav a span:last-child { display: none; }
  .sidebar-footer { display: none; }

  .main { height: auto; overflow: visible; }

  .topbar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .topbar h1 { font-size: 14px; }
  .topbar .actions { width: 100%; flex-direction: column; }
  .topbar .actions .btn { width: 100%; }

  .content { padding: 12px; }

  .form-group { margin-bottom: 14px; }
  input, select, textarea { padding: 9px 10px; font-size: 13px; }
  textarea { min-height: 60px; }

  .card { padding: 12px; border-radius: 8px; }
  .card + .card { margin-top: 10px; }
  .card-title { font-size: 13px; margin-bottom: 10px; }

  .btn { padding: 6px 10px; font-size: 11px; gap: 4px; }
  .btn-sm { padding: 4px 8px; font-size: 10px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; }
  th { padding: 7px 8px; font-size: 9px; }
  td { padding: 8px; }

  .badge { padding: 2px 6px; font-size: 10px; }
  .alert { padding: 8px 10px; font-size: 12px; margin-bottom: 10px; }

  .empty { padding: 28px 12px; }
  .empty .empty-icon { font-size: 28px; margin-bottom: 8px; }
  .empty p { font-size: 12px; }

  .modal-backdrop { padding: 12px; }
  .modal { width: 100%; max-width: 100%; max-height: 90vh; border-radius: 10px; }
  .modal-header { padding: 14px 14px 10px; }
  .modal-header h2 { font-size: 14px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 14px; gap: 6px; }

  .stats { gap: 10px; }
  .stat-card { flex: 1; min-width: 70px; padding: 12px 14px; border-radius: 8px; }
  .stat-card .stat-label { font-size: 9px; }
  .stat-card .stat-value { font-size: 18px; }

  .pipeline { gap: 8px; padding-bottom: 8px; }
  .pipeline-col { min-width: 160px; width: 160px; border-radius: 8px; }
  .pipeline-col-header { padding: 10px 12px 8px; }
  .pipeline-col-header h3 { font-size: 11px; }
  .pipeline-cards { padding: 8px; gap: 6px; }
  .deal-card { padding: 8px 10px; }
  .deal-card .deal-title { font-size: 12px; }
  .deal-card .deal-meta { font-size: 10px; }
  .deal-card .deal-value { font-size: 12px; }

  .detail-grid, .info-grid { grid-template-columns: 1fr; }
  .info-field label { font-size: 10px; }
  .info-field .val { font-size: 13px; }

  .search-bar { flex-direction: column; margin-bottom: 12px; }
  .search-bar input { max-width: 100%; width: 100%; }

  .activity-item { gap: 8px; padding: 8px 0; }
  .act-icon { width: 24px; height: 24px; font-size: 11px; }
  .act-subject { font-size: 12px; }
  .act-content { font-size: 11px; }
  .act-meta { font-size: 10px; }

  .log-form { gap: 8px; }
  .log-type-row { gap: 6px; }
  .type-btn { padding: 4px 10px; font-size: 11px; }
}

/* ──────────────────────────────────────────
   LEAD SCORE BADGE
   ────────────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.score-badge.score-cold  { background: rgba(255,255,255,0.06); color: var(--muted); }
.score-badge.score-warm  { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.score-badge.score-hot   { background: rgba(249,115,22,0.18);  color: #f97316; }
.score-badge.score-fire  { background: rgba(239,68,68,0.18);   color: #ef4444; }

/* Overdue deal card highlight */
.deal-card-overdue {
  border-color: rgba(244,63,94,0.35) !important;
}
.deal-card-overdue:hover {
  border-color: var(--danger) !important;
}
