:root {
  --primary: #198F86;
  --primary-dark: #116e67;
  --primary-light: #25b5aa;
  --primary-xlight: #e8f7f6;
  --secondary: #E89C4C;
  --secondary-dark: #c97d30;
  --secondary-light: #f5b97a;
  --secondary-xlight: #fdf3e8;
  --bg: #f0f4f4;
  --surface: #ffffff;
  --surface2: #f7fafa;
  --border: #daeae9;
  --text: #1a2e2d;
  --text-mid: #4a6665;
  --text-muted: #8aacab;
  --danger: #e05252;
  --success: #22c55e;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 2px 10px rgba(25, 143, 134, 0.07);
  --shadow-md: 0 4px 20px rgba(25, 143, 134, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

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

/* ========== LOGIN ========== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}

.login-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(232, 156, 76, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(37, 181, 170, 0.35), transparent 50%),
    linear-gradient(145deg, #0d4f4a 0%, var(--primary-dark) 45%, #198F86 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black, transparent);
  pointer-events: none;
}

.login-brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  animation: floatOrb 8s ease-in-out infinite;
}

.login-brand-orb.one {
  width: 220px; height: 220px;
  background: var(--secondary);
  top: -40px; right: -30px;
}

.login-brand-orb.two {
  width: 160px; height: 160px;
  background: var(--primary-light);
  bottom: 80px; left: -40px;
  animation-delay: -3s;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

.login-brand-top,
.login-brand-bottom { position: relative; z-index: 1; }

.login-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.6s ease both;
}

.login-mark-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(232, 156, 76, 0.4);
}

.login-mark-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.login-mark-sub {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.login-brand-copy {
  margin-top: 64px;
  max-width: 420px;
  animation: fadeUp 0.7s ease 0.1s both;
}

.login-brand-copy h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.login-brand-copy h1 span {
  color: var(--secondary-light);
}

.login-brand-copy p {
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  max-width: 360px;
}

.login-brand-stats {
  display: flex;
  gap: 28px;
  margin-top: 40px;
  animation: fadeUp 0.7s ease 0.2s both;
}

.login-brand-stats div strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-brand-stats div span {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--surface);
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 400px;
  animation: fadeUp 0.55s ease both;
}

.login-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-card h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}

.login-card-lead {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 143, 134, 0.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mid);
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(25, 143, 134, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-block { width: 100%; padding: 12px 18px; font-size: 14px; }

.login-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand {
    min-height: 240px;
    padding: 28px 24px;
  }
  .login-brand-copy { margin-top: 28px; }
  .login-brand-copy h1 { font-size: 28px; }
  .login-brand-stats { display: none; }
}

/* ========== CMS SHELL ========== */
.cms-body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(232,156,76,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-logo {
  padding: 0 16px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(232,156,76,0.35);
}

.logo-text { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.logo-sub { color: rgba(255,255,255,0.45); font-size: 9px; font-weight: 400; letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
}

.nav-section-label {
  padding: 10px 16px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  position: relative;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--secondary);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { background: rgba(255,255,255,0.14); }

.nav-arrow {
  margin-left: auto;
  font-size: 10px;
  opacity: .5;
  transition: transform .2s;
}

.nav-item.expanded .nav-arrow { transform: rotate(90deg); }

.nav-sub { display: none; padding-left: 36px; }
.nav-item.expanded + .nav-sub { display: block; }

.nav-sub-item {
  padding: 6px 16px 6px 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  transition: color .2s;
}

.nav-sub-item:hover,
.nav-sub-item.active { color: rgba(255,255,255,0.88); }

.nav-sub-item::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  flex-shrink: 0;
}

.nav-sub-item.active::before,
.nav-sub-item:hover::before { background: var(--secondary-light); }

.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  border: 2px solid rgba(255,255,255,0.18);
}

.user-name { color: #fff; font-size: 12px; font-weight: 600; }
.user-role { color: rgba(255,255,255,0.4); font-size: 10px; }

.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex: 1;
}

.breadcrumb-current { color: var(--text); font-weight: 600; }

.topbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-mid);
  transition: all .2s;
}

.topbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-xlight);
}

.page-content {
  flex: 1;
  padding: 22px;
  animation: fadeIn .22s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.teal::after { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.orange::after { background: linear-gradient(90deg, var(--secondary), var(--secondary-light)); }
.stat-card.green::after { background: linear-gradient(90deg, #22c55e, #86efac); }
.stat-card.purple::after { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-change { font-size: 11.5px; color: var(--text-muted); }
.stat-up { color: var(--success); }

.stat-icon {
  position: absolute;
  right: 18px; top: 18px;
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.stat-icon.teal { background: var(--primary-xlight); }
.stat-icon.orange { background: var(--secondary-xlight); }
.stat-icon.green { background: #dcfce7; }
.stat-icon.purple { background: #ede9fe; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.justify-end { justify-content: flex-end; }
.mt-8 { margin-top: 8px; }

.home-stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.testi-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.testi-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-title-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--primary-xlight);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.card-body { padding: 18px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 6px;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-xlight);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.logout-form { margin: 0; }

.nav-item.logout {
  margin-top: 8px;
  color: rgba(255,255,255,0.45);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.alert-success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.mb-16 { margin-bottom: 16px; }
.mb-12 { margin-bottom: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-success .badge-dot { background: #22c55e; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-warning .badge-dot { background: #eab308; }
.badge-info { background: var(--primary-xlight); color: var(--primary-dark); }
.badge-info .badge-dot { background: var(--primary); }
.badge-orange { background: var(--secondary-xlight); color: var(--secondary-dark); }
.badge-orange .badge-dot { background: var(--secondary); }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-danger .badge-dot { background: #ef4444; }

.act-av {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.text-sm { font-size: 12.5px; }
.text-primary { color: var(--primary); }
.mt-16 { margin-top: 16px; }

.category-card {
  display: block;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 0;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-card-bar { height: 4px; }
.category-card.accent-teal .category-card-bar { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.category-card.accent-orange .category-card-bar { background: linear-gradient(90deg, var(--secondary), var(--secondary-light)); }
.category-card.accent-purple .category-card-bar { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }

.category-card-body { padding: 16px 18px; }

.category-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.category-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.category-card-icon.accent-teal { background: var(--primary-xlight); }
.category-card-icon.accent-orange { background: var(--secondary-xlight); }
.category-card-icon.accent-purple { background: #ede9fe; }

.category-card-title {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
}

.category-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.category-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-height: 24px;
}

.category-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card-cta {
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 700;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

.td-bold { font-weight: 600; }
.td-mono {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  color: var(--text-mid);
}

.detail-row {
  display: flex;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  font-size: 13px;
}

.detail-row:last-child { border-bottom: none; }
.detail-key {
  width: 150px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-mid);
  font-size: 12px;
}
.detail-val { flex: 1; }

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}

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

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,156,76,0.28);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.filters-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  transition: all .2s;
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-xlight);
}

.action-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fee2e2;
}

.banner-thumb {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.banner-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  font-size: 16px;
}

.banner-preview {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

.flex { display: flex; }
.items-center { align-items: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.mt-4 { margin-top: 4px; }
.mt-12 { margin-top: 12px; }

.badge-rf {
  background: #e0f2fe;
  color: #0369a1;
  font-family: 'DM Mono', monospace;
}

.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width .6s ease;
}

.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.6;
}

.result-box strong { color: var(--text); }

.result-box.strength {
  background: var(--primary-xlight);
  color: var(--primary-dark);
}

.result-box.blindspot {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.result-box.action {
  background: var(--secondary-xlight);
  border-color: #fde8c8;
  color: var(--secondary-dark);
}

.result-box.hook {
  border: 1.5px dashed var(--primary);
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.tab-bar {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all .2s;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.topic-category-card { margin-bottom: 14px; overflow: hidden; }

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  flex-wrap: wrap;
}

.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cat-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.18);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cat-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-meta {
  font-size: 11px;
  opacity: .75;
  margin-top: 2px;
}

.cat-status { margin-left: 8px; flex-shrink: 0; }

.btn-add-topic {
  background: #fff;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.btn-add-topic:hover { background: #f1f6f6; }

.section-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--primary);
  color: #fff;
}

.section-header h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.section-body { padding: 16px; }

.overview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  margin-bottom: 8px;
  border-bottom: 2px solid var(--primary-xlight);
  padding-bottom: 5px;
}

.quest-option {
  font-size: 12.5px;
  color: var(--text-mid);
  padding: 2px 0;
}

.quest-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  margin-bottom: 3px;
  background: #e0f2fe;
  color: #0369a1;
}

.quest-type-badge.alt {
  background: #fce7f3;
  color: #9d174d;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.mb-8 { margin-bottom: 8px; }
.flex-col { flex-direction: column; }
.gap-12 { gap: 12px; }

.filter-input {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  gap: 6px;
}

.filter-input input,
.filter-input select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  padding: 6px 0;
  outline: none;
  min-width: 140px;
}

.score-combo {
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sc-code {
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
}

.sc-code.alt {
  background: #fce7f3;
  color: #9d174d;
}

.ciri-text {
  font-size: 12px;
  color: var(--text-mid);
}

.cell-clamp {
  font-size: 12px;
  max-width: 160px;
  line-height: 1.45;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.scoring-steps ol {
  padding-left: 18px;
  margin: 0;
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.7;
}

.scoring-steps li {
  margin-bottom: 6px;
}

.scoring-steps code {
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  background: var(--primary-xlight);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrap { margin-left: 0; }
  .category-header { flex-direction: column; align-items: stretch; }
  .btn-add-topic { width: 100%; text-align: center; }
}
