/* Aloy Ops — quiet luxury editorial console
   Uyghur RTL · UKIJ local fonts (real Uyghur shaping) · anti-clutter */

/* Primary UI: UKIJ Tuz Tom — standard Uyghur screen face */
@font-face {
  font-family: "UKIJ Tuz Tom";
  src: url("/fonts/UKIJTuzTom.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "UKIJ Tuz Tom";
  src: url("/fonts/UKIJQara-Bold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "UKIJ Tuz Tom";
  src: url("/fonts/UKIJQara-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "UKIJ Tuz Tom";
  src: url("/fonts/UKIJQara-Bold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* Screen UI alternate */
@font-face {
  font-family: "UKIJ Ekran";
  src: url("/fonts/UKIJEkran.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* Unified family name used by the app */
@font-face {
  font-family: "Aloy Uyghur";
  src: url("/fonts/UKIJTuzTom.ttf") format("truetype");
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aloy Uyghur";
  src: url("/fonts/UKIJQara-Bold.ttf") format("truetype");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* Latin / numbers / CJK fallback stack companions */
@font-face {
  font-family: "Aloy Uyghur Naskh";
  src: url("/fonts/NotoNaskhArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aloy Uyghur Naskh";
  src: url("/fonts/NotoNaskhArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aloy Noto Sans";
  src: url("/fonts/NotoSansArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aloy Noto Sans";
  src: url("/fonts/NotoSansArabic-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1a1614;
  --ink-soft: #4a433c;
  --muted: #8a8178;
  --mute-2: #b0a79d;
  --canvas: #f4f0ea;
  --surface: #fffcf8;
  --surface-2: #f7f2eb;
  --line: rgba(40, 32, 24, 0.08);
  --line-strong: rgba(40, 32, 24, 0.12);
  --coral: #e85a3c;
  --coral-deep: #c94a30;
  --coral-soft: rgba(232, 90, 60, 0.1);
  --teal: #1f6f68;
  --teal-soft: rgba(31, 111, 104, 0.1);
  --gold: #b8892a;
  --gold-soft: rgba(184, 137, 42, 0.12);
  --ok: #1f7a4c;
  --ok-soft: rgba(31, 122, 76, 0.1);
  --danger: #c43c2c;
  --danger-soft: rgba(196, 60, 44, 0.1);
  --shadow-sm: 0 1px 2px rgba(26, 22, 20, 0.04);
  --shadow: 0 12px 40px rgba(26, 22, 20, 0.06);
  --shadow-lg: 0 24px 60px rgba(26, 22, 20, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --side: 272px;
  /* UKIJ first — real Uyghur joining forms; Noto as safety net */
  --font: "Aloy Uyghur", "UKIJ Tuz Tom", "UKIJ Ekran", "Aloy Noto Sans",
          "Aloy Uyghur Naskh", "Noto Sans Arabic", "Noto Naskh Arabic",
          "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Force Uyghur font stack over Bootstrap reboot */
html[dir="rtl"],
html[dir="rtl"] body,
body,
body.aloy-ops,
body.aloy-ops * {
  font-family: var(--font) !important;
}

html[dir="rtl"] body,
body.aloy-ops {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
}

/* Keep icons / mono on their own faces */
body.aloy-ops .bi,
body.aloy-ops [class^="bi-"],
body.aloy-ops [class*=" bi-"],
.bi {
  font-family: "bootstrap-icons" !important;
  font-style: normal !important;
  font-weight: normal !important;
}
body.aloy-ops code,
body.aloy-ops .font-monospace,
body.aloy-ops .ltr-num,
body.aloy-ops pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--coral-deep); }

/* ── Shell ── */
.ops-shell { display: flex; min-height: 100vh; }
.ops-side {
  width: var(--side);
  flex-shrink: 0;
  background: linear-gradient(180deg, #1c1917 0%, #151311 100%);
  color: rgba(255, 250, 244, 0.88);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 18px 24px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid rgba(255,255,255,0.04);
}
.ops-side::-webkit-scrollbar { width: 0; }
.ops-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(232, 90, 60, 0.05), transparent 55%),
    radial-gradient(700px 360px at 0% 100%, rgba(31, 111, 104, 0.04), transparent 50%),
    var(--canvas);
}

/* Brand */
.ops-brand {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 10px 28px;
}
.ops-brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(145deg, #f07a55 0%, #e85a3c 45%, #1f6f68 120%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 10px 28px rgba(232, 90, 60, 0.35);
  position: relative;
  flex-shrink: 0;
}
.ops-brand-mark::after {
  content: "";
  position: absolute; inset: 2px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  pointer-events: none;
}
.ops-brand-mark b {
  position: relative; z-index: 1;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif !important;
}
.ops-brand h1 {
  margin: 0; font-size: 1.05rem; font-weight: 700;
  color: #fffaf4; letter-spacing: -0.02em;
}
.ops-brand p {
  margin: 3px 0 0; font-size: .7rem; color: rgba(255,250,244,0.42);
  font-weight: 500; max-width: 150px; line-height: 1.35;
}

/* Nav */
.ops-nav { flex: 1; }
.ops-nav-label {
  font-size: .65rem;
  letter-spacing: .14em;
  color: rgba(255,250,244,0.32);
  padding: 18px 14px 8px;
  font-weight: 600;
}
.ops-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin: 2px 0;
  border-radius: 14px;
  color: rgba(255, 250, 244, 0.62);
  font-weight: 500; font-size: .9rem;
  border: 1px solid transparent;
  transition: all .22s var(--ease);
  position: relative;
}
.ops-nav a i {
  width: 1.35rem; text-align: center;
  font-size: 1.05rem; opacity: .7;
  transition: opacity .2s;
}
.ops-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #fffaf4;
}
.ops-nav a:hover i { opacity: 1; }
.ops-nav a.active {
  background: rgba(255, 250, 244, 0.08);
  color: #fffaf4;
  border-color: rgba(255,255,255,0.06);
  box-shadow: inset -2px 0 0 var(--coral);
  font-weight: 600;
}
.ops-nav a.active i { opacity: 1; color: #f08a6a; }
html[dir="ltr"] .ops-nav a.active {
  box-shadow: inset 2px 0 0 var(--coral);
}
.ops-nav a .dot {
  margin-inline-start: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--coral); color: #fff;
  font-size: .68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(232, 90, 60, 0.4);
}

.ops-side-foot {
  margin-top: auto;
  padding: 16px 10px 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ops-side-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.ops-side-user .ava {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(145deg, #3d3530, #2a2420);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid; place-items: center;
  color: #f08a6a; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.ops-side-user .meta { min-width: 0; flex: 1; }
.ops-side-user .meta strong {
  display: block; font-size: .82rem; color: #fffaf4;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ops-side-user .meta span {
  font-size: .68rem; color: rgba(255,250,244,0.38);
}
.ops-side-user form { margin: 0; }
.ops-side-user .btn-logout {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent; color: rgba(255,250,244,0.5);
  display: grid; place-items: center; cursor: pointer;
  transition: .2s var(--ease);
}
.ops-side-user .btn-logout:hover {
  background: rgba(232,90,60,0.15); color: #f08a6a; border-color: rgba(232,90,60,0.25);
}

/* Top bar — minimal */
.ops-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 28px 36px 0;
}
.ops-top-title h2 {
  margin: 0; font-size: 1.55rem; font-weight: 700;
  letter-spacing: -0.03em; color: var(--ink);
  line-height: 1.25;
}
.ops-top-title span {
  color: var(--muted); font-size: .82rem; font-weight: 500;
  display: block; margin-top: 4px;
}
.ops-top-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 4px;
}
.ops-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .78rem; font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.ops-pill .live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2db86e;
  box-shadow: 0 0 0 3px rgba(45, 184, 110, 0.18);
  animation: pulse-live 2.4s ease infinite;
}
@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 3px rgba(45, 184, 110, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(45, 184, 110, 0.08); }
}
.ops-content { padding: 22px 36px 48px; max-width: 1400px; }

/* ── Hero — quiet luxury ── */
.ops-hero {
  position: relative; overflow: hidden;
  border-radius: 24px;
  padding: 28px 32px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.ops-hero::before {
  content: "";
  position: absolute;
  inset-inline-end: 0; top: 0; bottom: 0;
  width: 42%;
  background:
    radial-gradient(ellipse 80% 90% at 80% 40%, rgba(232, 90, 60, 0.12), transparent 70%),
    linear-gradient(105deg, transparent 0%, rgba(31, 111, 104, 0.04) 100%);
  pointer-events: none;
}
.ops-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--coral), #1f6f68);
  border-radius: 0 2px 2px 0;
}
html[dir="ltr"] .ops-hero::after {
  border-radius: 2px 0 0 2px;
}
.ops-hero-inner {
  position: relative; z-index: 1;
  display: flex; gap: 28px;
  justify-content: space-between; align-items: center;
  flex-wrap: wrap;
}
.ops-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--coral-soft);
  color: var(--coral-deep);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .72rem; font-weight: 700;
  letter-spacing: 0.02em;
}
.ops-hero h3 {
  margin: 12px 0 8px;
  font-size: 1.55rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink);
  line-height: 1.3;
}
.ops-hero h3 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--coral) 0%, #c45a3a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ops-hero .hero-lead {
  margin: 0;
  color: var(--ink-soft);
  max-width: 480px;
  font-weight: 500;
  font-size: .92rem;
  line-height: 1.65;
}
.ops-hero .hero-lead strong {
  color: var(--ink);
  font-weight: 700;
}
.ops-hero-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px;
}
.ops-hero-actions a {
  background: var(--ink);
  border: none;
  color: #fffaf4;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: .8rem; font-weight: 600;
  transition: all .22s var(--ease);
  box-shadow: 0 6px 16px rgba(26, 22, 20, 0.12);
}
.ops-hero-actions a:hover {
  background: var(--coral);
  color: #fff;
  transform: translateY(-1px);
}
.ops-hero-actions a.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.ops-hero-actions a.ghost:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
  transform: none;
}
.ops-date-card {
  min-width: 148px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  text-align: center;
}
.ops-date-card small {
  color: var(--muted); font-size: .72rem;
  display: block; font-weight: 600;
}
.ops-date-card strong {
  font-size: 1.15rem; display: block;
  margin-top: 6px; font-weight: 700;
  letter-spacing: -0.02em;
}
.ops-date-card span {
  font-size: .75rem; color: var(--mute-2);
  display: block; margin-top: 4px;
}

/* ── Stat mosaic — calmer ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.stat-grid.secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}
@media (max-width: 1200px) {
  .stat-grid, .stat-grid.secondary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stat-grid, .stat-grid.secondary { grid-template-columns: 1fr; }
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-height: auto;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.stat-tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.stat-tile header {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .8rem; font-weight: 600;
  margin-bottom: 12px;
}
.stat-tile .tag {
  font-size: .62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--mute-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stat-tile .tag.t-user { background: rgba(59, 111, 212, 0.08); color: #4a6fb8; }
.stat-tile .tag.t-vip { background: var(--gold-soft); color: var(--gold); }
.stat-tile .tag.t-pay { background: var(--teal-soft); color: var(--teal); }
.stat-tile .tag.t-hot { background: var(--coral-soft); color: var(--coral-deep); }
.stat-tile .value {
  font-size: 1.85rem; font-weight: 700;
  letter-spacing: -0.04em; line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-tile .value.accent { color: var(--coral); }
.stat-tile .sub {
  color: var(--muted); font-size: .75rem;
  margin-top: 8px; font-weight: 500;
  line-height: 1.45;
}
.stat-tile .spark {
  position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 36px; opacity: .35;
  pointer-events: none;
}
.stat-tile.compact {
  padding: 16px 18px;
  min-height: auto;
}
.stat-tile.compact .value { font-size: 1.35rem; }
.stat-tile.compact header { margin-bottom: 8px; }
.stat-tile.compact .spark { display: none; }

/* accent bar on primary tiles */
.stat-tile.primary::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 18px; bottom: 18px;
  width: 3px;
  border-radius: 2px;
  background: var(--line-strong);
}
.stat-tile.primary.tone-coral::before { background: var(--coral); }
.stat-tile.primary.tone-teal::before { background: var(--teal); }
.stat-tile.primary.tone-gold::before { background: var(--gold); }
.stat-tile.primary.tone-ink::before { background: var(--ink-soft); }

/* ── Panels / tables ── */
.ops-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.ops-panel .panel-hd {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.ops-panel .panel-hd h3 {
  margin: 0; font-size: .95rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.ops-panel .panel-bd { padding: 18px 22px; }

.ops-table { width: 100%; border-collapse: collapse; }
.ops-table th, .ops-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: start; vertical-align: middle; font-size: .875rem;
}
.ops-table th {
  color: var(--mute-2); font-size: .7rem; font-weight: 700;
  letter-spacing: .06em;
  background: transparent;
  text-transform: none;
}
.ops-table tbody tr { transition: background .15s; }
.ops-table tr:last-child td { border-bottom: 0; }
.ops-table tr:hover td { background: rgba(26, 22, 20, 0.02); }

.btn-aloy {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--coral);
  --bs-btn-hover-border-color: var(--coral);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--coral-deep);
  --bs-btn-active-border-color: var(--coral-deep);
  font-weight: 600 !important;
  border-radius: 12px !important;
  padding: .55rem 1.15rem !important;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(26, 22, 20, 0.12);
  transition: all .2s var(--ease) !important;
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: 12px;
  font-weight: 600;
  padding: .45rem .95rem;
  font-size: .85rem;
  transition: all .2s var(--ease);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--coral);
  color: var(--coral-deep);
  background: var(--coral-soft);
}
.btn-sm, .btn-ghost.btn-sm {
  padding: .35rem .75rem;
  font-size: .78rem;
  border-radius: 10px;
}

/* Drama list: fixed grid, header/body columns stay paired */
.drama-list-table {
  table-layout: fixed !important;
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
}
/* widths via th (more reliable than col in some WebKits) */
.drama-list-table th.col-id,
.drama-list-table td.col-id { width: 52px; }
.drama-list-table th.col-cover,
.drama-list-table td.col-cover { width: 58px; }
.drama-list-table th.col-title,
.drama-list-table td.col-title { width: auto; }
.drama-list-table th.col-cat,
.drama-list-table td.col-cat { width: 84px; }
.drama-list-table th.col-num,
.drama-list-table td.col-num { width: 64px; }
.drama-list-table th.col-status,
.drama-list-table td.col-status { width: 150px; }
.drama-list-table th.col-actions,
.drama-list-table td.col-actions { width: 180px; }

.drama-list-table > thead > tr > th,
.drama-list-table > tbody > tr > td {
  vertical-align: middle !important;
  box-sizing: border-box;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}
/* compact horizontal padding on fixed cols */
.drama-list-table > thead > tr > th.col-id,
.drama-list-table > tbody > tr > td.col-id,
.drama-list-table > thead > tr > th.col-cover,
.drama-list-table > tbody > tr > td.col-cover,
.drama-list-table > thead > tr > th.col-cat,
.drama-list-table > tbody > tr > td.col-cat,
.drama-list-table > thead > tr > th.col-num,
.drama-list-table > tbody > tr > td.col-num {
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible;
}
.drama-list-table > thead > tr > th.col-title,
.drama-list-table > tbody > tr > td.col-title {
  padding-left: 12px !important;
  padding-right: 12px !important;
  text-align: start !important;
  overflow: hidden;
}
.drama-list-table > thead > tr > th.col-status,
.drama-list-table > tbody > tr > td.col-status,
.drama-list-table > thead > tr > th.col-actions,
.drama-list-table > tbody > tr > td.col-actions {
  padding-left: 8px !important;
  padding-right: 8px !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible;
}
.drama-list-table > thead > tr > th {
  font-size: .68rem !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}
.drama-list-table td.col-num,
.drama-list-table td.col-id {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
/* ltr-num is inline-block globally — keep numbers on one line inside cells */
.drama-list-table td.col-num .ltr-num,
.drama-list-table td.col-id.ltr-num,
.drama-list-table td.col-id .ltr-num {
  display: inline !important;
  white-space: nowrap !important;
}
.drama-list-table .drama-list-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drama-list-table .drama-list-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.drama-list-table .drama-list-sub code {
  font-size: .72em;
}
.drama-status-stack {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
}
.drama-status-stack .badge-soft {
  flex-shrink: 0;
}
.drama-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.drama-row-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.drama-row-actions form {
  display: inline;
  margin: 0;
}

/* Drama list poster thumbnail */
.drama-cover-thumb {
  width: 40px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cover-fallback, #e8e4df);
  border: 1px solid var(--line);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(26, 22, 20, 0.06);
  margin-inline: auto;
}
.drama-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f3f0eb;
}
.drama-cover-thumb.is-empty {
  background:
    linear-gradient(145deg, rgba(255,255,255,.35), transparent 50%),
    var(--cover-fallback, #d9d3cb);
}
.drama-list-table td.col-cover .drama-cover-thumb {
  margin-inline: auto;
}

/* Drama edit cover preview */
.drama-cover-editor {
  display: flex;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
}
.drama-cover-preview {
  width: 108px;
  height: 152px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255,255,255,.42), transparent 55%),
    var(--cover-fallback, #e8e4df);
  box-shadow: 0 8px 22px rgba(26, 22, 20, 0.08);
}
.drama-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f3f0eb;
}
.drama-cover-preview-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(26, 22, 20, 0.45);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}
.drama-cover-preview-ph i {
  font-size: 22px;
  opacity: .7;
}
.drama-cover-preview.is-empty img {
  display: none;
}
.drama-cover-fields {
  min-width: 220px;
}
.form-control-color {
  width: 46px;
  padding: 4px;
  min-height: 38px;
}

/* Bulk movie paths (legacy "电影地址" multi-line paste) */
.movie-paths-input {
  font-size: .82rem !important;
  line-height: 1.55 !important;
  white-space: pre;
  overflow-x: auto;
  min-height: 280px;
  tab-size: 2;
  direction: ltr;
  text-align: left;
}
.white-space-pre {
  white-space: pre-line;
}

.badge-soft {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 8px; padding: 4px 10px;
  font-size: .72rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid transparent;
}
.badge-soft.ok { background: var(--ok-soft); color: var(--ok); }
.badge-soft.warn { background: var(--gold-soft); color: #8a6a18; }
.badge-soft.danger { background: var(--danger-soft); color: var(--danger); }
.badge-soft.info { background: var(--teal-soft); color: var(--teal); }

.form-control, .form-select {
  border-radius: 12px !important;
  border-color: var(--line-strong) !important;
  background: var(--surface) !important;
  padding: .6rem .9rem !important;
  font-size: .9rem !important;
  color: var(--ink) !important;
  transition: border-color .2s, box-shadow .2s !important;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(232, 90, 60, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(232, 90, 60, 0.1) !important;
}
.form-label { color: var(--ink-soft); font-weight: 600; }
.alert {
  border-radius: 14px; border: 0;
  padding: 12px 16px;
  font-weight: 500;
}
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }

.ops-empty {
  text-align: center; padding: 48px 16px; color: var(--muted);
  font-weight: 500;
}

/* Hot rank list polish */
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rank-row:first-child { padding-top: 0; }
a.rank-row-link {
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  margin: 0 -6px;
  padding-inline: 6px;
  transition: background .15s;
}
a.rank-row-link:hover {
  background: rgba(26, 22, 20, 0.03);
  color: inherit;
}
.rank-num {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; font-size: .75rem;
  background: var(--surface-2); color: var(--muted);
  flex-shrink: 0;
}
.rank-num.top {
  background: linear-gradient(145deg, #f07a55, #e85a3c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 90, 60, 0.28);
}
.rank-cover.drama-cover-thumb {
  width: 40px;
  height: 56px;
  border-radius: 7px;
  flex-shrink: 0;
  margin-inline: 0;
}
.rank-score {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink); font-size: .9rem;
  flex-shrink: 0;
}

/* Login — refined dark */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(700px 400px at 15% 10%, rgba(232, 90, 60, 0.14), transparent 55%),
    radial-gradient(600px 360px at 90% 90%, rgba(31, 111, 104, 0.12), transparent 50%),
    #12100e;
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 28px;
  padding: 36px 32px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-lg);
}
.login-card .mark {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 1.35rem;
  font-family: Georgia, "Times New Roman", serif !important;
  font-style: italic;
  background: linear-gradient(145deg, #f07a55, #e85a3c 50%, #1f6f68);
  margin-bottom: 18px;
  box-shadow: 0 12px 28px rgba(232, 90, 60, 0.3);
}
.login-screen,
.login-screen * {
  font-family: var(--font) !important;
}
.login-card .mark { font-family: Georgia, "Times New Roman", serif !important; }

/* RTL */
html[dir="rtl"] .ops-table th,
html[dir="rtl"] .ops-table td { text-align: right; }
html[dir="rtl"] .text-end { text-align: left !important; }
html[dir="rtl"] .font-monospace,
html[dir="rtl"] code,
html[dir="rtl"] .ltr-num {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] textarea { text-align: right; }
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input.font-monospace {
  direction: ltr;
  text-align: left;
}
html[dir="rtl"] .bi { margin-inline-end: 0.1rem; }
.ug-body {
  font-family: "Aloy Uyghur", "UKIJ Tuz Tom", var(--font) !important;
  line-height: 1.8;
}

/* Inputs inherit Uyghur face */
.form-control, .form-select, .btn, button, input, textarea, select, label,
h1, h2, h3, h4, h5, h6, p, span, a, td, th, li {
  font-family: inherit;
}

/* Bootstrap overrides for calm look */
.btn-outline-primary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--coral-soft);
  --bs-btn-hover-border-color: var(--coral);
  --bs-btn-hover-color: var(--coral-deep);
  border-radius: 10px;
  font-weight: 600;
}
.btn-outline-danger {
  border-radius: 10px;
  font-weight: 600;
}
.btn-outline-secondary {
  border-radius: 10px;
  font-weight: 600;
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line-strong);
}

@media (max-width: 992px) {
  .ops-shell { flex-direction: column; }
  .ops-side {
    width: 100%; height: auto; position: relative;
    border-inline-end: 0;
  }
  .ops-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .ops-nav a { flex: 1 1 44%; }
  .ops-nav-label { flex: 1 1 100%; }
  .ops-side-foot { display: none; }
  .ops-content, .ops-top { padding-left: 18px; padding-right: 18px; }
  .ops-top { padding-top: 18px; }
}
