/* ==========================================================================
   INDUSTRY PODCAST — admin interface (dashboard, data entry, reports)
   Loads after main.css and reuses its tokens.
   ========================================================================== */

body.admin {
  background: #060607;
  min-height: 100vh;
}
body.admin::before { opacity: 0.6; }

.admin-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #08080a;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  z-index: 60;
}
.admin-sidebar__brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-sidebar__brand img { height: 32px; width: auto; }
.admin-sidebar__brand span {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
  line-height: 1.5;
}
.admin-nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.admin-nav__label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5d5d64;
  padding: 14px 12px 8px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  color: #b4b2ab;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.admin-nav a svg { width: 17px; height: 17px; flex: none; opacity: 0.8; }
.admin-nav a:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.admin-nav a[aria-current='page'] {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
}
.admin-nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gold);
}
.admin-nav a .count {
  margin-left: auto;
  font-size: 0.62rem;
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
  padding: 2px 7px;
  border-radius: 10px;
}
.admin-sidebar__footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
  color: var(--muted-2);
}
.admin-sidebar__user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--gold);
  flex: none;
}
.admin-sidebar__user strong { display: block; color: #e6e3da; font-size: 0.8rem; font-weight: 500; }
.admin-sidebar__user span { font-size: 0.65rem; color: var(--muted-2); }

/* ---------------- Main ---------------- */

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 68px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(16px, 3vw, 34px);
  background: rgba(6, 6, 7, 0.85);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar h1 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #f0ede4;
}
.admin-topbar__sub { font-size: 0.7rem; color: var(--muted-2); margin-top: 2px; }
.admin-topbar__actions { display: flex; align-items: center; gap: 10px; }
.admin-content { padding: clamp(18px, 3vw, 34px); }

.admin-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  place-items: center;
  color: var(--gold);
}

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

.stat-grid-admin {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #0c0c0e, #08080a);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 70%);
}
.stat-card__label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-card__label svg { width: 14px; height: 14px; color: var(--gold); opacity: 0.85; }
.stat-card__value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1rem;
  line-height: 1;
  color: #f7f5ee;
}
.stat-card__value small { font-size: 0.9rem; color: var(--muted-2); margin-left: 4px; font-family: 'Inter', sans-serif; }
.stat-card__foot { margin-top: 10px; font-size: 0.7rem; color: var(--muted-2); }
.stat-card--accent { border-color: rgba(212, 175, 55, 0.35); background: linear-gradient(180deg, rgba(212, 175, 55, 0.1), #08080a); }
.stat-card--accent .stat-card__value { color: var(--gold); }

/* ---------------- Panels ---------------- */

.panel {
  border: 1px solid var(--line-soft);
  background: #08080a;
  margin-bottom: 22px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.panel__head h2 {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dedbd2;
  font-weight: 500;
}
.panel__head .hint { font-size: 0.7rem; color: var(--muted-2); }
.panel__body { padding: 18px 20px; }
.panel__body--flush { padding: 0; }

.grid-2-admin { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
.grid-3-admin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* ---------------- Table ---------------- */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 620px;
}
table.data thead th {
  text-align: left;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #77777e;
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  background: #070709;
}
table.data tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cfcdc6;
  vertical-align: middle;
}
table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .cell-title { color: #f0eee6; font-weight: 500; }
table.data .cell-sub { display: block; font-size: 0.72rem; color: var(--muted-2); margin-top: 3px; }
table.data .thumb-cell img { width: 68px; height: 38px; object-fit: cover; border: 1px solid var(--line-soft); border-radius: 2px; }
table.data .thumb-cell img.portrait { width: 30px; height: 53px; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  color: #a9a7a0;
  border-radius: 2px;
  transition: all 0.18s;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(224, 104, 90, 0.08); }

/* ---------------- Badges ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 2px;
  white-space: nowrap;
}
.badge--published, .badge--responded { color: #7fd3a0; border-color: rgba(127, 211, 160, 0.35); background: rgba(127, 211, 160, 0.08); }
.badge--draft, .badge--archived { color: #9a9aa1; border-color: rgba(154, 154, 161, 0.3); background: rgba(154, 154, 161, 0.07); }
.badge--new { color: var(--gold); border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.1); }
.badge--reviewed { color: #85b4e0; border-color: rgba(133, 180, 224, 0.35); background: rgba(133, 180, 224, 0.08); }
.badge--portrait, .badge--landscape { color: #c7c4bb; border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); }

/* ---------------- Toolbar / filters ---------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: #070709;
}
.toolbar .field { margin: 0; gap: 5px; min-width: 0; }
.toolbar .field label { font-size: 0.58rem; letter-spacing: 0.14em; }
.toolbar .field input, .toolbar .field select { min-height: 38px; padding: 8px 11px; font-size: 0.8rem; }
.toolbar .field--grow { flex: 1 1 220px; }
.toolbar .spacer { flex: 1; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 6px;
  background: #070709;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 14px 15px;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: #93919a;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.tabs button:hover { color: #e6e3da; }
.tabs button[aria-selected='true'] { color: var(--gold); border-bottom-color: var(--gold); }

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.75rem;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.pagination { display: flex; gap: 6px; }
.pagination button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line-soft);
  color: #b6b4ad;
  font-size: 0.75rem;
  padding: 0 8px;
}
.pagination button[aria-current='true'] { border-color: var(--gold); color: var(--gold); }
.pagination button:disabled { opacity: 0.35; }

/* ---------------- Form modal ---------------- */

.modal__panel--form { width: min(760px, 100%); }
.modal__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal__head h2 { font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 500; letter-spacing: 0.04em; }
.modal__body { padding: 22px 24px; }
.modal__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: #08080a;
}
.modal__close--inline { position: static; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 14px; }
.form-grid .field textarea { min-height: 90px; }
.form-grid .field input, .form-grid .field select, .form-grid .field textarea { font-size: 0.86rem; min-height: 40px; padding: 9px 11px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid #24242a;
  background: #0a0a0c;
  margin-bottom: 14px;
  grid-column: 1 / -1;
}
.switch-row__text strong { display: block; font-size: 0.82rem; color: #e8e5dc; font-weight: 500; }
.switch-row__text span { font-size: 0.72rem; color: var(--muted-2); }
.switch { position: relative; width: 42px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  background: #232329;
  border-radius: 20px;
  transition: background 0.2s;
  pointer-events: none;
}
.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6c6c74;
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + span { background: rgba(212, 175, 55, 0.25); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--gold); }

/* ---------------- Submission detail drawer ---------------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(3, 3, 4, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
}
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer__panel {
  width: min(600px, 100%);
  height: 100%;
  background: #08080a;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(24px);
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  background: #08080a;
  z-index: 2;
}
.drawer__head h2 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 500; }
.drawer__head p { font-size: 0.72rem; color: var(--muted-2); margin-top: 4px; }
.drawer__body { padding: 22px 24px; display: grid; gap: 18px; }
.drawer__foot {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: #08080a;
}
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; font-size: 0.85rem; }
.detail-row dt { color: var(--muted-2); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; padding-top: 3px; }
.detail-row dd { color: #e6e3da; margin: 0; overflow-wrap: anywhere; }
.detail-message {
  border: 1px solid var(--line-soft);
  background: #0b0b0e;
  padding: 16px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #d3d0c8;
  white-space: pre-wrap;
  margin: 0;
}

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

.admin-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 54px);
  border-right: 1px solid var(--line);
}
.login-art img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.login-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(5, 5, 5, 0.4), rgba(5, 5, 5, 0.94));
}
.login-art > * { position: relative; z-index: 2; }
.login-art img.logo { height: 46px; width: auto; }
.login-art h1 { font-size: clamp(2rem, 3.4vw, 3rem); max-width: 15ch; margin-top: auto; }
.login-art p { margin-top: 14px; max-width: 40ch; font-size: 0.92rem; }
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 60px);
}
.login-form { width: min(400px, 100%); }
.login-form h2 { font-size: 1.8rem; margin-bottom: 8px; }
.login-form > p { font-size: 0.88rem; margin-bottom: 28px; }
.login-error {
  border-left: 2px solid var(--danger);
  background: rgba(224, 104, 90, 0.08);
  color: #f0b4ab;
  font-size: 0.82rem;
  padding: 11px 14px;
  margin-bottom: 16px;
}
.login-hint {
  margin-top: 22px;
  border: 1px dashed rgba(212, 175, 55, 0.3);
  padding: 12px 14px;
  font-size: 0.74rem;
  color: var(--muted-2);
  line-height: 1.6;
}
.login-hint code { color: var(--gold); }

/* ---------------- Report ---------------- */

.report-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.report-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.report-tab {
  padding: 10px 18px;
  border: 1px solid var(--line-soft);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #a9a7a0;
  background: #08080a;
}
.report-tab[aria-selected='true'] { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.report-tab span { font-size: 0.66rem; opacity: 0.7; margin-left: 6px; }

.status-select {
  background: #0b0b0e;
  border: 1px solid #2a2a31;
  color: #d8d5cd;
  font-size: 0.7rem;
  padding: 5px 8px;
  border-radius: 2px;
  min-height: 28px;
}
.status-select:focus { border-color: var(--gold); outline: none; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .stat-grid-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2-admin { grid-template-columns: 1fr; }
  .grid-3-admin { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 268px;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: 30px 0 60px -20px #000;
  }
  body.sidebar-open .admin-sidebar { transform: none; }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 55;
  }
  .admin-menu-btn { display: grid; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-art h1 { font-size: 1.9rem; margin-top: 24px; }
  .login-art p { display: none; }
  .grid-3-admin { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .report-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .stat-grid-admin { grid-template-columns: 1fr; }
  .admin-content { padding: 14px; }
  .toolbar { padding: 12px; }
  .panel__head { padding: 13px 14px; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .report-stats { grid-template-columns: 1fr; }
}

@media print {
  .admin-sidebar, .admin-topbar, .toolbar, .tabs, .pagination-bar, .actions, .report-tabs { display: none !important; }
  body.admin, .admin-main, .panel { background: #fff; color: #000; }
  table.data tbody td, table.data .cell-title { color: #000; }
}

/* --------------------------------------------------------------------------
   Additions: charts, activity, settings, password field
   -------------------------------------------------------------------------- */

.mini-chart svg { display: block; }

.activity-list { display: grid; gap: 14px; }
.activity-list li { display: flex; gap: 11px; font-size: 0.8rem; color: #c3c1b9; line-height: 1.5; }
.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 6px;
  flex: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.activity-list strong { color: #f0ede4; font-weight: 500; }
.activity-list em { color: var(--gold); font-style: normal; text-transform: capitalize; }
.activity-list time { display: block; font-size: 0.68rem; color: var(--muted-2); margin-top: 3px; }

.settings-group { border: 0; border-top: 1px solid var(--line-soft); padding: 20px 0 4px; margin: 0 0 6px; }
.settings-group legend {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  padding-right: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 8px;
}
.pw-toggle:hover { color: var(--gold-soft); }

.login-form .field { margin-bottom: 16px; }
.login-form .btn { margin-top: 6px; }

@media (max-width: 900px) {
  .login-art { min-height: 220px; }
  .login-art img.logo { height: 36px; }
}
