/* =================================================================
   INTECH CRM — Brand Stylesheet
   Navy + Cyan + Orange palette (matching Intech logo)
   ================================================================= */

:root {
  /* Brand colors */
  --navy: #0A1F3D;
  --navy-2: #122B52;
  --navy-3: #1B3A6B;
  --cyan: #1FA3D8;
  --cyan-2: #29B6E0;
  --cyan-soft: #E8F6FC;
  --orange: #F58220;
  --orange-2: #FF9842;
  --orange-soft: #FFF1E2;

  /* Neutrals */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --border: #E1E6EE;
  --border-strong: #C8D1DD;
  --text: #1B2A3F;
  --text-muted: #5C6B81;
  --text-dim: #8895A8;

  /* Status */
  --success: #10B981;
  --success-soft: #D7F4E5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;

  /* Quadrant colors */
  --q-pink: #F5C6D6;
  --q-pink-text: #B33872;
  --q-blue: #7DA9D9;
  --q-blue-text: #1F4F8A;
  --q-lightblue: #BDDEEC;
  --q-lightblue-text: #2273A0;
  --q-green: #C8E6C9;
  --q-green-text: #2E7D32;

  /* Layout */
  --sidebar-w: 240px;
  --header-h: 64px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 31, 61, 0.06);
  --shadow: 0 4px 16px rgba(10, 31, 61, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 31, 61, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--orange); }

/* =================================================================
   LAYOUT — Sidebar + Main
   ================================================================= */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 6px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #E1E8F2;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img { width: 44px; height: 44px; border-radius: 8px; background: var(--navy-3); padding: 4px; }
.sidebar-brand .brand-name { color: var(--cyan); font-weight: 700; font-size: 16px; line-height: 1.1; }
.sidebar-brand .brand-sub { color: var(--orange); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.sidebar-brand .brand-tagline {
  color: #DDE9F5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 4px;
  max-width: 150px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 12px 8px; flex: 1; }
.sidebar-nav .nav-section { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 14px 12px 6px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #D6E3F3;
  font-weight: 600;
  margin-bottom: 4px;
  position: relative;
  transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--cyan), #36B8E7);
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 163, 216, 0.28);
}
.sidebar-nav a .icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  font-size: 0;
  color: #fff;
  background: linear-gradient(135deg, rgba(31, 163, 216, 0.95), rgba(12, 55, 94, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 5px 12px rgba(0,0,0,0.12);
}
.sidebar-nav a .icon::before {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}
.sidebar-nav a.active .icon {
  background: rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.24);
}
.sidebar-nav a[href="/"] .icon::before { content: "D"; }
.sidebar-nav a[href^="/customers"] .icon { background: linear-gradient(135deg, #38BDF8, #2563EB); }
.sidebar-nav a[href^="/customers"] .icon::before { content: "C"; }
.sidebar-nav a[href^="/vendors"] .icon { background: linear-gradient(135deg, #F59E0B, #EA580C); }
.sidebar-nav a[href^="/vendors"] .icon::before { content: "V"; }
.sidebar-nav a[href^="/products"] .icon { background: linear-gradient(135deg, #22C55E, #15803D); }
.sidebar-nav a[href^="/products"] .icon::before { content: "P"; }
.sidebar-nav a[href^="/inquiries"] .icon { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.sidebar-nav a[href^="/inquiries"] .icon::before { content: "I"; }
.sidebar-nav a[href^="/message-inbox"] .icon { background: linear-gradient(135deg, #14B8A6, #0F766E); }
.sidebar-nav a[href^="/message-inbox"] .icon::before { content: "MI"; font-size: 10px; }
.sidebar-nav a[href^="/quotations"] .icon { background: linear-gradient(135deg, #06B6D4, #0E7490); }
.sidebar-nav a[href^="/quotations"] .icon::before { content: "Q"; }
.sidebar-nav a[href^="/dc"] .icon { background: linear-gradient(135deg, #FB7185, #BE123C); }
.sidebar-nav a[href^="/dc"] .icon::before { content: "DC"; font-size: 10px; }
.sidebar-nav a[href^="/purchase-orders"] .icon { background: linear-gradient(135deg, #F97316, #C2410C); }
.sidebar-nav a[href^="/purchase-orders"] .icon::before { content: "PO"; font-size: 10px; }
.sidebar-nav a[href^="/amc"] .icon { background: linear-gradient(135deg, #10B981, #047857); }
.sidebar-nav a[href^="/amc"] .icon::before { content: "AMC"; font-size: 9px; }
.sidebar-nav a[href^="/tasks"] .icon { background: linear-gradient(135deg, #64748B, #334155); }
.sidebar-nav a[href^="/tasks"] .icon::before { content: "✓"; font-size: 14px; }
.sidebar-nav a[href^="/engineer-tickets"] .icon { background: linear-gradient(135deg, #0EA5E9, #0369A1); }
.sidebar-nav a[href^="/engineer-tickets"] .icon::before { content: "ET"; font-size: 10px; }
.sidebar-nav a[href^="/service-tickets"] .icon { background: linear-gradient(135deg, #8B5CF6, #5B21B6); }
.sidebar-nav a[href^="/service-tickets"] .icon::before { content: "LT"; font-size: 10px; }
.sidebar-nav a[href^="/settings"] .icon { background: linear-gradient(135deg, #FF8A00, #D94A00); }
.sidebar-nav a[href^="/settings"] .icon::before { content: "IM"; font-size: 10px; }
.sidebar-nav a[href^="/settings/gmail"] .icon { background: linear-gradient(135deg, #EA4335, #B91C1C); }
.sidebar-nav a[href^="/settings/gmail"] .icon::before { content: "GM"; font-size: 10px; }
.sidebar-nav a[href^="/suggestions"] .icon { background: linear-gradient(135deg, #FACC15, #CA8A04); }
.sidebar-nav a[href^="/suggestions"] .icon::before { content: "S"; }
.sidebar-nav a[href^="/admin"] .icon { background: linear-gradient(135deg, #EC4899, #9333EA); }
.sidebar-nav a[href^="/admin"] .icon::before { content: "U"; }
.sidebar-nav a[href^="/admin/backups"] .icon { background: linear-gradient(135deg, #0EA5E9, #0369A1); }
.sidebar-nav a[href^="/admin/backups"] .icon::before { content: "B"; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.footer-mail-icon {
  display: inline-block;
  width: 17px;
  height: 13px;
  margin-left: 8px;
  position: relative;
  top: 2px;
  border: 2px solid var(--orange);
  border-radius: 3px;
}
.footer-mail-icon::before,
.footer-mail-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 9px;
  height: 2px;
  background: var(--orange);
}
.footer-mail-icon::before {
  left: 0;
  transform: rotate(35deg);
  transform-origin: left center;
}
.footer-mail-icon::after {
  right: 0;
  transform: rotate(-35deg);
  transform-origin: right center;
}

.sidebar-resizer {
  position: sticky;
  top: 0;
  height: 100vh;
  cursor: col-resize;
  background: linear-gradient(90deg, rgba(10,31,61,0.18), rgba(10,31,61,0.05));
  z-index: 20;
}
.sidebar-resizer:hover,
.sidebar-resizer.resizing {
  background: var(--cyan);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;  /* Important for child overflow */
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; color: var(--navy); }
.topbar .user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.topbar .user-chip a { font-weight: 600; }

.crm-assist {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 14px;
}
.crm-assist-form {
  display: flex;
  align-items: center;
  width: min(440px, 34vw);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.crm-assist-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
}
.crm-assist-icon {
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
}
.crm-assist-icon:hover {
  background: var(--cyan-soft);
  color: var(--cyan);
}
.crm-assist-icon.listening {
  background: var(--danger-soft);
  color: var(--danger);
}
.crm-mic-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  justify-content: center;
}
.mic-symbol {
  position: relative;
  width: 12px;
  height: 17px;
  display: inline-block;
}
.mic-symbol::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 6px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 8px;
}
.mic-symbol::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 10px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 4px 6px 0 -3px currentColor, 4px 9px 0 -3px currentColor;
}
.crm-assist-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 58px;
  width: min(520px, 80vw);
  max-height: 430px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.crm-assist-row,
.help-result-row {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.crm-assist-row:hover,
.help-result-row:hover {
  background: var(--cyan-soft);
  color: var(--navy);
}
.crm-assist-row:last-child,
.help-result-row:last-child { border-bottom: 0; }
.crm-assist-type,
.help-result-type {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.crm-assist-row strong,
.help-result-row strong {
  color: var(--navy);
}
.crm-assist-row span:last-child,
.help-result-row span:last-child {
  color: var(--text-muted);
  font-size: 12px;
}
.help-search-form {
  display: flex;
  gap: 8px;
}
.help-search-input { flex: 1; }
.help-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.help-topic-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}
.help-topic-card:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  color: var(--navy);
}
.help-topic-card strong { color: var(--navy); }
.help-topic-card span { color: var(--text-muted); font-size: 13px; }
.help-results-list { display: grid; }

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

/* =================================================================
   FLASH MESSAGES
   ================================================================= */

.flashes { margin-bottom: 18px; }
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-weight: 500;
  border-left: 4px solid;
}
.flash.success { background: var(--success-soft); border-color: var(--success); color: #065F46; }
.flash.danger  { background: var(--danger-soft);  border-color: var(--danger);  color: #991B1B; }
.flash.warning { background: var(--warning-soft); border-color: var(--warning); color: #92400E; }
.flash.info    { background: var(--info-soft);    border-color: var(--info);    color: #1E40AF; }

/* =================================================================
   CARDS
   ================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(0deg, #FAFBFD 0%, #fff 100%);
}
.card-header h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.card-body { padding: 22px; }

/* =================================================================
   STATS GRID  (Dashboard)
   ================================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.stat-card .icon-bg {
  position: absolute; top: -10px; right: -10px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
}
.stat-card.cyan .icon-bg    { background: var(--cyan); }
.stat-card.orange .icon-bg  { background: var(--orange); }
.stat-card.success .icon-bg { background: var(--success); }
.stat-card.navy .icon-bg    { background: var(--navy); }

.stat-card.cyan    { border-top: 3px solid var(--cyan); }
.stat-card.orange  { border-top: 3px solid var(--orange); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.navy    { border-top: 3px solid var(--navy); }

/* =================================================================
   BUTTONS
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--cyan); color: #fff; }
.btn-primary:hover { background: var(--cyan-2); color: #fff; box-shadow: 0 4px 12px rgba(31, 163, 216, 0.3); }
.btn-secondary { background: var(--surface); color: var(--navy); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); color: var(--navy); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-2); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* =================================================================
   FORMS
   ================================================================= */

.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; display: block; }
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(31, 163, 216, 0.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-help { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* =================================================================
   TABLES
   ================================================================= */

.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.data-table thead th {
  position: relative;
  background: #F8FAFD;
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-strong);
  border-top: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table.resizable-columns {
  table-layout: fixed;
}
.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
}
.column-resizer:hover,
.column-resizer.resizing {
  background: rgba(31, 163, 216, 0.45);
}
table.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: #FAFBFD; }
table.data-table tbody tr:last-child td { border-bottom: none; }

.message-inbox-table {
  table-layout: fixed;
  min-width: 1080px;
}
.message-inbox-table th:nth-child(1) { width: 9%; }
.message-inbox-table th:nth-child(2) { width: 20%; }
.message-inbox-table th:nth-child(3) { width: 24%; }
.message-inbox-table th:nth-child(4) { width: 31%; }
.message-inbox-table th:nth-child(5) { width: 12%; }
.message-inbox-table th:nth-child(6) { width: 4%; }
.message-inbox-table tbody td {
  vertical-align: top;
}
.message-inbox-table .mi-sender,
.message-inbox-table .mi-subject,
.message-inbox-table .mi-message,
.message-inbox-table tbody td:nth-child(4) {
  max-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.message-inbox-table .mi-sender > div,
.message-inbox-table .mi-subject > div,
.message-inbox-table .mi-message > div {
  max-width: 100%;
}
.message-inbox-table .mi-message .muted {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =================================================================
   QUADRANT PILLS  (4-color customer classification)
   ================================================================= */

.quad-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.quad-pill .shape { font-size: 14px; line-height: 1; }
.quad-pill.pink_circle      { background: var(--q-pink);      color: var(--q-pink-text); }
.quad-pill.blue_triangle    { background: var(--q-blue);      color: var(--q-blue-text); }
.quad-pill.lightblue_square { background: var(--q-lightblue); color: var(--q-lightblue-text); }
.quad-pill.green_squiggle   { background: var(--q-green);     color: var(--q-green-text); }
.quad-pill.untagged         { background: #ECEFF3; color: var(--text-dim); }

/* Quadrant matrix on dashboard */
.quad-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.quad-cell {
  padding: 18px;
  border-radius: var(--radius);
  position: relative;
}
.quad-cell .shape-big { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.quad-cell .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.quad-cell .count { font-size: 28px; font-weight: 800; line-height: 1; margin-top: 4px; }
.quad-cell.pink_circle      { background: var(--q-pink);      color: var(--q-pink-text); }
.quad-cell.blue_triangle    { background: var(--q-blue);      color: var(--q-blue-text); }
.quad-cell.lightblue_square { background: var(--q-lightblue); color: var(--q-lightblue-text); }
.quad-cell.green_squiggle   { background: var(--q-green);     color: var(--q-green-text); }

/* =================================================================
   BADGES, MISC
   ================================================================= */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--cyan-soft);
  color: var(--navy-3);
}
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.gray { background: #ECEFF3; color: var(--text-muted); }
.badge.green { background: var(--success-soft); color: var(--success); }

.completeness-bar {
  width: 60px; height: 6px; background: #ECEFF3; border-radius: 3px; overflow: hidden;
  display: inline-block; vertical-align: middle;
}
.completeness-bar > span { display: block; height: 100%; background: var(--cyan); transition: width 0.3s; }

/* Filter row */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: end;
}
.filters .form-group { margin: 0; }
.filters input, .filters select { min-width: 160px; }

/* Pagination */
.pagination {
  display: flex; gap: 6px; justify-content: center; padding: 18px;
  border-top: 1px solid var(--border);
  background: #FAFBFD;
}
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.pagination a:hover { border-color: var(--cyan); color: var(--cyan); }
.pagination .active { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.pagination .disabled { opacity: 0.4; }

/* Login page */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 50%, var(--navy-3) 100%);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(31, 163, 216, 0.18) 0, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(245, 130, 32, 0.14) 0, transparent 50%);
  pointer-events: none;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.login-card .logo { text-align: center; margin-bottom: 22px; }
.login-card .logo img { width: 64px; height: 64px; }
.login-card h1 { font-size: 22px; color: var(--navy); margin: 0; text-align: center; }
.login-card .brand-tagline {
  text-align: center;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 7px;
  text-transform: uppercase;
}
.login-card .subtitle { text-align: center; color: var(--orange); font-weight: 700; font-size: 12px; letter-spacing: 0.03em; margin: 8px 0 28px; }

/* Detail rows */
.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 20px;
}
.detail-grid dt { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 4px; }
.detail-grid dd { margin: 0; font-size: 14px; color: var(--text); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .big { font-size: 48px; margin-bottom: 8px; }

/* Strategy box (on customer detail) */
.strategy-box {
  background: linear-gradient(135deg, var(--cyan-soft) 0%, #fff 100%);
  border-left: 4px solid var(--cyan);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-top: 14px;
}
.strategy-box .head { font-weight: 700; color: var(--navy); margin-bottom: 4px; font-size: 13px; }
.strategy-box .body { color: var(--text); font-size: 13px; }

/* Section heading */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-head h2 { font-size: 22px; margin: 0; color: var(--navy); font-weight: 800; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* Responsive */
@media (max-width: 900px) {
  .app-layout {
    display: block;
    min-height: 100vh;
  }
  .sidebar-resizer {
    display: none;
  }
  .sidebar {
    display: block;
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar-brand {
    padding: 10px 12px;
  }
  .sidebar-brand img {
    width: 34px;
    height: 34px;
  }
  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: thin;
  }
  .sidebar-nav .nav-section,
  .sidebar-footer {
    display: none;
  }
  .sidebar-nav a {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .main {
    min-height: auto;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    min-height: 56px;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
  }
  .topbar h1 {
    width: 100%;
    font-size: 16px;
  }
  .crm-assist {
    order: 3;
    width: 100%;
    min-width: 0;
  }
  .crm-assist-form {
    flex: 1;
    min-width: 0;
  }
  .topbar .user-chip {
    margin-left: auto;
    font-size: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .content {
    padding: 12px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .page-head > div:last-child {
    width: 100%;
  }
  .page-head h2 {
    font-size: 19px;
  }
  .card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .filters {
    align-items: stretch;
  }
  .filters .form-group,
  .filters .form-control,
  .filters .btn {
    width: 100%;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  table.data-table {
    min-width: 760px;
  }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
