/* ============================================================
   Elite Space — design system
   Dark indigo sidebar shell · Inter · soft elevated surfaces
   ============================================================ */

:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7eaf3;
  --bg: #f4f5fb;
  --card: #ffffff;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 1rem;
  --sidebar-w: 264px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, .18);
}

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Vivid tinted page background */
.app-body {
  background:
    radial-gradient(1000px 520px at 100% -6%, #c3c9ff 0%, rgba(195,201,255,0) 55%),
    radial-gradient(880px 560px at -8% 0%, #e6c9ff 0%, rgba(230,201,255,0) 52%),
    radial-gradient(760px 520px at 50% 118%, #ffd0e6 0%, rgba(255,208,230,0) 55%),
    linear-gradient(180deg, #dfe3fd 0%, #e9ecfb 420px, #e9ecfb 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .fw-bold, .fw-semibold { letter-spacing: -0.015em; }

/* ---------- App shell ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 1040;
  background: linear-gradient(180deg, #0d1226 0%, #131a3a 55%, #1b1440 100%);
  color: #cbd5e1;
  padding: 1.1rem .9rem;
}
/* Offcanvas menu must sit ABOVE its backdrop (Bootstrap backdrop = 1040); the .sidebar
   rule above forces 1040, which let the backdrop cover the menu and block taps on mobile. */
.sidebar-offcanvas { width: var(--sidebar-w) !important; padding: .6rem .9rem 1.1rem; z-index: 1046; }

.side-brand {
  display: flex; align-items: center; gap: .7rem;
  padding: .4rem .5rem 1.1rem;
  text-decoration: none;
}
.side-brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 1.15rem;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8);
}
.side-brand-name { display: block; color: #fff; font-weight: 700; line-height: 1.15; }
.side-brand-sub { display: block; color: #7c86a8; font-size: .72rem; }

.side-nav { display: flex; flex-direction: column; gap: .2rem; }
.side-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem .8rem;
  border-radius: .7rem;
  color: #aab3cf; text-decoration: none;
  font-weight: 500; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
  text-align: left;
}
.side-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .9);
}
.side-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .08); }

.main { min-height: 100vh; }
@media (min-width: 992px) { .main { margin-left: var(--sidebar-w); } }

.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1.25rem;
  background: rgba(233, 235, 251, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e5f6;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.btn-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: .7rem;
  background: #fff; font-size: 1.2rem;
}

/* allow flex children to shrink so text-truncate works */
.min-w-0 { min-width: 0; }

/* Colored accent stripe + soft tinted background for list cards/rows */
.acc { border-left: 5px solid #e2e8f0; }
.acc-green  { border-left: 5px solid #22c55e; background: #eafcf1 !important; }
.acc-red    { border-left: 5px solid #ef4444; background: #fdeeee !important; }
.acc-amber  { border-left: 5px solid #f59e0b; background: #fff6e6 !important; }
.acc-indigo { border-left: 5px solid #6366f1; background: #edeeff !important; }
.acc-slate  { border-left: 5px solid #94a3b8; background: #f2f5f9 !important; }
.acc-teal   { border-left: 5px solid #14b8a6; background: #e7fbf7 !important; }
.acc-blue   { border-left: 5px solid #3b82f6; background: #eaf3ff !important; }
.acc-purple { border-left: 5px solid #a855f7; background: #f7ecff !important; }
/* soft round icon badge for list items */
.li-ic {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 1.05rem;
}
.li-ic.tone-green  { background: #dcfce7; color: #15803d; }
.li-ic.tone-red    { background: #fee2e2; color: #b91c1c; }
.li-ic.tone-amber  { background: #fef3c7; color: #b45309; }
.li-ic.tone-indigo { background: #e0e7ff; color: #4f46e5; }
.li-ic.tone-slate  { background: #e2e8f0; color: #334155; }
.li-ic.tone-teal   { background: #ccfbf1; color: #0f766e; }
.li-ic.tone-blue   { background: #dbeafe; color: #1d4ed8; }
.li-ic.tone-purple { background: #f3e8ff; color: #7e22ce; }

/* Notification bell */
.notif .btn-icon { position: relative; }
.notif-active { border-color: #ef4444 !important; color: #b91c1c; }
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; border: 2px solid #fff; line-height: 1;
  box-shadow: 0 0 0 0 rgba(239,68,68,.6);
  animation: notif-pulse 1.6s infinite;
}
@keyframes notif-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.notif-menu { width: 340px; max-width: 92vw; padding: 0; overflow: hidden; }
.notif-list { max-height: 320px; overflow-y: auto; }

.content { padding: 1.25rem; max-width: 1320px; }
@media (min-width: 768px) { .content { padding: 1.6rem 1.9rem; } }
.app-foot { text-align: center; color: #a3adc2; font-size: .8rem; padding: 2rem 0 .8rem; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card);
}
.card-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-bottom: none;
  color: #fff;
  font-weight: 600;
  padding: .85rem 1.1rem;
  border-top-left-radius: var(--radius) !important;
  border-top-right-radius: var(--radius) !important;
}
.card-header .text-muted { color: rgba(255, 255, 255, .78) !important; }
.card-header a { color: #fff; }
.card-header .badge.text-bg-light { background: rgba(255,255,255,.85) !important; }
/* the Collection accordion header stays plain (transparent background set inline) — so its
   text must be dark, otherwise the white .card-header text is invisible on the white card. */
.apt-card > .card-header { color: #1f2937; }
.apt-card > .card-header .text-muted { color: #6b7280 !important; }
.card .table { margin-bottom: 0; }

/* stat cards */
.stat-card .card-body { padding: 1rem 1.1rem; }
.stat-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: .9rem; font-size: 1.25rem;
}
.stat-icon.tone-indigo  { background: #eef2ff; color: #4f46e5; }
.stat-icon.tone-green   { background: #dcfce7; color: #15803d; }
.stat-icon.tone-slate   { background: #e2e8f0; color: #334155; }
.stat-icon.tone-amber   { background: #fef3c7; color: #b45309; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .78rem; color: var(--muted); }

.fs-3.fw-bold, .fs-4.fw-bold, .fs-5.fw-bold, .stat-value { font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f7f8ff; }
.table thead th {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  background: #fafbff !important;
  border-bottom: 1px solid var(--line);
  padding: .6rem .75rem;
}
.table td { padding: .6rem .75rem; border-color: #f0f2f9; }
.table tfoot td { background: #fafbff; }

/* ---------- Buttons ---------- */
.btn { border-radius: .65rem; font-weight: 600; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
  box-shadow: 0 6px 16px -8px rgba(99, 102, 241, .9);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-sm { border-radius: .55rem; }
.btn-outline-primary { color: var(--brand); border-color: #c7d2fe; }
.btn-outline-primary:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.btn-outline-secondary { border-color: var(--line); color: #475569; }
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--ink); border-color: #cbd5e1; }
.btn-outline-success { color: #047857; border-color: #a7f3d0; }
.btn-outline-success:hover { background: #ecfdf5; color: #047857; border-color: #047857; }
.btn-outline-danger { color: var(--danger); border-color: #fecaca; }
.btn-outline-danger:hover { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
.btn-outline-warning { color: #b45309; border-color: #fde68a; }
.btn-outline-warning:hover { background: #fffbeb; color: #92400e; border-color: #d97706; }
.btn-outline-info { color: #0369a1; border-color: #bae6fd; }
.btn-outline-info:hover { background: #f0f9ff; color: #0369a1; border-color: #0369a1; }

/* ---------- Badges: soft pills ---------- */
.badge { border-radius: 999px; font-weight: 600; padding: .38em .7em; }
.badge.text-bg-success   { background: #dcfce7 !important; color: #15803d !important; }
.badge.text-bg-secondary { background: #e2e8f0 !important; color: #334155 !important; }
.badge.text-bg-warning   { background: #fef3c7 !important; color: #b45309 !important; }
.badge.text-bg-danger    { background: #fee2e2 !important; color: #b91c1c !important; }
.badge.text-bg-info      { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.text-bg-light     { background: #f1f5f9 !important; color: #475569 !important; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: .65rem;
  border-color: #e2e8f0;
  padding: .5rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .18);
}
.form-label { font-weight: 600; font-size: .85rem; }
.form-text { font-size: .78rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- Alerts ---------- */
.alert { border: 0; border-radius: .8rem; box-shadow: var(--shadow-sm); }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-info { background: #eff6ff; color: #1e40af; }
.alert-warning { background: #fffbeb; color: #92400e; }

/* ---------- Progress ---------- */
.progress { border-radius: 999px; background: #edf0f9; }
.progress-bar { border-radius: 999px; }

/* ---------- Auth (login) ---------- */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 15% -10%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(50rem 28rem at 110% 10%, rgba(124, 58, 237, .3), transparent 60%),
    linear-gradient(180deg, #0d1226, #151b3a 60%, #1b1440);
}
.auth-main {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(255, 255, 255, .97);
  border: 0; border-radius: 1.25rem;
  box-shadow: 0 30px 60px -20px rgba(2, 6, 23, .7);
}
.auth-mark {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0 auto;
  border-radius: 16px; font-size: 1.6rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, .8);
}

/* ---------- Misc ---------- */
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
::selection { background: rgba(99, 102, 241, .25); }

/* ---------- Print (receipts etc.) ---------- */
@media print {
  .sidebar, .topbar, .app-foot, .d-print-none, .alert { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: 100% !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7cde0; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
