/* ============================================================
   MINDSHIFTCS HUB — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --brand:       #712c30;
  --brand-dark:  #5a2126;
  --brand-light: #8f3a3f;
  --brand-pale:  #f9f0f0;
  --brand-glow:  rgba(113, 44, 48, 0.15);

  --black:    #010101;
  --white:    #ffffff;
  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d1d1d6;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  --success:  #16a34a;
  --success-bg: #dcfce7;
  --warning:  #d97706;
  --warning-bg: #fef3c7;
  --danger:   #dc2626;
  --danger-bg: #fee2e2;
  --info:     #2563eb;
  --info-bg:  #dbeafe;

  --sidebar-w: 240px;
  --header-h:  60px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-brand: 0 4px 20px rgba(113, 44, 48, 0.25);

  --font: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  --transition: 0.18s ease;
  --transition-lg: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(113,44,48,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(113,44,48,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 50%, rgba(30,10,10,0.8) 0%, transparent 80%);
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(113,44,48,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113,44,48,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 420px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.login-logo-mark {
  width: 42px;
  height: 42px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-brand);
}

.login-logo-text {
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.login-logo-text span { color: var(--gray-400); font-weight: 400; font-size: 12px; display: block; }

.login-title {
  color: white;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.login-sub {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

/* Login card overrides label colour to light */
.login-card .form-label { color: var(--gray-300); }

/* Login page dark inputs */
.login-card .form-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
}
.login-card .form-input:focus {
  border-color: var(--brand);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(113,44,48,0.2);
}
.login-card .form-input::placeholder { color: var(--gray-600); }

/* Modal / dashboard light inputs */
.form-input {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-800);
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--brand);
  background: white;
  box-shadow: 0 0 0 3px rgba(113,44,48,0.15);
}
.form-input::placeholder { color: var(--gray-400); }
.form-label { color: var(--gray-600); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.1px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 6px 24px rgba(113,44,48,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

.login-demo {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.login-demo-title {
  color: var(--gray-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.demo-account:hover { background: rgba(255,255,255,0.08); }
.demo-account-info { color: var(--gray-400); font-size: 12px; }
.demo-account-role { color: var(--brand-light); font-size: 11px; font-weight: 600; }

.error-msg {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── App Shell ────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--black);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 34px;
  height: 34px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-logo-text {
  color: white;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.sidebar-logo-text small { display: block; color: var(--gray-600); font-size: 10px; font-weight: 400; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  color: var(--gray-600);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--gray-400);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
  text-decoration: none;
  letter-spacing: -0.1px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item svg, .nav-item .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active {
  color: white;
  background: rgba(113,44,48,0.2);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}
.nav-item.active svg, .nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: white;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  color: var(--brand-light);
  font-size: 11px;
}
.sidebar-logout {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger); }

/* ── Main Content ─────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-title { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; color: var(--gray-900); flex: 1; }
.topbar-title span { color: var(--gray-400); font-weight: 400; font-size: 13px; margin-left: 8px; }

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

.notification-btn {
  position: relative;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition);
}
.notification-btn:hover { background: var(--gray-50); color: var(--gray-800); }
.notification-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid white;
}

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

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.3px;
}
.card-subtitle {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-lg);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand);
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.green::before { background: var(--success); }
.stat-card.amber::before { background: var(--warning); }
.stat-card.blue::before  { background: var(--info); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}
.stat-icon.red   { background: var(--brand-pale); color: var(--brand); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.blue  { background: var(--info-bg); color: var(--info); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
}
.stat-change {
  font-size: 11px;
  font-weight: 500;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead {
  background: var(--gray-50);
}
th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-pending        { background: var(--warning-bg); color: var(--warning); }
.badge-approved       { background: var(--success-bg); color: var(--success); }
.badge-rejected       { background: var(--danger-bg);  color: var(--danger); }
.badge-sent           { background: var(--info-bg);    color: var(--info); }
.badge-paid           { background: #d1fae5; color: #065f46; }
.badge-partially_paid { background: #fef9c3; color: #854d0e; }
.badge-role           { background: var(--brand-pale); color: var(--brand); }
.badge-default        { background: var(--gray-100);   color: var(--gray-600); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; }
.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-800); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}

/* ── Forms ────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  padding: 9px 12px;
  outline: none;
  transition: all var(--transition);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--brand);
  background: white;
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.field-textarea { resize: vertical; min-height: 80px; }
.field-select { appearance: none; cursor: pointer; }

/* ── Search & Filters ─────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.search-input-wrap {
  position: relative;
  flex: 1;
}
.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 15px;
  height: 15px;
}
.search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-800);
  outline: none;
  transition: all var(--transition);
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.filter-select {
  padding: 9px 12px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--brand); }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-text h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--gray-900);
}
.page-header-text p {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 3px;
}

/* ── Grid Layouts ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Team Directory Cards ─────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-lg);
  box-shadow: var(--shadow-sm);
}
.team-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow), 0 0 0 3px var(--brand-glow);
  transform: translateY(-3px);
}

.team-avatar {
  width: 56px; height: 56px;
  background: var(--brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-brand);
}
.team-avatar.green { background: var(--success); box-shadow: 0 4px 16px rgba(22,163,74,0.3); }
.team-avatar.blue  { background: var(--info);    box-shadow: 0 4px 16px rgba(37,99,235,0.3); }
.team-avatar.amber { background: var(--warning); box-shadow: 0 4px 16px rgba(217,119,6,0.3); }
.team-avatar.gray  { background: var(--gray-600); }

.team-name { font-size: 14px; font-weight: 600; letter-spacing: -0.3px; color: var(--gray-900); }
.team-role { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.team-email { font-size: 11px; color: var(--brand); margin-top: 6px; font-family: var(--font-mono); }

/* ── Services ─────────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-lg);
}
.service-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.service-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.service-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--gray-900); }
.service-price { font-size: 16px; font-weight: 700; color: var(--brand); letter-spacing: -0.5px; }
.service-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.service-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }

/* ── Marketing ────────────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.status-dot.hot    { background: var(--danger); }
.status-dot.warm   { background: var(--warning); }
.status-dot.cold   { background: var(--info); }
.status-dot.closed { background: var(--success); }

/* ── Notifications ────────────────────────────────────────── */
.notification-panel {
  position: fixed;
  top: 70px; right: 20px;
  width: 320px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  display: none;
}
.notification-panel.open { display: block; animation: slideDown 0.2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  gap: 12px;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--brand-pale); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand-pale);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.notif-text { flex: 1; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.notif-time { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
  max-width: 340px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.2px;
}
.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Activity Feed ────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-text { font-size: 13px; color: var(--gray-700); flex: 1; line-height: 1.5; }
.activity-text strong { color: var(--gray-900); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); transition: transform var(--transition-lg); }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex !important; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-600);
}

.overlay-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}
.overlay-backdrop.open { display: block; }

/* ── Utility ──────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-400); }
.fw-600 { font-weight: 600; }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Invoice print styles ─────────────────────────────────── */
@media print {
  @page { size: A4 portrait; margin: 12mm 14mm; }
  html, body { height: auto !important; overflow: visible !important; background: white !important; }
  body * { visibility: hidden; }
  #invPrintWrap, #invPrintWrap * { visibility: visible; }
  #invPrintWrap {
    position: absolute;
    inset: 0;
    padding: 0;
    background: white;
    z-index: 9999;
    width: 100%;
  }
  #invPrintWrap > div:first-child {
    max-width: 100% !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 12px !important;
  }
  .no-print { display: none !important; }
  table { page-break-inside: avoid; }
  img { max-height: 55px !important; }
  /* Tighten spacing for print */
  #invPrintWrap [style*="margin-bottom:28px"] { margin-bottom: 14px !important; }
  #invPrintWrap [style*="margin-bottom:30px"] { margin-bottom: 14px !important; }
  #invPrintWrap [style*="margin-bottom:24px"] { margin-bottom: 12px !important; }
  #invPrintWrap [style*="margin-bottom:32px"] { margin-bottom: 14px !important; }
  #invPrintWrap [style*="padding:40px 44px"] { padding: 0 !important; }
}
