/* ═══════════════════════════════════════════════════════════════════
   TeknikSoft v2 — Tasarım Sistemi
   Attio/Pylon vibe: sofistike indigo, ince çizgiler, yumuşak gri yüzeyler
   ═══════════════════════════════════════════════════════════════════ */

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

:root {
  /* Yüzeyler */
  --bg:        #f7f7f8;
  --surface:   #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f1f1f3;

  /* Sınırlar */
  --border:    #ececef;
  --border-2:  #e0e0e4;
  --border-3:  #d4d4d9;

  /* Metin */
  --text:       #0a0a0c;
  --text-2:     #2a2a30;
  --text-muted: #6b6b75;
  --text-xs:    #8e8e98;

  /* Accent — sofistike indigo */
  --accent:       #4f46e5;
  --accent-h:     #4338ca;
  --accent-light: #eef2ff;
  --accent-mid:   #e0e7ff;
  --accent-deep:  #1e1b4b;

  /* Status */
  --green:    #16a34a;  --green-bg: #f0fdf4;
  --amber:    #b45309;  --amber-bg: #fffbeb;
  --red:      #dc2626;  --red-bg:   #fef2f2;
  --blue:     #2563eb;  --blue-bg:  #eff6ff;
  --purple:   #7c3aed;  --purple-bg:#f5f3ff;

  /* Shadows */
  --sh-xs: 0 1px 1px rgba(15,15,20,.03);
  --sh-sm: 0 1px 2px rgba(15,15,20,.04), 0 0 0 1px rgba(15,15,20,.02);
  --sh-md: 0 4px 12px rgba(15,15,20,.06), 0 1px 2px rgba(15,15,20,.04);
  --sh-lg: 0 12px 32px rgba(15,15,20,.08), 0 2px 6px rgba(15,15,20,.04);

  --r-xs: 4px;
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;

  --sb-w-collapsed: 60px;
  --sb-w-expanded:  232px;
  --sb-w: var(--sb-w-expanded);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.mono, code, kbd, .tnum { font-feature-settings: 'tnum'; }
.mono, code, kbd { font-family: 'JetBrains Mono', 'SF Mono', monospace; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }

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

/* ═══ Sidebar ═══ */
.sidebar {
  width: var(--sb-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width .2s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sb-w-collapsed); }

.sb-head {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.sidebar.collapsed .sb-head { padding: 14px 12px; }

.sb-logo {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #4f46e5 0%, #1e1b4b 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(79,70,229,.3), inset 0 1px 0 rgba(255,255,255,.2);
}
.sb-logo i { font-size: 14px; }

.sb-brand { flex: 1; min-width: 0; overflow: hidden; }
.sb-brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; color: var(--text); }
.sb-brand-sub { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .sb-brand, .sidebar.collapsed .sb-toggle-collapse { display: none; }

.sb-toggle-collapse {
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sb-toggle-collapse:hover { background: var(--surface-3); }

.sb-search { padding: 10px 12px 6px; }
.sb-search-input {
  position: relative;
  width: 100%; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center;
  padding: 0 7px 0 26px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .12s;
}
.sb-search-input:hover { border-color: var(--border-3); }
.sb-search-input i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--text-xs); }
.sb-search-input .kbd {
  margin-left: auto;
  font-size: 10px; color: var(--text-xs);
  background: var(--surface-3);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border-2);
}
.sidebar.collapsed .sb-search { display: none; }

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

.sb-section {
  padding: 6px 8px 4px;
  font-size: 10px; font-weight: 600;
  color: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 14px;
}
.sb-section:first-child { margin-top: 0; }
.sidebar.collapsed .sb-section { display: none; }
.sidebar.collapsed .sb-divider { display: block; height: 1px; background: var(--border); margin: 8px 6px; }
.sb-divider { display: none; }

.sb-link {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  margin-top: 1px;
  background: transparent;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
  position: relative;
  text-decoration: none;
}
.sb-link i { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.sb-link:hover { background: var(--surface-2); color: var(--text); }
.sb-link.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.sb-link.active i { color: var(--accent); }
.sb-link-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-link-badge {
  font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 4px;
  background: var(--red-bg); color: var(--red);
  border: 1px solid #fecaca;
}

.sidebar.collapsed .sb-link {
  justify-content: center;
  padding: 8px;
}
.sidebar.collapsed .sb-link-label,
.sidebar.collapsed .sb-link-badge { display: none; }
.sidebar.collapsed .sb-link.has-badge::after {
  content: '';
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}

/* Açılır alt menü */
.sb-parent {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 9px;
  margin-top: 1px;
  background: transparent;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-muted); cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
}
.sb-parent i.bi-chevron-down { margin-left: auto; font-size: 10px; transition: transform .2s; }
.sb-parent:hover { background: var(--surface-2); color: var(--text); }
.sb-parent.open { color: var(--text); }
.sb-parent.open i.bi-chevron-down { transform: rotate(180deg); }
.sb-parent.has-active { color: var(--text); font-weight: 600; }
.sb-parent > i:first-child { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.sb-parent.has-active > i:first-child { color: var(--accent); }

.sb-sub { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.sb-sub.open { max-height: 400px; }

.sb-sub-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 5px 9px 5px 36px;
  margin-top: 1px;
  background: transparent;
  border: none; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; font-family: inherit;
  color: var(--text-muted); cursor: pointer; text-align: left;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sb-sub-link i { font-size: 12px; flex-shrink: 0; width: 14px; }
.sb-sub-link:hover { background: var(--surface-2); color: var(--text); }
.sb-sub-link.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.sb-sub-link.active i { color: var(--accent); }

.sidebar.collapsed .sb-parent,
.sidebar.collapsed .sb-sub { display: none; }

.sb-foot { padding: 10px; border-top: 1px solid var(--border); }
.sidebar.collapsed .sb-foot { padding: 8px; }
.sb-user {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: none; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.sb-user:hover { background: var(--surface-3); }
.sb-user-meta { flex: 1; min-width: 0; text-align: left; }
.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: var(--text-muted); }
.sidebar.collapsed .sb-user { padding: 6px; justify-content: center; }
.sidebar.collapsed .sb-user-meta, .sidebar.collapsed .sb-user > i { display: none; }

.sb-collapse-toggle-btn {
  width: 100%; height: 32px;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-top: 4px;
}
.sb-collapse-toggle-btn:hover { background: var(--surface-3); }
.sb-collapse-toggle-btn .bi-chevron-double-left { display: none; }
.sidebar.collapsed .sb-collapse-toggle-btn .bi-chevron-double-left { display: inline-block; }
.sidebar.collapsed .sb-collapse-toggle-btn .bi-chevron-double-right { display: none; }
.sb-collapse-toggle-btn .bi-chevron-double-right { display: none; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #4f46e5; color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: -0.01em;
  flex-shrink: 0;
}
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-md { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 13px; }
.avatar-c0 { background: #4f46e5; }
.avatar-c1 { background: #0891b2; }
.avatar-c2 { background: #16a34a; }
.avatar-c3 { background: #b45309; }
.avatar-c4 { background: #dc2626; }
.avatar-c5 { background: #7c3aed; }
.avatar-c6 { background: #db2777; }
.avatar-c7 { background: #0d9488; }

/* ═══ Main ═══ */
.main-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ═══ Topbar ═══ */
.topbar {
  height: 52px;
  padding: 0 20px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.topbar-toggle {
  width: 28px; height: 28px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.topbar-toggle:hover { background: var(--surface-3); }
.topbar-divider { width: 1px; height: 18px; background: var(--border); }
.topbar-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted);
  flex: 1; min-width: 0;
}
.topbar-crumbs .current { color: var(--text); font-weight: 500; }
.topbar-crumbs .sep { font-size: 9px; color: var(--text-xs); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
  position: relative;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn i { font-size: 14px; }
.icon-btn.bordered { border-color: var(--border-2); background: #fff; }
.icon-btn.bordered:hover { background: var(--surface-2); border-color: var(--border-3); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}
.icon-btn-sm { width: 26px; height: 26px; }
.icon-btn-sm i { font-size: 13px; }

/* ═══ Trial banner ═══ */
.trial-banner {
  padding: 7px 20px;
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 1px solid #fde68a;
  font-size: 12.5px;
  color: #78350f;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.trial-banner a { color: #92400e; font-weight: 600; text-decoration: underline; }

/* ═══ Page area ═══ */
.page-area { flex: 1; overflow-y: auto; }
.page-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: flex-start; gap: 16px;
}
.page-header-main { flex: 1; min-width: 0; }
.page-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 6px;
}
.page-breadcrumb .sep { font-size: 9px; color: var(--text-xs); }
.page-breadcrumb .current { color: var(--text-2); font-weight: 500; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.page-content { padding: 20px 28px; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; height: 32px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 14px; }

.btn-sm { padding: 5px 10px; height: 28px; font-size: 12.5px; gap: 6px; }
.btn-sm i { font-size: 13px; }
.btn-xs { padding: 4px 8px; height: 26px; font-size: 12px; gap: 5px; }
.btn-lg { padding: 8px 16px; height: 38px; font-size: 13.5px; gap: 8px; }

.btn-primary {
  background: var(--text); color: #fff;
  border-color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-primary:hover { background: #1f1f24; color: #fff; }

.btn-accent {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(79,70,229,.18), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-accent:hover { background: var(--accent-h); color: #fff; }

.btn-secondary {
  background: #fff; color: var(--text-2);
  border-color: var(--border-2);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-3); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }

.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-bg); color: var(--red); }
.btn-danger-solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger-solid:hover { background: #b91c1c; color: #fff; }

.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #15803d; color: #fff; }

.btn-outline-primary { background: transparent; color: var(--accent); border-color: var(--accent-mid); }
.btn-outline-primary:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent-h); }
.btn-outline-secondary { background: #fff; color: var(--text-2); border-color: var(--border-2); }
.btn-outline-secondary:hover { background: var(--surface-2); border-color: var(--border-3); }
.btn-outline-danger { background: transparent; color: var(--red); border-color: #fecaca; }
.btn-outline-danger:hover { background: var(--red-bg); }
.btn-outline-success { background: transparent; color: var(--green); border-color: #bbf7d0; }
.btn-outline-success:hover { background: var(--green-bg); }
.btn-outline-warning { background: transparent; color: var(--amber); border-color: #fde68a; }
.btn-outline-warning:hover { background: var(--amber-bg); }

.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn:not(:first-child) { margin-left: -1px; }

/* ═══ Cards ═══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: transparent;
}
.card-header-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 13px;
  flex-shrink: 0;
}
.card-header-main { flex: 1; min-width: 0; }
.card-title { font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.card-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.card-body { padding: 18px; }
.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ═══ Forms ═══ */
.form-control, .form-select {
  width: 100%;
  height: 32px;
  padding: 0 12px;
  font-size: 13px; font-family: inherit;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--text-xs); }
.form-control-sm, .form-select-sm { height: 28px; font-size: 12.5px; padding: 0 10px; }
.form-control-lg { height: 38px; font-size: 13.5px; padding: 0 14px; }
textarea.form-control { height: auto; padding: 8px 12px; min-height: 80px; resize: vertical; }

.form-select {
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236b6b75' d='M4.5 6.5L8 10l3.5-3.5z'/%3E%3C/svg%3E") no-repeat right 8px center;
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-check-input { accent-color: var(--accent); }
.input-group { display: flex; }
.input-group .form-control { border-radius: 6px 0 0 6px; }
.input-group .btn { border-radius: 0 6px 6px 0; }
.input-group-text {
  display: inline-flex; align-items: center; padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  font-size: 12.5px; color: var(--text-muted);
}

/* Search input with icon */
.search-input { position: relative; display: inline-flex; }
.search-input > i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-xs); font-size: 13px; pointer-events: none;
}
.search-input > input { padding-left: 32px; }

/* ═══ Status pills ═══ */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.status-pill-sm { font-size: 11px; padding: 2px 8px; }
.status-1 { background: #f4f4f5; color: #3f3f46; border-color: #e4e4e7; } /* TeslimAlındı */
.status-1::before { background: #71717a; }
.status-2 { background: #ecfeff; color: #155e75; border-color: #a5f3fc; } /* Teşhis */
.status-2::before { background: #0891b2; }
.status-3 { background: #fffbeb; color: #92400e; border-color: #fde68a; } /* OnayBekleniyor */
.status-3::before { background: #b45309; }
.status-4 { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; } /* Tamirde */
.status-4::before { background: #4f46e5; }
.status-5 { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; } /* Test */
.status-5::before { background: #2563eb; }
.status-6 { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; } /* TeslimeHazır */
.status-6::before { background: #16a34a; }
.status-7 { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; } /* TeslimEdildi */
.status-7::before { background: #059669; }
.status-8 { background: #fef2f2; color: #b91c1c; border-color: #fecaca; } /* İptal */
.status-8::before { background: #dc2626; }

/* ═══ Tags / Badges ═══ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  font-size: 11px; font-weight: 500;
  border-radius: 4px;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border-2);
  white-space: nowrap;
}
.tag-md { padding: 3px 9px; font-size: 12px; }
.tag-accent { background: var(--accent-light); color: var(--accent-h); border-color: var(--accent-mid); }
.tag-green { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.tag-red { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.tag-amber { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.tag-blue { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }
.tag-purple { background: var(--purple-bg); color: var(--purple); border-color: #ddd6fe; }

/* Bootstrap badge override */
.badge {
  font-size: 11px; font-weight: 500;
  border-radius: 4px;
  padding: 2px 7px;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--border-2);
}
.badge.bg-primary, .bg-primary { background: var(--accent-light) !important; color: var(--accent-h) !important; border: 1px solid var(--accent-mid); }
.badge.bg-secondary, .bg-secondary { background: var(--surface-3) !important; color: var(--text-2) !important; border: 1px solid var(--border-2); }
.badge.bg-success, .bg-success { background: var(--green-bg) !important; color: var(--green) !important; border: 1px solid #bbf7d0; }
.badge.bg-danger, .bg-danger { background: var(--red-bg) !important; color: var(--red) !important; border: 1px solid #fecaca; }
.badge.bg-warning, .bg-warning { background: var(--amber-bg) !important; color: var(--amber) !important; border: 1px solid #fde68a; }
.badge.bg-info { background: var(--blue-bg) !important; color: var(--blue) !important; border: 1px solid #bfdbfe; }
.bg-opacity-75 { opacity: 1 !important; }

/* ═══ Tables ═══ */
.table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
  margin-bottom: 0;
}
.table thead { background: var(--surface-2); }
.table thead th, .table-header-custom th {
  text-align: left;
  padding: 9px 16px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2) !important;
}
.table-header-custom { background: var(--surface-2); }
.table-header-custom, .table-header-custom th { color: var(--text-muted) !important; background: var(--surface-2) !important; }
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  background: transparent;
}
.table tbody tr { transition: background .1s; }
.table-hover tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .text-muted { color: var(--text-muted) !important; font-size: 12.5px; }

/* Filter tabs (segmented) */
.seg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: 8px;
  width: fit-content;
}
.seg-tab {
  padding: 5px 11px;
  background: transparent;
  border: none; border-radius: 5px;
  font-size: 12.5px; font-weight: 500; font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.seg-tab:hover { color: var(--text); }
.seg-tab.active { background: #fff; color: var(--text); box-shadow: var(--sh-xs); }
.seg-tab .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-xs);
}
.seg-tab.active .count { color: var(--text-muted); }

/* ═══ Alerts ═══ */
.alert {
  border-radius: 8px;
  font-size: 13px;
  padding: 11px 14px;
  border: 1px solid;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.alert-danger { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }
.alert-secondary { background: var(--surface-3); color: var(--text-2); border-color: var(--border-2); }

/* ═══ Pagination ═══ */
.pagination { display: inline-flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.page-item { display: inline-block; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px;
  padding: 0 8px;
  font-size: 12.5px; font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.page-link:hover { background: var(--surface-3); color: var(--text); }
.page-item.active .page-link {
  background: var(--surface-3); color: var(--text);
  border-color: var(--border-2);
  font-weight: 600;
}
.page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }

/* ═══ Modals ═══ */
.modal-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 14px 18px; border-radius: 12px 12px 0 0; }
.modal-title { font-size: 14px; font-weight: 600; }
.modal-body { padding: 18px; font-size: 13px; }
.modal-footer { border-top: 1px solid var(--border); padding: 12px 18px; gap: 8px; border-radius: 0 0 12px 12px; }

/* ═══ Dashboard widgets ═══ */
.kpi-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.kpi-label { font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.kpi-value {
  font-family: 'Inter Tight', sans-serif;
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1;
  color: var(--text);
}
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-sub-up { color: var(--green); }

/* ═══ Utility ═══ */
.text-mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum'; }
.text-accent { color: var(--accent) !important; }
.text-muted-2 { color: var(--text-muted) !important; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fs-mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum'; font-size: 12.5px; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.empty-state-icon i { font-size: 22px; color: var(--text-xs); }
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.empty-state-hint { font-size: 12.5px; color: var(--text-muted); }

/* ═══ Login ═══ */
.login-shell { width: 100%; height: 100vh; display: flex; background: var(--bg); }
.login-visual {
  flex: 1;
  background: radial-gradient(circle at 30% 40%, #4f46e5 0%, #1e1b4b 70%);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px; color: #fff;
}
.login-visual-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-visual-content { position: relative; }
.login-form-side { width: 480px; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.login-form { width: 100%; max-width: 360px; }

/* ═══ Customer avatar palette compat ═══ */
.bg-avatar-1 { background: #4f46e5; }
.bg-avatar-2 { background: #0891b2; }
.bg-avatar-3 { background: #16a34a; }
.bg-avatar-4 { background: #b45309; }
.bg-avatar-5 { background: #dc2626; }

/* ═══ Tooltip / kbd ═══ */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  font-size: 10.5px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

/* ═══ Print ═══ */
@media print {
  .sidebar, .topbar, .trial-banner, .page-actions { display: none !important; }
  .main-wrap { margin-left: 0; }
  .card { box-shadow: none !important; }
}

/* ═══ Mobile ═══ */
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s; z-index: 300; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 299; }
  .sidebar-overlay.active { display: block; }
  .page-header, .page-content { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 12px; }
}

/* Bootstrap utility overrides for compatibility */
.text-primary { color: var(--accent) !important; }
.border-primary { border-color: var(--accent) !important; }
.fs-1 { font-size: 28px !important; }
.fs-5 { font-size: 16px !important; }
.opacity-75 { opacity: .9 !important; }
