/* ============================================================================
   IB Player Pro — Admin theme (fresh UI/UX layer over Bootstrap 5)
   No build step: plain CSS, served straight from /public.
   ========================================================================== */

:root {
  --bg:        #0b1020;   /* app background (deep navy) */
  --surface:   #ffffff;
  --surface-2: #f5f7fb;
  --ink:       #0f172a;   /* primary text */
  --ink-soft:  #64748b;   /* muted text */
  --line:      #e6e9f2;   /* borders */
  --brand:     #6366f1;   /* indigo */
  --brand-2:   #8b5cf6;   /* violet */
  --brand-ink: #ffffff;
  --ok:        #10b981;
  --warn:      #f59e0b;
  --danger:    #ef4444;
  --info:      #0ea5e9;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.18);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Shell ---------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(185deg, #0f1530 0%, #0b1020 100%);
  color: #cbd5e1;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  z-index: 1040;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 18px;
  color: #fff;
}
.sidebar .brand img { width: 34px; height: 34px; border-radius: 9px; }
.sidebar .brand b { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.sidebar .brand small { display: block; color: #94a3b8; font-size: 11px; font-weight: 500; }

.nav-group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: #64748b; font-weight: 700; padding: 16px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 10px; color: #cbd5e1; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.side-link i { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.side-link .badge { margin-left: auto; }

/* ---------- Main ----------------------------------------------------------- */
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.topbar {
  height: 64px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; position: sticky; top: 0; z-index: 1030;
}
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; }
.topbar .spacer { flex: 1; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.dot-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.profile-pill {
  display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px;
  border-radius: 30px; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.avatar.lg { width: 46px; height: 46px; font-size: 18px; }

.content { padding: 26px; max-width: 1320px; }

/* ---------- Cards ---------------------------------------------------------- */
.card-ib {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-ib .card-bd { padding: 20px 22px; }
.card-ib .card-hd {
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px;
}
.card-hd .sub { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

/* KPI cards */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-ico {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 21px;
}
.kpi .kpi-val { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.kpi .kpi-label { color: var(--ink-soft); font-weight: 500; }
.tone-brand { background: rgba(99,102,241,.12); color: var(--brand); }
.tone-ok    { background: rgba(16,185,129,.12); color: var(--ok); }
.tone-warn  { background: rgba(245,158,11,.14); color: var(--warn); }
.tone-info  { background: rgba(14,165,233,.12); color: var(--info); }
.tone-danger{ background: rgba(239,68,68,.12);  color: var(--danger); }

/* ---------- Tables --------------------------------------------------------- */
.table-ib { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-ib th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.table-ib td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-ib tr:last-child td { border-bottom: 0; }
.table-ib tbody tr:hover { background: var(--surface-2); }

/* ---------- Pills / badges ------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 600;
}
.pill-ok     { background: rgba(16,185,129,.13); color: #047857; }
.pill-warn   { background: rgba(245,158,11,.16); color: #b45309; }
.pill-danger { background: rgba(239,68,68,.13);  color: #b91c1c; }
.pill-info   { background: rgba(14,165,233,.13); color: #0369a1; }
.pill-muted  { background: var(--surface-2); color: var(--ink-soft); }

/* ---------- Buttons -------------------------------------------------------- */
.btn-ib {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 16px; border-radius: 11px; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: .15s;
}
.btn-ib:hover { background: var(--surface-2); }
.btn-ib.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none;
  box-shadow: 0 8px 18px rgba(99,102,241,.35);
}
.btn-ib.primary:hover { filter: brightness(1.05); color: #fff; }
.btn-ib.danger { color: var(--danger); border-color: rgba(239,68,68,.4); }
.btn-ib.danger:hover { background: rgba(239,68,68,.08); }
.btn-ib.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Forms ---------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field .hint { color: var(--ink-soft); font-size: 12px; margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: 11px; font-size: 14px; background: #fff; color: var(--ink); font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* ---------- Tabs ----------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 7px 14px; border-radius: 30px; font-weight: 600; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Alerts --------------------------------------------------------- */
.flash { padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; display:flex; gap:9px; align-items:center; }
.flash-ok     { background: rgba(16,185,129,.12); color: #047857; }
.flash-danger { background: rgba(239,68,68,.1);   color: #b91c1c; }

/* ---------- Misc ----------------------------------------------------------- */
.muted { color: var(--ink-soft); }
.grid { display: grid; gap: 18px; }
.grid.k4 { grid-template-columns: repeat(4, 1fr); }
.grid.k3 { grid-template-columns: repeat(3, 1fr); }
.grid.k2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 860px)  {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .grid.k4, .grid.k3, .grid.k2 { grid-template-columns: 1fr; }
}

.spark { display: flex; align-items: flex-end; gap: 7px; height: 120px; }
.spark .bar {
  flex: 1; border-radius: 7px 7px 0 0; min-height: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); opacity: .9;
}
.spark .bar span { display:block; text-align:center; font-size:11px; color:var(--ink-soft); margin-top:6px; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty i { font-size: 34px; opacity: .5; display: block; margin-bottom: 8px; }

/* ---- Activity bell notifications ---------------------------------------- */
.notif-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 14px 11px 20px; border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative; text-decoration: none; color: inherit;
  transition: background .12s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: rgba(99,102,241,.06); }
.notif-item.unread:hover { background: rgba(99,102,241,.11); }
.notif-item .notif-dot {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.notif-item .notif-msg { font-size: 13px; line-height: 1.4; color: var(--ink); }
.notif-item.unread .notif-msg { font-weight: 600; }
.notif-item .notif-ago { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
.notif-item .notif-go {
  margin-left: auto; align-self: center; font-size: 20px;
  color: var(--ink-soft); opacity: 0; transition: opacity .12s, transform .12s;
}
.notif-item:hover .notif-go { opacity: 1; transform: translateX(2px); }
