/* ==========================================================================
   finSCAN — dark matte UI with neon accents
   ========================================================================== */

:root {
  --bg: #08090d;
  --surface: #101318;
  --surface-2: #151922;
  --surface-3: #1b202b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #e3e9f6;
  --muted: #7f8aa1;
  --dim: #545e73;

  --primary: #0d6efd;
  --lime: #5cff9d;
  --danger: #ff3e3e;
  --violet: #9d6bff;
  --amber: #ffb648;
  --blue: #3d8bff;

  --radius: 14px;
  --sidebar-w: 264px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --display: 'Orbitron', 'Inter', sans-serif;

  /* Bootstrap overrides */
  --bs-body-bg: #08090d;
  --bs-body-color: #e3e9f6;
  --bs-body-font-family: 'Inter', system-ui, sans-serif;
  --bs-body-line-height: 1.6;
  --bs-border-color: rgba(255, 255, 255, .08);
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: rgba(227, 233, 246, .62);
  --bs-tertiary-bg: #101318;
  --bs-secondary-bg: #151922;
  --bs-tertiary-color: #7f8aa1;
  --bs-form-control-bg: #0c0f14;
  --bs-form-control-color: #e3e9f6;
  --bs-form-control-border-color: rgba(255, 255, 255, .10);
  --bs-form-control-focus-bg: #0c0f14;
  --bs-form-control-focus-border-color: rgba(13, 110, 253, .55);
  --bs-form-select-bg: #0c0f14;
  --bs-form-select-color: #e3e9f6;
  --bs-form-select-border-color: rgba(255, 255, 255, .10);
  --bs-form-select-indicator-color: #7f8aa1;
  --bs-table-color: #e3e9f6;
  --bs-table-bg: transparent;
  --bs-table-border-color: rgba(255, 255, 255, .07);
  --bs-table-striped-bg: rgba(255, 255, 255, .022);
  --bs-table-striped-color: #e3e9f6;
  --bs-table-hover-bg: rgba(13, 110, 253, .055);
  --bs-table-hover-color: #e3e9f6;
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-success: #5cff9d;
  --bs-success-rgb: 92, 255, 157;
  --bs-danger: #ff3e3e;
  --bs-danger-rgb: 255, 62, 62;
  --bs-warning: #ffb648;
  --bs-warning-rgb: 255, 182, 72;
  --bs-info: #0d6efd;
  --bs-info-rgb: 13, 110, 253;
}

/* ---------- base ---------- */

* { scrollbar-width: thin; scrollbar-color: #2a3140 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #262d3b; border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #333c4f; }

html { height: 100%; }

body {
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(13, 110, 253, .10), transparent 62%),
    radial-gradient(820px 520px at 102% -4%, rgba(157, 107, 255, .10), transparent 58%),
    radial-gradient(760px 620px at 55% 118%, rgba(92, 255, 157, .05), transparent 62%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { color: #4d94ff; }

h1, h2, h3, h4, h5, h6 { color: #fff; font-weight: 650; letter-spacing: -.01em; }

::selection { background: rgba(13, 110, 253, .3); color: #fff; }

.text-muted { color: var(--muted) !important; }
code, .token { font-family: var(--mono); font-size: .82em; color: var(--primary); background: rgba(13, 110, 253, .08); border: 1px solid rgba(13, 110, 253, .18); padding: 2px 7px; border-radius: 6px; word-break: break-all; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pos { color: var(--lime) !important; text-shadow: 0 0 14px rgba(92, 255, 157, .35); }
.neg { color: var(--danger) !important; text-shadow: 0 0 14px rgba(255, 62, 62, .3); }
.pct { font-family: var(--mono); color: var(--primary); text-shadow: 0 0 12px rgba(13, 110, 253, .45); font-weight: 600; }

/* ---------- shell ---------- */

.app-shell { display: flex; min-height: 100vh; position: relative; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  gap: 4px;
  background: linear-gradient(180deg, #0c0e14 0%, #0a0b10 100%);
  border-right: 1px solid var(--line);
  z-index: 1045;
  overflow-y: auto;
}
.sidebar::after {
  content: ''; position: absolute; top: 0; right: -1px; width: 1px; height: 220px;
  background: linear-gradient(180deg, rgba(13, 110, 253, .55), transparent);
}

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.side-overlay { display: none; }

/* ---------- brand / logo ---------- */

.brand { display: flex; align-items: center; gap: 13px; padding: 4px 8px 14px; }

.brand-mark {
  position: relative; width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center; border-radius: 13px;
  background: radial-gradient(circle at 32% 24%, rgba(13, 110, 253, .28), rgba(13, 110, 253, .04) 65%), #0a0d12;
  border: 1px solid rgba(13, 110, 253, .38);
  color: var(--primary); font-size: 1.1rem;
  box-shadow: 0 0 26px -8px rgba(13, 110, 253, .8), inset 0 0 18px rgba(13, 110, 253, .12);
}
.brand-mark::before, .brand-mark::after {
  content: ''; position: absolute; width: 9px; height: 9px; border: 2px solid var(--primary); opacity: .85;
}
.brand-mark::before { top: -4px; left: -4px; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.brand-mark::after { bottom: -4px; right: -4px; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }

.brand-name { font-family: var(--display); font-size: 1.14rem; font-weight: 800; letter-spacing: .07em; line-height: 1; color: #fff; display: block; }
.brand-name b { font-weight: 800; color: var(--primary); text-shadow: 0 0 20px rgba(13, 110, 253, .8); }
.brand-tag { display: block; margin-top: 5px; font-size: .56rem; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }

/* ---------- sidebar nav ---------- */

.nav-group { font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: #4d576b; font-weight: 700; margin: 16px 10px 7px; }

.snav { display: flex; flex-direction: column; gap: 3px; }

.snav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 11px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.snav-item i { width: 19px; text-align: center; font-size: .95rem; opacity: .85; }
.snav-item span:first-of-type { flex: 1; }
.snav-item:hover { color: #dce4f5; background: rgba(255, 255, 255, .045); }

.snav-check {
  display: none; width: 19px; height: 19px; border-radius: 6px;
  place-items: center; font-size: .6rem; color: #ffffff;
  background: var(--primary); box-shadow: 0 0 12px rgba(13, 110, 253, .7);
}
.snav-item.active {
  color: var(--primary);
  background: linear-gradient(90deg, rgba(13, 110, 253, .16), rgba(13, 110, 253, .03));
  border-color: rgba(13, 110, 253, .32);
  font-weight: 600;
}
.snav-item.active i { opacity: 1; text-shadow: 0 0 14px rgba(13, 110, 253, .8); }
.snav-item.active .snav-check { display: grid; }
.snav-item.active::before {
  content: ''; position: absolute; left: -15px; top: 22%; height: 56%; width: 3px;
  background: var(--primary); border-radius: 0 3px 3px 0; box-shadow: 0 0 12px var(--primary);
}

.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 5px 6px; border-radius: 11px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--display); font-size: .85rem; font-weight: 700; color: #ffffff;
  background: linear-gradient(145deg, var(--primary), #4d94ff); box-shadow: 0 0 16px -4px rgba(13, 110, 253, .8);
}
.u-name { font-size: .84rem; font-weight: 600; color: #cfd8ea; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 26px;
  background: rgba(8, 9, 13, .82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, rgba(13, 110, 253, .35), transparent 45%, transparent 55%, rgba(157, 107, 255, .3)); }

.tb-crumb { display: flex; align-items: center; gap: 9px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.tb-crumb .tb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); animation: pulse 2.4s ease-in-out infinite; }
.tb-crumb strong { color: #dfe7f7; letter-spacing: .1em; font-weight: 700; }
.tb-crumb i { font-size: .55rem; color: var(--dim); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  color: var(--muted); font-size: .95rem; transition: .16s ease;
}
.icon-btn:hover { color: var(--primary); border-color: rgba(13, 110, 253, .45); box-shadow: 0 0 18px -6px rgba(13, 110, 253, .9); transform: translateY(-1px); }

.cloud-btn {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 15px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(157, 107, 255, .16), rgba(157, 107, 255, .05));
  border: 1px solid rgba(157, 107, 255, .45);
  color: #c9b3ff; font-size: .95rem; transition: .16s ease; position: relative;
}
.cloud-btn .cb-label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.cloud-btn::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 9px var(--lime);
}
.cloud-btn:hover { color: #fff; box-shadow: 0 0 26px -6px rgba(157, 107, 255, .95); transform: translateY(-1px); }
.cloud-btn.active {
  color: #fff; background: linear-gradient(135deg, rgba(157, 107, 255, .35), rgba(13, 110, 253, .14));
  border-color: rgba(157, 107, 255, .8); box-shadow: 0 0 24px -8px rgba(157, 107, 255, .9);
}

.toggler { display: none; }

/* ---------- content ---------- */

.content { width: 100%; max-width: 1460px; margin: 0 auto; padding: 28px 26px 60px; flex: 1; }

/* ---------- page header ---------- */

.page-head {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 26px;
  background: linear-gradient(115deg, rgba(13, 110, 253, .055), rgba(157, 107, 255, .05) 52%, rgba(255, 255, 255, .012));
  border: 1px solid var(--line); border-radius: 18px;
}
.page-head::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 110, 253, .75), rgba(157, 107, 255, .5), transparent);
}
.page-head::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 110, 253, .12), transparent 70%); pointer-events: none;
}

.ph-icon {
  width: 58px; height: 58px; flex: 0 0 58px; border-radius: 17px;
  display: grid; place-items: center; font-size: 1.45rem; color: #ffffff;
  background: linear-gradient(145deg, var(--primary), #4d94ff);
  box-shadow: 0 0 30px -6px rgba(13, 110, 253, .75);
}
.ph-icon.ph-lime   { color: #04121a; background: linear-gradient(145deg, var(--lime), #17c46e); box-shadow: 0 0 30px -6px rgba(92, 255, 157, .7); }
.ph-icon.ph-pink   { background: linear-gradient(145deg, var(--danger), #cc1f7e); box-shadow: 0 0 30px -6px rgba(255, 62, 62, .7); }
.ph-icon.ph-violet { background: linear-gradient(145deg, var(--violet), #6f3fe0); box-shadow: 0 0 30px -6px rgba(157, 107, 255, .7); }
.ph-icon.ph-amber  { color: #04121a; background: linear-gradient(145deg, var(--amber), #e08b16); box-shadow: 0 0 30px -6px rgba(255, 182, 72, .65); }
.ph-icon.ph-blue   { background: linear-gradient(145deg, var(--blue), #1f5fd6); box-shadow: 0 0 30px -6px rgba(61, 139, 255, .7); }

.ph-body { min-width: 0; }
.ph-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .65rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--primary); background: rgba(13, 110, 253, .08);
  border: 1px solid rgba(13, 110, 253, .3); border-radius: 999px; padding: 3px 11px;
}
.ph-tag .ph-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.ph-tag.t-pink { color: var(--danger); background: rgba(255, 62, 62, .08); border-color: rgba(255, 62, 62, .32); }
.ph-tag.t-lime { color: var(--lime); background: rgba(92, 255, 157, .08); border-color: rgba(92, 255, 157, .3); }
.ph-tag.t-violet { color: #bda6ff; background: rgba(157, 107, 255, .1); border-color: rgba(157, 107, 255, .35); }
.ph-tag.t-amber { color: var(--amber); background: rgba(255, 182, 72, .08); border-color: rgba(255, 182, 72, .32); }

.ph-title { margin: 9px 0 3px; font-family: var(--display); font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 700; letter-spacing: .03em; color: #fff; }
.ph-sub { margin: 0; color: var(--muted); font-size: .89rem; max-width: 640px; }
.ph-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- panels / cards ---------- */

.card {
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -34px rgba(0, 0, 0, .95);
  color: var(--text);
}
.card > .card-header {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .028);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 600; font-size: .92rem; color: #e7edfa;
}
.card > .card-header i { color: var(--primary); }
.card > .card-footer { background: rgba(255, 255, 255, .02); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.card-title { font-weight: 600; font-size: .98rem; color: #fff; }
.card-title i { color: var(--primary); margin-right: 7px; }
.card-text { color: var(--muted); }

.accent-card { border-top: 3px solid var(--c, var(--primary)); }

/* account cards */
.acc-card .sc-label i { margin-right: 5px; color: var(--primary); }
.acc-card .acc-meta {
  display: flex; align-items: center; gap: 13px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.acc-card .acc-meta .sc-icon { --sc: var(--primary); flex: 0 0 40px; }
.acc-card .badge { margin-top: 3px; }

/* stat cards (dashboard) */
.stat-card {
  position: relative; overflow: hidden; height: 100%;
  padding: 17px 19px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 16px;
}
.stat-card::after {
  content: ''; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--sc-glow, rgba(13, 110, 253, .2)), transparent 70%);
}
.stat-top { display: flex; align-items: center; gap: 11px; }
.sc-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1rem;
  color: var(--sc, var(--primary)); background: color-mix(in srgb, var(--sc, var(--primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc, var(--primary)) 38%, transparent);
}
.sc-label { font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sc-value { margin-top: 12px; font-family: var(--mono); font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 600; color: #fff; letter-spacing: -.03em; }
.sc-hint { font-size: .72rem; color: var(--dim); margin-top: 3px; }
.sc-lime { --sc: var(--lime); --sc-glow: rgba(92, 255, 157, .2); }
.sc-pink { --sc: var(--danger); --sc-glow: rgba(255, 62, 62, .2); }
.sc-cyan { --sc: var(--primary); --sc-glow: rgba(13, 110, 253, .2); }
.sc-violet { --sc: var(--violet); --sc-glow: rgba(157, 107, 255, .22); }

/* ---------- buttons ---------- */

.btn { border-radius: 10px; font-weight: 600; font-size: .87rem; padding: .52rem 1.05rem; letter-spacing: .01em; transition: .16s ease; }
.btn:active { transform: translateY(1px); }

.btn-neon, .btn-primary {
  color: var(--primary);
  background: linear-gradient(135deg, rgba(13, 110, 253, .16), rgba(13, 110, 253, .05));
  border: 1px solid rgba(13, 110, 253, .5);
}
.btn-neon:hover, .btn-primary:hover, .btn-neon:focus, .btn-primary:focus {
  color: #ffffff; background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 26px -4px rgba(13, 110, 253, .85);
}
.btn-outline-primary { color: var(--primary); border-color: rgba(13, 110, 253, .45); background: transparent; }
.btn-outline-primary:hover { color: #ffffff; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 22px -6px rgba(13, 110, 253, .9); }

.btn-secondary, .btn-outline-secondary { color: var(--muted); background: rgba(255, 255, 255, .045); border-color: var(--line-2); }
.btn-secondary:hover, .btn-outline-secondary:hover { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }

.btn-danger, .btn-outline-danger { color: var(--danger); background: rgba(255, 62, 62, .1); border-color: rgba(255, 62, 62, .45); }
.btn-danger:hover, .btn-outline-danger:hover { color: #17010c; background: var(--danger); border-color: var(--danger); box-shadow: 0 0 24px -6px rgba(255, 62, 62, .9); }

.btn-success, .btn-outline-success { color: var(--lime); background: rgba(92, 255, 157, .1); border-color: rgba(92, 255, 157, .42); }
.btn-success:hover, .btn-outline-success:hover { color: #04170d; background: var(--lime); border-color: var(--lime); box-shadow: 0 0 24px -6px rgba(92, 255, 157, .85); }

.btn-warning, .btn-outline-warning { color: var(--amber); background: rgba(255, 182, 72, .1); border-color: rgba(255, 182, 72, .45); }
.btn-warning:hover, .btn-outline-warning:hover { color: #1a1000; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 24px -6px rgba(255, 182, 72, .85); }

.btn-link { color: var(--primary); text-decoration: none; }
.btn-link:hover { color: #4d94ff; }

/* ---------- tables ---------- */

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: rgba(255, 255, 255, .07);
  margin-bottom: 0;
  vertical-align: middle;
}
.table > :not(caption) > * > * { background: transparent; box-shadow: none; padding: .74rem .9rem; }
.table thead th {
  font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); background: rgba(13, 110, 253, .045);
  border-bottom: 1px solid rgba(13, 110, 253, .28) !important;
  white-space: nowrap;
}
.table thead th i { color: var(--primary); margin-right: 6px; opacity: .9; }
.table tbody td { font-size: .885rem; border-color: rgba(255, 255, 255, .055) !important; }
.table tbody tr:last-child > * { border-bottom: 0 !important; }
.table-hover tbody tr:hover > * { --bs-table-hover-bg: rgba(13, 110, 253, .06); --bs-table-hover-color: var(--text); }
.table-hover tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.table tbody a { font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-actions form { display: inline-flex; margin: 0; }
.table .row-actions { display: flex; align-items: center; justify-content: flex-start; gap: 7px; flex-wrap: wrap; }
.table td .btn-sm, .table th .btn-sm { padding: .28rem .6rem; font-size: .76rem; border-radius: 8px; }
.table .row-actions form { display: inline-flex; margin: 0; }
.btn-icon { width: 34px; height: 32px; padding: 0 !important; display: inline-grid !important; place-items: center; line-height: 1; }
.empty-row td { color: var(--dim) !important; font-style: italic; letter-spacing: .04em; }
.table-neon { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(170deg, var(--surface-2), var(--surface)); }
.table-neon .table { border-radius: inherit; }

/* key/value detail table */
.table.detail-table th {
  width: 230px; padding: .82rem 1.05rem; vertical-align: middle;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); background: rgba(255, 255, 255, .022);
  border-color: rgba(255, 255, 255, .06) !important;
}
.table.detail-table th i { color: var(--primary); width: 17px; margin-right: 8px; text-align: center; }
.table.detail-table td {
  padding: .82rem 1.05rem; vertical-align: middle; font-size: .92rem;
  border-color: rgba(255, 255, 255, .06) !important;
}
.table.detail-table tr:last-child th, .table.detail-table tr:last-child td { border-bottom: 0 !important; }
.table.detail-table:hover tbody tr:hover th { background: rgba(255, 255, 255, .035); }

/* ---------- badges ---------- */

.badge { font-weight: 700; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; padding: .36em .7em; border-radius: 7px; border: 1px solid transparent; }
.bg-primary { background: rgba(13, 110, 253, .14) !important; color: var(--primary) !important; border-color: rgba(13, 110, 253, .4) !important; }
.bg-secondary { background: rgba(255, 255, 255, .06) !important; color: var(--muted) !important; border-color: var(--line-2) !important; }
.bg-success { background: rgba(92, 255, 157, .13) !important; color: var(--lime) !important; border-color: rgba(92, 255, 157, .4) !important; }
.bg-danger { background: rgba(255, 62, 62, .13) !important; color: var(--danger) !important; border-color: rgba(255, 62, 62, .42) !important; }
.bg-warning { background: rgba(255, 182, 72, .13) !important; color: var(--amber) !important; border-color: rgba(255, 182, 72, .42) !important; }
.bg-info { background: rgba(13, 110, 253, .13) !important; color: var(--primary) !important; border-color: rgba(13, 110, 253, .4) !important; }
.bg-dark { background: rgba(255, 255, 255, .05) !important; color: var(--text) !important; border-color: var(--line-2) !important; }
.text-bg-success, .text-bg-danger, .text-bg-primary, .text-bg-info, .text-bg-warning, .text-bg-secondary {
  border: 1px solid var(--line-2); border-radius: 12px;
}

/* ---------- forms ---------- */

.form-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .45rem;
}
.form-label i { color: var(--primary); font-size: .78rem; }

.form-control, .form-select {
  background: #0c0f14; color: var(--text);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px; padding: .58rem .85rem; font-size: .92rem;
}
.form-control:focus, .form-select:focus {
  background: #0c0f14; color: var(--text);
  border-color: rgba(13, 110, 253, .6);
  box-shadow: 0 0 0 .19rem rgba(13, 110, 253, .14);
}
.form-control::placeholder { color: #525c70; }
.form-select option { background: #0c0f14; color: var(--text); }
.form-select:not([multiple]):not([size]) { background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem; }
.form-control-color { padding: .3rem; height: 46px; width: 100%; cursor: pointer; }
.form-control-color::-webkit-color-swatch-wrapper { padding: 3px; }
.form-control-color::-webkit-color-swatch { border: none; border-radius: 7px; }
.form-text, small.text-muted { color: var(--dim) !important; font-size: .78rem; }
.input-group-text { background: rgba(255, 255, 255, .045); border-color: var(--line-2); color: var(--muted); border-radius: 10px; }
.input-group > .form-control, .input-group > .form-select { border-radius: 10px; }

fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- progress ---------- */

.progress {
  height: 11px; background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line); border-radius: 99px; overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg, #4d94ff, var(--primary));
  box-shadow: 0 0 16px rgba(13, 110, 253, .6); border-radius: 99px;
  font-size: .68rem; font-weight: 700; color: #ffffff; font-family: var(--mono);
}
.progress-bar.p-lime { color: #04170d; background: linear-gradient(90deg, #17c46e, var(--lime)); box-shadow: 0 0 16px rgba(92, 255, 157, .55); }
.progress-bar.p-pink { background: linear-gradient(90deg, #cc1f7e, var(--danger)); box-shadow: 0 0 16px rgba(255, 62, 62, .55); }
.progress-bar.p-violet { background: linear-gradient(90deg, #6f3fe0, var(--violet)); box-shadow: 0 0 16px rgba(157, 107, 255, .6); }
.progress-bar.p-amber { color: #1a1000; background: linear-gradient(90deg, #e08b16, var(--amber)); box-shadow: 0 0 16px rgba(255, 182, 72, .55); }

/* ---------- alerts / flashes ---------- */

.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.alert, .flash {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-left: 3px solid var(--primary);
  border-radius: 12px; padding: .78rem 1rem; font-size: .89rem;
}
.alert i, .flash i:first-child { color: var(--primary); }
.alert-success, .flash-success { border-left-color: var(--lime); background: rgba(92, 255, 157, .07); }
.alert-success i, .flash-success i:first-child { color: var(--lime); }
.alert-danger, .alert-error, .flash-danger, .flash-error { border-left-color: var(--danger); background: rgba(255, 62, 62, .07); }
.alert-danger i, .flash-danger i:first-child, .alert-error i { color: var(--danger); }
.alert-warning, .flash-warning { border-left-color: var(--amber); background: rgba(255, 182, 72, .07); }
.alert-warning i, .flash-warning i:first-child { color: var(--amber); }
.alert-info, .flash-info { border-left-color: var(--violet); background: rgba(157, 107, 255, .07); }
.alert-info i, .flash-info i:first-child { color: var(--violet); }
.flash span { flex: 1; }
.flash-close {
  margin-left: auto; background: transparent; border: 0; color: var(--dim);
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; cursor: pointer;
}
.flash-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- list group ---------- */

.list-group-item {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px !important;
  margin-bottom: 7px; font-size: .9rem;
}
.list-group-item:last-child { margin-bottom: 0; }
.list-group-item-action:hover, .list-group-item-action.active {
  background: rgba(13, 110, 253, .07); color: var(--primary); border-color: rgba(13, 110, 253, .35);
}
.list-group-item i { color: var(--primary); }

/* ---------- info grid (detail pages) ---------- */

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.info-item {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px;
}
.info-item:hover { border-color: rgba(13, 110, 253, .28); }
.ii-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .64rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; color: var(--muted);
}
.ii-label i { color: var(--primary); width: 15px; text-align: center; }
.ii-value { display: block; margin-top: 9px; font-family: var(--mono); font-size: 1.02rem; font-weight: 600; color: #fff; word-break: break-word; }

/* ---------- empty state ---------- */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 46px 20px; text-align: center; color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(255, 255, 255, .015);
}
.empty i { font-size: 2.1rem; color: #2f3a4e; }
.empty p { margin: 0; font-size: .9rem; }

/* ---------- AI cloud ---------- */

.chat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 10px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 13px;
  color: var(--text); transition: .16s ease;
}
.chat-row:hover {
  border-color: rgba(157, 107, 255, .5); transform: translateY(-2px);
  box-shadow: 0 14px 30px -24px rgba(157, 107, 255, .9);
}
.chat-row .cr-icon {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center;
  color: #c9b3ff; background: rgba(157, 107, 255, .12); border: 1px solid rgba(157, 107, 255, .38);
}
.chat-row .cr-title { font-weight: 600; color: #fff; font-size: .95rem; }
.chat-row .cr-meta { font-size: .76rem; color: var(--dim); font-family: var(--mono); }
.chat-row .cr-go { margin-left: auto; color: var(--dim); }
.chat-row:hover .cr-go { color: var(--violet); transform: translateX(3px); }

.chat-box {
  display: flex; flex-direction: column; gap: 16px;
  max-height: 540px; overflow-y: auto; padding: 20px;
}
.msg { max-width: 80%; padding: 12px 16px; border-radius: 15px; font-size: .93rem; line-height: 1.6; color: #dfe6f5; }
.msg .who {
  display: flex; align-items: center; gap: 7px; margin-bottom: 6px;
  font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--muted);
}
.msg.user {
  align-self: flex-end; border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, rgba(13, 110, 253, .15), rgba(13, 110, 253, .05));
  border: 1px solid rgba(13, 110, 253, .34);
}
.msg.user .who { color: var(--primary); }
.msg.bot {
  align-self: flex-start; border-bottom-left-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.msg.bot .who { color: var(--violet); }
.msg:empty { display: none; }

/* ---------- auth ---------- */

.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; padding: 40px 20px;
  position: relative; overflow: hidden;
}
.auth-shell::before {
  content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 110, 253, .14), transparent 65%);
  top: -180px; left: -160px; pointer-events: none;
}
.auth-shell::after {
  content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 107, 255, .14), transparent 65%);
  bottom: -220px; right: -180px; pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 430px;
  padding: 34px 32px 30px;
  background: rgba(15, 18, 24, .92);
  border: 1px solid var(--line-2); border-radius: 22px;
  backdrop-filter: blur(12px);
  box-shadow: 0 40px 90px -50px #000, 0 0 70px -34px rgba(13, 110, 253, .65);
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; text-align: center; }
.auth-brand .brand-mark { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.35rem; border-radius: 16px; }
.auth-brand .brand-name { font-size: 1.5rem; }
.auth-brand .brand-tag { letter-spacing: .34em; }
.auth-title { text-align: center; margin-bottom: 22px; }
.auth-title .ph-tag { margin-bottom: 11px; }
.auth-title h2 { font-family: var(--display); font-size: 1.2rem; letter-spacing: .05em; margin: 0 0 5px; }
.auth-title p { margin: 0; color: var(--muted); font-size: .86rem; }
.auth-foot { position: relative; z-index: 1; font-size: .74rem; color: var(--dim); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- modal ---------- */

.modal-content { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; color: var(--text); box-shadow: 0 40px 80px -40px #000; }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-weight: 650; }
.btn-close { filter: invert(1) grayscale(1) brightness(1.8); opacity: .6; }
.btn-close:hover { opacity: 1; }
.dropdown-menu { background: var(--surface-2); border: 1px solid var(--line-2); }

/* ---------- misc ---------- */

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); margin: 22px 0; border: 0; }
.section-caption {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 14px;
  font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.section-caption::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.section-caption i { color: var(--primary); }

.link-ghost { color: var(--muted); font-size: .86rem; font-weight: 600; }
.link-ghost:hover { color: var(--primary); }
.link-ghost i { margin-right: 6px; }

.dash-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary); border: 1px solid rgba(13, 110, 253, .35);
  padding: 4px 11px; border-radius: 999px; background: rgba(13, 110, 253, .07);
}
.dash-link:hover { background: var(--primary); color: #ffffff; box-shadow: 0 0 20px -5px rgba(13, 110, 253, .9); }

.chart-box { position: relative; width: 100%; height: 268px; }

.code-sample {
  background: #0a0d12; border: 1px solid rgba(92, 255, 157, .25);
  border-left: 3px solid var(--lime); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: .8rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* ---------- responsive ---------- */

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-102%); transition: transform .25s ease; box-shadow: 30px 0 70px -40px #000; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .toggler { display: grid; }
  .side-overlay {
    display: block; position: fixed; inset: 0; z-index: 1040;
    background: rgba(4, 5, 8, .68); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .side-overlay.show { opacity: 1; pointer-events: auto; }
  .content { padding: 20px 15px 50px; }
  .topbar { padding: 11px 15px; }
  .ph-actions { margin-left: 0; width: 100%; }
  .msg { max-width: 94%; }
}

@media (max-width: 575.98px) {
  .cloud-btn .cb-label { display: none; }
  .cloud-btn { padding: 0 12px; }
  .tb-crumb .tb-sec { display: none; }
  .ph-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 1.2rem; border-radius: 14px; }
  .chart-box { height: 230px; }
}
