/* ============================================================
   Incloudia One - Design System & Global Styles
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --success: #198754;
  --warning: #fd7e14;
  --danger: #dc3545;
  --purple: #6f42c1;
  --teal: #0dcaf0;
  --sidebar-w: 240px;
  --sidebar-bg: #1e2a3a;
  --topbar-h: 60px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
  --transition: 0.2s ease;
}

html, body { height: 100%; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }

a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---- App Layout ---- */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition);
  overflow: hidden;
  z-index: 100;
}
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon { font-size: 22px; }
.logo-text { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 18px; flex-shrink: 0; }
.nav-label { font-size: 13.5px; font-weight: 500; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.5); font-size: 11px; }
.btn-logout { background: none; border: none; color: rgba(255,255,255,.5); font-size: 18px; padding: 4px; border-radius: 6px; transition: all var(--transition); }
.btn-logout:hover { color: var(--danger); background: rgba(220,53,69,.15); }

/* ---- Topbar ---- */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.sidebar-toggle { background: none; border: none; font-size: 20px; color: var(--text-muted); padding: 6px; border-radius: 6px; }
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; pointer-events: none; }
#global-search { width: 100%; padding: 8px 12px 8px 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13.5px; outline: none; transition: all var(--transition); }
#global-search:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(13,110,253,.1); }
.topbar-actions { display: flex; gap: 4px; margin-left: auto; }
.btn-icon { background: none; border: none; font-size: 18px; padding: 8px; border-radius: 8px; color: var(--text-muted); transition: all var(--transition); }
.btn-icon:hover { background: var(--bg); color: var(--text); }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ---- Page Header ---- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500; border: none; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,110,253,.3); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-action { background: none; border: none; padding: 4px 6px; border-radius: 6px; font-size: 15px; opacity: 0.7; transition: all var(--transition); }
.btn-action:hover { opacity: 1; background: var(--bg); }
.btn-action.btn-delete:hover { background: rgba(220,53,69,.1); }
.btn-action.btn-convert:hover { background: rgba(25,135,84,.1); }
.action-btns { display: flex; gap: 2px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; flex: 1; min-width: 0; }
.form-row { display: flex; gap: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13.5px; color: var(--text);
  background: var(--surface); outline: none; transition: all var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }
.form-control-sm { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 13px; color: var(--text); background: var(--surface); outline: none; }
.form-control-sm:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; }
.form-error { color: var(--danger); font-size: 13px; padding: 8px 12px; background: rgba(220,53,69,.08); border-radius: 6px; margin-bottom: 12px; }

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-icon-sm { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; pointer-events: none; }
.search-input { width: 100%; padding: 8px 12px 8px 32px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--surface); outline: none; transition: all var(--transition); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }

/* ---- Table ---- */
.table-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: #f8fafc; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-row { transition: background var(--transition); cursor: pointer; }
.table-row:hover { background: #f8fafc; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary); }
.col-actions { text-align: right; width: 80px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px !important; }
.empty-state a { cursor: pointer; }
.empty-state-full { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-full p { margin-bottom: 16px; font-size: 15px; }
.empty-state-sm { color: var(--text-muted); font-size: 13px; padding: 8px 0; }

.cell-with-avatar { display: flex; align-items: center; gap: 10px; }
.cell-primary { font-weight: 500; color: var(--text); }
.cell-secondary { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }

/* ---- Avatar ---- */
.avatar { border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-lead { background: linear-gradient(135deg, var(--warning), var(--danger)); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-success { background: rgba(25,135,84,.12); color: var(--success); }
.badge-secondary { background: rgba(108,117,125,.12); color: #6c757d; }
.badge-danger { background: rgba(220,53,69,.12); color: var(--danger); }
.badge-warning { background: rgba(253,126,20,.12); color: var(--warning); }
.badge-info { background: rgba(13,202,240,.12); color: #0dcaf0; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.badge-priority { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ---- KPI Cards ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition);
  border-left: 4px solid transparent;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-blue  { border-left-color: var(--primary); }
.kpi-purple{ border-left-color: var(--purple); }
.kpi-green { border-left-color: var(--success); }
.kpi-orange{ border-left-color: var(--warning); }
.kpi-teal  { border-left-color: var(--teal); }
.kpi-red   { border-left-color: var(--danger); }
.kpi-icon { font-size: 28px; flex-shrink: 0; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kpi-trend { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.trend-up { color: var(--success); }
.trend-warn { color: var(--warning); }

/* ---- Mini Stats ---- */
.mini-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.mini-stat { background: var(--surface); border-radius: var(--radius); padding: 14px 20px; min-width: 110px; flex: 1; text-align: center; box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition); }
.mini-stat:hover { box-shadow: var(--shadow-md); }
.mini-stat-count { font-size: 24px; font-weight: 700; color: var(--text); }
.mini-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.text-blue { color: var(--primary) !important; }
.text-green { color: var(--success) !important; }
.text-red { color: var(--danger) !important; }

/* ---- Charts ---- */
.charts-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.chart-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chart-large { flex: 2; min-width: 320px; }
.chart-small { flex: 1; min-width: 220px; }
.chart-medium { flex: 1.5; min-width: 280px; }
.chart-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 15px; font-weight: 600; color: var(--text); }
.chart-subtitle { font-size: 12px; color: var(--text-muted); }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 12.5px; color: var(--text-muted); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; transition: width .6s ease; min-width: 30px; }
.bar-count { font-size: 11px; color: #fff; font-weight: 600; }
.bar-value { font-size: 12px; color: var(--text-muted); width: 80px; text-align: right; flex-shrink: 0; }

/* Line chart */
.line-chart { width: 100%; }
.line-svg { width: 100%; height: 150px; }
.line-labels { display: flex; justify-content: space-between; padding: 4px 10px 0; }
.line-labels span { font-size: 11px; color: var(--text-muted); }

/* Funnel */
.funnel-chart { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.funnel-stage { border-radius: 4px; padding: 8px 12px; color: #fff; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 500; transition: width .4s ease; }
.funnel-label { }
.funnel-count { font-weight: 700; font-size: 14px; }

/* Donut */
.donut-chart { display: flex; justify-content: center; padding: 8px 0; }
.donut-svg { width: 120px; height: 120px; }
.donut-center { font-size: 18px; font-weight: 700; fill: var(--text); }
.donut-legend { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ---- Bottom Row Widgets ---- */
.bottom-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.widget-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget-large { flex: 2; min-width: 300px; }
.widget-small { flex: 1; min-width: 200px; }
.widget-medium { flex: 1.5; min-width: 240px; }
.widget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.widget-title { font-size: 14px; font-weight: 600; }
.widget-link { font-size: 12.5px; color: var(--primary); cursor: pointer; }

/* Activity list */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-badge { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; background: var(--bg); }
.activity-desc { font-size: 13.5px; font-weight: 500; color: var(--text); }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Task list (widget) ---- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; align-items: flex-start; gap: 10px; }
.task-check { padding-top: 2px; }
.check-box { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; transition: all var(--transition); }
.check-box.checked { background: var(--success); border-color: var(--success); }
.task-title-text { font-size: 13.5px; font-weight: 500; }
.task-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.task-due { font-size: 11.5px; color: var(--text-muted); }
.task-due.overdue { color: var(--danger); font-weight: 600; }

/* Deals mini list */
.deals-mini-list { display: flex; flex-direction: column; gap: 8px; }
.deal-mini-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.deal-mini-item:last-child { border-bottom: none; }
.deal-mini-name { font-size: 13.5px; font-weight: 500; }
.deal-mini-stage { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.deal-mini-value { font-size: 13.5px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--surface); border-radius: 14px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity:0; transform: scale(.95) translateY(-10px); } to { opacity:1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-muted); line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-form { padding: 20px 24px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; }

/* ---- Detail View ---- */
.detail-view { padding: 20px 24px 24px; }
.detail-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.detail-hero-info { flex: 1; }
.detail-hero-info h2 { font-size: 20px; font-weight: 700; }
.detail-hero-info p { color: var(--text-muted); margin-top: 3px; font-size: 13.5px; }
.detail-hero-info > * { margin-top: 6px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.detail-section { margin-bottom: 16px; }
.detail-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 10px; }
.detail-field { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; gap: 12px; }
.detail-field > span:first-child { color: var(--text-muted); flex-shrink: 0; }
.notes-text { font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.account-logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.account-logo-lg { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; }

/* ---- Toast ---- */
#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { background: #1e2a3a; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500; transform: translateX(120%); transition: transform .3s ease; box-shadow: var(--shadow-lg); max-width: 320px; }
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-error { border-left: 4px solid var(--danger); }

/* ---- Auth ---- */
.auth-body { background: linear-gradient(135deg, #0d1b2a 0%, #1e2a3a 100%); }
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--surface); border-radius: 20px; padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { font-size: 40px; margin-bottom: 8px; }
.auth-logo-text { font-size: 26px; font-weight: 800; color: var(--text); }
.auth-tagline { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-form-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; text-align: center; }
.auth-demo-hint { text-align: center; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.auth-demo-hint code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-family: monospace; }
.social-divider { display: flex; align-items: center; text-align: center; margin: 18px 0; color: var(--text-muted); font-size: 12px; }
.social-divider::before, .social-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.social-divider span { padding: 0 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.social-buttons { display: flex; gap: 10px; margin-bottom: 16px; }
.btn-social { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: background .15s ease, border-color .15s ease; }
.btn-social:hover { background: var(--bg); border-color: var(--primary); }
.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }


/* ---- Kanban ---- */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column { min-width: 240px; max-width: 260px; flex-shrink: 0; background: #f0f2f5; border-radius: 12px; display: flex; flex-direction: column; }
.kanban-column.drag-over { background: rgba(13,110,253,.06); outline: 2px dashed var(--primary); }
.kanban-col-header { padding: 14px 14px 10px; }
.kanban-col-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.kanban-col-meta { display: flex; gap: 8px; align-items: center; }
.kanban-count { font-size: 12px; background: var(--border); padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.kanban-value { font-size: 12px; color: var(--text-muted); }
.kanban-cards { flex: 1; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: calc(100vh - 320px); }
.kanban-card {
  background: var(--surface); border-radius: 10px; padding: 12px;
  box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition);
  border: 1px solid var(--border); position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.card-overdue { border-left: 3px solid var(--danger); }
.kanban-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-value { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.kanban-card-contact { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.kanban-card-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.probability-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; min-width: 40px; }
.prob-fill { height: 100%; background: var(--primary); border-radius: 2px; }
.prob-label { font-size: 11px; color: var(--text-muted); }
.close-date { font-size: 11px; color: var(--text-muted); }
.close-date.overdue { color: var(--danger); }
.kanban-card-actions { display: flex; gap: 4px; position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity var(--transition); }
.kanban-card:hover .kanban-card-actions { opacity: 1; }
.kanban-card-actions button { background: var(--bg); border: none; border-radius: 6px; padding: 3px 5px; font-size: 13px; }
.kanban-add { color: var(--text-muted); font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: all var(--transition); text-align: center; }
.kanban-add:hover { background: rgba(13,110,253,.08); color: var(--primary); }

/* ---- View Toggle ---- */
.view-toggle { display: flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; }
.btn-view { background: none; border: none; padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.btn-view.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Accounts Grid ---- */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.account-card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition); }
.account-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.account-card-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.account-card-info { flex: 1; min-width: 0; }
.account-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.account-actions { display: flex; gap: 2px; }
.account-stats { display: flex; gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.account-stat { flex: 1; text-align: center; padding: 10px 4px; }
.account-stat:not(:last-child) { border-right: 1px solid var(--border); }
.account-stat-val { font-size: 16px; font-weight: 700; color: var(--text); }
.account-stat-lbl { font-size: 11px; color: var(--text-muted); }
.account-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.account-phone { font-size: 12.5px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { background: none; border: none; padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--text); }

/* ---- Task Cards ---- */
.task-cards { display: flex; flex-direction: column; gap: 8px; }
.task-card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow); transition: all var(--transition); }
.task-card:hover { box-shadow: var(--shadow-md); }
.task-card.task-done { opacity: .6; }
.task-card.task-overdue { border-left: 3px solid var(--danger); }
.task-card-check { padding-top: 2px; flex-shrink: 0; }
.check-circle { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
.check-circle.checked { background: var(--success); border-color: var(--success); }
.check-circle.checked::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.task-card-body { flex: 1; min-width: 0; }
.task-card-title { font-size: 14px; font-weight: 500; color: var(--text); }
.task-card-title.line-through { text-decoration: line-through; color: var(--text-muted); }
.task-card-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.task-type-badge { font-size: 12px; color: var(--text-muted); }
.task-related { font-size: 12px; color: var(--text-muted); }
.task-card-due { flex-shrink: 0; text-align: right; }
.due-date { font-size: 12.5px; color: var(--text-muted); }
.task-card-actions { display: flex; gap: 2px; }

/* ---- Activity Feed / Timeline ---- */
.activity-feed { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.activity-feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: var(--bg); }
.timeline-content { flex: 1; }
.timeline-desc { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.timeline-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline-time { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ---- Filter buttons ---- */
.btn-group { display: flex; gap: 4px; }
.btn-filter { background: var(--surface); border: 1.5px solid var(--border); padding: 6px 14px; border-radius: 7px; font-size: 13px; color: var(--text-muted); font-weight: 500; transition: all var(--transition); }
.btn-filter.active, .btn-filter:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { position: fixed; height: 100%; transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .charts-row { flex-direction: column; }
  .bottom-row { flex-direction: column; }
  .form-row { flex-direction: column; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.hidden { display: none !important; }
.overdue { color: var(--danger); }
.line-through { text-decoration: line-through; }

/* ---- Spinner / Loading ---- */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: flex; align-items: center; justify-content: center; height: 300px; }
.page-error { padding: 40px; text-align: center; color: var(--danger); font-size: 15px; }
.page-error button { margin-top: 12px; }

/* ---- Win rate ---- */
.win-rate-display { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.win-rate-circle svg { width: 140px; height: 140px; }
.win-rate-text { font-size: 22px; font-weight: 800; fill: var(--text); }
.win-rate-label { font-size: 12px; color: var(--text-muted); }

/* ── Workspace Layout ─────────────────────────────────────────────────────── */
.workspace-layout { display: flex; flex-direction: column; gap: 0; min-height: calc(100vh - 60px); }
.workspace-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.workspace-hero-left { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.btn-back { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; width: fit-content; }
.btn-back:hover { color: var(--primary); }
.ws-header { display: flex; align-items: flex-start; gap: 16px; }
.ws-header-info { flex: 1; }
.ws-title { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ws-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; color: var(--text-muted); }
.ws-meta-item { display: flex; align-items: center; gap: 4px; }
.ws-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.ownership-banner { display: flex; align-items: center; gap: 12px; background: rgba(253,126,20,.08); border: 1px solid rgba(253,126,20,.3); border-radius: 8px; padding: 8px 14px; font-size: 13px; margin-top: 8px; }
.account-logo-xl { width: 60px; height: 60px; font-size: 26px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--purple)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0; }
.account-logo-sm { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
.avatar-xl { width: 60px; height: 60px; font-size: 22px; }
.avatar-md { width: 42px; height: 42px; font-size: 16px; }
.deal-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; opacity: .2; }

/* ── Workspace Tabs ────────────────────────────────────────────────────────── */
.ws-tabs { display: flex; gap: 2px; background: var(--surface); border-bottom: 2px solid var(--border); padding: 0 24px; overflow-x: auto; flex-shrink: 0; }
.ws-tab { background: none; border: none; padding: 12px 18px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; transition: all var(--transition); }
.ws-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ws-tab:hover { color: var(--text); }
.ws-content { padding: 24px; flex: 1; overflow-y: auto; }
.ws-tab-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.ws-tab-header h3 { font-size: 15px; font-weight: 600; }
.tab-loading { display: flex; justify-content: center; padding: 40px; }
.tab-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-filter-sm { background: var(--bg); border: 1px solid var(--border); padding: 3px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.btn-filter-sm:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Overview grid ─────────────────────────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 20px; }
.overview-section { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 12px; }
.form-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin: 16px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

/* ── Contact cards ─────────────────────────────────────────────────────────── */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; box-shadow: var(--shadow); cursor: pointer; transition: all var(--transition); align-items: flex-start; }
.contact-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.contact-card-body { flex: 1; }
.contact-name { font-size: 14px; font-weight: 600; }
.contact-title { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.contact-roles { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.contact-card-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; flex-shrink: 0; }

/* ── Duplicate warning ─────────────────────────────────────────────────────── */
.dup-warning { background: rgba(253,126,20,.08); border: 1px solid rgba(253,126,20,.3); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.dup-msg { font-size: 14px; font-weight: 500; color: var(--warning); margin-bottom: 12px; }
.dup-card { background: var(--surface); border-radius: 8px; padding: 12px; border: 1px solid var(--border); }
.dup-card-name { font-size: 15px; font-weight: 600; }
.dup-card-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ── Lead score ────────────────────────────────────────────────────────────── */
.lead-score-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 60px; display: inline-block; vertical-align: middle; }
.lead-score-fill { height: 100%; background: linear-gradient(90deg, #fd7e14, #dc3545); border-radius: 3px; }
.lead-score-num { font-size: 12px; color: var(--text-muted); margin-left: 6px; vertical-align: middle; }
.lead-score-big { display: flex; align-items: baseline; gap: 4px; }
.lead-score-val { font-size: 2rem; font-weight: 700; color: var(--text); }
.lead-score-lbl { font-size: 13px; color: var(--text-muted); }

/* ── Notes ─────────────────────────────────────────────────────────────────── */
.note-card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); border-left: 3px solid var(--primary); }
.note-content { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.note-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }

/* ── Search dropdown ───────────────────────────────────────────────────────── */
.search-drop { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 500; max-height: 380px; overflow-y: auto; margin-top: 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background var(--transition); }
.search-item:hover { background: var(--bg); }
.search-item-icon { font-size: 18px; flex-shrink: 0; }
.search-item-body { flex: 1; min-width: 0; }
.search-item-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.search-item-sub { font-size: 12px; color: var(--text-muted); }
.search-item-badge { font-size: 11px; flex-shrink: 0; }
.search-no-result { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.topbar-search { position: relative; flex: 1; max-width: 480px; }

/* ── Render.yaml + deployment ─────────────────────────────────────────────── */
.page-error { padding: 60px; text-align: center; color: var(--danger); font-size: 15px; }

@media (max-width:768px) {
  .workspace-hero { flex-direction: column; }
  .overview-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .ws-title { font-size: 18px; }
}

/* ── Phase 2 Styles ─────────────────────────────────────────────────────── */

/* Call log */
.call-list { display: flex; flex-direction: column; gap: 8px; }
.call-card { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.call-card-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.call-out { background: rgba(13,110,253,.1); }
.call-in  { background: rgba(25,135,84,.1); }
.call-card-body { flex: 1; min-width: 0; }
.call-card-title { font-size: 14px; font-weight: 500; }
.call-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.call-duration { font-size: 12.5px; color: var(--text-muted); }
.call-time { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.call-notes { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.btn-call { background: none; border: none; color: var(--primary); font-size: 13.5px; cursor: pointer; padding: 0; text-decoration: underline; }
.btn-call:hover { color: var(--primary-dark); }

/* Call dialing */
.call-dialing { text-align: center; padding: 32px 0; }
.call-dialing-number { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.call-dialing-status { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.call-spinner { display: flex; justify-content: center; }

/* Email threads */
.connect-email-banner { background: rgba(13,110,253,.05); border: 1px solid rgba(13,110,253,.2); border-radius: var(--radius); padding: 20px; text-align: center; }
.email-thread-list { display: flex; flex-direction: column; }
.email-thread-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.email-thread-row:hover { background: var(--bg); }
.thread-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.thread-body { flex: 1; min-width: 0; }
.thread-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-subject { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-meta { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--text-muted); }
.thread-count { margin-top: 3px; }

/* Email thread view */
.email-thread-view { padding-bottom: 0 !important; }
.email-message { padding: 16px 0; }
.email-message.inbound .email-msg-header { color: var(--text-muted); }
.email-message.outbound .email-msg-header { color: var(--primary); }
.email-msg-header { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.email-msg-subject { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.email-iframe { width: 100%; border: none; min-height: 100px; }
.email-plain { font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.email-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.form-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }

/* Meetings */
.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meeting-card { display: flex; align-items: flex-start; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.meeting-card-left { flex-shrink: 0; }
.meeting-date { text-align: center; padding-left: 12px; }
.meeting-day { font-size: 13px; font-weight: 600; color: var(--text); }
.meeting-time { font-size: 12px; color: var(--text-muted); }
.meeting-card-body { flex: 1; }
.meeting-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.meeting-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.meeting-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.meeting-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Sequences */
.sequences-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.sequence-card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.sequence-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sequence-name { font-size: 15px; font-weight: 700; }
.sequence-meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-muted); }
.sequence-desc { font-size: 13px; color: var(--text-muted); }
.sequence-footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* Sequence builder steps */
.seq-step { display: flex; align-items: flex-start; gap: 10px; background: var(--bg); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.seq-step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 8px; }
.seq-step-body { flex: 1; min-width: 0; }

/* Enroll list */
.enroll-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.enroll-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background var(--transition); }
.enroll-item:hover { background: var(--bg); }
.enroll-item input { width: 16px; height: 16px; flex-shrink: 0; }
.enroll-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.enroll-name { font-size: 13.5px; font-weight: 500; }
.enroll-email { font-size: 12px; color: var(--text-muted); }

/* Templates grid */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.template-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.template-card-header { display: flex; align-items: center; justify-content: space-between; }
.template-name { font-size: 14px; font-weight: 600; }
.template-subject { font-size: 13px; color: var(--text-muted); }
.template-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.template-uses { font-size: 12px; color: var(--text-muted); }

/* ── Phase 3 Styles ─────────────────────────────────────────────────────── */

/* Report toolbar */
.report-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; gap: 8px; }

/* Notifications dropdown */
.notif-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 600;
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-title { font-size: 14px; font-weight: 600; }
.notif-read-all { background: none; border: none; font-size: 12px; color: var(--primary); cursor: pointer; }
.notif-read-all:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background var(--transition); border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-unread { background: rgba(13,110,253,.04); }
.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.notif-item-body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item-time  { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 6px;
}

/* Settings page */
.settings-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.settings-section-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.settings-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 16px; }

.integration-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.integration-row:last-of-type { border-bottom: none; margin-bottom: 12px; }
.integration-info { display: flex; align-items: center; gap: 14px; }
.integration-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: #ea4335; color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.integration-name   { font-size: 14px; font-weight: 500; }
.integration-status { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.booking-link-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg); border-radius: 8px; padding: 10px 14px;
  margin-bottom: 14px;
}
.booking-link-url { font-size: 13px; color: var(--primary); flex: 1; word-break: break-all; }

.subscription-list { display: flex; flex-direction: column; gap: 0; }
.subscription-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.subscription-row:last-child { border-bottom: none; }
.subscription-name { font-size: 13.5px; font-weight: 500; text-transform: capitalize; }
.subscription-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-transform: capitalize; }

/* Availability rows in booking form */
.avail-row input[type="time"]:disabled { opacity: .4; }

/* Report sparkline */
.sparkline-wrap { padding: 8px 0; }

/* ── Forecast view ──────────────────────────────────────────────────────── */
.forecast-group { margin-bottom: 8px; }
.forecast-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
}
.forecast-cat-name  { font-size: 14px; font-weight: 700; }
.forecast-cat-total { font-size: 13px; color: var(--text-muted); }

/* ── Document list ──────────────────────────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow);
}
.doc-icon { font-size: 24px; flex-shrink: 0; }
.doc-body { flex: 1; min-width: 0; }
.doc-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Phase 4 Styles ─────────────────────────────────────────────────────── */

/* Role badges */
.badge-role-admin   { background: #dc354520; color: #dc3545; }
.badge-role-manager { background: #fd7e1420; color: #fd7e14; }
.badge-role-sales   { background: #0d6efd20; color: #0d6efd; }
.badge-warning      { background: #fd7e1420; color: #fd7e14; }
.badge-success      { background: #19875420; color: #198754; }
.badge-secondary    { background: #6c757d20; color: #6c757d; }
.badge-outline      { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }

/* Toggle switch */
.toggle-switch { position:relative; display:inline-block; width:36px; height:20px; cursor:pointer; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:var(--border); border-radius:20px; transition:.2s; }
.toggle-slider::before { content:''; position:absolute; height:14px; width:14px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* Approval cards */
.approval-list { display:flex; flex-direction:column; gap:12px; }
.approval-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; border-left:4px solid #fd7e14; }
.approval-card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
.approval-type { font-size:13px; font-weight:600; text-transform:capitalize; }
.approval-entity { font-size:12.5px; color:var(--text-muted); margin-top:2px; }
.approval-notes { font-size:13px; color:var(--text-muted); font-style:italic; margin-top:6px; padding:6px 10px; background:var(--bg); border-radius:6px; }
.approval-card-footer { display:flex; gap:8px; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }

/* Workflow builder */
.wf-section { background:var(--bg); border-radius:var(--radius); padding:14px; margin-bottom:14px; }
.wf-section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:13.5px; font-weight:600; }
.wf-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.wf-row .form-control { flex:1; }

/* File drop zone */
.file-drop-zone { border:2px dashed var(--border); border-radius:var(--radius); padding:32px; text-align:center; cursor:pointer; transition:all .2s; }
.file-drop-zone:hover, .file-drop-zone.dragover { border-color:var(--primary); background:rgba(13,110,253,.04); }
.file-drop-zone.has-file { border-color:var(--success); background:rgba(25,135,84,.04); }
.file-drop-icon { font-size:36px; margin-bottom:8px; }
.file-drop-text { font-size:14px; font-weight:500; }
.file-drop-sub  { font-size:12.5px; color:var(--text-muted); margin-top:4px; }

/* Import progress */
.import-progress-bar { background:var(--bg); border-radius:var(--radius); padding:14px; }
.progress-track { height:6px; background:var(--border); border-radius:3px; overflow:hidden; margin-top:8px; }
.progress-fill  { height:100%; background:var(--primary); border-radius:3px; transition:width .3s; }
.import-result  { display:flex; align-items:flex-start; gap:12px; padding:14px; border-radius:var(--radius); }
.import-result-success { background:rgba(25,135,84,.08); border:1px solid rgba(25,135,84,.3); }
.import-result-error   { background:rgba(220,53,69,.08);  border:1px solid rgba(220,53,69,.3); }
.import-result-icon { font-size:22px; }

/* Duplicate cards */
.dup-list { display:flex; flex-direction:column; gap:12px; }
.dup-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; }
.dup-card-header { margin-bottom:12px; }
.dup-records { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.dup-record { flex:1; background:var(--bg); border-radius:8px; padding:12px; }
.dup-record-title { font-size:14px; font-weight:600; }
.dup-record-sub   { font-size:12px; color:var(--text-muted); margin-top:2px; }
.dup-vs { font-size:13px; font-weight:700; color:var(--text-muted); flex-shrink:0; }
.dup-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Audit log */
.audit-val { font-size:12.5px; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pagination { display:flex; align-items:center; justify-content:center; gap:16px; padding:16px; }

/* Admin form section title */
.form-section-title { font-size:13px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; margin:16px 0 8px; }

/* ── Phase 5 Styles ─────────────────────────────────────────────────────── */

/* Quick Actions Bar */
.quick-actions-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius); padding: 10px 16px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.quick-actions-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.quick-action-btn {
  padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px;
  background: var(--bg); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(13,110,253,.06); }

/* Stage Progress Bar */
.stage-progress-wrap { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 16px; overflow-x: auto; }
.stage-progress { display: flex; align-items: center; gap: 0; min-width: max-content; }
.stage-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 80px; cursor: pointer; position: relative; }
.stage-step::before { content: ''; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--border); z-index: 0; }
.stage-step:first-child::before { display: none; }
.stage-step.done::before { background: var(--primary); }
.stage-step-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--border); border: 2px solid var(--border); z-index: 1; transition: all .2s; }
.stage-step.done .stage-step-dot, .stage-step.active .stage-step-dot { border-color: transparent; }
.stage-step.active .stage-step-dot { box-shadow: 0 0 0 3px rgba(13,110,253,.2); }
.stage-step-label { font-size: 10px; color: var(--text-muted); text-align: center; max-width: 75px; line-height: 1.2; }
.stage-step.active .stage-step-label { color: var(--primary); font-weight: 600; }
.stage-step.done .stage-step-label { color: var(--text); }
.stage-step.won .stage-step-label { color: var(--success); font-weight: 700; }
.stage-step.lost .stage-step-label { color: var(--danger); }

/* Checklist */
.checklist-list { display: flex; flex-direction: column; gap: 8px; }
.checklist-item { background: var(--surface); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; transition: all .15s; }
.checklist-item.checked { background: rgba(25,135,84,.05); border-left: 3px solid var(--success); }
.checklist-label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.checklist-checkbox { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.checklist-text { font-size: 13.5px; }
.checklist-item.checked .checklist-text { text-decoration: line-through; color: var(--text-muted); }
.checklist-required { color: var(--danger); font-size: 12px; margin-left: 4px; }
.checklist-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; margin-left: 12px; }

/* Avatar XL */
.avatar-xl { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }

/* Form success message */
.form-success { padding: 10px 14px; border-radius: 8px; background: rgba(25,135,84,.1); color: var(--success); font-size: 13.5px; border: 1px solid rgba(25,135,84,.3); }
.form-error   { padding: 10px 14px; border-radius: 8px; background: rgba(220,53,69,.08); color: var(--danger); font-size: 13.5px; border: 1px solid rgba(220,53,69,.2); }

/* Calendar */
.calendar-toolbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.cal-current-label { font-size: 15px; font-weight: 700; flex: 1; text-align: center; }
.cal-month { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-day-headers { display: grid; grid-template-columns: repeat(7,1fr); background: var(--bg); border-bottom: 1px solid var(--border); }
.cal-day-name { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 8px 0; }
.cal-week-row { display: grid; grid-template-columns: repeat(7,1fr); border-bottom: 1px solid var(--border); }
.cal-week-row:last-child { border-bottom: none; }
.cal-cell { min-height: 100px; padding: 6px; border-right: 1px solid var(--border); font-size: 12px; }
.cal-cell:last-child { border-right: none; }
.cal-cell-empty { background: var(--bg); }
.cal-today { background: rgba(13,110,253,.04); }
.cal-date-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }
.today-badge { background: var(--primary); color: #fff; font-weight: 700; }
.cal-event { background: var(--primary); color: #fff; border-radius: 4px; padding: 2px 6px; margin-bottom: 2px; font-size: 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; }
.cal-event-time { opacity: .8; flex-shrink: 0; }
.cal-more { font-size: 11px; color: var(--text-muted); text-align: center; cursor: pointer; }

/* Week/Day views */
.cal-week { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-week-header { display: grid; grid-template-columns: 60px repeat(7,1fr); background: var(--bg); border-bottom: 2px solid var(--border); }
.cal-week-day-head { text-align: center; padding: 8px 4px; border-left: 1px solid var(--border); }
.cal-week-day-head.today { background: rgba(13,110,253,.06); }
.cal-week-day-name { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.cal-week-day-num { font-size: 16px; font-weight: 700; }
.cal-week-body { overflow-y: auto; max-height: 600px; }
.cal-hour-row { display: grid; grid-template-columns: 60px repeat(7,1fr); border-bottom: 1px solid var(--border); min-height: 50px; }
.cal-time-col { font-size: 11px; color: var(--text-muted); padding: 4px 8px; text-align: right; flex-shrink: 0; width: 60px; }
.cal-hour-cell { border-left: 1px solid var(--border); padding: 2px 4px; }
.cal-day { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-day-hour { display: flex; border-bottom: 1px solid var(--border); min-height: 50px; }
.cal-day-hour.has-events { background: rgba(13,110,253,.02); }
.cal-day-events { flex: 1; padding: 4px 8px; }
.cal-day-event { background: var(--surface); border-radius: 6px; padding: 8px 10px; margin-bottom: 4px; box-shadow: var(--shadow); cursor: pointer; }
.cal-day-event:hover { box-shadow: var(--shadow-lg); }
.cal-day-event-title { font-size: 13.5px; font-weight: 600; }
.cal-day-event-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── SaaS / Multi-tenancy Styles ─────────────────────────────────────────── */

/* Trial warning banner */
.trial-banner {
  background: var(--primary); color: #fff;
  padding: 8px 16px; font-size: 13px; text-align: center;
  font-weight: 500; width: 100%;
}
.trial-banner a { color: #fff; text-decoration: underline; }

/* Quick actions bar */
.quick-actions-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border-radius: var(--radius);
  padding: 10px 16px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.quick-actions-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.quick-action-btn {
  padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 20px;
  background: var(--bg); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.quick-action-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(13,110,253,.05); }

/* Billing / Pricing cards in app */
.pricing-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px;
}
.price-card-app {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 24px; position: relative; transition: all .2s;
}
.price-card-app.current-plan { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }
.current-plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 2px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.plan-name-app  { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.plan-price-app { font-size: 30px; font-weight: 900; margin-bottom: 4px; }
.plan-price-app span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-features-app { list-style: none; margin: 16px 0 20px; padding: 0; }
.plan-features-app li {
  font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border);
  display: flex; gap: 6px;
}
.plan-features-app li:last-child { border: none; }
.plan-features-app li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* Usage grid */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.usage-item { background: var(--bg); border-radius: var(--radius); padding: 14px 16px; }
.usage-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.usage-icon  { font-size: 16px; }
.usage-count { font-size: 22px; font-weight: 700; }

/* ── Phase 6 Styles ─────────────────────────────────────────────────────── */

/* Ticket cards */
.internal-note { background: rgba(253,126,20,.06); border-left: 3px solid #fd7e14; }

/* CPQ quote line rows */
.quote-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.quote-line .form-control { flex: 1; }

/* Forecast attainment */
.forecast-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; flex: 1; }
.forecast-fill { height: 100%; border-radius: 3px; transition: width .4s; }

/* API key code display */
.api-key-display {
  background: var(--dark); color: #a8d8a8;
  border-radius: 8px; padding: 14px 16px;
  font-family: monospace; font-size: 13px;
  word-break: break-all; line-height: 1.6;
}

/* Campaign stats */
.campaign-stat-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.campaign-stat-row:last-child { border: none; }

/* Form builder field row */
.form-field-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}

/* Ticket priority dots */
.priority-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
}

/* Sandbox warning */
.sandbox-banner {
  background: rgba(253,126,20,.1);
  border: 1.5px solid rgba(253,126,20,.4);
  border-radius: 8px; padding: 10px 16px;
  font-size: 13.5px; color: #fd7e14;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}

/* ── Saved Views ─────────────────────────────────────────────────────────── */

/* Page layout when sidebar is present */
.sv-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 768px) {
  .sv-layout { grid-template-columns: 1fr; }
  .sv-sidebar { display: none; }
}

.sv-main { min-width: 0; }

/* Views sidebar */
.sv-sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sv-header-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.sv-create-btn {
  background: none;
  border: none;
  font-size: 11.5px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
}
.sv-create-btn:hover { background: rgba(13,110,253,.08); }

.sv-group { margin-bottom: 4px; }
.sv-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 8px 12px 3px;
}

.sv-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background .12s;
  position: relative;
}
.sv-item:hover { background: var(--bg); }
.sv-item.sv-active {
  background: rgba(13,110,253,.08);
  border-left: 3px solid var(--primary);
}
.sv-icon { font-size: 14px; flex-shrink: 0; }
.sv-label {
  font-size: 13px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.sv-item.sv-active .sv-label { color: var(--primary); font-weight: 600; }

.sv-default-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.sv-actions {
  display: none;
  gap: 2px;
  position: absolute;
  right: 6px;
}
.sv-item:hover .sv-actions { display: flex; }
.sv-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 3px;
  border-radius: 3px;
  opacity: .7;
}
.sv-btn:hover { opacity: 1; background: var(--border); }

.sv-empty {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 14px;
  line-height: 1.6;
}

/* Active view badge in page title */
.sv-active-badge {
  font-size: 12px;
  font-weight: 500;
  background: rgba(13,110,253,.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Save view button in toolbar */
.sv-save-filter-btn {
  font-size: 12.5px;
  padding: 5px 12px;
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sv-save-filter-btn:hover { border-color: var(--primary); color: var(--primary); }


/* ── Saved Views ─────────────────────────────────────────────────────────── */
.sv-layout { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
@media (max-width: 768px) { .sv-layout { grid-template-columns: 1fr; } .sv-sidebar { display: none; } }
.sv-main { min-width: 0; }
.sv-sidebar { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 0; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.sv-header { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sv-header-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.sv-create-btn { background: none; border: none; font-size: 11.5px; color: var(--primary); cursor: pointer; font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.sv-create-btn:hover { background: rgba(13,110,253,.08); }
.sv-group { margin-bottom: 4px; }
.sv-group-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 12px 3px; }
.sv-item { display: flex; align-items: center; gap: 7px; padding: 7px 12px; cursor: pointer; transition: background .12s; position: relative; }
.sv-item:hover { background: var(--bg); }
.sv-item.sv-active { background: rgba(13,110,253,.08); border-left: 3px solid var(--primary); }
.sv-icon { font-size: 14px; flex-shrink: 0; }
.sv-label { font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.sv-item.sv-active .sv-label { color: var(--primary); font-weight: 600; }
.sv-default-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.sv-actions { display: none; gap: 2px; position: absolute; right: 6px; }
.sv-item:hover .sv-actions { display: flex; }
.sv-btn { background: none; border: none; cursor: pointer; font-size: 11px; padding: 2px 3px; border-radius: 3px; opacity: .7; }
.sv-btn:hover { opacity: 1; background: var(--border); }
.sv-empty { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 20px 14px; line-height: 1.6; }
.sv-active-badge { font-size: 12px; font-weight: 500; background: rgba(13,110,253,.1); color: var(--primary); padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; }
.sv-save-filter-btn { font-size: 12.5px; padding: 5px 12px; border: 1.5px dashed var(--border); border-radius: 20px; background: transparent; color: var(--text-muted); cursor: pointer; transition: all .15s; white-space: nowrap; }
.sv-save-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
