/* QSIC — Operational Visibility
   D&H red — aurora glass on deep charcoal
------------------------------------------------ */
:root {
  /* D&H brand palette
     Primary Red #D11C23 · Black #000 · White #FFF
     Accent Blue #3498DB · Light Gray #EEE · Dark Gray #666 */
  --bg: #0a0a0a;
  --bg-2: #141414;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .24);
  --text: #ffffff;
  --text-dim: #eeeeee;
  /* Light Gray — AA on dark */
  --muted: #bfbfbf;
  /* secondary text, AA on dark */
  --accent: #d11c23;
  /* Primary Red — PMS 711C */
  --accent-2: #ef3b42;
  /* lighter red for gradients/hover */
  --accent-3: #3498db;
  /* Accent Blue — PMS 801C */
  --gray-1: #eeeeee;
  --gray-2: #666666;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #ef3b42;
  --info: #3498db;
  --focus-ring: 0 0 0 3px rgba(209, 28, 35, .55), 0 0 0 5px rgba(255, 255, 255, .35);
  --radius: 18px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 2px 10px rgba(0, 0, 0, .4);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1100px 700px at 85% -10%, rgba(209, 28, 35, .35) 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(52, 152, 219, .18) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -.01em;
  color: var(--text)
}

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

a:hover {
  color: #ff6a62
}

.text-muted {
  color: var(--text-dim) !important
}

code {
  color: #fde68a;
  background: rgba(252, 211, 77, .08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .85em
}

/* ===== Aurora background ===== */
.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none
}

.aurora .blob {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .45;
  mix-blend-mode: screen;
  animation: float 22s ease-in-out infinite
}

.aurora .b1 {
  background: radial-gradient(circle, #d11c23 0%, transparent 60%);
  top: -20vmax;
  left: -15vmax
}

.aurora .b2 {
  background: radial-gradient(circle, #3498db 0%, transparent 60%);
  bottom: -25vmax;
  right: -15vmax;
  animation-delay: -7s
}

.aurora .b3 {
  background: radial-gradient(circle, #ef3b42 0%, transparent 60%);
  top: 30%;
  left: 35%;
  width: 40vmax;
  height: 40vmax;
  animation-delay: -14s;
  opacity: .28
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%)
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(4vmax, -3vmax) scale(1.05)
  }

  66% {
    transform: translate(-3vmax, 4vmax) scale(.95)
  }
}

/* ===== Glass ===== */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Auth shell ===== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: stretch
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  min-height: 100vh
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr
  }

  .brand-panel {
    display: none
  }
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
  position: relative
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  font-family: 'Space Grotesk';
  font-size: 18px
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -.02em;
  box-shadow: 0 8px 24px -8px var(--accent)
}

.brand-copy {
  max-width: 520px
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-transform: uppercase;
  letter-spacing: .08em
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .7);
  animation: pulse 1.8s infinite
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0)
  }
}

.brand-copy h1 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  margin: 18px 0 14px
}

.brand-copy p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 46ch
}

.brand-stats {
  display: flex;
  gap: 28px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none
}

.brand-stats li {
  display: flex;
  flex-direction: column
}

.brand-stats strong {
  font-family: 'Space Grotesk';
  font-size: 24px
}

.brand-stats span {
  font-size: 12px;
  color: var(--text-dim)
}

.brand-foot {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px
}

.brand-foot i {
  color: var(--success)
}

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px
}

.form-card {
  width: 100%;
  max-width: 440px;
  padding: 36px
}

.form-head {
  margin-bottom: 22px
}

.form-head h2 {
  font-size: 26px;
  margin: 6px 0 6px
}

.form-head p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px
}

.back-link:hover {
  color: var(--text)
}

/* ===== Forms ===== */
.field {
  margin-bottom: 16px
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block
}

.control {
  position: relative
}

.control>i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none
}

.control .reveal {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer
}

.control .reveal:hover {
  color: var(--text);
  background: var(--surface)
}

.form-control {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--text);
  height: 48px;
  padding-left: 42px;
  border-radius: 12px;
  font-size: 14px;
  transition: .18s ease;
}

.form-control:focus {
  background: rgba(255, 255, 255, .06);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 4px rgba(230, 48, 39, .18);
}

.form-control::placeholder {
  color: #b8a4a4
}

.form-check-input {
  background-color: rgba(255, 255, 255, .06);
  border-color: var(--border-strong)
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent)
}

.form-check-label {
  color: var(--text);
  font-size: 13px
}

.link-muted {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, .25)
}

.link-muted:hover {
  color: var(--text);
  text-decoration-color: currentColor
}

.link-accent {
  color: #ff8a82;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px
}

.invalid-feedback {
  font-size: 12px
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: #ef3b42 !important;
  background-image: none !important;
  padding-right: 12px !important;
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 59, 66, 0.2) !important;
}

.was-validated :invalid~.invalid-feedback,
.was-validated .control:has(:invalid)~.invalid-feedback {
  display: block !important;
}


.chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px
}

/* ===== Buttons ===== */
.btn {
  font-weight: 600;
  border-radius: 12px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .18s ease;
  border: 1px solid transparent
}

.btn-grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  height: 48px;
  box-shadow: 0 12px 30px -10px rgba(230, 48, 39, .55);
  position: relative;
  overflow: hidden;
}

.btn-grad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s
}

.btn-grad:hover {
  transform: translateY(-1px);
  color: #fff
}

.btn-grad:hover::after {
  transform: translateX(100%)
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong)
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: #fff
}

.btn-ghost.active {
  background: var(--surface-2);
  border-color: var(--border-strong)
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2)) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 4px 15px -4px rgba(209, 28, 35, 0.4) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: linear-gradient(120deg, var(--accent-2), var(--accent)) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px -2px rgba(209, 28, 35, 0.55) !important;
  filter: brightness(1.1) !important;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px
}

/* Accessible focus ring for all interactive elements */
:where(a, button, .btn, .icon-btn, .form-control, .form-check-input, input, select, textarea, [role="button"]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-soft {
  border: 1px solid transparent;
  font-weight: 600
}

.btn-soft.btn-success {
  background: rgba(52, 211, 153, .12);
  color: #86efac;
  border-color: rgba(52, 211, 153, .25)
}

.btn-soft.btn-info {
  background: rgba(96, 165, 250, .12);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, .25)
}

.btn-soft.btn-warning {
  background: rgba(251, 191, 36, .12);
  color: #fde68a;
  border-color: rgba(251, 191, 36, .3)
}

.btn-soft.btn-danger {
  background: rgba(251, 113, 133, .12);
  color: #fecaca;
  border-color: rgba(251, 113, 133, .3)
}

.btn-soft:hover {
  filter: brightness(1.15)
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border)
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 14px
}

.steps li span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600
}

.steps li.active {
  color: var(--text)
}

.steps li.active span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent
}

.steps li.done span {
  background: rgba(52, 211, 153, .2);
  color: #86efac;
  border-color: rgba(52, 211, 153, .35)
}

/* Strength meter */
.strength {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.strength .bars {
  display: flex;
  gap: 4px;
  flex: 1
}

.strength .bars span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  transition: .2s
}

.strength .bars span.weak {
  background: var(--danger)
}

.strength .bars span.fair {
  background: var(--warning)
}

.strength .bars span.good {
  background: var(--info)
}

.strength .bars span.strong {
  background: var(--success)
}

.strength .label {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px
}

.checklist li.ok {
  color: #86efac
}

.checklist li i {
  font-size: 14px
}

/* Soft alerts */
.alert-soft {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(230, 48, 39, .08);
  border: 1px solid rgba(230, 48, 39, .18);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
}

.alert-soft.alert-warning {
  background: rgba(251, 191, 36, .08);
  border-color: rgba(251, 191, 36, .25);
  color: #fde68a
}

.alert-soft.alert-warning code {
  background: rgba(251, 191, 36, .15);
  color: #fde68a
}

.alert-soft.alert-danger {
  background: rgba(239, 59, 66, .08) !important;
  border-color: rgba(239, 59, 66, .25) !important;
  color: #fecaca !important
}

.alert-soft.alert-danger i {
  color: #fca5a5 !important
}

.alert-soft.alert-success {
  background: rgba(74, 222, 128, .08) !important;
  border-color: rgba(74, 222, 128, .25) !important;
  color: #bbf7d0 !important
}

.alert-soft.alert-success i {
  color: #86efac !important
}

.alert-soft i {
  font-size: 18px;
  line-height: 1;
  margin-top: 1px
}

/* ===== Dashboard ===== */
.dash-body {
  display: flex;
  height: 100vh;
  overflow: hidden
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 0 14px 14px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 7, 7, .85), rgba(20, 7, 7, .6));
  backdrop-filter: blur(14px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 30;
  overflow: hidden;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 14px;
  margin: 0 -14px;
  padding-left: 22px;
  padding-right: 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.side-brand-name {
  font-family: 'Space Grotesk';
  font-weight: 700;
  color: var(--text);
  line-height: 1.1
}

.side-brand-name small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -6px;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.side-nav::-webkit-scrollbar {
  width: 6px
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 6px
}

.side-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .28)
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  padding: 14px 12px 6px;
  font-weight: 600
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.side-nav a i {
  font-size: 17px;
  width: 20px;
  text-align: center
}

.side-nav a:hover {
  color: var(--text);
  background: var(--surface)
}

.side-nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(230, 48, 39, .18), rgba(230, 48, 39, 0));
  box-shadow: inset 2px 0 0 var(--accent);
}

.side-nav a .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px
}

.bg-accent {
  background: rgba(230, 48, 39, .2) !important;
  color: #ffffff
}

.side-card {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0
}

.side-card strong {
  color: var(--text);
  font-size: 13px;
  display: block
}

.side-card p {
  color: var(--text-dim);
  font-size: 12px;
  margin: 4px 0 10px
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: rgba(20, 7, 7, .6);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: .18s
}

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

.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #1f0a0a
}

.search {
  position: relative;
  flex: 1;
  max-width: 520px
}

.search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted)
}

.search .form-control {
  padding-left: 40px;
  padding-right: 60px;
  height: 40px;
  border-radius: 10px
}

.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--text-dim)
}

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

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 18px
}

.content {
  padding: 28px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap
}

.page-head h1 {
  font-size: 32px;
  margin: 10px 0 4px
}

.page-head p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: 1fr
  }
}

.kpi {
  padding: 18px 18px 14px;
  position: relative;
  overflow: hidden
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px
}

.kpi-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px
}

.ico-blue {
  background: rgba(230, 48, 39, .15);
  color: #ffb199
}

.ico-violet {
  background: rgba(167, 139, 250, .15);
  color: #c4b5fd
}

.ico-amber {
  background: rgba(251, 191, 36, .15);
  color: #fde68a
}

.ico-green {
  background: rgba(52, 211, 153, .15);
  color: #86efac
}

.trend {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px
}

.trend.up {
  background: rgba(52, 211, 153, .12);
  color: #86efac
}

.trend.down {
  background: rgba(251, 113, 133, .12);
  color: #fecaca
}

.kpi h3 {
  font-size: 30px;
  margin: 6px 0 2px;
  font-family: 'Space Grotesk'
}

.kpi p {
  color: var(--text-dim);
  margin: 0;
  font-size: 13px
}

.spark {
  margin-top: 10px;
  height: 36px
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px
}

@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr
  }
}

.span-2 {
  grid-column: span 1
}

.panel {
  padding: 20px;
  min-width: 0
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px
}

.panel-head h4 {
  font-size: 16px;
  margin: 0 0 2px
}

.panel-head small {
  color: var(--text-dim);
  font-size: 12px
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim)
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px
}

.upload-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.upload-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  transition: .18s
}

.upload-list li:hover {
  background: var(--surface)
}

.file-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(34, 211, 238, .12);
  color: #67e8f9;
  display: grid;
  place-items: center;
  font-size: 16px
}

.upload-list .meta {
  min-width: 160px
}

.upload-list .meta strong {
  display: block;
  font-size: 13px;
  color: var(--text)
}

.upload-list .meta small {
  color: var(--text-dim);
  font-size: 11px
}

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-2))
}

.status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap
}

.status.ok {
  background: rgba(52, 211, 153, .12);
  color: #86efac
}

.status.warn {
  background: rgba(251, 191, 36, .12);
  color: #fde68a
}

.status.err {
  background: rgba(251, 113, 133, .12);
  color: #fecaca
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.rank-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px
}

.rank-list li:hover {
  background: var(--surface)
}

.rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-dim);
  font-size: 13px
}

.rank-list li:nth-child(1) .rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1300
}

.rank-list li:nth-child(2) .rank {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #0a0f1a
}

.rank-list li:nth-child(3) .rank {
  background: linear-gradient(135deg, #fb923c, #c2410c);
  color: #fff
}

.who {
  flex: 1
}

.who strong {
  font-size: 13px;
  display: block
}

.who small {
  color: var(--text-dim);
  font-size: 11px
}

.score {
  font-weight: 700;
  font-family: 'Space Grotesk'
}

.alert-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

/* Toasts */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  max-width: 360px
}

.qtoast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 14px 12px;
  border-radius: 14px;
  background: rgba(31, 10, 10, .85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  color: var(--text);
  font-size: 13px;
  transform: translateX(380px);
  opacity: 0;
  transition: .4s cubic-bezier(.2, .8, .2, 1);
  position: relative;
  overflow: hidden;
}

.qtoast.show {
  transform: translateX(0);
  opacity: 1
}

.qtoast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent)
}

.qtoast.success::before {
  background: var(--success)
}

.qtoast.warning::before {
  background: var(--warning)
}

.qtoast.danger::before {
  background: var(--danger)
}

.qtoast.info::before {
  background: var(--info)
}

.qtoast .tico {
  font-size: 18px;
  margin-top: 1px
}

.qtoast.success .tico {
  color: #86efac
}

.qtoast.warning .tico {
  color: #fde68a
}

.qtoast.danger .tico {
  color: #fecaca
}

.qtoast.info .tico {
  color: #bfdbfe
}

.qtoast strong {
  display: block;
  margin-bottom: 2px
}

.qtoast small {
  color: var(--text-dim);
  display: block;
  line-height: 1.4
}

.qtoast .x {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  margin-left: auto;
  align-self: flex-start
}

.qtoast .x:hover {
  color: var(--text)
}

.qtoast .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 100%;
  transform-origin: left;
  animation: tprog 4s linear forwards
}

@keyframes tprog {
  to {
    transform: scaleX(0)
  }
}

/* Mobile sidebar */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    transform: translateX(-110%);
    transition: .3s
  }

  .sidebar.open {
    transform: translateX(0)
  }

  .content {
    padding: 20px 16px 60px
  }
}

/* ===== Brand logo (img) ===== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px -8px rgba(209, 28, 35, .6)
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block
}

/* ===== Tables ===== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  color: var(--text)
}

.data-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  vertical-align: middle
}

.data-table tbody tr:hover {
  background: var(--surface)
}

.data-table tbody tr:last-child td {
  border-bottom: 0
}

.table-wrap {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
  display: flex;
  flex-direction: column
}

.table-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .03)
}

.table-toolbar .search {
  flex: 1;
  max-width: 340px;
  min-width: 200px
}

.table-toolbar .search .form-control {
  height: 38px;
  padding-left: 38px
}

.table-toolbar .search i {
  left: 12px
}

.filter-select {
  height: 38px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0 32px 0 12px;
  font-size: 13px
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 48, 39, .18)
}

.table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  background: rgba(255, 255, 255, .02)
}

.pager {
  display: inline-flex;
  gap: 4px
}

.pager button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer
}

.pager button.active,
.pager button:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong)
}

/* Common-components page section spacing */
.cc-section {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.cc-section>.panel {
  padding: 22px
}

.cc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

@media (max-width: 900px) {
  .cc-grid-2 {
    grid-template-columns: 1fr
  }
}

.swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim)
}

.swatch .dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .18)
}

/* ===== Native select dark options ===== */
select.form-control,
select.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bfbfbf' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 36px;
}

select.form-control option,
select.filter-select option,
datalist option {
  background: #141414;
  color: #eee;
}

select.form-control optgroup {
  background: #0a0a0a;
  color: #fff
}

/* ===== Input group ===== */
.input-group .input-group-text {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 12px 0 0 12px;
}

.input-group>.form-control {
  padding-left: 14px;
  border-radius: 0 12px 12px 0
}

.input-group>.form-control:not(:last-child) {
  border-radius: 0
}

.input-group>.input-group-text+.form-control {
  border-left: 0
}

.input-group>.form-control+.input-group-text {
  border-left: 0;
  border-radius: 0 12px 12px 0
}

/* ===== Floating labels ===== */
.form-floating>.form-control {
  height: 56px;
  padding: 18px 14px 6px 14px
}

.form-floating>label {
  color: var(--muted);
  padding: 1rem .9rem
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
  color: var(--text-dim);
  transform: scale(.82) translateY(-.6rem) translateX(.1rem);
  background: transparent;
}

/* ===== Range ===== */
.form-range::-webkit-slider-thumb {
  background: var(--accent)
}

.form-range::-moz-range-thumb {
  background: var(--accent)
}

.form-range::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, .12);
  border-radius: 6px;
  height: 6px
}

.form-range::-moz-range-track {
  background: rgba(255, 255, 255, .12);
  border-radius: 6px;
  height: 6px
}

/* ===== File input ===== */
.form-control[type="file"] {
  padding: 10px 14px;
  line-height: 1.4
}

.form-control[type="file"]::file-selector-button {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Dropdown menu (dark) ===== */
.dropdown-menu {
  background: #141414;
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .6);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
}

.dropdown-menu .dropdown-item {
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-menu .dropdown-item i {
  color: var(--muted);
  width: 16px
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.dropdown-menu .dropdown-item.text-danger {
  color: #fca5a5
}

.dropdown-menu .dropdown-item.text-danger:hover {
  background: rgba(239, 59, 66, .15);
  color: #fecaca
}

.dropdown-divider {
  border-color: var(--border)
}

/* ===== Modal (dark) ===== */
.modal-content {
  background: #0f0f0f;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}

.modal-header,
.modal-footer {
  border-color: var(--border)
}

.modal-header .btn-close {
  filter: invert(1) grayscale(1) brightness(1.6);
  opacity: .7
}

.modal-backdrop.show {
  opacity: .7
}


.uploads-rich {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.upl-row {
  display: grid;
  grid-template-columns: auto 1.4fr 2fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: .18s;
}

.upl-row:hover {
  background: var(--surface);
  border-color: var(--border)
}

.upl-row .file-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(34, 211, 238, .10);
  color: #67e8f9;
  font-size: 18px;
  border: 1px solid rgba(34, 211, 238, .18);
}

.upl-row .meta {
  min-width: 0
}

.upl-row .meta strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.upl-row .meta small {
  color: var(--text-dim);
  font-size: 12px
}

.upl-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  display: flex
}

.upl-bar .seg-valid {
  background: linear-gradient(90deg, #fb7185, #ef4444)
}

/* match red look */
.upl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.upl-status.ok {
  background: rgba(16, 185, 129, .12);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, .25)
}

.upl-status.warn {
  background: rgba(234, 179, 8, .12);
  color: #fde68a;
  border: 1px solid rgba(234, 179, 8, .25)
}

.upl-status.err {
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, .25)
}

.upl-status a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

/* nested sheet detail (collapsible) */
.upl-sheets {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border)
}

.upl-sheet {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim)
}

.upl-sheet .sn {
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px
}

.upl-sheet .sn i {
  color: #67e8f9
}

.upl-sheet b {
  color: var(--text);
  font-weight: 700
}

.upl-sheet .v {
  color: #86efac
}

.upl-sheet .e {
  color: #fca5a5
}

@media (max-width:780px) {
  .upl-row {
    grid-template-columns: auto 1fr auto;
    gap: 10px
  }

  .upl-row .upl-bar-wrap {
    grid-column: 1/-1;
    order: 5
  }

  .upl-sheet {
    grid-template-columns: 1fr 1fr
  }
}

/* ===== Responsive Table Alignment & Customizations ===== */

/* Prevent wrapping in cells to keep dates and metrics in one line */
.data-table td,
.data-table th,
table.table td,
table.table th {
  white-space: nowrap !important;
}

/* Align sorting indicators cleanly in the top header row */
table.dataTable thead>tr>th.sorting,
table.dataTable thead>tr>th.sorting_asc,
table.dataTable thead>tr>th.sorting_desc {
  padding-right: 28px !important;
  cursor: pointer;
}

table.dataTable thead>tr>th.sorting::before,
table.dataTable thead>tr>th.sorting::after,
table.dataTable thead>tr>th.sorting_asc::before,
table.dataTable thead>tr>th.sorting_asc::after,
table.dataTable thead>tr>th.sorting_desc::before,
table.dataTable thead>tr>th.sorting_desc::after {
  right: 10px !important;
  opacity: 0.15;
}

table.dataTable thead>tr>th.sorting_asc::before,
table.dataTable thead>tr>th.sorting_desc::after {
  opacity: 0.85 !important;
  color: var(--accent-2) !important;
}

/* Style table search inputs in filter row to be compact and aligned */
.data-table thead tr.search-row th input.form-control-sm {
  height: 34px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
  text-align: center !important;
}

.data-table thead tr.search-row th input.form-control-sm::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
  text-align: center !important;
}

.data-table thead tr.search-row th input.form-control-sm:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(230, 48, 39, 0.18) !important;
}

/* ===== Custom Scrollbar Style Matching Sidebar Theme ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Firefox compatibility */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

/* ===== Chart Layout Styles ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 991px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  padding: 24px;
  margin-bottom: 20px;
  border-radius: var(--radius);
}

.chart-card h5,
.chart-head h5 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Sidebar dropdown and submenu styling */
.nav-item-dropdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  cursor: pointer;
  text-decoration: none !important;
}

.dropdown-trigger i:first-child {
  font-size: 17px;
  width: 20px;
  text-align: center;
}

.dropdown-trigger:hover {
  color: var(--text);
  background: var(--surface);
}

.dropdown-trigger.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(230, 48, 39, 0.1), rgba(230, 48, 39, 0));
}

.dropdown-trigger[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-chevron {
  transition: transform 0.2s ease;
  font-size: 11px;
}

.submenu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 20px;
  /* Indent submenu items */
  margin-top: 2px;
  margin-bottom: 6px;
}

.submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.submenu-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.7;
}

.submenu-item:hover {
  color: var(--text);
  background: var(--surface);
}

.submenu-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(230, 48, 39, 0.15), rgba(230, 48, 39, 0));
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ===== Premium Drag and Drop File Input ===== */
.dropzone-wrapper {
  position: relative;
  width: 100%;
}

.dropzone-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 32px 24px;
  min-height: 180px;
  height: auto;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

.dropzone-area:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.dropzone-area.dragover {
  background: rgba(209, 28, 35, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(209, 28, 35, 0.2);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.dropzone-icon {
  font-size: 42px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.dropzone-area:hover .dropzone-icon {
  color: var(--accent-2);
  transform: translateY(-3px);
}

.dropzone-text {
  font-size: 14.5px;
  color: var(--text-dim);
  text-align: center;
  max-width: 90%;
  line-height: 1.5;
}

.dropzone-text .browse-link {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dropzone-text.has-file {
  color: var(--text);
  font-weight: 500;
}