:root {
  --pou-sidebar: #111827;
  --pou-sidebar-soft: #172033;
  --pou-red: #b71f27;
  --pou-red-dark: #981a21;
  --pou-red-soft: #fff0f1;
  --pou-bg: #f5f7fb;
  --pou-card: #ffffff;
  --pou-text: #172033;
  --pou-muted: #667085;
  --pou-border: #e4e8ef;
  --pou-shadow: 0 14px 34px rgba(17, 24, 39, .08);
  --pou-radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.pou-admin-body {
  min-height: 100vh;
  background: var(--pou-bg);
  color: var(--pou-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pou-admin-layout { min-height: 100vh; display: flex; }

.pou-admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 323px;
  min-height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background: var(--pou-sidebar);
  color: #fff;
  box-shadow: 14px 0 35px rgba(15, 23, 42, .12);
  overflow-y: auto;
}

.pou-admin-brand {
  min-height: 59px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.11);
}

.pou-admin-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255,255,255,.35);
}

.pou-admin-brand div { min-width: 0; }
.pou-admin-brand strong {
  display: block;
  max-width: 220px;
  font-size: .94rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pou-admin-brand span {
  display: block;
  margin-top: 3px;
  color: #9ec2e8;
  font-size: .83rem;
}

.pou-admin-nav-title {
  margin: 25px 13px 9px;
  color: #7891b4;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.pou-admin-nav { display: grid; gap: 7px; }
.pou-admin-nav a {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 17px;
  color: #eaf2fc;
  text-decoration: none;
  font-size: .97rem;
  font-weight: 800;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.pou-admin-nav a:hover,
.pou-admin-nav a:focus-visible,
.pou-admin-nav a.active {
  color: #fff;
  background: var(--pou-red);
  outline: none;
}
.pou-admin-nav a:hover { transform: translateX(2px); }
.pou-admin-nav .nav-icon {
  width: 23px;
  min-width: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.03rem;
  line-height: 1;
}

.pou-admin-user {
  margin-top: auto;
  padding: 18px 13px 3px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.pou-admin-user strong,
.pou-admin-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pou-admin-user strong { font-size: .88rem; }
.pou-admin-user span { margin-top: 4px; color: #8fa5c4; font-size: .73rem; }

.pou-admin-main {
  width: calc(100% - 323px);
  min-width: 0;
  margin-left: 323px;
}

.pou-admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 82px;
  padding: 16px clamp(20px, 3vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pou-border);
}
.pou-admin-topbar h1 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.pou-admin-topbar p { margin: 5px 0 0; color: var(--pou-muted); font-size: .84rem; font-weight: 600; }

.pou-admin-content { padding: 28px clamp(18px, 3vw, 42px) 45px; }
.pou-page-heading {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.pou-page-heading h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2rem); }
.pou-page-heading p { margin: 7px 0 0; color: var(--pou-muted); line-height: 1.55; }

.pou-admin-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.pou-btn {
  min-height: 42px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.1;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.pou-btn:hover { transform: translateY(-1px); }
.pou-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.pou-btn-sm { min-height: 36px; padding: 8px 12px; border-radius: 10px; font-size: .82rem; }
.pou-btn-primary { background: var(--pou-red); color: #fff; box-shadow: 0 8px 18px rgba(183,31,39,.18); }
.pou-btn-primary:hover { background: var(--pou-red-dark); }
.pou-btn-light { background: #fff; color: #344054; border-color: #d9dee8; }
.pou-btn-light:hover { background: #f8fafc; }
.pou-btn-dark { background: #172033; color: #fff; }
.pou-btn-danger { background: #fff1f2; color: #b4232c; border-color: #ffd1d5; }
.pou-btn-success { background: #e9f9ef; color: #137a3f; border-color: #c4efd2; }

.pou-card {
  overflow: hidden;
  background: var(--pou-card);
  border: 1px solid var(--pou-border);
  border-radius: var(--pou-radius);
  box-shadow: var(--pou-shadow);
}
.pou-card-header {
  min-height: 66px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--pou-border);
}
.pou-card-header h3 { margin: 0; font-size: 1rem; }
.pou-card-body { padding: 20px; }

.pou-stat-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.pou-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--pou-border);
  border-radius: var(--pou-radius);
  box-shadow: var(--pou-shadow);
}
.pou-stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--pou-red-soft);
  color: var(--pou-red);
  font-size: 1.15rem;
  font-weight: 900;
}
.pou-stat-label { margin-top: 17px; color: var(--pou-muted); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pou-stat-value { margin-top: 5px; font-size: 2rem; font-weight: 900; }
.pou-stat-note { margin-top: 4px; color: var(--pou-muted); font-size: .78rem; }

.pou-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.8fr); gap: 18px; align-items: start; }
.pou-list { display: grid; }
.pou-list-row {
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #edf0f5;
}
.pou-list-row:first-child { padding-top: 0; }
.pou-list-row:last-child { padding-bottom: 0; border-bottom: 0; }
.pou-list-title { font-weight: 850; line-height: 1.35; }
.pou-list-meta { margin-top: 5px; color: var(--pou-muted); font-size: .78rem; line-height: 1.45; }

.pou-quick-grid { display: grid; gap: 10px; }
.pou-quick-link {
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--pou-border);
  border-radius: 14px;
  text-decoration: none;
  transition: border .16s ease, transform .16s ease;
}
.pou-quick-link:hover { border-color: #efb6ba; transform: translateY(-1px); }
.pou-quick-link > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--pou-red-soft); color: var(--pou-red); }
.pou-quick-link strong { display: block; font-size: .87rem; }
.pou-quick-link small { display: block; margin-top: 3px; color: var(--pou-muted); line-height: 1.4; }

.pou-badge {
  min-height: 28px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .71rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-transform: capitalize;
}
.pou-badge-neutral { background: #f1f3f7; color: #475467; }
.pou-badge-green { background: #e7f7ed; color: #137a3f; }
.pou-badge-red { background: #fff0f1; color: #b4232c; }
.pou-badge-amber { background: #fff5dd; color: #946200; }

.pou-alert { margin-bottom: 16px; padding: 13px 15px; border: 1px solid; border-radius: 13px; font-weight: 700; line-height: 1.5; }
.pou-alert-success { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.pou-alert-danger { background: #fff1f3; color: #a71930; border-color: #fecdd6; }
.pou-alert-info { background: #eef6ff; color: #175cd3; border-color: #b2ddff; }

.pou-empty { padding: 40px 20px; text-align: center; color: var(--pou-muted); }
.pou-empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: #f1f3f7; color: #667085; font-size: 1.35rem; font-weight: 900; }
.pou-empty h3 { margin: 0; color: var(--pou-text); }
.pou-empty p { margin: 8px auto 0; max-width: 560px; line-height: 1.55; }

.pou-tabs { margin-bottom: 16px; padding: 5px; display: inline-flex; gap: 5px; background: #eaedf3; border-radius: 14px; }
.pou-tab { min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; border-radius: 11px; color: #475467; text-decoration: none; font-weight: 800; }
.pou-tab.active { background: #fff; color: var(--pou-red); box-shadow: 0 4px 10px rgba(17,24,39,.08); }

.pou-filter-card { margin-bottom: 18px; padding: 17px; background: #fff; border: 1px solid var(--pou-border); border-radius: 16px; box-shadow: 0 8px 20px rgba(17,24,39,.04); }
.pou-filter-grid { display: grid; grid-template-columns: 1.2fr repeat(2,minmax(140px,.55fr)) auto; gap: 12px; align-items: end; }

.pou-field { display: grid; gap: 7px; }
.pou-field label,
.pou-form-field label { color: #344054; font-size: .78rem; font-weight: 850; }
.pou-field input,
.pou-field select,
.pou-field textarea,
.pou-form-field input,
.pou-form-field select,
.pou-form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--pou-text);
  background: #fff;
  border: 1px solid #d7dde7;
  border-radius: 11px;
  outline: none;
  transition: border .16s ease, box-shadow .16s ease;
}
.pou-field textarea,
.pou-form-field textarea { min-height: 135px; resize: vertical; line-height: 1.55; }
.pou-field input:focus,
.pou-field select:focus,
.pou-field textarea:focus,
.pou-form-field input:focus,
.pou-form-field select:focus,
.pou-form-field textarea:focus {
  border-color: #d56a70;
  box-shadow: 0 0 0 4px rgba(183,31,39,.09);
}
.pou-form-help { margin-top: 6px; color: var(--pou-muted); font-size: .75rem; line-height: 1.5; }
.pou-form-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 16px; }
.pou-form-field { grid-column: span 6; display: grid; gap: 7px; }
.pou-form-field.full { grid-column: 1 / -1; }
.pou-form-field.third { grid-column: span 4; }
.pou-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

.pou-records { display: grid; gap: 14px; }
.pou-record { background: #fff; border: 1px solid var(--pou-border); border-radius: 16px; overflow: hidden; }
.pou-record-head { padding: 16px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.pou-record-title { font-weight: 900; line-height: 1.38; }
.pou-record-sub { margin-top: 5px; color: var(--pou-muted); font-size: .78rem; line-height: 1.5; }
.pou-record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pou-record-body { padding: 0 18px 18px; }
.pou-record-toggle { display: none; }

.pou-status-form { display: grid; grid-template-columns: 180px minmax(220px,1fr) auto; align-items: end; gap: 11px; }
.pou-status-form .note-field { min-width: 0; }

.pou-detail-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.pou-detail-box { padding: 15px; background: #f8fafc; border: 1px solid #e8ecf2; border-radius: 13px; }
.pou-detail-box.full { grid-column: 1 / -1; }
.pou-detail-label { color: var(--pou-muted); font-size: .69rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pou-detail-value { margin-top: 7px; font-weight: 750; line-height: 1.55; word-break: break-word; }
.pou-story-copy { margin-top: 8px; white-space: pre-wrap; line-height: 1.7; }

.pou-file-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.pou-file-card { overflow: hidden; border: 1px solid var(--pou-border); border-radius: 15px; background: #fff; }
.pou-file-preview { height: 175px; display: grid; place-items: center; overflow: hidden; background: #f4f6f9; border-bottom: 1px solid var(--pou-border); }
.pou-file-preview img,
.pou-file-preview video { width: 100%; height: 100%; object-fit: cover; }
.pou-file-info { padding: 13px; }
.pou-file-name { font-weight: 850; word-break: break-word; }
.pou-file-meta { margin-top: 5px; color: var(--pou-muted); font-size: .73rem; }
.pou-file-actions { margin-top: 11px; display: flex; gap: 8px; flex-wrap: wrap; }

.pou-table-wrap { width: 100%; overflow-x: auto; }
.pou-table { width: 100%; min-width: 840px; border-collapse: collapse; }
.pou-table th,
.pou-table td { padding: 14px 13px; text-align: left; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
.pou-table th { color: var(--pou-muted); background: #fafbfc; font-size: .7rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.pou-table tr:last-child td { border-bottom: 0; }
.pou-table-title { max-width: 460px; font-weight: 800; line-height: 1.45; }
.pou-table-sub { margin-top: 4px; color: var(--pou-muted); font-size: .74rem; }
.pou-inline-form { display: inline-flex; margin: 0; }

.pou-pagination { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.pou-pagination-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pou-page-link { min-width: 36px; min-height: 36px; padding: 8px; display: grid; place-items: center; border: 1px solid var(--pou-border); border-radius: 10px; background: #fff; text-decoration: none; font-size: .8rem; font-weight: 800; }
.pou-page-link.active { background: var(--pou-red); color: #fff; border-color: var(--pou-red); }
.pou-page-link.disabled { opacity: .45; pointer-events: none; }

.pou-sidebar-toggle { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--pou-border); border-radius: 11px; background: #fff; cursor: pointer; }
.pou-sidebar-toggle span { display: block; height: 2px; margin: 4px 0; background: #344054; border-radius: 3px; }

/* Login */
.pou-auth-body { background: radial-gradient(circle at top left, #ffe9eb, transparent 32%), #f5f7fb; }
.pou-auth-shell { min-height: 100vh; padding: 32px 20px; display: grid; place-items: center; }
.pou-auth-card { width: min(1020px,100%); min-height: 610px; display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; border-radius: 26px; background: #fff; box-shadow: 0 24px 70px rgba(17,24,39,.16); }
.pou-auth-brand-panel { padding: clamp(35px,5vw,65px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; color: #fff; background: linear-gradient(145deg,#111827,#1b263c); }
.pou-auth-logo img { width: min(235px,100%); max-height: 78px; object-fit: contain; object-position: left center; background: #fff; border-radius: 14px; padding: 8px; }
.pou-auth-kicker { color: #d75d65; font-size: .73rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.pou-auth-brand-panel h1 { max-width: 470px; margin: 14px 0 12px; color: #fff; font-family: "Playfair Display", Georgia, serif; font-size: clamp(2rem,4vw,3.3rem); line-height: 1.1; }
.pou-auth-brand-panel p { margin: 0; color: #c6d1df; line-height: 1.75; }
.pou-auth-features { display: grid; gap: 10px; }
.pou-auth-features span { position: relative; padding-left: 24px; color: #dde6f2; font-size: .83rem; font-weight: 750; }
.pou-auth-features span::before { content: "✓"; position: absolute; left: 0; color: #f06d76; }
.pou-auth-form-panel { padding: clamp(35px,5vw,65px); display: flex; flex-direction: column; justify-content: center; }
.pou-auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.pou-auth-mobile-brand img { width: 42px; height: 42px; border-radius: 50%; }
.pou-auth-mobile-brand strong,
.pou-auth-mobile-brand span { display: block; }
.pou-auth-mobile-brand span { color: var(--pou-muted); font-size: .75rem; }
.pou-auth-form-head h2 { margin: 8px 0 7px; font-size: 2rem; }
.pou-auth-form-head p { margin: 0 0 24px; color: var(--pou-muted); }
.pou-auth-form { display: grid; gap: 16px; }
.pou-auth-field { display: grid; gap: 8px; color: #344054; font-size: .78rem; font-weight: 850; }
.pou-auth-field input { width: 100%; min-height: 49px; padding: 12px 14px; border: 1px solid #d7dde7; border-radius: 12px; outline: none; }
.pou-auth-field input:focus { border-color: #d56a70; box-shadow: 0 0 0 4px rgba(183,31,39,.09); }
.pou-password-wrap { position: relative; display: block; }
.pou-password-wrap input { padding-right: 70px; }
.pou-password-wrap button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: transparent; color: var(--pou-red); cursor: pointer; font-weight: 850; }
.pou-auth-submit { width: 100%; min-height: 50px; margin-top: 4px; }
.pou-auth-help { margin-top: 22px; display: flex; justify-content: space-between; gap: 10px; color: var(--pou-muted); font-size: .75rem; }
.pou-auth-help a { color: var(--pou-red); font-weight: 850; text-decoration: none; }
.pou-auth-footer { margin: 17px 0 0; color: var(--pou-muted); font-size: .73rem; text-align: center; }

/* Logout compatibility */
.pou-logout-shell { padding: 20px; }
.pou-logout-card { width: min(520px,100%); padding: 36px; text-align: center; background: #fff; border: 1px solid var(--pou-border); border-radius: 24px; box-shadow: var(--pou-shadow); }
.pou-logout-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; background: var(--pou-red-soft); }
.pou-logout-icon svg { width: 30px; fill: var(--pou-red); }
.pou-logout-card h1 { margin: 10px 0; }
.pou-logout-card p { color: var(--pou-muted); line-height: 1.6; }
.pou-logout-actions { margin-top: 22px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pou-logout-note { margin-bottom: 0; font-size: .75rem; }

@media (max-width: 1120px) {
  .pou-admin-sidebar { width: 280px; }
  .pou-admin-main { width: calc(100% - 280px); margin-left: 280px; }
  .pou-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pou-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .pou-admin-sidebar { width: min(86vw,310px); transform: translateX(-105%); transition: transform .22s ease; }
  body.pou-sidebar-open .pou-admin-sidebar { transform: translateX(0); }
  body.pou-sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.45); }
  .pou-admin-main { width: 100%; margin-left: 0; }
  .pou-sidebar-toggle { display: block; }
  .pou-admin-topbar { min-height: 72px; padding: 12px 17px; }
  .pou-admin-topbar > div:first-of-type { flex: 1; }
  .pou-admin-topbar .pou-admin-actions { display: none; }
  .pou-filter-grid { grid-template-columns: 1fr 1fr; }
  .pou-filter-grid > :first-child { grid-column: 1 / -1; }
  .pou-status-form { grid-template-columns: 1fr; }
  .pou-detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pou-file-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pou-auth-card { grid-template-columns: 1fr; min-height: auto; }
  .pou-auth-brand-panel { display: none; }
  .pou-auth-mobile-brand { display: flex; }
}

@media (max-width: 580px) {
  .pou-admin-content { padding: 21px 13px 35px; }
  .pou-page-heading { display: block; }
  .pou-page-heading .pou-admin-actions { margin-top: 14px; }
  .pou-stat-grid { grid-template-columns: 1fr; }
  .pou-filter-grid { grid-template-columns: 1fr; }
  .pou-filter-grid > :first-child { grid-column: auto; }
  .pou-detail-grid,
  .pou-file-grid { grid-template-columns: 1fr; }
  .pou-detail-box.full { grid-column: auto; }
  .pou-form-field,
  .pou-form-field.third { grid-column: 1 / -1; }
  .pou-list-row,
  .pou-record-head { align-items: flex-start; flex-direction: column; }
  .pou-record-actions { justify-content: flex-start; }
  .pou-auth-shell { padding: 12px; }
  .pou-auth-form-panel { padding: 28px 22px; }
  .pou-auth-help { align-items: flex-start; flex-direction: column; }
  .pou-pagination { align-items: flex-start; flex-direction: column; }
}

/* Small compatibility refinements for the review queue. */
.pou-alert-warning { background: #fffaeb; color: #8a5a00; border-color: #fedf89; }
.pou-record > summary { list-style: none; cursor: pointer; }
.pou-record > summary::-webkit-details-marker { display: none; }
.pou-record[open] > summary { border-bottom: 1px solid var(--pou-border); }
.pou-record-actions > .pou-status-form { flex: 1 1 620px; }

@media (min-width: 1100px) {
  .pou-filter-grid { grid-template-columns: minmax(240px,1.4fr) repeat(3,minmax(135px,.65fr)) auto; }
}
