/* =============================================================
   Surveillance Platform — Ink Wash Theme
   Palette:
     page bg       #f5f7f9   (very light blue-gray)
     foreground    #2d3748   (deep slate)
     card          #ffffff   (white cards)
     sidebar bg    #1e2a3a   (deep navy)
     primary       #5b7fa6   (medium blue)
     primary-dark  #4a6a8f
     accent        #7c9fc7   (lighter blue)
     muted         #94a3b8
     border        #e2e8f0
     destructive   #e05c5c
     success-bg    #f0fdf4
     radius        0.5rem
   ============================================================= */

:root {
  --ink-bg:            #f5f7f9;
  --ink-fg:            #2d3748;
  --ink-card:          #ffffff;
  --ink-primary:       #5b7fa6;
  --ink-primary-dark:  #4a6a8f;
  --ink-accent:        #7c9fc7;
  --ink-muted:         #94a3b8;
  --ink-border:        #e2e8f0;
  --ink-sidebar-bg:    #1e2a3a;
  --ink-sidebar-fg:    #cbd5e1;
  --ink-sidebar-hover: rgba(255,255,255,0.08);
  --ink-sidebar-active:#5b7fa6;
  --ink-destructive:   #e05c5c;
  --ink-radius:        0.5rem;
  --ink-sidebar-width: 240px;

  /* Override Bootstrap 5 primary so all BS color utilities use our palette */
  --bs-primary:          #5b7fa6;
  --bs-primary-rgb:      91, 127, 166;
  --bs-secondary:        #94a3b8;
  --bs-secondary-rgb:    148, 163, 184;
  --bs-danger:           #e05c5c;
  --bs-danger-rgb:       224, 92, 92;
  --bs-link-color:       #5b7fa6;
  --bs-link-hover-color: #4a6a8f;
  --bs-link-color-rgb:   91, 127, 166;
  --bs-border-color:     #e2e8f0;
  --bs-body-color:       #2d3748;
  --bs-body-bg:          #f5f7f9;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background-color: var(--ink-bg);
  color: var(--ink-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
}

a { color: var(--ink-primary); }
a:hover { color: var(--ink-primary-dark); }

code {
  color: var(--ink-primary-dark);
  background: rgba(91, 127, 166, 0.1);
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  font-size: 0.875em;
}

/* ── Shell layout ─────────────────────────────────────────── */
.ink-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.ink-sidebar {
  width: var(--ink-sidebar-width);
  min-width: var(--ink-sidebar-width);
  background: var(--ink-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.25s ease, min-width 0.25s ease;
  z-index: 100;
}

.ink-sidebar.collapsed {
  width: 0;
  min-width: 0;
}

.ink-sidebar-header {
  padding: 1.125rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.ink-sidebar-brand {
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ink-sidebar-brand:hover { color: var(--ink-accent); }

.ink-sidebar-nav {
  padding: 0.75rem 0.5rem;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.ink-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  padding: 0.75rem 0.75rem 0.3rem;
  font-weight: 600;
  white-space: nowrap;
}

.ink-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  color: var(--ink-sidebar-fg);
  text-decoration: none;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  margin-bottom: 1px;
}

.ink-nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.ink-nav-link:hover {
  background: var(--ink-sidebar-hover);
  color: #fff;
}
.ink-nav-link:hover i { opacity: 1; }

.ink-nav-link.active {
  background: var(--ink-sidebar-active);
  color: #fff;
  font-weight: 500;
}
.ink-nav-link.active i { opacity: 1; }

.ink-sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  color: var(--ink-muted);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

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

/* ── Topbar ───────────────────────────────────────────────── */
.ink-topbar {
  border-bottom: 1px solid var(--ink-border);
  background: var(--ink-card);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ink-topbar-toggle {
  border: none;
  background: none;
  color: var(--ink-muted);
  padding: 0.35rem 0.45rem;
  border-radius: 0.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
}
.ink-topbar-toggle:hover {
  background: var(--ink-bg);
  color: var(--ink-fg);
}

/* ── Content area ─────────────────────────────────────────── */
.ink-content {
  flex: 1;
  padding: 1.75rem 2rem;
  overflow-y: auto;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background-color: var(--ink-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--ink-radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--ink-border);
  padding: 0.875rem 1rem;
  font-weight: 600;
  color: var(--ink-fg);
}

/* Colored card headers (used in forms across the app) */
.card-header-custom,
.card-header-custom *:not(.btn):not(input):not(select) {
  background-color: #1e2a3a !important;
  color: #e8f1ff !important;
  border-bottom: none !important;
}
.card-header-custom {
  border-radius: calc(var(--ink-radius) - 1px) calc(var(--ink-radius) - 1px) 0 0 !important;
}
.card-header-custom .badge {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
}
.card-header-custom .btn-outline-light {
  border-color: rgba(255,255,255,0.4) !important;
  color: rgba(255,255,255,0.9) !important;
  background: transparent !important;
}
.card-header-custom .btn-outline-light:hover,
.card-header-custom .btn-outline-light.active {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.65) !important;
}

.shadow-sm {
  box-shadow: 0 1px 4px rgba(0,0,0,0.07) !important;
}

/* ── Stat cards (tadmin dashboard) ───────────────────────── */
.ink-stat-card {
  background: var(--ink-card);
  border: 1px solid var(--ink-border);
  border-radius: var(--ink-radius);
  text-decoration: none;
  display: block;
  transition: box-shadow 0.15s, transform 0.15s;
}
.ink-stat-card:hover {
  box-shadow: 0 4px 16px rgba(91, 127, 166, 0.15);
  transform: translateY(-1px);
}

.ink-stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(91,127,166,0.15), rgba(91,127,166,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.ink-stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--ink-fg);
  line-height: 1.1;
}

.ink-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  border-radius: 0.4rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.btn-primary {
  --bs-btn-bg:                 var(--ink-primary);
  --bs-btn-border-color:       var(--ink-primary);
  --bs-btn-hover-bg:           var(--ink-primary-dark);
  --bs-btn-hover-border-color: var(--ink-primary-dark);
  --bs-btn-active-bg:          var(--ink-primary-dark);
  --bs-btn-color:              #fff;
  --bs-btn-hover-color:        #fff;
  --bs-btn-active-color:       #fff;
}

.btn-outline-primary {
  --bs-btn-color:              var(--ink-primary);
  --bs-btn-border-color:       var(--ink-primary);
  --bs-btn-hover-bg:           var(--ink-primary);
  --bs-btn-hover-border-color: var(--ink-primary);
  --bs-btn-hover-color:        #fff;
  --bs-btn-active-bg:          var(--ink-primary-dark);
}

.btn-outline-secondary {
  --bs-btn-color:              var(--ink-muted);
  --bs-btn-border-color:       var(--ink-border);
  --bs-btn-hover-bg:           var(--ink-bg);
  --bs-btn-hover-border-color: var(--ink-muted);
  --bs-btn-hover-color:        var(--ink-fg);
}

.btn-outline-warning {
  --bs-btn-color:              #d97706;
  --bs-btn-border-color:       #f59e0b;
  --bs-btn-hover-bg:           #f59e0b;
  --bs-btn-hover-color:        #fff;
}

.btn-outline-danger {
  --bs-btn-color:              var(--ink-destructive);
  --bs-btn-border-color:       var(--ink-destructive);
  --bs-btn-hover-bg:           var(--ink-destructive);
  --bs-btn-hover-color:        #fff;
}

.btn-success, .btn-outline-success {
  --bs-btn-bg:           #059669;
  --bs-btn-border-color: #059669;
  --bs-btn-hover-bg:     #047857;
  --bs-btn-color:        #fff;
  --bs-btn-hover-color:  #fff;
}

.btn-link { color: var(--ink-primary); }
.btn-link:hover { color: var(--ink-primary-dark); }

/* ── Tables ───────────────────────────────────────────────── */
.table {
  --bs-table-bg:         transparent;
  --bs-table-hover-bg:   rgba(91, 127, 166, 0.06);
  --bs-table-striped-bg: rgba(91, 127, 166, 0.03);
  color: var(--ink-fg);
  margin-bottom: 0;
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--ink-border) !important;
  padding: 0.625rem 0.75rem;
  background: rgba(91,127,166,0.04);
  white-space: nowrap;
}

.table-light {
  --bs-table-bg:           rgba(91,127,166,0.04);
  --bs-table-border-color: var(--ink-border);
}

.table td, .table th {
  border-color: var(--ink-border);
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-color-state: var(--ink-fg);
}

/* ── Forms ────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-color: var(--ink-border);
  border-radius: 0.4rem;
  background-color: #fff;
  color: var(--ink-fg);
  font-size: 0.9rem;
  padding: 0.475rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ink-primary);
  box-shadow: 0 0 0 0.2rem rgba(91, 127, 166, 0.18);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--ink-fg);
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.form-text { color: var(--ink-muted); font-size: 0.8rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge-company { background-color: var(--ink-primary) !important; }

/* bg-light badges: slate background so they're visible on the page background */
.badge.bg-light {
  background-color: #dde3ec !important;
  color: #2d3748 !important;
  border-color: #c8d0dc !important;
}

.badge.bg-danger    { background-color: var(--ink-destructive) !important; }
.badge.bg-secondary { background-color: var(--ink-muted) !important; color: #fff !important; }
.badge.bg-success   { background-color: #059669 !important; }
.badge.bg-warning   { background-color: #d97706 !important; }

/* Status variants */
.badge-active   { background: #dcfce7; color: #166534; font-weight: 500; }
.badge-inactive { background: #f1f5f9; color: #64748b; font-weight: 500; }
.badge-archived { background: #f1f5f9; color: #94a3b8; font-weight: 500; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  border-radius: var(--ink-radius);
  border: 1px solid;
  font-size: 0.9rem;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Dropdown menus ───────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--ink-border);
  border-radius: var(--ink-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 0.375rem;
}

.dropdown-item {
  color: var(--ink-fg);
  font-size: 0.875rem;
  border-radius: 0.3rem;
  padding: 0.45rem 0.75rem;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: rgba(91, 127, 166, 0.08);
  color: var(--ink-fg);
}
.dropdown-item.text-danger { color: var(--ink-destructive) !important; }
.dropdown-item.fw-bold { font-weight: 600; color: var(--ink-primary); }

.dropdown-divider { border-color: var(--ink-border); margin: 0.25rem 0; }
.dropdown-header {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-content {
  background: var(--ink-card);
  border: 1px solid var(--ink-border);
  border-radius: calc(var(--ink-radius) * 1.5);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}
.modal-header {
  border-bottom: 1px solid var(--ink-border);
  padding: 1rem 1.25rem;
}
.modal-footer { border-top: 1px solid var(--ink-border); }
.modal-backdrop { background: rgba(30,42,58,0.5); }

/* ── Tabs ─────────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 1px solid var(--ink-border);
  gap: 0.25rem;
}
.nav-tabs .nav-link {
  color: var(--ink-muted);
  border-radius: 0.4rem 0.4rem 0 0;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-tabs .nav-link:hover {
  color: var(--ink-fg);
  border-color: transparent;
  background: rgba(91,127,166,0.06);
}
.nav-tabs .nav-link.active {
  background: var(--ink-card);
  border-color: var(--ink-border) var(--ink-border) var(--ink-card);
  color: var(--ink-primary);
  font-weight: 600;
}

/* ── Pagination ───────────────────────────────────────────── */
.page-link {
  color: var(--ink-primary);
  border-color: var(--ink-border);
  background: var(--ink-card);
}
.page-link:hover {
  color: var(--ink-primary-dark);
  background: var(--ink-bg);
  border-color: var(--ink-border);
}
.page-item.active .page-link {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #fff;
}

/* ── Company section inner sidebar ───────────────────────── */
.company-sidebar {
  overflow-y: auto;
  background: var(--ink-card) !important;
  border-right: 1px solid var(--ink-border) !important;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  color: var(--ink-fg);
  text-decoration: none;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav-link i {
  width: 18px;
  text-align: center;
  color: var(--ink-muted);
}
.sidebar-nav-link:hover {
  background: rgba(91,127,166,0.08);
  color: var(--ink-fg);
}
.sidebar-nav-link:hover i { color: var(--ink-primary); }
.sidebar-nav-link.active {
  background: rgba(91,127,166,0.12);
  color: var(--ink-primary);
  font-weight: 600;
}
.sidebar-nav-link.active i { color: var(--ink-primary); }

.company-switcher-item {
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-fg);
  text-decoration: none;
  display: block;
  transition: background 0.12s;
}
.company-switcher-item:hover { background: rgba(91,127,166,0.08); }
.company-switcher-item.fw-bold { color: var(--ink-primary); }

#sidebarSearchInput { font-size: 0.85rem; }

/* ── Permissions tile view ────────────────────────────────── */
.perm-tile { cursor: pointer; }

/* ── Login page (split layout) ────────────────────────────── */
html, body { height: 100%; }

.ink-login-wrap {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left panel — form */
.ink-login-left {
  width: 420px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--ink-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.75rem;
}

.ink-login-form-box {
  width: 100%;
}

.ink-login-logo {
  font-size: 2.5rem;
  color: var(--ink-primary);
}

.ink-login-form-box h2 {
  color: var(--ink-fg);
  font-size: 1.5rem;
}

.ink-login-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Right panel — decorative */
.ink-login-right {
  flex: 1;
  min-height: 100vh;
  background: linear-gradient(145deg, #1e2a3a 0%, #2d4a6e 55%, #1a3550 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background grid pattern */
.ink-login-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(91,127,166,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,127,166,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

.ink-login-right-inner {
  position: relative;
  text-align: center;
  padding: 2rem;
}

.ink-login-bg-icon {
  font-size: 8rem;
  color: rgba(91,127,166,0.25);
  display: block;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 60px rgba(91,127,166,0.3));
}

.ink-login-tagline h3 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ink-login-tagline p {
  color: rgba(255,255,255,0.55);
  font-size: 1rem;
  margin: 0;
}

/* Small screens: stack vertically */
@media (max-width: 640px) {
  .ink-login-wrap { flex-direction: column; }
  .ink-login-left { flex: none; max-width: 100%; padding: 2rem 1.5rem; }
  .ink-login-right { flex: 0 0 220px; }
}

/* ── Utility / override helpers ───────────────────────────── */
.text-primary    { color: var(--ink-primary) !important; }
.bg-primary      { background-color: var(--ink-primary) !important; }
.border-primary  { border-color: var(--ink-primary) !important; }

/* heading in content area */
h1, h2 { color: var(--ink-fg); font-weight: 700; }
h3, h4, h5, h6 { color: var(--ink-fg); font-weight: 600; }

/* Page header rows (used extensively) */
.d-flex.justify-content-between.align-items-center h2,
.d-flex.justify-content-between.align-items-center h3 {
  font-size: 1.35rem;
  margin-bottom: 0;
}

/* Responsive: small screens */
@media (max-width: 768px) {
  .ink-sidebar {
    position: fixed;
    z-index: 1050;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }
  .ink-sidebar.collapsed { width: 0; min-width: 0; }
  .ink-content { padding: 1rem; }
}

/* =============================================================
   Dark mode — applied when <html class="ink-dark">
   Using html.ink-dark prefix for guaranteed specificity over Bootstrap
   ============================================================= */

/* CSS variable overrides (cascade to all children) */
html.ink-dark {
  --ink-bg:            #111827;
  --ink-fg:            #e2e8f0;
  --ink-card:          #1e293b;
  --ink-primary:       #7c9fc7;
  --ink-primary-dark:  #6389b0;
  --ink-accent:        #93b5d8;
  --ink-muted:         #64748b;
  --ink-border:        #2d3f55;
  --ink-sidebar-bg:    #0f172a;
  --ink-sidebar-fg:    #94a3b8;
  --ink-sidebar-hover: rgba(255,255,255,0.06);
  --ink-sidebar-active:#5b7fa6;
  --ink-destructive:   #f87171;
  /* Override Bootstrap CSS vars */
  --bs-body-bg:        #111827;
  --bs-body-color:     #e2e8f0;
  --bs-border-color:   #2d3f55;
  --bs-secondary-bg:   #1e293b;
}

html.ink-dark body {
  background-color: #111827 !important;
  color: #e2e8f0 !important;
}

html.ink-dark .ink-shell {
  background-color: #111827;
}

html.ink-dark .ink-content {
  background-color: #111827;
}

html.ink-dark .ink-topbar {
  background-color: #1e293b !important;
  border-bottom-color: #2d3f55 !important;
}

/* Cards — use !important to beat Bootstrap's local --bs-card-bg variable */
html.ink-dark .card {
  background-color: #1e293b !important;
  border-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

html.ink-dark .card-header {
  background-color: transparent !important;
  border-bottom-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

html.ink-dark .card-body,
html.ink-dark .card-footer {
  color: #e2e8f0 !important;
}

/* Tables */
html.ink-dark .table {
  color: #e2e8f0 !important;
  --bs-table-color: #e2e8f0;
  --bs-table-hover-bg: rgba(124,159,199,0.08);
  --bs-table-border-color: #2d3f55;
}

html.ink-dark .table thead th {
  color: #94a3b8 !important;
  background-color: rgba(124,159,199,0.06) !important;
  border-bottom-color: #2d3f55 !important;
}

html.ink-dark .table td,
html.ink-dark .table th {
  border-color: #2d3f55 !important;
  color: #e2e8f0;
}

html.ink-dark .table-light {
  --bs-table-bg: rgba(124,159,199,0.06) !important;
  background-color: rgba(124,159,199,0.06) !important;
}

/* Forms */
html.ink-dark .form-control,
html.ink-dark .form-select {
  background-color: #0f172a !important;
  border-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

html.ink-dark .form-control:focus,
html.ink-dark .form-select:focus {
  border-color: #7c9fc7 !important;
  box-shadow: 0 0 0 0.2rem rgba(124,159,199,0.2) !important;
}

html.ink-dark .form-control::placeholder { color: #64748b; }
html.ink-dark .form-label { color: #cbd5e1 !important; }

/* Dropdowns */
html.ink-dark .dropdown-menu {
  background-color: #1e293b !important;
  border-color: #2d3f55 !important;
}

html.ink-dark .dropdown-item { color: #e2e8f0 !important; }
html.ink-dark .dropdown-item:hover,
html.ink-dark .dropdown-item:focus {
  background-color: rgba(124,159,199,0.1) !important;
  color: #fff !important;
}
html.ink-dark .dropdown-item.text-danger { color: #f87171 !important; }
html.ink-dark .dropdown-header { color: #64748b !important; }
html.ink-dark .dropdown-divider { border-color: #2d3f55 !important; }

/* Modal */
html.ink-dark .modal-content {
  background-color: #1e293b !important;
  border-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

html.ink-dark .modal-header,
html.ink-dark .modal-footer {
  border-color: #2d3f55 !important;
}

/* Alerts */
html.ink-dark .alert-success { background:#052e16 !important; border-color:#166534 !important; color:#86efac !important; }
html.ink-dark .alert-danger  { background:#450a0a !important; border-color:#991b1b !important; color:#fca5a5 !important; }
html.ink-dark .alert-warning { background:#431407 !important; border-color:#92400e !important; color:#fcd34d !important; }
html.ink-dark .alert-info    { background:#0c1a3a !important; border-color:#1e40af !important; color:#93c5fd !important; }

/* Nav tabs */
html.ink-dark .nav-tabs { border-bottom-color: #2d3f55 !important; }
html.ink-dark .nav-tabs .nav-link { color: #94a3b8 !important; }
html.ink-dark .nav-tabs .nav-link.active {
  background-color: #1e293b !important;
  border-color: #2d3f55 #2d3f55 #1e293b !important;
  color: #7c9fc7 !important;
}

/* Text & headings */
html.ink-dark h1, html.ink-dark h2,
html.ink-dark h3, html.ink-dark h4,
html.ink-dark h5, html.ink-dark h6 { color: #e2e8f0 !important; }

html.ink-dark p,
html.ink-dark span,
html.ink-dark td,
html.ink-dark li { color: #e2e8f0; }

html.ink-dark .text-muted  { color: #64748b !important; }
html.ink-dark .text-dark   { color: #e2e8f0 !important; }

html.ink-dark code {
  background-color: rgba(124,159,199,0.15) !important;
  color: #93b5d8 !important;
}

/* Badges */
html.ink-dark .badge.bg-secondary { background-color: #374151 !important; color: #9ca3af !important; }
html.ink-dark .badge.bg-light     { background-color: #1e3a5f !important; color: #93c5fd !important; border-color: #2d4f7a !important; }
html.ink-dark .badge.bg-success   { background-color: #14532d !important; color: #86efac !important; }
html.ink-dark .badge.bg-warning   { background-color: #78350f !important; color: #fcd34d !important; }
html.ink-dark .badge.bg-danger    { background-color: #7f1d1d !important; color: #fca5a5 !important; }

/* Color dot utility */
.ink-color-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.12);
}

/* Preset colour swatch picker (forms) */
.color-swatch-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.color-swatch-opt { cursor: pointer; }
.color-swatch {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: transform 0.12s, outline-color 0.12s;
}
.color-swatch-none {
  background: transparent;
  border: 2px dashed var(--ink-muted);
  color: var(--ink-muted);
}
.color-swatch-opt:has(input:checked) .color-swatch {
  outline-color: var(--ink-fg);
  transform: scale(1.18);
}
html.ink-dark .color-swatch-opt:has(input:checked) .color-swatch {
  outline-color: #e2e8f0;
}

/* Coloured badge — used for role / company chips with a chosen colour */
.badge-colored {
  color: #fff !important;
  border: none !important;
}

/* Sidebar topbar controls */
html.ink-dark .ink-topbar-toggle { color: #64748b; }
html.ink-dark .ink-topbar-toggle:hover { background-color: #2d3f55; color: #e2e8f0; }

/* Stat cards */
html.ink-dark .ink-stat-card {
  background-color: #1e293b !important;
  border-color: #2d3f55 !important;
}
html.ink-dark .ink-stat-card .stat-value { color: #e2e8f0 !important; }

/* Company sidebar */
html.ink-dark .company-sidebar {
  background-color: #1e293b !important;
  border-color: #2d3f55 !important;
}
html.ink-dark .sidebar-nav-link { color: #cbd5e1 !important; }
html.ink-dark .sidebar-nav-link:hover { background-color: rgba(124,159,199,0.1) !important; }
html.ink-dark .sidebar-nav-link.active { background-color: rgba(91,127,166,0.25) !important; color: #7c9fc7 !important; }
html.ink-dark .company-switcher-item { color: #cbd5e1 !important; }
html.ink-dark .company-switcher-item:hover { background-color: rgba(124,159,199,0.1) !important; }

/* Outline secondary buttons */
html.ink-dark .btn-outline-secondary {
  color: #94a3b8 !important;
  border-color: #2d3f55 !important;
}
html.ink-dark .btn-outline-secondary:hover {
  background-color: #2d3f55 !important;
  color: #e2e8f0 !important;
}

/* Login left panel */
html.ink-dark .ink-login-left { background-color: #1e293b !important; }

/* Prevent white flash on page load */
html.ink-dark .ink-sidebar { background-color: #0f172a; }
