/* === Onlike clone — global styles ===================================== */
:root {
  --primary: #635aff;
  --primary-light: #8b85ff;
  --primary-dark: #4a42d6;
  --success: #009e7c;
  --info: #00b8f2;
  --warning: #e8a300;
  --secondary: #df7af3;
  --error: #e73104;

  --bg: #f3f4f9;
  --surface: #ffffff;
  --border: #e7e9f3;
  --divider: #eef0f7;

  --text: #1a1d2c;
  --text-muted: #7a829c;
  --text-faint: #b3b9cd;

  --shadow-sm: 0 1px 2px rgba(20, 22, 50, 0.04), 0 1px 3px rgba(20, 22, 50, 0.04);
  --shadow-md: 0 4px 14px rgba(20, 22, 50, 0.06), 0 2px 6px rgba(20, 22, 50, 0.04);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: #eceefa;
       padding: 1px 5px; border-radius: 4px; font-size: .85em; }

input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  outline: none; transition: border-color 120ms; background: white;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

/* === Login page ========================================================== */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #ecedff 0%, #fdf3ff 50%, #eaf3ff 100%);
}
.login-card {
  background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-md); padding: 32px;
  width: min(460px, calc(100vw - 32px));
}
.login-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; margin-bottom: 18px;
}
.login-card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.login-card label { display: block; font-weight: 600; font-size: .85rem; margin: 14px 0 6px; }
.login-card input { font-size: 14px; }

/* === Buttons & alerts ==================================================== */
.btn-primary {
  display: inline-block;
  border: 0; padding: 12px 16px;
  background: var(--primary); color: white !important;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background 120ms; text-decoration: none;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--text-faint); cursor: not-allowed; }
.btn-primary.btn-sm, .btn-sm { padding: 7px 12px; font-size: 12px; font-weight: 700; }
.btn-sm {
  display: inline-block; border: 1px solid var(--border); background: white;
  color: var(--text) !important; border-radius: 8px;
  text-decoration: none; cursor: pointer; transition: all 120ms;
  margin-right: 4px;
}
.btn-sm:hover { background: var(--divider); border-color: var(--text-faint); }
.btn-danger {
  border: 0; padding: 10px 16px; background: var(--error); color: white;
  border-radius: var(--radius-sm); font-weight: 700; cursor: pointer;
}
.btn-danger:hover { background: #b8270b; }

.alert { padding: 10px 12px; border-radius: var(--radius-sm);
        margin: 12px 0; font-size: 13px; }
.alert-error   { background: #fde7e0; color: #8e1f04; }
.alert-success { background: #d8f3e7; color: #04654d; }
.login-help { margin-top: 18px; font-size: 13px; }

/* === App shell =========================================================== */
:root { --sidebar-w: 240px; --topbar-h: 64px; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); padding: 18px 14px;
  overflow-y: auto; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: -.5px;
}
.brand-name { font-weight: 800; font-size: 1rem; }
.nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); padding: 14px 12px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text) !important; font-weight: 600; font-size: .9rem;
  transition: background 120ms, color 120ms;
}
.nav-item .ico {
  width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 14px; color: var(--text-muted);
}
.nav-item:hover { background: #f3f3fb; }
.nav-item.active { background: #efeeff; color: var(--primary) !important; }
.nav-item.active .ico { color: var(--primary); }

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 9;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 38px; height: 38px; border: 0; background: #f3f3fb;
  border-radius: 10px; display: grid; place-items: center;
  cursor: pointer; font-size: 16px; color: var(--text); text-decoration: none;
  transition: background 120ms;
}
.icon-btn:hover { background: #e9e9f6; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #ddd; object-fit: cover;
}
.avatar-fallback {
  display: grid; place-items: center; color: white; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.user-meta { line-height: 1.2; }
.user-name { font-weight: 700; font-size: .9rem; }
.user-email { font-size: .75rem; color: var(--text-muted); }

.content {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 22px) 28px 40px;
  max-width: 1480px;
}

/* === Cards & grid ======================================================== */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px 24px;
}
.section { margin-bottom: 28px; }
.section-head { margin-bottom: 14px; }
.greeting { padding: 4px 0 16px; }
.greeting h1 { margin-bottom: 2px; }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}

.grid { display: grid; gap: 18px; }
.grid-mt { margin-top: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .topbar, .content { left: 0; margin-left: 0; }
  .topbar { left: 0 !important; }
  .content { padding-left: 14px; padding-right: 14px; }
}

/* === Announcement, stat tiles, metrics, chart, etc. ====================== */
.announcement {
  display: flex; gap: 14px; align-items: flex-start;
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, #f3f2ff 0%, #ffffff 100%);
}
.ann-icon { font-size: 22px; }
.ann-subject { font-weight: 700; margin-bottom: 4px; }
.ann-desc { color: var(--text-muted); font-size: .9rem; }

.stat-tile {
  position: relative; overflow: hidden; color: white;
  padding: 22px 24px;
}
.stat-tile .stat-icon {
  position: absolute; right: 16px; top: 16px;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.18); display: grid; place-items: center;
  font-size: 18px;
}
.stat-tile .stat-label { font-weight: 600; opacity: .9; font-size: .85rem; }
.stat-tile .stat-value { font-size: 1.85rem; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.tile-blue   { background: linear-gradient(135deg, #635aff 0%, #8b85ff 100%); }
.tile-purple { background: linear-gradient(135deg, #9333ea 0%, #df7af3 100%); }
.tile-green  { background: linear-gradient(135deg, #009e7c 0%, #38d9a9 100%); }
.tile-amber  { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.tile-rose   { background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%); }
.tile-orange { background: linear-gradient(135deg, #e8a300 0%, #ffd166 100%); }

.metric-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.metric-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.metric-value { font-size: 1.7rem; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; }
.metric-sub { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.metric-sub b { color: var(--text); font-weight: 700; }
.metric-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; flex: 0 0 44px;
}
.icon-info     { background: #e1f5fe; color: var(--info); }
.icon-success  { background: #e0f5ee; color: var(--success); }
.icon-primary  { background: #eeebff; color: var(--primary); }
.icon-warning  { background: #fff5dd; color: var(--warning); }
.icon-secondary{ background: #f9e6ff; color: var(--secondary); }
.icon-error    { background: #fdded3; color: var(--error); }

.chart-wrap { height: 320px; position: relative; }
#trend-chart { width: 100% !important; height: 100% !important; }
.chart-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: white;
  padding: 6px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 120ms;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: white; }

/* === Tables ============================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
  text-align: left; font-weight: 700; font-size: .75rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 10px;
}
.data-table td {
  padding: 10px;
  border-top: 1px solid var(--divider); vertical-align: middle;
}
.data-table.compact th, .data-table.compact td { padding: 6px 8px; }
.data-table.compact th { width: 130px; vertical-align: top; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.poster {
  width: 64px; height: 36px; border-radius: 6px; object-fit: cover;
  background: #eceefa;
}
.poster-fallback { display: grid; place-items: center; color: var(--text-faint); font-size: 14px; }
.video-name {
  max-width: 380px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-weight: 600;
}
.empty { padding: 30px; text-align: center; }
.empty-state {
  padding: 60px 20px; text-align: center;
}
.empty-state h3 { margin-bottom: 6px; }

/* === Country list ======================================================== */
.country-list { list-style: none; padding: 0; margin: 0;
                display: flex; flex-direction: column; gap: 10px; }
.cl-row { display: flex; align-items: center; gap: 10px; }
.flag {
  width: 28px; height: 20px; border-radius: 3px;
  background: #eceefa; display: inline-grid; place-items: center;
  font-size: 14px;
}
.cl-name { flex: 1; font-weight: 600; font-size: .9rem; }
.cl-num { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 700; }
.bar { height: 6px; background: var(--divider); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
}

/* === Realtime / Balance ================================================== */
.rt-tile { background: #f7f7fc; border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; }
.rt-label { font-size: .75rem; color: var(--text-muted); font-weight: 700;
            text-transform: uppercase; letter-spacing: .04em; }
.rt-value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.dot-pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--error); margin-left: 6px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(231,49,4,.6); }
  70% { box-shadow: 0 0 0 10px rgba(231,49,4,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,49,4,0); }
}

.balance-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.bal-label { font-size: .75rem; color: var(--text-muted); font-weight: 700;
             text-transform: uppercase; letter-spacing: .04em; }
.bal-value { font-size: 1.4rem; font-weight: 800; margin-top: 4px; color: var(--success); }
.bal-sub { font-size: .76rem; color: var(--text-muted); margin-top: 4px; }

/* === Status pills ======================================================== */
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.status-active   { background: #d8f3e7; color: #04654d; }
.status-pending  { background: #fff5dd; color: #8a5500; }
.status-deleted  { background: #fdded3; color: #8e1f04; }

/* === Filter bar / pager ================================================== */
.filter-bar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.filter-bar input { flex: 1; }
.filter-bar select { width: auto; }
.pager { padding: 16px 0 0; display: flex; gap: 14px; align-items: center; }

/* === Drop zone / file list (upload page) ================================ */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all 160ms;
  background: linear-gradient(180deg, #fafaff 0%, #ffffff 100%);
}
.drop-zone:hover, .dz-over {
  border-color: var(--primary); background: #f7f6ff;
  transform: translateY(-2px);
}
.dz-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; display: grid; place-items: center; font-size: 26px;
}
.dz-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }

.file-list { list-style: none; padding: 0; margin: 14px 0 0; }
.file-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #f7f7fc; border-radius: 8px; margin-top: 6px;
  font-size: .9rem;
}
.file-list .fl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.file-list .fl-size { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.embed-box {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, monospace; font-size: 12px; resize: vertical;
  background: #f7f7fc; margin-top: 6px;
}

label { display: block; font-weight: 600; font-size: .85rem; margin: 14px 0 6px; }

/* === Dark theme ============================================================ */
[data-theme="dark"] {
  --bg: #0e0f17;
  --surface: #16182a;
  --border: #2a2d44;
  --divider: #232646;
  --text: #e8eaf3;
  --text-muted: #969cba;
  --text-faint: #565a7c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1b1e36; color: var(--text); border-color: var(--border);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus { border-color: var(--primary-light); }
[data-theme="dark"] code { background: #2a2d44; color: #b8b6ff; }
[data-theme="dark"] .login-body { background: linear-gradient(135deg, #1a1c30 0%, #2c1e3a 50%, #1a253f 100%); }
[data-theme="dark"] .nav-item:hover { background: #1f2240; }
[data-theme="dark"] .nav-item.active { background: #2a2358; color: #b8b6ff !important; }
[data-theme="dark"] .icon-btn { background: #1f2240; color: var(--text); }
[data-theme="dark"] .icon-btn:hover { background: #2a2d4f; }
[data-theme="dark"] .btn-sm { background: #1b1e36; color: var(--text) !important; }
[data-theme="dark"] .btn-sm:hover { background: #232746; }
[data-theme="dark"] .alert-success { background: #103324; color: #6ee5b8; }
[data-theme="dark"] .alert-error { background: #34141b; color: #ffa9a9; }
[data-theme="dark"] .rt-tile, [data-theme="dark"] .balance-tile { background: #1b1e36; }
[data-theme="dark"] .file-list li { background: #1b1e36; }
[data-theme="dark"] .embed-box { background: #1b1e36; color: var(--text); }
[data-theme="dark"] .data-table td { border-top-color: var(--border); }
[data-theme="dark"] .announcement { background: linear-gradient(90deg, #1f1d3e 0%, #16182a 100%); }
[data-theme="dark"] .drop-zone {
  background: linear-gradient(180deg, #1a1d36 0%, #16182a 100%);
  border-color: var(--border);
}
[data-theme="dark"] .drop-zone:hover, [data-theme="dark"] .dz-over {
  background: #1f1c3e; border-color: var(--primary-light);
}
[data-theme="dark"] .login-card { background: var(--surface); }

/* === Tabs ================================================================== */
.tabs {
  display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab {
  padding: 10px 16px; color: var(--text-muted) !important; font-weight: 700;
  border-bottom: 2px solid transparent; text-decoration: none;
  font-size: .9rem; cursor: pointer;
}
.tab:hover { color: var(--text) !important; }
.tab.active { color: var(--primary) !important; border-bottom-color: var(--primary); }

/* === Toggles =============================================================== */
.toggle-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px;
}
@media (max-width: 700px) { .toggle-grid { grid-template-columns: 1fr; } }
.toggle {
  display: flex; gap: 12px; cursor: pointer; align-items: flex-start;
  padding: 8px; border-radius: 8px; user-select: none;
}
.toggle:hover { background: var(--divider); }
.toggle input { width: 0; height: 0; opacity: 0; position: absolute; }
.toggle-slider {
  position: relative; width: 38px; height: 22px; flex: 0 0 38px;
  background: var(--text-faint); border-radius: 999px; margin-top: 2px;
  transition: background 160ms;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  transition: transform 160ms;
}
.toggle input:checked ~ .toggle-slider { background: var(--primary); }
.toggle input:checked ~ .toggle-slider::after { transform: translateX(16px); }
.toggle-label { line-height: 1.2; flex: 1; }
.toggle-label small { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* === Filter checkbox ====================================================== */
.filter-checkbox {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
  font-size: .85rem; padding: 6px 10px; cursor: pointer;
}
.filter-checkbox input { width: auto; }

/* === Tag pills (cloud) ==================================================== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid;
  font-weight: 700; font-size: .85rem;
}
.tag-pill a { color: inherit; }
.tag-count { background: rgba(0,0,0,.1); padding: 1px 6px; border-radius: 10px; font-size: .72rem; }
.tag-x { background: transparent; border: 0; cursor: pointer; color: inherit; opacity: .5; font-size: 14px; }
.tag-x:hover { opacity: 1; }

.tag-mini {
  display: inline-block; padding: 1px 6px; border-radius: 10px;
  font-size: .68rem; font-weight: 700; margin-left: 4px;
}
.folder-chip {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 12px; margin-right: 8px; vertical-align: -5px;
}

/* === Player preview cards ================================================ */
.player-card { padding: 16px; }
.player-preview {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: #000; display: grid; place-items: center;
}
.player-controls {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.player-play {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; color: white; font-size: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.player-wm {
  position: absolute; top: 8px; right: 12px; color: white; opacity: .7;
  font-size: 10px; font-weight: 800; letter-spacing: .05em;
}

/* === Plan cards =========================================================== */
.plan-card { padding: 22px; }
.plan-current { border: 2px solid var(--primary); }
.plan-price { margin: 14px 0 4px; font-weight: 800; }
.plan-features { list-style: none; padding: 0; margin: 14px 0 0; font-size: .85rem; }
.plan-features li { padding: 4px 0; color: var(--text-muted); }

/* === Badges =============================================================== */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; vertical-align: 2px;
}
.badge-primary   { background: #efeeff; color: var(--primary); }
.badge-secondary { background: #f9e6ff; color: var(--secondary); }
.badge-warning   { background: #fff5dd; color: var(--warning); }
.badge-low       { background: #e0f5ee; color: var(--success); }
.badge-normal    { background: #efeeff; color: var(--primary); }
.badge-high      { background: #fff5dd; color: var(--warning); }
.badge-urgent    { background: #fdded3; color: var(--error); }

[data-theme="dark"] .badge-primary { background: #2a2358; color: #b8b6ff; }
[data-theme="dark"] .badge-secondary { background: #3a1a48; color: #f3aaff; }
[data-theme="dark"] .badge-warning { background: #3d2e0c; color: #ffd166; }

/* === Status pills additions =============================================== */
.status-open      { background: #efeeff; color: var(--primary); }
.status-replied   { background: #fff5dd; color: var(--warning); }
.status-closed    { background: #e0e3f0; color: var(--text-muted); }
.status-completed { background: #d8f3e7; color: #04654d; }
.status-paid      { background: #d8f3e7; color: #04654d; }
.status-unpaid    { background: #fff5dd; color: var(--warning); }
.status-cancelled { background: #fdded3; color: var(--error); }
.status-inactive  { background: #e0e3f0; color: var(--text-muted); }

/* === Notification list ==================================================== */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-item {
  display: flex; gap: 12px; padding: 14px 0;
  border-top: 1px solid var(--divider);
}
.notif-item:first-child { border-top: 0; }
.notif-unread { background: linear-gradient(90deg, #f7f6ff, transparent); padding-left: 14px; padding-right: 14px; margin: 0 -14px; border-radius: 8px;}
[data-theme="dark"] .notif-unread { background: linear-gradient(90deg, #1f1c3e, transparent); }
.notif-status { width: 4px; align-self: stretch; border-radius: 2px; flex: 0 0 4px; }
.notif-success { background: var(--success); }
.notif-warning { background: var(--warning); }
.notif-error   { background: var(--error); }
.notif-body { flex: 1; }
.notif-head { font-size: .9rem; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  background: var(--error); color: white; border-radius: 50%;
  font-size: 10px; font-weight: 700;
}

/* === Tickets ============================================================== */
.ticket-thread { display: flex; flex-direction: column; gap: 16px; }
.ticket-msg { padding: 14px; border-radius: 10px; }
.ticket-user  { background: var(--divider); }
.ticket-staff { background: linear-gradient(90deg, #efeeff, #f7f6ff); border-left: 3px solid var(--primary); }
[data-theme="dark"] .ticket-user { background: #1b1e36; }
[data-theme="dark"] .ticket-staff { background: #1f1c3e; border-left-color: var(--primary-light); }
.ticket-meta { font-size: .85rem; margin-bottom: 8px; }
.ticket-body { line-height: 1.5; }

/* === Bulk action bar ======================================================= */
.bulk-bar {
  position: sticky; bottom: 14px;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px; margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); z-index: 5;
}

/* === Backup codes ======================================================== */
.backup-codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 16px; background: var(--divider); border-radius: 8px;
  margin-top: 14px;
}
.backup-code {
  font-family: ui-monospace, monospace; font-size: 1.1rem; font-weight: 700;
  text-align: center; padding: 8px; background: var(--surface);
  border-radius: 6px; user-select: all;
}

/* === Invoice ============================================================== */
.invoice-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 14px;
}

/* === Tile labels darker theme ============================================ */
[data-theme="dark"] .tile-blue,
[data-theme="dark"] .tile-purple,
[data-theme="dark"] .tile-green,
[data-theme="dark"] .tile-amber,
[data-theme="dark"] .tile-rose,
[data-theme="dark"] .tile-orange { box-shadow: 0 4px 14px rgba(0,0,0,0.5); }

/* ===== Upload tabs ===== */
.upload-tabs { flex-wrap: wrap; gap: 4px; }
.upload-tabs .tab { font-size: .9rem; padding: 8px 14px; }

/* Fix link/torrent job tables */
#job-table-link .progress,
#job-table-torrent .progress {
  width: 120px; height: 6px; background: var(--divider);
  border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle;
}
#job-table-link .progress-bar,
#job-table-torrent .progress-bar {
  height: 100%; border-radius: 3px; transition: width .3s;
}
#job-table-link td,
#job-table-torrent td { vertical-align: middle; }

/* ===== Progress bar ===== */
.progress {
  display: inline-block; vertical-align: middle;
  width: 200px; height: 8px; background: var(--bg-subtle);
  border-radius: 4px; overflow: hidden; margin-right: 8px;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, #635aff 0%, #df7af3 100%);
  transition: width 0.3s ease;
}

/* ===== Codeblock for API examples ===== */
.codeblock {
  background: #1a1a2e; color: #e4e4f0;
  padding: 14px 18px; border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .85rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
  margin: 8px 0; overflow-x: auto;
}
[data-theme="dark"] .codeblock { background: #0d0d1a; }

/* ===== Live stream cards ===== */
.stream-card { padding: 0; overflow: hidden; }
.stream-card > :not(.stream-thumb) { padding: 0 18px 18px 18px; }
.stream-thumb {
  position: relative;
  aspect-ratio: 16/9; background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 100%);
  display: flex; align-items: center; justify-content: center;
}
.stream-thumb-placeholder { font-size: 3rem; opacity: .3; }
.stream-thumb.is-live { background: linear-gradient(135deg, #635aff 0%, #df7af3 100%); }
.live-pill {
  display: inline-flex; align-items: center;
  background: rgba(220,38,38,.95); color: white;
  padding: 4px 10px; border-radius: 6px;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  position: absolute; top: 12px; left: 12px;
}

/* ===== Recorder UI ===== */
.recorder { margin-top: 14px; }

/* ===== Status pills used by upload jobs ===== */
.status-running   { background: #fef3c7; color: #92400e; }
.status-queued    { background: #dbeafe; color: #1e40af; }
.status-done      { background: #d1fae5; color: #065f46; }
.status-failed    { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .status-running { background: #78350f; color: #fde68a; }
[data-theme="dark"] .status-queued  { background: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .status-done    { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .status-failed  { background: #7f1d1d; color: #fecaca; }
