﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ?? Dashboard: Dark Glassmorphism ?? */

/* Scoped dark backdrop */
.dark-dash {
  background: #0f172a;
  margin: -1rem -0.75rem -1.5rem;
  padding: 2rem 1.5rem 3rem;
  border-radius: 0;
  min-height: calc(100vh - 80px);
  position: relative;
  z-index: 1;
}

/* Dark Navbar */
.navbar-dark-glass {
  background: #0b1120 !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 1030;
}

.navbar-dark-glass .navbar-brand {
  color: #22d3ee !important;
  font-weight: 700;
}

.navbar-dark-glass .navbar-brand i {
  color: #06b6d4;
}

.navbar-dark-glass .nav-link {
  color: #94a3b8 !important;
  transition: color .15s;
}

.navbar-dark-glass .nav-link:hover,
.navbar-dark-glass .nav-link:focus {
  color: #e2e8f0 !important;
}

.navbar-dark-glass .dropdown-menu {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.08);
  z-index: 1050;
}

.navbar-dark-glass .dropdown-item {
  color: #cbd5e1;
}

.navbar-dark-glass .dropdown-item:hover {
  background: rgba(255,255,255,.06);
  color: #f1f5f9;
}

.navbar-dark-glass .dropdown-divider {
  border-color: rgba(255,255,255,.08);
}

.navbar-dark-glass .navbar-toggler {
  border-color: rgba(255,255,255,.15);
}

.navbar-dark-glass .navbar-toggler-icon {
  filter: invert(1) brightness(.8);
}

/* Dark Footer */
.footer-dark {
  background: #0b1120 !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  color: #475569 !important;
}

.footer-dark a {
  color: #22d3ee !important;
}

/* Dark body background */
body.dark-body {
  background: #0f172a;
}

/* Header */
.dash-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 2rem;
}

.dash-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(6,182,212,.35);
}

.dash-header h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1.45rem;
  color: #f1f5f9;
}

.dash-header p {
  margin: 0;
  font-size: .82rem;
  color: #64748b;
}

/* Glass mixin */
.glass {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* KPI Cards */
.kpi-card {
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 16px 0 0 16px;
}

.kpi-card.kpi-cyan::before   { background: #06b6d4; box-shadow: 0 0 12px #06b6d4; }
.kpi-card.kpi-amber::before  { background: #f59e0b; box-shadow: 0 0 12px #f59e0b; }
.kpi-card.kpi-rose::before   { background: #f43f5e; box-shadow: 0 0 12px #f43f5e; }
.kpi-card.kpi-purple::before { background: #a855f7; box-shadow: 0 0 12px #a855f7; }
.kpi-card.kpi-green::before  { background: #22c55e; box-shadow: 0 0 12px #22c55e; }

.kpi-body {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.kpi-cyan   .kpi-icon { background: rgba(6,182,212,.15);  color: #22d3ee; }
.kpi-amber  .kpi-icon { background: rgba(245,158,11,.15); color: #fbbf24; }
.kpi-rose   .kpi-icon { background: rgba(244,63,94,.15);  color: #fb7185; }
.kpi-purple .kpi-icon { background: rgba(168,85,247,.15); color: #c084fc; }
.kpi-green  .kpi-icon { background: rgba(34,197,94,.15);  color: #4ade80; }

.kpi-text { flex: 1; }

.kpi-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin-bottom: .2rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
}

/* Alerts / Section Card */
.alerts-card {
  overflow: hidden;
}

.alerts-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: .65rem;
}

.alerts-card-header h5 {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #e2e8f0;
}

.alerts-card-header .header-icon {
  color: #22d3ee;
  font-size: 1.1rem;
}

.alerts-card-header .badge-count {
  background: rgba(6,182,212,.15);
  color: #22d3ee;
  font-size: .73rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-left: auto;
}

/* Table – override Bootstrap inside .dark-dash */
.dark-dash .dash-table {
  margin: 0;
  font-size: .85rem;
  --bs-table-bg: transparent;
  --bs-table-color: #cbd5e1;
  --bs-table-border-color: rgba(255,255,255,.04);
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,.04);
  --bs-table-hover-color: #e2e8f0;
  color: #cbd5e1;
}

.dark-dash .dash-table > :not(caption) > * > * {
  background-color: transparent !important;
  color: #cbd5e1 !important;
  border-bottom-color: rgba(255,255,255,.04) !important;
  box-shadow: none !important;
}

.dark-dash .dash-table thead th {
  background: rgba(255,255,255,.03) !important;
  color: #64748b !important;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  border-top: none !important;
  white-space: nowrap;
}

.dark-dash .dash-table tbody tr {
  transition: background .15s;
}

.dark-dash .dash-table tbody tr:hover > * {
  background: rgba(255,255,255,.04) !important;
  color: #e2e8f0 !important;
}

.dark-dash .dash-table tbody td {
  padding: .7rem 1rem;
  vertical-align: middle;
}

.dark-dash .dash-table .code-cell {
  font-weight: 700;
  color: #22d3ee !important;
}

.dark-dash .dash-table .time-cell {
  color: #64748b !important;
  font-size: .78rem;
}

.dark-dash .dash-table .action-cell code {
  background: rgba(255,255,255,.07);
  color: #94a3b8;
  padding: .15rem .5rem;
  border-radius: 6px;
  font-size: .76rem;
}

.dark-dash .dash-table .summary-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b !important;
  font-size: .8rem;
}

.dark-dash .dash-table .user-cell {
  color: #64748b !important;
  font-size: .8rem;
}

/* Status: glowing pills */
.status-pill {
  font-size: .7rem;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 20px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-new {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
}
.status-new::before {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: pulse-dot 1.8s infinite;
}

.status-acknowledged {
  background: rgba(245,158,11,.15);
  color: #fcd34d;
}
.status-acknowledged::before {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.status-resolved {
  background: rgba(34,197,94,.15);
  color: #86efac;
}
.status-resolved::before {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* Action Buttons */
.dash-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid;
  background: transparent;
  font-size: .85rem;
  transition: all .15s;
  padding: 0;
}

.dash-action-btn.ack-btn {
  border-color: rgba(245,158,11,.4);
  color: #fbbf24;
}
.dash-action-btn.ack-btn:hover {
  background: rgba(245,158,11,.12);
  box-shadow: 0 0 10px rgba(245,158,11,.25);
}

.dash-action-btn.resolve-btn {
  border-color: rgba(34,197,94,.4);
  color: #4ade80;
}
.dash-action-btn.resolve-btn:hover {
  background: rgba(34,197,94,.12);
  box-shadow: 0 0 10px rgba(34,197,94,.25);
}

/* Empty state */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #475569;
}

.empty-state i {
  font-size: 2rem;
  display: block;
  margin-bottom: .5rem;
}

/* Dark toast/alert */
.dark-dash .alert-success-glass {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  color: #86efac;
  border-radius: 12px;
  padding: .75rem 1.25rem;
}

/* Severity badges */
.sev-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 20px;
  display: inline-block;
}

.sev-critical { background: rgba(239,68,68,.18); color: #fca5a5; }
.sev-high     { background: rgba(245,158,11,.18); color: #fcd34d; }
.sev-medium   { background: rgba(6,182,212,.18);  color: #67e8f9; }
.sev-low      { background: rgba(34,197,94,.18);  color: #86efac; }

/* Toggle switch (Scenarios) */
.toggle-label-on {
  color: #4ade80;
  font-weight: 600;
  font-size: .78rem;
}

.toggle-label-off {
  color: #64748b;
  font-weight: 600;
  font-size: .78rem;
}

/* Dark form controls */
.dark-dash .form-control-dark {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}

.dark-dash .form-control-dark:focus {
  background: rgba(255,255,255,.07);
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
  color: #f1f5f9;
}

.dark-dash .form-control-dark::placeholder {
  color: #475569;
}

.dark-dash .form-label-dark {
  color: #94a3b8;
  font-weight: 600;
  font-size: .82rem;
}

.dark-dash .form-text-dark {
  color: #475569;
  font-size: .78rem;
}

.dark-dash .form-switch .form-check-input {
  background-color: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.15);
}

.dark-dash .form-switch .form-check-input:checked {
  background-color: #06b6d4;
  border-color: #06b6d4;
}

.dark-dash .form-check-label {
  color: #cbd5e1;
}

/* Dark buttons */
.btn-glass-primary {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .5rem 1.5rem;
  font-weight: 600;
  transition: box-shadow .2s, transform .2s;
}

.btn-glass-primary:hover {
  box-shadow: 0 0 20px rgba(6,182,212,.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-glass-secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #94a3b8;
  border-radius: 10px;
  padding: .5rem 1.5rem;
  font-weight: 600;
  transition: all .15s;
}

.btn-glass-secondary:hover {
  background: rgba(255,255,255,.1);
  color: #e2e8f0;
}

.btn-glass-outline-cyan {
  background: transparent;
  border: 1.5px solid rgba(6,182,212,.4);
  color: #22d3ee;
  border-radius: 8px;
  padding: .25rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  transition: all .15s;
}

.btn-glass-outline-cyan:hover {
  background: rgba(6,182,212,.1);
  box-shadow: 0 0 10px rgba(6,182,212,.2);
  color: #22d3ee;
}

/* Scenario card grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.scenario-card {
  padding: 1.25rem 1.35rem;
  transition: transform .2s, box-shadow .2s;
}

.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.25);
}

.scenario-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.scenario-code {
  color: #22d3ee;
  font-weight: 800;
  font-size: .95rem;
}

.scenario-title {
  color: #e2e8f0;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: .5rem;
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .85rem;
  font-size: .78rem;
  color: #64748b;
}

.scenario-meta span i {
  margin-right: .25rem;
}

.scenario-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.threshold-code {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .72rem;
  color: #64748b;
  font-family: monospace;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Edit scenario description */
.desc-glass {
  color: #64748b;
  font-size: .88rem;
  line-height: 1.5;
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* ?? Fraud Center: shared dark patterns ?? */

/* Breadcrumb */
.dark-dash .breadcrumb {
  background: transparent;
  margin-bottom: 0;
  padding: 0;
}
.dark-dash .breadcrumb-item a { color: #22d3ee; }
.dark-dash .breadcrumb-item.active { color: #64748b; }
.dark-dash .breadcrumb-item + .breadcrumb-item::before { color: #475569; }

/* View toggle pill group */
.pill-toggle {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.pill-toggle a,
.pill-toggle button {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.pill-toggle a:hover,
.pill-toggle button:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.pill-toggle a.active,
.pill-toggle button.active {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
}

/* Glass section card */
.section-card {
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.section-card-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #e2e8f0;
  font-weight: 700;
  font-size: .88rem;
}
.section-card-header i { color: #22d3ee; }
.section-card-header .ms-auto { margin-left: auto; }
.section-card-body { padding: 1rem 1.25rem; }

/* Dark select / input */
.dark-dash .form-select-dark {
  background: rgba(255,255,255,.05) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right .75rem center/16px 12px;
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  border-radius: 8px;
  font-size: .82rem;
  padding: .3rem 2rem .3rem .6rem;
  appearance: none;
  -webkit-appearance: none;
}
.dark-dash .form-select-dark:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
}
.dark-dash .form-select-dark option { background: #1e293b; color: #e2e8f0; }

.dark-dash .form-input-dark {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  border-radius: 8px;
  font-size: .82rem;
  padding: .3rem .6rem;
}
.dark-dash .form-input-dark:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
  color: #f1f5f9;
}
.dark-dash .form-input-dark::placeholder { color: #475569; }

.dark-dash .filter-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: .15rem;
}

.dark-dash .form-check-input {
  background-color: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}
.dark-dash .form-check-input:checked {
  background-color: #06b6d4;
  border-color: #06b6d4;
}
.dark-dash .form-check-label { color: #94a3b8; font-size: .82rem; }

/* Dark nav tabs */
.dark-dash .nav-tabs-dark {
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.dark-dash .nav-tabs-dark .nav-link {
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .5rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  background: transparent;
}
.dark-dash .nav-tabs-dark .nav-link:hover { color: #cbd5e1; }
.dark-dash .nav-tabs-dark .nav-link.active {
  color: #22d3ee;
  border-bottom-color: #06b6d4;
  background: transparent;
}

/* Pagination */
.dark-dash .pagination-dark .page-item .page-link {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #94a3b8;
  font-size: .78rem;
}
.dark-dash .pagination-dark .page-item .page-link:hover {
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
}
.dark-dash .pagination-dark .page-item.active .page-link {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border-color: transparent;
  color: #fff;
}

/* Progress bar dark */
.dark-dash .progress-dark {
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  height: 8px;
}
.dark-dash .progress-dark .bar-danger { background: #ef4444; }
.dark-dash .progress-dark .bar-warning { background: #f59e0b; }
.dark-dash .progress-dark .bar-success { background: #22c55e; }

/* Risk score pill */
.risk-score {
  font-weight: 800;
  font-size: 1.1rem;
}
.risk-danger  { color: #fca5a5; }
.risk-warning { color: #fcd34d; }
.risk-success { color: #86efac; }

/* Entity list items */
.entity-item {
  padding: .6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .15s;
}
.entity-item:hover { background: rgba(255,255,255,.03); }
.entity-item:last-child { border-bottom: none; }
.entity-item a { color: #22d3ee; font-size: .82rem; }
.entity-item .score-pill {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 20px;
}

/* Note bubble */
.note-bubble {
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.note-bubble:last-of-type { border-bottom: none; }
.note-meta { font-size: .72rem; color: #64748b; margin-bottom: .2rem; }
.note-text { font-size: .85rem; color: #cbd5e1; }

/* Chart dark overrides */
.dark-dash .chart-card canvas {
  filter: brightness(1);
}

/* Checkbox dark */
.dark-dash input[type="checkbox"] {
  accent-color: #06b6d4;
}

/* Dark text helpers */
.dark-dash .text-glass-muted { color: #64748b; }
.dark-dash .text-glass-light { color: #cbd5e1; }
.dark-dash .text-glass-bright { color: #f1f5f9; }

/* Inline code dark */
.dark-dash code {
  background: rgba(255,255,255,.07);
  color: #94a3b8;
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .78rem;
}

/* Report card */
.report-card {
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.report-card-title {
  font-weight: 700;
  color: #e2e8f0;
  font-size: .95rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.report-card-title i { color: #22d3ee; }
.report-card-desc {
  color: #64748b;
  font-size: .82rem;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1rem;
}

/* ???????????????????????????????????????????
   Sidebar + Top Bar Layout
   ??????????????????????????????????????????? */

:root {
  --sidebar-w: 250px;
  --topbar-h: 52px;
}

/* ?? Top Bar ?? */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #0b1120;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  z-index: 1040;
  gap: .75rem;
}

.topbar-brand {
  color: #22d3ee !important;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.topbar-brand i { color: #06b6d4; }

.topbar-spacer { flex: 1; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #94a3b8;
  font-size: .82rem;
}
.topbar-user i.bi-person-circle { font-size: 1.15rem; color: #64748b; }

.topbar-logout {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: .95rem;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 6px;
  transition: all .15s;
}
.topbar-logout:hover { color: #f43f5e; background: rgba(244,63,94,.1); }

.sidebar-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: .15rem .35rem;
  border-radius: 6px;
}
.sidebar-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }

/* ?? Sidebar ?? */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #0f172a;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
  z-index: 1035;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: none; /* shown in topbar instead */
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
}

.sidebar-section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  padding: 1.1rem 1.25rem .35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .52rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.04);
}
.sidebar-link.active {
  color: #22d3ee;
  background: rgba(6,182,212,.08);
  border-left-color: #06b6d4;
}
.sidebar-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-link.active i {
  color: #22d3ee;
}

.sidebar-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
  color: #334155;
  font-size: .7rem;
}

/* ?? Content Area ?? */
.layout-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
}
.layout-content > main {
  flex: 1;
  padding: 1rem 1.5rem;
}

.layout-footer {
  background: #0b1120;
  border-top: 1px solid rgba(255,255,255,.06);
  color: #475569;
  padding: .75rem 1.5rem;
  font-size: .78rem;
}
.layout-footer a { color: #22d3ee; }

/* ?? Mobile Sidebar ?? */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1034;
    display: none;
  }
  .sidebar-open .sidebar-overlay {
    display: block;
  }
  .layout-content {
    margin-left: 0;
  }
}

/* Hide topbar brand text on larger screens (sidebar has it) */
@media (min-width: 992px) {
  .sidebar-toggle { display: none; }
}

/* ???????????????????????????????????????????
   Admin / User Management Styles
   ??????????????????????????????????????????? */

/* Role badges */
.role-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
  display: inline-block;
  margin-right: .25rem;
}
.role-admin        { background: rgba(239,68,68,.15); color: #fca5a5; }
.role-fraudmanager { background: rgba(245,158,11,.15); color: #fcd34d; }
.role-fraudanalyst { background: rgba(6,182,212,.15); color: #67e8f9; }
.role-executive    { background: rgba(168,85,247,.15); color: #c084fc; }

/* User avatar (small) */
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #64748b;
  flex-shrink: 0;
}

/* Lock button */
.dash-action-btn.lock-btn {
  border-color: rgba(239,68,68,.4);
  color: #fb7185;
}
.dash-action-btn.lock-btn:hover {
  background: rgba(239,68,68,.12);
  box-shadow: 0 0 10px rgba(239,68,68,.25);
}

/* Status locked pill */
.status-locked {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
}
.status-locked::before {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

/* Alert-danger-glass */
.alert-danger-glass {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
  border-radius: 12px;
  padding: .75rem 1.25rem;
}

/* Badge count (in section headers) */
.badge-count {
  background: rgba(6,182,212,.15);
  color: #22d3ee;
  font-size: .73rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
}

/* ═══════════════════════════════════════════
   Profile Page
   ═══════════════════════════════════════════ */

/* Avatar */
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(6,182,212,.25);
}

.profile-avatar span {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .04em;
}

/* Meta list inside user card */
.profile-meta-list {
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: .85rem;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem 0;
  font-size: .8rem;
}

.profile-meta-item i {
  color: #475569;
  font-size: .9rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.profile-meta-item .label {
  color: #64748b;
  flex-shrink: 0;
}

.profile-meta-item .value {
  color: #cbd5e1;
  margin-left: auto;
  font-weight: 600;
  text-align: right;
}

/* Banners */
.profile-banner {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  font-size: .84rem;
  line-height: 1.4;
}

.profile-banner > i {
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.profile-banner strong {
  display: block;
  margin-bottom: .1rem;
}

.profile-banner span {
  opacity: .8;
  font-size: .78rem;
}

.profile-banner-warning {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  color: #fbbf24;
}

.profile-banner-warning > i { color: #f59e0b; }

.profile-banner-danger {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  color: #fca5a5;
}

.profile-banner-danger > i { color: #ef4444; }

/* ???????????????????????????????????????????
   System Login Page
   ??????????????????????????????????????????? */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -30%;
  width: 160%;
  height: 160%;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(6,182,212,.1) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(139,92,246,.08) 0%, transparent 55%);
  animation: loginBgShift 25s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loginBgShift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-3%, -2%) scale(1.02); }
}

.login-glass-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.35), 0 0 80px rgba(6,182,212,.05);
}

/* Brand */
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  margin-bottom: .75rem;
  box-shadow: 0 0 32px rgba(6,182,212,.3);
}

.login-brand h2 {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 1.45rem;
  margin: 0;
}

.login-brand p {
  color: #64748b;
  font-size: .85rem;
  margin: .3rem 0 0;
}

/* Form */
.login-form .form-label {
  color: #94a3b8;
  font-weight: 600;
  font-size: .82rem;
}

.login-input-group {
  position: relative;
}

.login-input-group > i {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  font-size: .95rem;
  pointer-events: none;
  z-index: 2;
}

.login-input-group > .form-control {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #e2e8f0;
  border-radius: 10px;
  padding: .6rem .85rem .6rem 2.5rem;
  transition: border-color .15s, box-shadow .15s;
}

.login-input-group > .form-control:focus {
  background: rgba(255,255,255,.07);
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
  color: #f1f5f9;
}

.login-input-group > .form-control::placeholder {
  color: #475569;
}

/* Validation */
.login-validation-error {
  font-size: .82rem;
  color: #fca5a5;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px;
  padding: .5rem .85rem;
}

.login-validation-error:empty {
  display: none;
}

.login-field-error {
  font-size: .78rem;
  color: #fca5a5;
}

.login-alert-info {
  background: rgba(6,182,212,.1);
  border: 1px solid rgba(6,182,212,.25);
  color: #67e8f9;
  border-radius: 10px;
  font-size: .82rem;
  padding: .55rem .85rem;
}

/* Submit button */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .7rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}

.btn-login:hover {
  box-shadow: 0 0 28px rgba(6,182,212,.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-login:active {
  transform: translateY(0);
}

/* Links */
.login-links {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.login-links a {
  color: #22d3ee;
  font-size: .82rem;
  text-decoration: none;
  transition: color .15s;
}

.login-links a:hover {
  color: #67e8f9;
}

.login-divider {
  color: #334155;
  margin: 0 .5rem;
}

/* Footer */
.login-footer {
  position: relative;
  margin-top: 2rem;
  color: #334155;
  font-size: .75rem;
}

/* ???????????????????????????????????????????
   Fraud Test Login Page
   ??????????????????????????????????????????? */

.test-login-banner {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 12px;
  padding: .65rem 1rem;
  color: #fbbf24;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1rem;
}

.test-login-banner i {
  font-size: 1.1rem;
}

.form-control-dark {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #e2e8f0 !important;
  border-radius: 8px;
}

.form-control-dark:focus {
  background: rgba(255,255,255,.07) !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15) !important;
  color: #f1f5f9 !important;
}

.form-control-dark::placeholder {
  color: #475569 !important;
}

.form-select-dark {
  background-color: rgba(255,255,255,.05) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #e2e8f0 !important;
  border-radius: 8px;
}

.form-select-dark:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 3px rgba(6,182,212,.15) !important;
}

.form-select-dark option {
  background: #1e293b;
  color: #e2e8f0;
}

.btn-test-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}

.btn-test-login:hover {
  box-shadow: 0 0 24px rgba(245,158,11,.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-test-login:active {
  transform: translateY(0);
}