/* ==========================================================================
   KBS MEDIA PORTAL — base design system
   Dark-first premium SaaS look · RTL + LTR · mobile friendly
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0d12;
  --bg-2: #11141c;
  --card: #171b25;
  --card-hover: #1c2130;
  --border: #272d3a;
  --border-strong: #333b4c;

  --primary: #6366f1;
  --primary-hover: #5558e8;
  --primary-2: #8b5cf6;

  --text: #f8fafc;
  --muted: #94a3b8;

  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 24px 48px -32px rgba(0, 0, 0, 0.9);

  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 66px;
  --container: 1180px;
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #f5f7fb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --muted: #64748b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(1200px 520px at 78% -12%, rgba(99, 102, 241, 0.16), transparent 68%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

html[dir='ltr'] body {
  background-image: radial-gradient(1200px 520px at 22% -12%, rgba(99, 102, 241, 0.16), transparent 68%);
}

h1, h2, h3, h4, p, figure, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(99, 102, 241, 0.35);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ------------------------------- layout -------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack-lg {
  display: grid;
  gap: 18px;
  align-content: start;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------- buttons ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding-inline: 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn[aria-busy='true'] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 26px -18px rgba(99, 102, 241, 0.95);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--card-hover);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  height: 34px;
  padding-inline: 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

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

.lang-btn {
  min-width: 40px;
  height: 34px;
  padding-inline: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

[data-theme='light'] .spinner {
  border-color: rgba(15, 23, 42, 0.2);
  border-top-color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------- forms --------------------------------- */

.field {
  display: grid;
  gap: 7px;
}

.label,
.field > label,
.settings-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.req {
  color: var(--error);
  font-size: 13px;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.textarea {
  resize: vertical;
  min-height: 96px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--border-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 34px;
}

html[dir='rtl'] .select {
  background-position: 18px 18px, 13px 18px;
  padding-inline-end: 13px;
  padding-inline-start: 34px;
}

.select-sm {
  min-height: 36px;
  padding-block: 6px;
  font-size: 13px;
  border-radius: 8px;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

.field-error {
  font-size: 12px;
  color: var(--error);
}

/* ------------------------------- badges -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding-inline: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-video {
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
}

.badge-image {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.badge-document {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
}

.badge-archive {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.badge-other {
  color: var(--muted);
}

[data-theme='light'] .badge-video {
  color: #4338ca;
}
[data-theme='light'] .badge-image {
  color: #047857;
}
[data-theme='light'] .badge-document {
  color: #1d4ed8;
}
[data-theme='light'] .badge-archive {
  color: #b45309;
}

/* -------------------------------- cards -------------------------------- */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

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

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-lead {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
  font-size: 13px;
}

.inline-alert .icon {
  color: var(--error);
  margin-top: 2px;
}

[data-theme='light'] .inline-alert {
  color: #991b1b;
}

.inline-alert-info {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.1);
  color: #c7d2fe;
}

[data-theme='light'] .inline-alert-info {
  color: #3730a3;
}

/* ------------------------------- brand --------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand-text {
  display: grid;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-text span {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------------- header -------------------------------- */

.site-header,
.page-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(14px);
}

[data-theme='light'] .site-header,
[data-theme='light'] .page-header {
  background: rgba(255, 255, 255, 0.86);
}

.site-header-inner,
.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--card-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -------------------------------- hero --------------------------------- */

.hero {
  position: relative;
  padding-block: 76px 64px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.eyebrow .icon {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin-top: 18px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-note .icon {
  width: 15px;
  height: 15px;
  color: var(--success);
}

.hero-visual {
  position: relative;
}

.glass-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)), var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

[data-theme='light'] .glass-panel {
  background: var(--card);
}

.glass-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.glass-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.glass-title {
  margin-inline-start: 8px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.glass-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.glass-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 12.5px;
}

.glass-drop .icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.glass-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-2);
}

.glass-file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.14);
  color: var(--primary);
}

.glass-file-icon .icon {
  width: 15px;
  height: 15px;
}

.glass-lines {
  display: grid;
  gap: 5px;
  flex: 1;
}

.glass-line {
  height: 7px;
  border-radius: 99px;
  background: var(--border);
}

.glass-line.short {
  width: 42%;
  background: var(--border-strong);
  opacity: 0.7;
}

.glass-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--bg-2);
  overflow: hidden;
}

.glass-progress span {
  display: block;
  height: 100%;
  width: 62%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.glass-pct {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ features ------------------------------- */

.section {
  padding-block: 56px;
}

.section-head {
  max-width: 620px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.section-head p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.feature:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 11px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.feature-icon .icon {
  width: 18px;
  height: 18px;
}

.feature h3 {
  font-size: 13.5px;
  font-weight: 700;
}

.feature p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 13.5px;
  font-weight: 700;
}

.step p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 26px;
  margin-top: 24px;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

.page-footer {
  border-top: 1px solid var(--border);
  padding-block: 22px;
  color: var(--muted);
  font-size: 12.5px;
}

.page-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* -------------------------------- login -------------------------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
}

.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px 48px;
  border-inline-end: 1px solid var(--border);
  background-color: var(--bg-2);
  background-image: radial-gradient(720px 420px at 20% 8%, rgba(99, 102, 241, 0.16), transparent 70%);
  overflow: hidden;
}

.auth-showcase h2 {
  max-width: 18ch;
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.auth-showcase-lead {
  margin-top: 16px;
  max-width: 40ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.auth-points {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.auth-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.auth-point .icon {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--success);
}

.auth-showcase-foot {
  color: var(--muted);
  font-size: 12px;
}

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

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .brand {
  margin-bottom: 28px;
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.auth-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-inline-end: 46px;
}

.password-toggle {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--card-hover);
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
  font-size: 12.5px;
}

[data-theme='light'] .auth-error {
  color: #991b1b;
}

.auth-error .icon {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  color: var(--error);
}

.auth-note {
  padding: 10px 12px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
  font-size: 12.5px;
}

[data-theme='light'] .auth-note {
  color: #166534;
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.auth-foot a:hover {
  color: var(--text);
}

.auth-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.auth-secure .icon {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* -------------------------------- toasts ------------------------------- */

.toast-host {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 90;
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--muted);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
}
.toast-success .icon {
  color: var(--success);
}
.toast-error {
  border-color: rgba(239, 68, 68, 0.45);
}
.toast-error .icon {
  color: var(--error);
}
.toast-info .icon {
  color: var(--primary);
}

/* -------------------------------- modals ------------------------------- */

body.has-modal {
  overflow: hidden;
}

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(6px);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition: opacity 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.modal.is-visible {
  opacity: 1;
  transform: none;
}

.modal-sm {
  max-width: 430px;
}
.modal-lg {
  max-width: 900px;
}
.modal-xl {
  max-width: 1120px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  padding: 18px;
  overflow: auto;
}

.modal-text {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex: 0 0 auto;
}

/* -------------------------------- empty -------------------------------- */

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 52px 24px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg-2);
  color: var(--muted);
}

.empty-icon .icon {
  width: 22px;
  height: 22px;
}

.empty-title {
  font-size: 14.5px;
  font-weight: 700;
}

.empty-body {
  max-width: 42ch;
  color: var(--muted);
  font-size: 12.5px;
}

.empty .btn {
  margin-top: 8px;
}

/* ------------------------------ skeletons ------------------------------ */

.skeleton {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--card-hover) 25%,
    var(--border) 37%,
    var(--card-hover) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 0;
}

.skeleton-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.skeleton-line {
  height: 9px;
  width: 100%;
}

.skeleton-line.tall {
  height: 20px;
}

.w-35 {
  width: 35%;
}
.w-45 {
  width: 45%;
}
.w-60 {
  width: 60%;
}
.w-70 {
  width: 70%;
}

/* ---------------------------- misc utilities --------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.page-shell {
  display: grid;
  gap: 18px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.view-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.view-lead {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

[hidden] {
  display: none !important;
}
