/* ═══════════════════════════════════════════════════════════
   AGS Admin — Design System
   Professional, responsive admin panel
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ────────────────────────────────────────── */
:root {
  --brand:      #1CABE2;
  --brand-dk:   #1590c4;
  --brand-lt:   #e8f6fd;
  --navy:       #002858;
  --navy-lt:    #0a3a72;
  --navy-muted: rgba(0,40,88,0.65);

  --sidebar-w:  252px;

  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --surface-3:  #f1f5f9;

  --border:     #e2e8f0;
  --border-md:  #cbd5e1;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-xmuted:    #b8c4d0;

  --red:        #ef4444;
  --red-lt:     #fef2f2;
  --green:      #22c55e;
  --green-lt:   #f0fdf4;
  --amber:      #f59e0b;
  --amber-lt:   #fffbeb;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-pill:999px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
  --shadow-brand: 0 4px 14px rgba(28,171,226,.25);

  --t: 160ms ease-out;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Login screen ─────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, #1a4e8a 60%, #0d3a72 100%);
  padding: 24px;
}
.login-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.20);
  text-align: center;
}
.login-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #0095cc);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-brand);
}
.login-box h1 {
  font-size: 22px; font-weight: 800;
  color: var(--navy); letter-spacing: -0.02em; margin-bottom: 6px;
}
.login-box > p { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 12px; }

/* ── App shell ────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 200;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: rgba(255,255,255,.06);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 11px; }
.sidebar-logo-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #0095cc);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 10px rgba(28,171,226,.4);
  flex-shrink: 0;
}
.sidebar-logo-text { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 10.5px; color: rgba(255,255,255,.38); }
.sidebar-close {
  display: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  align-items: center; justify-content: center;
  color: rgba(255,255,255,.6);
  transition: background var(--t), color var(--t);
  font-size: 14px;
}
.sidebar-close:hover { background: rgba(255,255,255,.14); color: #fff; }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px 16px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-group {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 18px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  transition: background var(--t), color var(--t);
  user-select: none;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: rgba(28,171,226,.20);
  color: var(--brand);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-item i { width: 16px; text-align: center; font-size: 13px; }
.nav-item.publish-item { color: rgba(28,171,226,.8); font-weight: 600; }
.nav-item.publish-item:hover { background: rgba(28,171,226,.12); color: var(--brand); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #0095cc);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: 10.5px; color: rgba(255,255,255,.38); margin-top: 1px; }
.btn-signout {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.45);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
}
.btn-signout:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }

/* ── Main area ────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  gap: 16px;
}
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-status { font-size: 12px; color: var(--text-muted); }
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  transition: background var(--t);
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--border); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}
.card + .card { margin-top: 16px; }
.card:focus-within { box-shadow: var(--shadow-md); }

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-xmuted);
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-header-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-header strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
}

/* ── Section headings ─────────────────────────────────────── */
.section-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.section-sub   { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }

/* ── Grid helpers ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Form system (.field-* used by existing renderers) ─────── */
.field,
.form-group {
  margin-bottom: 14px;
}
.field:last-child,
.form-group:last-child { margin-bottom: 0; }

.field-label,
.form-group label,
.form-group .form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: .01em;
}

.field-input,
.field-textarea,
.field-select,
.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  line-height: 1.5;
}
.field-input:hover,
.field-textarea:hover,
.field-select:hover,
.form-control:hover {
  border-color: var(--border-md);
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus,
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(28,171,226,.12);
}
.field-input::placeholder,
.field-textarea::placeholder,
.form-control::placeholder {
  color: var(--text-xmuted);
}

textarea.field-textarea,
textarea.form-control { resize: vertical; min-height: 72px; }

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
}
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.field-row  { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.field-check {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; user-select: none;
}
.field-check input {
  accent-color: var(--brand);
  width: 15px; height: 15px; cursor: pointer;
}

/* ── Button system ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t), box-shadow var(--t), opacity var(--t), transform var(--t);
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(28,171,226,.28);
}
.btn-primary:hover { background: var(--brand-dk); box-shadow: 0 4px 14px rgba(28,171,226,.36); }

.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(0,40,88,.22); }
.btn-navy:hover { background: var(--navy-lt); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-md);
}
.btn-outline:hover { background: var(--surface-3); border-color: var(--brand); color: var(--brand); }

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; gap: 5px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
}
.badge-upcoming { background: var(--brand-lt); color: var(--brand); }
.badge-past     { background: var(--surface-3); color: var(--text-muted); }
.badge-featured { background: var(--amber-lt); color: #92400e; }

/* ── List items ───────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  margin-bottom: 8px;
  transition: border-color var(--t), box-shadow var(--t);
}
.list-item:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,171,226,.07); }
.list-item-body   { flex: 1; min-width: 0; }
.list-item-title  { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.list-item-meta   { font-size: 11.5px; color: var(--text-muted); }
.list-item-actions{ display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

.color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.dot-blue  { background: #3b82f6; }
.dot-teal  { background: #14b8a6; }
.dot-amber { background: #f59e0b; }
.dot-navy  { background: var(--navy); }

/* ── Edit panel ───────────────────────────────────────────── */
.edit-panel {
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px;
  background: #f0faff;
  margin-bottom: 10px;
}
.edit-panel-title {
  font-size: 12px; font-weight: 700;
  color: var(--brand); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 16px;
}

/* ── Dashboard ────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 20px 18px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.dash-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(28,171,226,.10);
  transform: translateY(-2px);
}
.dash-card-icon  { font-size: 18px; color: var(--brand); margin-bottom: 12px; }
.dash-card-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.dash-card-value { font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1; }
.dash-card-sub   { font-size: 11px; color: var(--text-xmuted); margin-top: 3px; }

/* ── Publish ──────────────────────────────────────────────── */
.publish-steps { list-style: none; margin: 16px 0; }
.publish-step {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--surface-3);
  font-size: 13px;
}
.publish-step:last-child { border-bottom: none; }
.step-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.step-idle    .step-icon { background: var(--surface-3); color: var(--text-muted); }
.step-running .step-icon { background: var(--brand-lt);  color: var(--brand); }
.step-ok      .step-icon { background: var(--green-lt);  color: #16a34a; }
.step-error   .step-icon { background: var(--red-lt);    color: var(--red); }
.step-label   { flex: 1; }
.step-msg     { font-size: 11px; color: var(--text-muted); }
.step-error .step-msg { color: var(--red); }

.publish-log {
  background: #0f172a;
  color: #7dd3fc;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 16px;
  display: none;
  line-height: 1.6;
}
.publish-log.visible { display: block; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: #fff;
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-error   { background: var(--red); }
.toast.toast-success { background: #16a34a; }

/* ── Spinner ──────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.fa-spin { animation: spin .7s linear infinite; }

/* ── Mobile sidebar overlay ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,40,88,.45);
  backdrop-filter: blur(2px);
  z-index: 199;
  animation: fadeIn .2s ease-out;
}
.sidebar-overlay.show { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 200;
    height: 100%;
    width: min(var(--sidebar-w), 88vw);
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .menu-toggle   { display: flex !important; }
  .content { padding: 20px 16px; }
  .topbar  { padding: 0 16px; }
  .grid-2  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px 12px; }
}

/* ── Page-based accordion nav ─────────────────────────────── */
.nav-page { margin: 1px 0; }

.nav-page-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  color: rgba(255,255,255,.52);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t), color var(--t);
}
.nav-page-hdr:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.88); }
.nav-page-hdr > i:first-child { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-page-hdr > span { flex: 1; }

.nav-chevron {
  font-size: 10px;
  color: rgba(255,255,255,.25);
  transition: transform .18s ease;
  flex-shrink: 0;
}
.nav-page.open > .nav-page-hdr,
.nav-page.has-active > .nav-page-hdr {
  color: rgba(255,255,255,.9);
}
.nav-page.open > .nav-page-hdr .nav-chevron {
  transform: rotate(90deg);
  color: rgba(255,255,255,.45);
}

.nav-sub-list {
  display: none;
  padding: 2px 0 4px 10px;
}
.nav-page.open > .nav-sub-list { display: block; }

.nav-item.nav-sub {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 11px 7px 24px;
  color: rgba(255,255,255,.42);
  border-radius: var(--radius-sm);
}
.nav-item.nav-sub i { width: 14px; font-size: 11px; }
.nav-item.nav-sub:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.nav-item.nav-sub.active {
  color: var(--brand);
  background: rgba(28,171,226,.18);
  font-weight: 600;
}
.nav-item.nav-sub.active::before { left: 10px; }

.nav-separator {
  border: none;
  border-top: 1px solid rgba(255,255,255,.07);
  margin: 10px 10px;
}

/* ── Dashboard — page cards ───────────────────────────────── */
.dash-card-sub {
  font-size: 11px;
  color: var(--text-xmuted);
  margin-top: 4px;
  line-height: 1.4;
}
.dash-card--publish { border-color: rgba(28,171,226,.3); }
.dash-card--publish:hover { border-color: var(--brand); }

/* ── Custom Section Manager ───────────────────────────────── */
.cs-type-picker {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.cs-type-picker-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.cs-type-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cs-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--t), background var(--t), color var(--t);
}
.cs-type-btn:hover {
  border-color: var(--brand);
  background: var(--brand-lt);
  color: var(--brand);
}

.cs-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius);
  margin-bottom: 16px;
  line-height: 1.6;
}

.cs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: opacity var(--t);
}
.cs-item--hidden { opacity: .5; }

.cs-item-drag {
  color: var(--text-xmuted);
  cursor: grab;
  font-size: 13px;
  flex-shrink: 0;
}

.cs-item-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.cs-badge-text-block  { background: var(--brand-lt);  color: var(--brand); }
.cs-badge-quote-block { background: var(--green-lt);  color: #15803d; }
.cs-badge-stats-row   { background: var(--amber-lt);  color: #92400e; }

.cs-item-preview {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.cs-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── M-Koba members ─────────────────────────────────────────── */
.mk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mk-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mk-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.mk-row:hover { background: var(--surface-2); }
.mk-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.mk-pending   { background: #fef3c7; color: #92400e; }
.mk-confirmed { background: var(--green-lt); color: #166534; }
.mk-rejected  { background: var(--red-lt); color: #991b1b; }
.mk-dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 8px 0 0; font-size: 13px; }
.mk-dl dt { color: var(--text-muted); font-weight: 600; }
.mk-dl dd { margin: 0; color: var(--text-primary); word-break: break-word; }
@media (max-width: 700px) { .mk-dl { grid-template-columns: 1fr; gap: 2px; } .mk-dl dd { margin-bottom: 8px; } }

/* ── Translations ───────────────────────────────────────────── */
.tr-list { display: flex; flex-direction: column; gap: 10px; }
.tr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.tr-row.tr-missing { border-color: #f59e0b; background: #fffbeb; }
.tr-en { font-size: 13px; color: var(--text-primary); line-height: 1.5; padding-top: 6px; word-break: break-word; }
.tr-sw { font-size: 13px; }
@media (max-width: 800px) { .tr-row { grid-template-columns: 1fr; } }

/* ── Image fields & media library ───────────────────────────── */
.imgf-row { display: flex; gap: 14px; align-items: flex-start; }
.imgf-thumb { width: 96px; height: 72px; flex-shrink: 0; border: 1px dashed var(--border-md); border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; }
.imgf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgf-ctrl { flex: 1; min-width: 0; }
.imgf-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.media-overlay { position: fixed; inset: 0; background: rgba(0,20,60,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.media-modal { background: var(--surface); border-radius: 14px; width: min(960px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.media-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.media-grid { padding: 16px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.media-pick { display: block; width: 100%; aspect-ratio: 4/3; padding: 0; border: 0; background: #e5e7eb; cursor: pointer; }
.media-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-pick:hover { outline: 3px solid var(--brand); outline-offset: -3px; }
.media-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; font-size: 11px; color: var(--text-secondary); }
.media-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-del { border: 0; background: none; color: var(--red); cursor: pointer; padding: 2px 4px; }
@media (max-width: 600px) { .imgf-row { flex-direction: column; } }
