/* ===========================================================
   Active CRM — Active Digit
   Brand: Navy #1F4E8C + Lime #B5D33D
   =========================================================== */

:root {
  /* Brand */
  --brand-navy: #1F4E8C;
  --brand-navy-700: #18406F;
  --brand-navy-800: #133258;
  --brand-navy-900: #0F2747;
  --brand-lime: #B5D33D;
  --brand-lime-600: #9DBE2C;
  --brand-lime-700: #82A21F;

  /* Neutrals */
  --bg: #F4F6FB;
  --bg-2: #EEF1F7;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --border: #E5E9F2;
  --border-strong: #D2D8E5;
  --text: #1A2238;
  --text-muted: #5B6477;
  --text-soft: #8892A6;

  /* States */
  --success: #18B96B;
  --success-bg: #E5F8EE;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  --purple: #8B5CF6;
  --purple-bg: #EDE9FE;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 39, 71, 0.06);
  --shadow: 0 4px 12px rgba(15, 39, 71, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 39, 71, 0.10);
  --shadow-lg: 0 16px 48px rgba(15, 39, 71, 0.14);

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --trans: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0E1726;
  --bg-2: #0A1220;
  --surface: #16203A;
  --surface-2: #1B2745;
  --border: #243150;
  --border-strong: #2F3F66;
  --text: #E8ECF5;
  --text-muted: #A5B0C5;
  --text-soft: #7281A0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Cairo', 'Heebo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  transition: background var(--trans), color var(--trans);
}
[lang="he"] body { font-family: 'Heebo', 'Cairo', system-ui, sans-serif; }
[lang="en"] body, [lang="en"] { font-family: 'Inter', system-ui, sans-serif; direction: ltr; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand-navy); text-decoration: none; }
.hidden { display: none !important; }

/* ===========================================================
   Login Screen
   =========================================================== */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1F4E8C 0%, #133258 100%);
  overflow: hidden;
  padding: 20px;
}
.login-bg-shape {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.5;
}
.shape-1 { width: 500px; height: 500px; background: var(--brand-lime); top: -100px; left: -100px; }
.shape-2 { width: 400px; height: 400px; background: #6FAEDD; bottom: -100px; right: -100px; }
.shape-3 { width: 300px; height: 300px; background: var(--brand-lime); top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.2; }

.login-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  animation: slideUp 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { width: 80px; height: 80px; object-fit: contain; border-radius: 16px; margin-bottom: 12px; }
.login-brand h1 {
  margin: 0 0 4px;
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-lime));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.login-brand p { margin: 0; color: var(--text-muted); font-size: 14px; }

.login-form .form-group { margin-bottom: 16px; }
.login-form label {
  display: block; margin-bottom: 6px;
  font-weight: 600; font-size: 13px; color: var(--text);
}
.login-form input[type="email"],
.login-form input[type="password"] {
  width: 100%; padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.login-form input:focus {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(31, 78, 140, 0.12);
}
.login-options {
  display: flex; justify-content: space-between; align-items: center;
  margin: 16px 0 20px;
  font-size: 13px;
}
.checkbox { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox input { accent-color: var(--brand-navy); }
.btn-block { width: 100%; }
.login-error {
  margin-top: 12px; padding: 10px;
  background: var(--danger-bg); color: var(--danger);
  border-radius: var(--radius); font-size: 13px; text-align: center;
}
.login-demo {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.login-demo > p { margin: 0 0 10px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.demo-accounts { display: flex; flex-direction: column; gap: 6px; }
.demo-account {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-muted);
  transition: all var(--trans); text-align: start;
}
.demo-account:hover { background: var(--bg-2); border-color: var(--brand-navy); }

.login-lang-switch {
  position: absolute; top: 20px; left: 20px;
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 4px; border-radius: var(--radius-full);
  z-index: 2;
}
.login-lang-switch button {
  padding: 6px 14px;
  color: white; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--trans);
}
.login-lang-switch button.active { background: white; color: var(--brand-navy); }

/* ===========================================================
   App Layout
   =========================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--brand-navy-900) 0%, var(--brand-navy-800) 100%);
  color: white;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width var(--trans);
}
.sidebar-brand {
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img {
  width: 42px; height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: white; padding: 4px;
}
.sidebar-brand h2 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1; }
.sidebar-brand span { font-size: 11px; color: rgba(255,255,255,0.6); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.nav-section {
  margin-bottom: 14px;
}
.nav-section-title {
  padding: 6px 14px;
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin: 2px 0;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.75);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--trans);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}
.nav-item.active {
  background: linear-gradient(135deg, var(--brand-lime) 0%, var(--brand-lime-600) 100%);
  color: var(--brand-navy-900);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(181, 211, 61, 0.4);
}
.nav-item.active .nav-icon { color: var(--brand-navy-900); }
.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
}
.nav-badge {
  margin-inline-start: auto;
  background: var(--brand-lime);
  color: var(--brand-navy-900);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  min-width: 22px; text-align: center;
}
.nav-item.active .nav-badge {
  background: var(--brand-navy-900); color: var(--brand-lime);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-lime), var(--brand-lime-600));
  color: var(--brand-navy-900);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: 13px; color: white; line-height: 1.2; }
.user-info small { font-size: 11px; color: rgba(255,255,255,0.6); }

/* Sidebar collapsed (mobile) */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 100;
    transform: translateX(100%);
  }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex !important; }
}

/* ---------- Main ---------- */
.main {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle { display: none; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--trans);
  position: relative;
}
.icon-btn:hover { background: var(--bg-2); color: var(--brand-navy); }

.topbar-search {
  flex: 1; max-width: 480px;
  position: relative;
  display: flex; align-items: center;
}
.topbar-search svg {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--text-soft);
}
.topbar-search input {
  width: 100%;
  padding: 10px 42px 10px 16px;
  background: var(--bg-2);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  transition: all var(--trans);
}
[dir="ltr"] .topbar-search input { padding: 10px 16px 10px 42px; }
.topbar-search input:focus {
  outline: none; background: var(--surface);
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(31,78,140,0.1);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-switch {
  display: inline-flex; gap: 2px;
  background: var(--bg-2);
  padding: 3px; border-radius: var(--radius-full);
}
.lang-switch button {
  padding: 5px 10px;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--trans);
}
.lang-switch button.active { background: var(--brand-navy); color: white; }

.notif-btn .notif-badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
}
.notif-btn .notif-badge:empty,
.notif-btn .notif-badge[data-zero="true"] { display: none; }

/* Notifications dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) + 6px);
  inset-inline-end: 20px;
  width: 360px; max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-dropdown-header {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-header h4 { margin: 0; font-size: 15px; }
.link-btn { color: var(--brand-navy); font-size: 12px; font-weight: 600; }
.link-btn:hover { color: var(--brand-navy-700); }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
  cursor: pointer;
  transition: background var(--trans);
}
.notif-item:hover { background: var(--bg-2); }
.notif-item.unread { background: rgba(31,78,140,0.04); }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-content strong { display: block; font-size: 13px; }
.notif-content small { font-size: 12px; color: var(--text-muted); }
.notif-time { font-size: 11px; color: var(--text-soft); margin-top: 2px; display: block; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Page Content */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.page-content::-webkit-scrollbar { width: 8px; }
.page-content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ===========================================================
   Common Components
   =========================================================== */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  transition: all var(--trans);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-700));
  color: white;
  box-shadow: 0 4px 14px rgba(31,78,140,0.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(31,78,140,0.35);
}
.btn-secondary {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-success {
  background: linear-gradient(135deg, var(--brand-lime), var(--brand-lime-600));
  color: var(--brand-navy-900);
  box-shadow: 0 4px 14px rgba(181,211,61,0.3);
}
.btn-success:hover:not(:disabled) { transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--brand-navy);
  color: var(--brand-navy);
}
.btn-outline:hover:not(:disabled) { background: var(--brand-navy); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* Page Header */
.page-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 24px;
}
.page-title { margin: 0; font-size: 22px; font-weight: 800; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-title { margin: 0; font-size: 16px; font-weight: 700; }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--trans);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: ''; position: absolute;
  top: 0; inset-inline-start: 0;
  width: 4px; height: 100%;
  background: var(--brand-navy);
}
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.lime::before { background: var(--brand-lime); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.purple::before { background: var(--purple); }

.kpi-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: rgba(31,78,140,0.08);
  color: var(--brand-navy);
  display: flex; align-items: center; justify-content: center;
}
.kpi-card.success .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi-card.warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-card.lime .kpi-icon { background: rgba(181,211,61,0.18); color: var(--brand-lime-700); }
.kpi-card.info .kpi-icon { background: var(--info-bg); color: var(--info); }
.kpi-card.purple .kpi-icon { background: var(--purple-bg); color: var(--purple); }

.kpi-value { font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.kpi-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kpi-meta .trend-up { color: var(--success); font-weight: 700; }
.kpi-meta .trend-down { color: var(--danger); font-weight: 700; }

/* Tables */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-tools {
  padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.table-tools .search-input {
  flex: 1; min-width: 200px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-tools .search-input:focus { outline: none; border-color: var(--brand-navy); }
.table-tools select {
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
}
.table-tools select:focus { outline: none; border-color: var(--brand-navy); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: start;
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--trans); cursor: pointer; }
.data-table tbody tr:hover { background: var(--bg-2); }

.table-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.table-empty svg { margin: 0 auto 14px; color: var(--text-soft); }
.table-empty h4 { margin: 0 0 6px; color: var(--text); }
.table-empty p { margin: 0; font-size: 13px; }

.table-footer {
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.pagination { display: flex; gap: 4px; }
.pagination button {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  transition: all var(--trans);
}
.pagination button:hover { background: var(--bg-2); }
.pagination button.active { background: var(--brand-navy); color: white; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-navy { background: rgba(31,78,140,0.12); color: var(--brand-navy); }
.badge-lime { background: rgba(181,211,61,0.2); color: var(--brand-lime-700); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

.role-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.role-admin { background: #FFE4E6; color: #BE123C; }
.role-sales { background: rgba(181,211,61,0.2); color: var(--brand-lime-700); }
.role-pm { background: rgba(31,78,140,0.12); color: var(--brand-navy); }
.role-designer { background: var(--purple-bg); color: var(--purple); }
.role-dev { background: var(--info-bg); color: var(--info); }

/* Avatars */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-navy);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* Action button group */
.action-icons { display: inline-flex; gap: 2px; }
.action-icons .icon-btn { width: 30px; height: 30px; }
.action-icons .icon-btn:hover.danger { color: var(--danger); background: var(--danger-bg); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-weight: 600; font-size: 13px;
}
.form-group .required { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--trans);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(31,78,140,0.1);
}
.form-control[type="textarea"], textarea.form-control {
  min-height: 80px; resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 39, 71, 0.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  animation: fadeIn 200ms ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 640px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.modal-lg { max-width: 880px; }
.modal.modal-xl { max-width: 1080px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  min-width: 280px; max-width: 360px;
  display: flex; align-items: center; gap: 12px;
  animation: toastIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
[dir="ltr"] .toast { animation-name: toastInLtr; }
@keyframes toastInLtr {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast .toast-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast.warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast.info .toast-icon { background: var(--info-bg); color: var(--info); }
.toast-content { flex: 1; font-size: 13px; }
.toast-content strong { display: block; margin-bottom: 2px; }

/* Tabs */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--trans);
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
}

/* Quick filters */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans);
}
.chip:hover { background: var(--border); }
.chip.active {
  background: var(--brand-navy); color: white;
  border-color: var(--brand-navy);
}

/* ===========================================================
   Kanban (Deals Pipeline)
   =========================================================== */
.kanban {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 500px;
}
.kanban-column {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 280px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-column.drag-over { background: rgba(181, 211, 61, 0.1); border-color: var(--brand-lime); }
.kanban-col-head {
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.kanban-col-head strong { font-size: 13px; }
.kanban-col-count {
  background: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
}
.kanban-col-total {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  transition: all var(--trans);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); }
.kanban-card-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.kanban-card-price { font-weight: 800; color: var(--brand-navy); }

/* ===========================================================
   Client Profile / Detail page
   =========================================================== */
.detail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-side .card { margin-bottom: 16px; }
.detail-side .avatar.lg { margin: 0 auto 12px; display: flex; }
.detail-name { text-align: center; font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.detail-role { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 14px; }
.detail-meta { font-size: 13px; }
.detail-meta li {
  list-style: none;
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-meta li:last-child { border-bottom: none; }
.detail-meta strong { color: var(--text-muted); font-weight: 600; }

/* Activity timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding-inline-start: 32px;
  padding-bottom: 18px;
}
.timeline li::before {
  content: ''; position: absolute;
  inset-inline-start: 8px; top: 6px; bottom: -6px;
  width: 2px; background: var(--border);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
  content: ''; position: absolute;
  inset-inline-start: 4px; top: 4px;
  width: 12px; height: 12px;
  border-radius: var(--radius-full);
  background: var(--brand-lime);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-lime);
}
.timeline-time { font-size: 11px; color: var(--text-soft); display: block; }
.timeline-content { font-size: 13px; }

/* Charts */
.chart-wrap {
  position: relative;
  height: 260px;
  width: 100%;
}
.bar-chart {
  display: flex; align-items: flex-end; gap: 16px;
  height: 220px;
  padding: 14px 8px 8px;
}
.bar-chart .bar-group {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  height: 100%;
  min-width: 0;
  position: relative;
}
.bar-chart .bar {
  width: 100%;
  background: linear-gradient(180deg, var(--brand-lime), var(--brand-lime-600));
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: relative;
  transition: height 600ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 50px;
}
.bar-chart .bar.navy { background: linear-gradient(180deg, var(--brand-navy), var(--brand-navy-700)); }
.bar-chart .bar-value {
  position: absolute; bottom: 100%;
  left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  padding-bottom: 4px;
}
.bar-chart .bar-label {
  margin-top: 6px;
  font-size: 11px; color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Donut chart */
.donut-chart {
  width: 160px; height: 160px;
  margin: 0 auto;
  position: relative;
}
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.donut-center strong { font-size: 22px; font-weight: 800; }
.donut-center small { font-size: 11px; color: var(--text-muted); }
.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}

/* Progress bar */
.progress {
  height: 8px;
  background: var(--bg-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-lime), var(--brand-lime-600));
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-bar.navy { background: linear-gradient(90deg, var(--brand-navy), var(--brand-navy-700)); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* Empty states */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state svg { color: var(--text-soft); margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 6px; color: var(--text); }
.empty-state p { margin: 0 0 16px; color: var(--text-muted); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.mini-stat {
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.mini-stat label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.mini-stat strong { font-size: 18px; font-weight: 800; display: block; margin-top: 4px; }

/* Loaders */
.loader {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-navy);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-inline-end: 6px;
  vertical-align: middle;
}
.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.info { background: var(--info); }
.status-dot.muted { background: var(--text-soft); }

/* Two-column dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* Quotation preview */
.quote-preview {
  background: var(--surface);
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.quote-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--brand-navy);
  margin-bottom: 20px;
}
.quote-head img { height: 56px; }
.quote-meta { font-size: 12px; }
.quote-items {
  width: 100%; margin-top: 16px;
}
.quote-items th, .quote-items td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: start;
}
.quote-items th { background: var(--surface-2); font-size: 12px; }
.quote-totals {
  margin-top: 16px;
  margin-inline-start: auto;
  width: 280px;
}
.quote-totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.quote-totals .row.total { border-top: 2px solid var(--brand-navy); padding-top: 10px; font-weight: 800; font-size: 16px; }

/* Print-friendly quotation */
@media print {
  body { background: white; }
  .sidebar, .topbar, .modal-backdrop, .toast-container { display: none !important; }
  .page-content { padding: 0; }
  .quote-preview { box-shadow: none; }
}

/* Misc */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-lg { font-size: 16px; }
.text-sm { font-size: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .page-content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-search { display: none; }
  .lang-switch { display: none; }
  .page-header { flex-direction: column; align-items: stretch; }
}
