:root {
  --brand: #fa7315;
  --brand-strong: #d95700;
  --brand-deep: #b94200;
  --brand-soft: #fff1e8;
  --brand-faint: #fff8f3;

  --navy: #1c2028;
  --navy-2: #101319;
  --orange: #fa7315;
  --sidebar: #181b21;
  --sidebar-deep: #111318;
  --sidebar-line: rgba(255, 255, 255, .075);

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f6;
  --text: #20242c;
  --muted: #6e7582;
  --muted-2: #9299a5;
  --line: #e3e6eb;
  --line-strong: #d7dbe2;

  --blue: #3867d6;
  --blue-bg: #edf3ff;
  --teal: #128269;
  --teal-bg: #eaf8f4;
  --violet: #7659c7;
  --violet-bg: #f1edff;
  --success: #18794e;
  --success-bg: #eaf7f0;
  --warning: #966300;
  --warning-bg: #fff6dc;
  --danger: #b42318;
  --danger-bg: #fff0ee;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .035), 0 4px 14px rgba(16, 24, 40, .045);
  --shadow: 0 12px 32px rgba(16, 24, 40, .08);
  --shadow-lg: 0 28px 80px rgba(16, 24, 40, .18);
  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, rgba(250, 115, 21, .045), transparent 26rem),
    var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; }

/* Sidebar */
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  color: #fff;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% -4%, rgba(250, 115, 21, .22), transparent 14rem),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
  border-right: 1px solid #252933;
  box-shadow: 14px 0 36px rgba(17, 19, 24, .08);
}
.admin-sidebar::after {
  content: '';
  position: absolute;
  inset: auto -92px -92px auto;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(250, 115, 21, .12);
  border-radius: 50%;
  pointer-events: none;
}
.brand-wrap {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 14px 20px;
  border-bottom: 1px solid var(--sidebar-line);
}
.brand-home { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.brand-logo { display: block; width: auto; max-width: 100%; object-fit: contain; }
.brand-logo-sidebar { width: 152px; height: auto; }
.brand-edition {
  margin-top: 4px;
  color: rgba(255, 255, 255, .54);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.75px;
  text-transform: uppercase;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 9px 22px rgba(250, 115, 21, .25);
}
.sidebar-close { display: none; margin-left: auto; border: 0; color: #fff; background: transparent; font-size: 28px; }
.sidebar-nav {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 20px 13px 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.nav-group { margin-bottom: 22px; }
.nav-group-title {
  padding: 0 13px 9px;
  font-size: 9px;
  font-weight: 800;
  color: rgba(255, 255, 255, .38);
  letter-spacing: 1.45px;
  text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: rgba(255, 255, 255, .68);
  font-weight: 560;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-link::before {
  content: '';
  position: absolute;
  left: -1px;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}
.nav-link:hover {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .045);
  color: #fff;
  transform: translateX(2px);
}
.nav-link.active {
  background: rgba(250, 115, 21, .13);
  border-color: rgba(250, 115, 21, .19);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.nav-link.active::before { background: var(--brand); }
.nav-link.active .nav-icon { color: var(--brand); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; color: rgba(255, 255, 255, .56); }
.sidebar-company {
  position: relative;
  z-index: 1;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--sidebar-line);
  color: rgba(255, 255, 255, .36);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.15px;
  line-height: 1.55;
}
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(14, 17, 22, .67); backdrop-filter: blur(3px); }

/* Main shell and topbar */
.admin-shell { min-height: 100vh; margin-left: 272px; display: flex; flex-direction: column; }
.admin-topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 30px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(215, 219, 226, .88);
  position: sticky;
  top: 0;
  z-index: 25;
  backdrop-filter: blur(18px);
  box-shadow: 0 5px 20px rgba(16, 24, 40, .035);
}
.admin-topbar::after {
  content: '';
  position: absolute;
  left: 30px;
  bottom: -1px;
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-left h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 730;
  line-height: 1.18;
  letter-spacing: -.55px;
}
.topbar-left p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 680px;
}
.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.topbar-right { display: flex; align-items: center; gap: 11px; }
.environment-pill {
  padding: 6px 10px;
  border: 1px solid #ffd8bf;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .85px;
}
.profile-menu { position: relative; }
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 7px 10px 7px 7px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.profile-button:hover { border-color: #ccd1d9; box-shadow: 0 7px 18px rgba(16, 24, 40, .07); }
.profile-avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 820;
  box-shadow: 0 7px 16px rgba(217, 87, 0, .21);
}
.profile-copy { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.profile-copy strong { font-size: 12px; color: var(--text); }
.profile-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.profile-chevron { color: var(--muted-2); }
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  box-shadow: var(--shadow);
}
.profile-menu.open .profile-dropdown { display: block; }
.profile-email { color: var(--muted); font-size: 11px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); word-break: break-all; }
.profile-dropdown a { display: block; margin-top: 8px; padding: 10px; border-radius: 9px; color: var(--danger); font-weight: 700; }
.profile-dropdown a:hover { background: var(--danger-bg); }
.profile-dropdown form { margin: 0; }
.profile-signout { width: 100%; display: block; margin-top: 8px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--danger); font-weight: 700; text-align: left; }
.profile-signout:hover { background: var(--danger-bg); }

.admin-content { width: 100%; max-width: 1680px; margin: 0 auto; flex: 1; padding: 28px 30px 42px; }
.admin-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  background: rgba(255, 255, 255, .72);
}

/* Alerts, forms and buttons */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.alert-success { border-color: #bfe4ce; background: var(--success-bg); color: var(--success); }
.alert-error, .alert-danger { border-color: #f2c6c1; background: var(--danger-bg); color: var(--danger); }
.alert-warning { border-color: #eed68d; background: var(--warning-bg); color: var(--warning); }
.alert button { border: 0; background: transparent; color: currentColor; font-size: 20px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.search-form { display: flex; gap: 10px; align-items: center; flex: 1; max-width: 680px; }
.form-control, .form-select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-control:hover, .form-select:hover, textarea:hover { border-color: #c8cdd5; }
.form-control:focus, .form-select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(250, 115, 21, .11); }
textarea { min-height: 110px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 730;
  font-size: 12px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(217, 87, 0, .19);
}
.btn-primary:hover { box-shadow: 0 10px 22px rgba(217, 87, 0, .25); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #c5cad3; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: #a46d00; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-soft-danger { background: var(--danger-bg); color: var(--danger); border-color: #f2c6c1; }
.btn-sm { min-height: 34px; padding: 7px 10px; font-size: 11px; }

/* Dashboard cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #d6dae1; box-shadow: 0 12px 28px rgba(16, 24, 40, .075); }
.stat-card::before { content: ''; position: absolute; left: 20px; top: 0; width: 42px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.stat-card::after { content: ''; position: absolute; width: 88px; height: 88px; border-radius: 50%; right: -35px; top: -35px; background: rgba(250, 115, 21, .055); }
.stat-card:nth-child(2)::before { background: var(--violet); }
.stat-card:nth-child(2)::after { background: rgba(118, 89, 199, .055); }
.stat-card:nth-child(3)::before { background: var(--danger); }
.stat-card:nth-child(3)::after { background: rgba(180, 35, 24, .05); }
.stat-card:nth-child(4)::before { background: var(--blue); }
.stat-card:nth-child(4)::after { background: rgba(56, 103, 214, .05); }
.stat-card:nth-child(5)::before { background: var(--success); }
.stat-card:nth-child(6)::before { background: var(--teal); }
.stat-card:nth-child(7)::before { background: #a46d00; }
.stat-card:nth-child(8)::before { background: #596273; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 720; }
.stat-value { margin-top: 9px; color: var(--text); font-size: 30px; font-weight: 780; letter-spacing: -.9px; line-height: 1.15; }
.stat-meta { margin-top: 6px; color: var(--muted-2); font-size: 10px; }

/* Panels and charts */
.content-grid { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(300px, .82fr); gap: 18px; }
.panel, .table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 69px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fdfdfd);
}
.panel-header::before { content: ''; position: absolute; left: 20px; bottom: -1px; width: 34px; height: 2px; border-radius: 999px; background: var(--brand); }
.panel-header h2 { margin: 0; color: var(--text); font-size: 15px; font-weight: 750; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 20px; }
.chart-bars { height: 250px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 12px; padding-top: 16px; }
.chart-day { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; height: 100%; text-align: center; }
.chart-stack { height: 200px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #eef0f3; }
.chart-bar { width: min(24px, 42%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: #353b46; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); }
.chart-bar.alt { background: var(--brand); }
.chart-label { font-size: 10px; color: var(--muted); }
.chart-value { font-size: 10px; font-weight: 720; color: var(--text); }
.connection-list { display: grid; gap: 8px; }
.connection-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.connection-row span:first-child { font-weight: 680; color: var(--text); }
.connection-state { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #a3a9b3; box-shadow: 0 0 0 3px rgba(163, 169, 179, .12); }
.connection-state.connected .connection-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(24, 121, 78, .11); }

/* Tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f7f8fa; color: #737b88; font-size: 9px; font-weight: 820; text-transform: uppercase; letter-spacing: .72px; white-space: nowrap; }
td { font-size: 12px; color: #3d434d; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fbfbfc; }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.cell-main strong { color: var(--text); font-weight: 720; }
.cell-main small { color: var(--muted); }
.cell-wrap { max-width: 420px; white-space: normal; word-break: break-word; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid transparent; border-radius: 999px; font-size: 9px; font-weight: 820; text-transform: capitalize; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: #c8e9d6; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: #f0dfaa; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #f2d0cc; }
.badge-neutral { background: #f0f2f5; color: #596273; border-color: #e1e4e9; }
.table-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; }
.empty-state { padding: 46px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 7px; }
.schema-warning { margin-bottom: 18px; border: 1px solid #eed68d; background: var(--warning-bg); color: #7d5700; border-radius: 12px; padding: 14px 16px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination-links { display: flex; gap: 7px; }
.pagination a, .pagination span.page-current { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
.pagination a:hover { border-color: #c9ced6; background: var(--surface-2); }
.pagination span.page-current { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.media-button { border: 0; padding: 0; background: transparent; color: var(--brand-deep); font-weight: 780; text-decoration: underline; text-underline-offset: 3px; }

/* Settings and detail views */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { color: var(--text); font-size: 11px; font-weight: 760; }
.form-help { color: var(--muted); font-size: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; background: var(--surface-2); }
.toggle-row strong { display: block; color: var(--text); }
.toggle-row small { color: var(--muted); }
.toggle { position: relative; width: 48px; height: 27px; flex: 0 0 48px; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #c2c7d0; transition: .2s; }
.toggle span::after { content: ''; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.toggle input:checked + span { background: var(--brand-strong); }
.toggle input:checked + span::after { transform: translateX(21px); }
.detail-list { display: grid; gap: 10px; }
.detail-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; color: var(--text); font-weight: 680; word-break: break-word; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .75fr); gap: 18px; }
.review-history { display: grid; gap: 10px; }
.history-item { border-left: 3px solid var(--brand); padding: 8px 0 8px 12px; }
.history-item strong { color: var(--text); }
.history-item p { margin: 4px 0; color: var(--muted); }
.history-item small { color: var(--muted-2); }

/* Media modal */
.modal { display: none; position: fixed; inset: 0; z-index: 80; background: rgba(12, 14, 18, .82); padding: 28px; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal.open { display: flex; }
.modal-card { width: min(900px, 100%); max-height: calc(100vh - 56px); background: #fff; border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-header strong { color: var(--text); }
.modal-close { border: 0; background: transparent; font-size: 26px; color: var(--muted); }
.media-stage { display: grid; place-items: center; min-height: 380px; max-height: calc(100vh - 150px); background: #0d0f13; }
.media-stage video, .media-stage img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; }
.media-stage audio { width: min(680px, calc(100% - 40px)); }

/* Authentication */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 7% 8%, rgba(250, 115, 21, .12), transparent 25rem),
    radial-gradient(circle at 91% 88%, rgba(28, 32, 40, .07), transparent 27rem),
    #f4f5f7;
}
.login-shell {
  width: min(1010px, 100%);
  min-height: 610px;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 14%, rgba(250, 115, 21, .25), transparent 17rem),
    linear-gradient(145deg, #20242c 0%, #111318 100%);
  color: #fff;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before, .login-brand::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand::before { width: 390px; height: 390px; right: -178px; top: -150px; border: 1px solid rgba(250, 115, 21, .22); }
.login-brand::after { width: 230px; height: 230px; left: -112px; bottom: -112px; border: 1px solid rgba(255, 255, 255, .08); }
.login-logo { position: relative; z-index: 1; display: flex; align-items: center; }
.login-logo-white { width: 215px; height: auto; }
.login-copy { position: relative; z-index: 1; max-width: 430px; }
.login-copy::before { content: ''; display: block; width: 38px; height: 3px; margin-bottom: 20px; border-radius: 999px; background: var(--brand); }
.login-copy h1 { margin: 0; font-size: clamp(34px, 5vw, 50px); font-weight: 760; line-height: 1.05; letter-spacing: -1.7px; }
.login-copy p { margin: 18px 0 0; color: rgba(255, 255, 255, .67); font-size: 14px; line-height: 1.75; }
.login-company { position: relative; z-index: 1; color: rgba(255, 255, 255, .40); font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
.login-form-wrap { padding: 52px; display: flex; flex-direction: column; justify-content: center; }
.login-form-logo { width: 154px; height: auto; margin: 0 0 30px; }
.login-form-wrap h2 { margin: 0; color: var(--text); font-size: 27px; font-weight: 760; letter-spacing: -.45px; }
.login-form-wrap > p { margin: 8px 0 26px; color: var(--muted); }
.login-form { display: grid; gap: 16px; }
.login-form .btn { min-height: 46px; margin-top: 4px; }
.login-note { margin-top: 18px; color: var(--muted); font-size: 11px; }
.otp-input { font-size: 24px; font-weight: 800; letter-spacing: 8px; text-align: center; color: var(--brand-deep); }
.otp-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.otp-actions button { border: 0; background: transparent; color: var(--brand-deep); font-weight: 800; padding: 0; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .review-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(14, 17, 22, .28); }
  body.sidebar-open .admin-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .sidebar-close { display: block; }
  .admin-shell { margin-left: 0; }
  .menu-button { display: grid; }
  .admin-content { padding: 22px 18px 32px; }
  .admin-topbar { padding: 14px 18px; }
  .admin-topbar::after { left: 18px; }
  .admin-footer { padding: 16px 18px; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { min-height: 300px; padding: 36px; }
  .login-form-wrap { padding: 36px; }
  .login-form-logo { width: 145px; margin-bottom: 26px; }
}

@media (max-width: 640px) {
  .topbar-left p, .environment-pill, .profile-copy, .profile-chevron { display: none; }
  .profile-button { padding: 5px; border-radius: 11px; }
  .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 118px; }
  .search-form { max-width: none; width: 100%; }
  .page-actions { align-items: stretch; }
  .page-actions > * { width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .admin-footer { flex-direction: column; }
  .chart-bars { gap: 7px; }
  .chart-stack { height: 170px; }
  .login-body { padding: 12px; }
  .login-shell { border-radius: 19px; }
  .login-brand { min-height: 250px; padding: 28px; }
  .login-copy h1 { font-size: 34px; }
  .login-form-wrap { padding: 28px; }
  .login-logo-white { width: 178px; }
  .modal { padding: 10px; }
  .modal-card { border-radius: 14px; }
  .detail-row { grid-template-columns: 1fr; gap: 3px; }
}

.post-body-preview {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.post-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.post-poll-preview {
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.post-poll-preview ol { margin: 10px 0 0; padding-left: 22px; color: var(--muted); }
.post-poll-preview li + li { margin-top: 7px; }
.validation-list { margin: 8px 0 0; padding-left: 20px; }
.validation-list li + li { margin-top: 5px; }

/* Post Validation — full-width table and details modal */
.posts-validation-page { width: 100%; }
.posts-toolbar { margin-bottom: 18px; }
.posts-search-form { display: grid; max-width: 860px; grid-template-columns: minmax(280px, 1fr) 190px auto auto; }
.posts-search-field { position: relative; min-width: 0; }
.posts-search-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.9;
  stroke-linecap: round;
  pointer-events: none;
}
.posts-search-field .form-control { width: 100%; padding-left: 39px; }
.posts-result-summary {
  min-width: 104px;
  min-height: 42px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.posts-result-summary strong { color: var(--text); font-size: 17px; line-height: 1; }
.posts-result-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.posts-table-card { width: 100%; overflow: hidden; }
.posts-table-heading {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fdfdfd 100%);
}
.posts-table-heading h2 { margin: 0; color: var(--text); font-size: 16px; font-weight: 780; letter-spacing: -.2px; }
.posts-table-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.posts-page-range { color: var(--muted); font-size: 11px; font-weight: 680; white-space: nowrap; }
.posts-table-scroll { width: 100%; }
.posts-table { min-width: 1180px; table-layout: auto; }
.posts-table th, .posts-table td { padding: 15px 16px; }
.posts-table th:first-child, .posts-table td:first-child { padding-left: 20px; }
.posts-table th:last-child, .posts-table td:last-child { padding-right: 20px; }
.posts-table tbody tr { cursor: default; }
.posts-table tbody tr:hover { background: #fafbfc; }
.posts-primary-cell { width: 34%; min-width: 320px; }
.post-title-link { display: flex; align-items: baseline; gap: 9px; max-width: 560px; }
.post-title-link:hover strong { color: var(--brand-deep); }
.post-title-link strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 740;
  line-height: 1.45;
  transition: color .16s ease;
}
.post-id { flex: 0 0 auto; color: var(--brand-deep); font-size: 10px; font-weight: 820; }
.post-cell-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.post-cell-meta span { position: relative; }
.post-cell-meta span + span::before { content: ''; position: absolute; left: -7px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: #c3c8d0; transform: translateY(-50%); }
.creator-cell { min-width: 210px; display: flex; align-items: center; gap: 10px; }
.creator-avatar, .post-author-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #f1d5c1;
  background: linear-gradient(145deg, #fff5ee, #ffe8d7);
  color: var(--brand-deep);
  font-weight: 820;
  text-transform: uppercase;
}
.creator-avatar { width: 36px; height: 36px; border-radius: 11px; font-size: 10px; }
.creator-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.creator-copy strong { max-width: 170px; overflow: hidden; color: var(--text); font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.creator-copy small { max-width: 170px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.post-format-cell { min-width: 155px; display: flex; align-items: center; gap: 9px; }
.post-format-cell > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.post-format-cell strong { color: var(--text); font-size: 11px; }
.post-format-cell small { color: var(--muted); font-size: 9px; }
.post-type-icon { position: relative; width: 33px; height: 33px; flex: 0 0 33px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.post-type-icon::before, .post-type-icon::after { content: ''; position: absolute; }
.post-type-text::before { left: 9px; top: 10px; width: 15px; height: 2px; border-radius: 2px; background: var(--blue); box-shadow: 0 5px 0 var(--blue), 0 10px 0 var(--blue); }
.post-type-image::before { inset: 8px; border: 1.7px solid var(--teal); border-radius: 3px; }
.post-type-image::after { left: 11px; bottom: 10px; width: 11px; height: 7px; border-left: 1.7px solid var(--teal); border-top: 1.7px solid var(--teal); transform: rotate(45deg); }
.post-type-carousel::before { inset: 8px 10px 8px 7px; border: 1.6px solid var(--violet); border-radius: 3px; box-shadow: 4px 3px 0 -1px #fff, 5px 4px 0 0 var(--violet); }
.post-type-poll::before { left: 9px; bottom: 8px; width: 3px; height: 9px; border-radius: 2px 2px 0 0; background: var(--brand); box-shadow: 6px -5px 0 var(--brand), 12px -10px 0 var(--brand); }
.post-activity-cell { min-width: 135px; display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.post-activity-cell span { white-space: nowrap; }
.post-activity-cell strong { color: var(--text); font-size: 11px; }
.post-date { display: block; min-width: 120px; color: var(--muted); font-size: 10px; }
.posts-action-cell { width: 1%; text-align: right; white-space: nowrap; }
.post-open-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 10px;
  font-weight: 760;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.post-open-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.post-open-button:hover { border-color: #f1c8aa; background: var(--brand-faint); color: var(--brand-deep); }
.posts-empty-state { min-height: 330px; display: grid; place-items: center; align-content: center; }
.empty-state-icon { position: relative; width: 54px; height: 54px; margin-bottom: 14px; border: 1px solid #ead8cb; border-radius: 16px; background: var(--brand-faint); }
.empty-state-icon::before { content: ''; position: absolute; inset: 14px 12px; border: 2px solid var(--brand); border-radius: 4px; }
.empty-state-icon::after { content: ''; position: absolute; left: 18px; top: 21px; width: 17px; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 6px 0 var(--brand); }

.post-detail-modal { z-index: 90; padding: 18px; background: rgba(16, 19, 25, .70); backdrop-filter: blur(8px); }
.post-detail-dialog {
  width: min(1240px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 20px;
  background: #f7f8fa;
  box-shadow: 0 36px 100px rgba(0, 0, 0, .28);
}
.post-detail-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px 15px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.post-detail-title-wrap, .post-detail-header-actions { display: flex; align-items: center; gap: 14px; }
.post-detail-id { padding: 7px 10px; border: 1px solid #f0d4c0; border-radius: 9px; background: var(--brand-faint); color: var(--brand-deep); font-size: 10px; font-weight: 820; white-space: nowrap; }
.post-detail-title-wrap h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 780; letter-spacing: -.25px; }
.post-detail-title-wrap p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.post-detail-close {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.post-detail-close:hover { border-color: #d4d9e0; background: var(--surface-2); color: var(--text); }
.post-detail-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.post-detail-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .72fr); overflow: hidden; }
.post-detail-main, .post-detail-sidebar { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.post-detail-main { padding: 20px; }
.post-detail-sidebar { padding: 20px; border-left: 1px solid var(--line); background: #f2f4f7; }
.post-author-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.post-author-avatar { width: 45px; height: 45px; border-radius: 14px; font-size: 13px; }
.post-author-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.post-author-name-line { display: flex; align-items: center; gap: 7px; }
.post-author-name-line strong { color: var(--text); font-size: 13px; }
.post-author-copy > span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.verified-pill { padding: 3px 6px; border-radius: 999px; background: var(--blue-bg); color: var(--blue); font-size: 8px; font-weight: 820; text-transform: uppercase; letter-spacing: .3px; }
.post-author-stats { display: flex; align-items: center; gap: 16px; padding-left: 16px; border-left: 1px solid var(--line); }
.post-author-stats span { display: flex; flex-direction: column; color: var(--muted); font-size: 9px; text-align: right; }
.post-author-stats strong { color: var(--text); font-size: 13px; }
.post-detail-section {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.post-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.post-section-kicker { display: block; margin-bottom: 2px; color: var(--brand-deep); font-size: 8px; font-weight: 850; letter-spacing: .75px; text-transform: uppercase; }
.post-section-heading h3 { margin: 0; color: var(--text); font-size: 14px; font-weight: 760; }
.content-length { color: var(--muted); font-size: 9px; font-weight: 680; white-space: nowrap; }
.post-content-preview {
  min-height: 95px;
  padding: 16px;
  border: 1px solid #eceef2;
  border-radius: 11px;
  background: #fafbfc;
  color: #343a44;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: normal;
}
.post-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.post-media-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #171a20;
  text-align: left;
}
.post-media-tile img { display: block; width: 100%; height: 210px; object-fit: cover; transition: transform .22s ease; }
.post-media-tile:hover img { transform: scale(1.025); }
.post-video-placeholder { min-height: 210px; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at center, #343a45 0, #191c22 70%); }
.post-video-placeholder svg { width: 48px; height: 48px; padding: 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; fill: currentColor; }
.post-media-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 12px 11px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.74));
}
.post-media-overlay strong { font-size: 11px; }
.post-media-overlay small { color: rgba(255,255,255,.72); font-size: 9px; }
.post-poll-options { display: grid; gap: 9px; }
.post-poll-option { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.post-poll-option > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 27px; border-radius: 8px; background: var(--violet-bg); color: var(--violet); font-size: 9px; font-weight: 820; }
.post-poll-option strong { color: var(--text); font-size: 11px; font-weight: 680; }
.validation-status { padding: 5px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 8px; font-weight: 820; text-transform: uppercase; letter-spacing: .4px; }
.validation-status.valid { border-color: #c9ead7; background: var(--success-bg); color: var(--success); }
.validation-status.invalid { border-color: #f1d1cd; background: var(--danger-bg); color: var(--danger); }
.validation-success, .validation-issues { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: 11px; }
.validation-success { border: 1px solid #cde8d9; background: var(--success-bg); }
.validation-success > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; border-radius: 50%; background: var(--success); color: #fff; font-weight: 850; }
.validation-success strong, .validation-issues strong { display: block; color: var(--text); font-size: 11px; }
.validation-success p { margin: 3px 0 0; color: #47745e; font-size: 10px; }
.validation-issues { border: 1px solid #efd0cc; background: var(--danger-bg); }
.validation-warning-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 850; }
.validation-issues ul { margin: 6px 0 0; padding-left: 17px; color: #7e3b35; font-size: 10px; }
.validation-issues li + li { margin-top: 4px; }
.post-side-card { margin-bottom: 13px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.post-side-card:last-child { margin-bottom: 0; }
.post-side-card-heading { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.post-side-card-heading span { color: var(--text); font-size: 11px; font-weight: 780; }
.post-side-card-heading small { color: var(--muted); font-size: 9px; }
.post-info-list { margin: 0; padding: 4px 15px; }
.post-info-list > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef0f3; }
.post-info-list > div:last-child { border-bottom: 0; }
.post-info-list dt { color: var(--muted); font-size: 10px; }
.post-info-list dd { margin: 0; color: var(--text); font-size: 10px; font-weight: 680; text-align: right; overflow-wrap: anywhere; }
.post-moderation-form { display: grid; gap: 13px; padding: 15px; }
.post-moderation-form textarea { min-height: 104px; resize: vertical; }
.post-decision-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.post-decision-actions .btn { width: 100%; }
.post-decision-actions .btn:only-child { grid-column: 1 / -1; }
.approval-blocked-note { margin: 0; padding: 9px 10px; border-radius: 9px; background: var(--warning-bg); color: #765407; font-size: 9px; }
.post-review-timeline { padding: 14px 15px; }
.post-review-event { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 9px; padding-bottom: 16px; }
.post-review-event:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 11px; bottom: 0; width: 1px; background: #dde1e7; }
.post-review-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 3px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 1px #edc9ae; }
.post-review-event strong { color: var(--text); font-size: 10px; }
.post-review-event p { margin: 3px 0; color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.post-review-event small { color: var(--muted-2); font-size: 8px; }
.post-history-empty { display: grid; gap: 3px; padding: 15px 4px; text-align: center; }
.post-history-empty strong { color: var(--text); font-size: 11px; }
.post-history-empty span { color: var(--muted); font-size: 9px; }
.media-preview-modal { z-index: 110; }

@media (max-width: 1180px) {
  .posts-search-form { max-width: none; }
  .post-detail-body { grid-template-columns: minmax(0, 1.35fr) minmax(310px, .75fr); }
}

@media (max-width: 900px) {
  .posts-search-form { grid-template-columns: minmax(0, 1fr) 180px auto; }
  .posts-search-form .btn-secondary { display: none; }
  .post-detail-modal { padding: 10px; }
  .post-detail-dialog { max-height: calc(100vh - 20px); border-radius: 16px; }
  .post-detail-body { display: block; overflow-y: auto; }
  .post-detail-main, .post-detail-sidebar { overflow: visible; }
  .post-detail-sidebar { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 640px) {
  .posts-toolbar { gap: 10px; }
  .posts-search-form { display: grid; grid-template-columns: 1fr 1fr; }
  .posts-search-field { grid-column: 1 / -1; }
  .posts-search-form .form-select, .posts-search-form .btn { width: 100%; }
  .posts-result-summary { width: 100%; }
  .posts-table-heading { align-items: flex-start; padding: 16px; }
  .posts-table-heading p { display: none; }
  .posts-table th:first-child, .posts-table td:first-child { padding-left: 15px; }
  .posts-table th:last-child, .posts-table td:last-child { padding-right: 15px; }
  .post-detail-header { min-height: 68px; padding: 12px; }
  .post-detail-title-wrap { gap: 9px; }
  .post-detail-id { display: none; }
  .post-detail-title-wrap p { display: none; }
  .post-detail-header-actions { gap: 8px; }
  .post-detail-main, .post-detail-sidebar { padding: 12px; }
  .post-author-banner { align-items: flex-start; flex-wrap: wrap; }
  .post-author-stats { width: 100%; justify-content: flex-start; padding: 10px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .post-author-stats span { text-align: left; }
  .post-detail-section { padding: 14px; }
  .post-media-grid { grid-template-columns: 1fr; }
  .post-media-tile, .post-media-tile img, .post-video-placeholder { min-height: 180px; height: 180px; }
  .post-info-list > div { grid-template-columns: 100px minmax(0, 1fr); }
}
