:root {
  --brand: #7a3b2e;
  --brand-dark: #51261e;
  --accent: #e8b86d;
  --surface: #fffaf6;
  --text: #2c201c;
  --muted: #6b5b55;
}

body {
  background:
    radial-gradient(circle at top left, rgba(232, 184, 109, 0.18), transparent 25%),
    linear-gradient(180deg, #fff7f0 0%, #f8f1eb 100%);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 288px;
  flex: 0 0 288px;
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  overflow: hidden;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  min-height: 0;
}

.app-brand {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.25rem;
}

.app-brand-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}

.app-brand-subtitle {
  display: block;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.app-nav-link {
  color: #fff;
  text-decoration: none;
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.app-nav-link:hover,
.app-nav-link:focus {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.app-sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.sidebar-user {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.35rem;
}

.app-topbar-title {
  color: var(--brand-dark);
  font-weight: 700;
}

.btn-sidebar {
  background: #fff;
  border: 1px solid rgba(81, 38, 30, 0.14);
  color: var(--brand-dark);
}

.mobile-sidebar-shell {
  padding: 0 1rem 1rem;
}

.mobile-sidebar {
  padding: 1rem;
}

.mobile-sidebar .app-nav-link {
  color: var(--brand-dark);
}

.mobile-sidebar .app-nav-link:hover,
.mobile-sidebar .app-nav-link:focus {
  background: rgba(122, 59, 46, 0.08);
}

.card {
  border: 0;
  box-shadow: 0 12px 32px rgba(81, 38, 30, 0.08);
  border-radius: 1rem;
}

.stat-card {
  background: var(--surface);
  border-left: 5px solid var(--accent);
}

.section-title {
  color: var(--brand-dark);
  font-weight: 700;
}

.table thead th {
  background: #f2e3d8;
  color: var(--brand-dark);
}

.table td,
.table th {
  vertical-align: middle;
}

.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}

.form-label {
  font-weight: 600;
}

.form-control,
.form-select,
.btn {
  min-height: 2.9rem;
}

.btn-sm {
  min-height: 2.35rem;
}

.app-shell {
  max-width: 1440px;
  padding-top: 0.5rem;
}

.app-footer {
  padding: 0 1.25rem 1.5rem;
}

.app-footer-inner {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.app-footer-line {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.app-footer-icon {
  font-size: 1rem;
  color: var(--brand-dark);
}

.app-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.app-footer a:hover,
.app-footer a:focus {
  color: var(--brand-dark);
  text-decoration: underline;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-card {
  background: rgba(255, 250, 246, 0.88);
}

.actions-cell {
  white-space: nowrap;
}

.actions-group {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dynamic-row {
  padding: 0.85rem;
  border: 1px solid rgba(81, 38, 30, 0.12);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.72);
}

.login-card {
  max-width: 420px;
}

.small-muted {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .app-topbar {
    padding: 1rem 1rem 0.25rem;
  }

  .app-topbar-title {
    font-size: 0.95rem;
  }

  .app-footer {
    padding: 0 1rem 1.25rem;
  }

  .table-responsive {
    margin-inline: -0.25rem;
  }
}

.page-context-help {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  float: right;
  margin: 0 0 0.85rem 1rem;
  padding: 0.48rem 0.72rem 0.48rem 0.5rem;
  color: #c9eeff;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  background: rgba(11, 31, 57, 0.72);
  box-shadow: 0 8px 20px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.06);
  cursor: help;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.page-context-help:hover,
.page-context-help:focus {
  border-color: var(--accent);
  outline: 0;
  transform: translateY(-2px);
  box-shadow: 0 11px 24px rgba(0,0,0,.24), 0 0 16px rgba(34,211,238,.12);
}
.page-context-help-icon {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  color: #07111f;
  border-radius: 50%;
  background: linear-gradient(135deg, #7deeff, #9f8cff);
  font-weight: 900;
}
.tooltip { --bs-tooltip-max-width: 295px; --bs-tooltip-bg: #dff7ff; --bs-tooltip-color: #07111f; --bs-tooltip-opacity: 1; }
.tooltip-inner { padding: 0.7rem 0.85rem; border-radius: 0.75rem; box-shadow: 0 12px 28px rgba(0,0,0,.35); font-size: 0.82rem; line-height: 1.4; text-align: left; }
.tooltip .tooltip-arrow::before { border-right-color: #dff7ff; }

.manual-section { height: 100%; }
.manual-list { display: grid; gap: 0.8rem; }
.manual-item {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(155, 190, 242, 0.12);
  border-radius: 0.9rem;
  background: rgba(5, 15, 31, 0.28);
}
.manual-item h3 { margin: 0 0 0.3rem; color: #bff3ff; font-size: 0.94rem; font-weight: 750; }
.manual-item p { color: #b7c6de; font-size: 0.9rem; line-height: 1.5; }

@media (max-width: 767.98px) {
  .page-context-help { float: none; margin: 0 0 1rem; }
}

@media (max-width: 767.98px) {
  main.container,
  main.container-fluid,
  main.container-xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .page-toolbar,
  .page-toolbar-actions,
  .d-flex.gap-2,
  .d-flex.gap-3 {
    width: 100%;
  }

  .page-toolbar-actions > *,
  .d-flex.gap-2 > .btn,
  .d-flex.gap-2 > a.btn,
  .d-flex.gap-3 > .btn,
  .d-flex.gap-3 > a.btn {
    flex: 1 1 auto;
  }

  .actions-group {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .app-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .actions-cell {
    min-width: 8rem;
  }
}

/* GTA dark dimensional theme */
:root {
  --brand: #7c3aed;
  --brand-dark: #35126b;
  --accent: #22d3ee;
  --accent-warm: #fb7185;
  --success: #34d399;
  --surface: #121d33;
  --surface-elevated: #182640;
  --text: #edf5ff;
  --muted: #9eb0cc;
  --line: rgba(173, 205, 255, 0.12);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 4%, rgba(124, 58, 237, 0.25), transparent 25rem),
    radial-gradient(circle at 92% 22%, rgba(34, 211, 238, 0.16), transparent 28rem),
    radial-gradient(circle at 48% 100%, rgba(251, 113, 133, 0.09), transparent 32rem),
    #07111f;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.app-sidebar {
  width: 302px;
  flex-basis: 302px;
  padding: 1rem;
  background: linear-gradient(155deg, rgba(22, 34, 61, 0.98), rgba(7, 14, 29, 0.99));
  border-right: 1px solid rgba(157, 187, 255, 0.14);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.24);
}

.app-sidebar::before {
  content: "";
  position: absolute;
  width: 16rem;
  height: 16rem;
  top: -7rem;
  left: -8rem;
  border-radius: 50%;
  background: #7c3aed;
  filter: blur(72px);
  opacity: 0.25;
}

.app-sidebar-inner { position: relative; gap: 1rem; }

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(160, 199, 255, 0.16);
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(34, 211, 238, 0.1));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 13px 30px rgba(0, 0, 0, 0.18);
}

.app-brand-logo {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  border-radius: 0.8rem;
  object-fit: cover;
  box-shadow: 0 0.45rem 1rem rgba(0, 0, 0, 0.24);
}

.app-brand-copy {
  min-width: 0;
}

.app-brand-title {
  letter-spacing: 0.14em;
  font-size: 1.55rem;
  background: linear-gradient(100deg, #fff, #bcecff 55%, #d8c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-brand-subtitle { color: #c1d3f3; font-size: 0.8rem; line-height: 1.35; }

.login-brand-logo {
  display: block;
  width: 6rem;
  height: 6rem;
  margin: 0 auto 0.9rem;
  border-radius: 1.25rem;
  object-fit: cover;
  box-shadow: 0 0.7rem 1.4rem rgba(15, 23, 42, 0.18);
}
.app-nav { gap: 0.27rem; padding: 0.3rem 0.25rem 0.5rem 0; }
.app-nav-link {
  position: relative;
  color: #b8c8e5;
  padding: 0.68rem 0.82rem;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.app-nav-link::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.7rem;
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  background: #536685;
  box-shadow: 0 0 0 transparent;
  transition: all 0.2s ease;
}
.app-nav-link:hover,
.app-nav-link:focus {
  color: #fff;
  background: linear-gradient(100deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.12));
  border-color: rgba(145, 194, 255, 0.17);
  transform: translateX(4px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15), inset 0 1px rgba(255,255,255,0.08);
}
.app-nav-link:hover::before,
.app-nav-link:focus::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.app-sidebar-footer {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px rgba(255,255,255,0.06);
}
.sidebar-user { color: #d9e7ff; padding: 0 0.15rem 0.2rem; }
.app-sidebar .btn-outline-light {
  color: #dcecff;
  border-color: rgba(184, 217, 255, 0.3);
  background: rgba(255,255,255,0.04);
}
.app-sidebar .btn-outline-light:hover { color: #07111f; border-color: #b9f3ff; background: #b9f3ff; box-shadow: 0 0 24px rgba(34,211,238,.32); }

.app-topbar { padding: 1.3rem 1.8rem 0.7rem; }
.app-topbar-title { color: #dfeaff; font-size: 0.93rem; letter-spacing: 0.04em; }
.btn-sidebar {
  color: #dff7ff;
  border-color: rgba(111, 214, 255, 0.35);
  background: rgba(19, 36, 65, 0.78);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

.card,
.filter-card {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(26, 41, 70, 0.9), rgba(14, 25, 46, 0.9));
  box-shadow: 0 18px 36px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.07), inset 1px 0 rgba(255,255,255,.02);
  backdrop-filter: blur(12px);
}
.card:hover { border-color: rgba(126, 223, 255, 0.22); }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 7.4rem;
  border-left: 0;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -2rem -3rem auto;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 66%);
}
.stat-card:nth-child(3n+2)::after { background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 66%); }
.stat-card:nth-child(3n)::after { background: radial-gradient(circle, rgba(251, 113, 133, 0.38), transparent 66%); }
.stat-card .fs-3 { color: #fff; text-shadow: 0 4px 18px rgba(34,211,238,.22); }

.section-title { color: #f3f7ff; letter-spacing: -0.025em; }
.text-muted,
.small-muted { color: var(--muted) !important; }
.table { --bs-table-color: #e6efff; --bs-table-bg: transparent; --bs-table-border-color: var(--line); }
.table thead th {
  color: #dff7ff;
  background: rgba(87, 126, 187, 0.16);
  border-bottom-color: rgba(112, 221, 255, 0.22);
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.table tbody tr { transition: background-color 0.18s ease; }
.table tbody tr:hover { background: rgba(74, 129, 194, 0.13); }

.form-label { color: #dce8fb; }
.form-control,
.form-select {
  color: #edf5ff;
  border-color: rgba(152, 186, 234, 0.22);
  border-radius: 0.8rem;
  background-color: rgba(5, 15, 31, 0.54);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.18), 0 1px rgba(255,255,255,.04);
}
.form-control::placeholder { color: #7185a6; }
.form-select { background-image: var(--bs-form-select-bg-img); }
.form-select option { color: #edf5ff; background: #12203a; }
.form-control:focus,
.form-select:focus {
  color: #fff;
  border-color: var(--accent);
  background-color: rgba(8, 22, 44, 0.9);
  box-shadow: 0 0 0 0.25rem rgba(34, 211, 238, .13), inset 0 2px 5px rgba(0,0,0,.18);
}
.form-check-input { background-color: #0d1930; border-color: #54719d; }
.form-check-input:checked { background-color: var(--brand); border-color: #a78bfa; }

.btn {
  border-radius: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform .17s ease, box-shadow .17s ease, filter .17s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.27), inset 0 1px rgba(255,255,255,.25);
}
.btn-primary:hover,
.btn-primary:focus { border-color: #a78bfa; background: linear-gradient(135deg, #8b5cf6, #2563eb); box-shadow: 0 14px 28px rgba(79,70,229,.38), 0 0 16px rgba(34,211,238,.14); }
.btn-outline-primary { color: #7deeff; border-color: rgba(34,211,238,.5); background: rgba(34,211,238,.045); }
.btn-outline-primary:hover { color: #07111f; border-color: #67e8f9; background: #67e8f9; box-shadow: 0 10px 22px rgba(34,211,238,.22); }
.btn-outline-secondary { color: #cbd9f1; border-color: #536a90; }
.btn-outline-secondary:hover { background: #536a90; border-color: #7897c5; }
.btn-outline-danger { color: #fda4af; border-color: rgba(251,113,133,.55); }
.btn-outline-danger:hover { background: #e11d48; border-color: #fb7185; }

.alert { color: #eaf5ff; border-color: var(--line); background: rgba(23, 42, 73, .88); box-shadow: 0 12px 30px rgba(0,0,0,.17); }
.alert-success { border-left: 4px solid var(--success); }
.alert-danger { border-left: 4px solid var(--accent-warm); }
.dynamic-row { border-color: var(--line); background: rgba(5, 15, 31, .32); }

.app-footer { padding-top: 1.1rem; }
.app-footer-inner {
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(8, 17, 33, .5);
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}
.app-footer a { color: #89eaff; }
.app-footer a:hover,
.app-footer a:focus { color: #d5f9ff; }
.app-footer-icon { color: var(--accent); }

.mobile-sidebar { background: linear-gradient(145deg, #172644, #0b1730); }
.mobile-sidebar .app-nav-link { color: #cbdaf1; }
.mobile-sidebar .app-nav-link:hover,
.mobile-sidebar .app-nav-link:focus { color: #fff; background: rgba(124,58,237,.25); }

@media (max-width: 991.98px) {
  .app-topbar { padding: 1rem 1rem 0.4rem; }
  .app-shell { padding-top: 0.8rem; }
}
