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

:root {
  --cream: #fefaf1;
  --navy: #00002d;
  --red: #d31900;
  --beige: #bfb1a2;
  --beige-light: #ede7df;
  --white: #ffffff;
  --gray: #6b7280;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --font-head: "Poppins", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --font-editorial: "Playfair Display", serif;
}

body {
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--cream);
  font-size: 16px;
  line-height: 1.6;
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) calc(100vh - var(--topbar-height));
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__logo-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}

.sidebar__logo-sub {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}

.sidebar__nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

.sidebar__nav a.active {
  background: rgba(211, 25, 0, 0.15);
  color: var(--white);
}

.sidebar__nav a.active .nav-icon {
  opacity: 1;
}

.nav-icon {
  font-size: 16px;
  opacity: 0.7;
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar__footer-user {
  font-family: var(--font-head);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── TOPBAR ── */
.topbar {
  grid-column: 2;
  grid-row: 1;
  background: var(--white);
  border-bottom: 1px solid var(--beige-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.3px;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── MAIN CONTENT ── */
.main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
}

.content {
  padding: 28px 32px;
  max-width: 1200px;
}

/* ── SUB-TABS ── */
.subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--beige-light);
  margin-bottom: 28px;
}

.subtab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 20px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 6px 6px 0 0;
}

.subtab-btn:hover {
  color: var(--navy);
  background: rgba(0, 0, 45, 0.04);
}

.subtab-btn.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.subtab-panel {
  display: none;
}

.subtab-panel.active {
  display: block;
}

/* ── PERSONA CONTENT (rendered markdown) ── */
.persona-content {
  max-width: 860px;
}

.persona-content h1 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--red);
}

.persona-content h2 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 36px 0 12px;
  padding-bottom: 8px;
}

.persona-content h3 {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.persona-content p {
  margin: 8px 0;
  line-height: 1.75;
}

.persona-content ul,
.persona-content ol {
  margin: 8px 0 8px 24px;
}

.persona-content li {
  margin: 5px 0;
  line-height: 1.65;
}

.persona-content strong {
  font-weight: 700;
  color: var(--navy);
}

.persona-content em {
  font-style: italic;
  color: var(--gray);
}

.persona-content blockquote {
  border-left: 4px solid var(--red);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(211, 25, 0, 0.04);
  border-radius: 0 8px 8px 0;
}

.persona-content blockquote p {
  color: var(--navy);
  font-style: italic;
  margin: 0;
}

.persona-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 45, 0.08);
}

.persona-content th {
  background: var(--navy);
  color: var(--white);
  padding: 11px 14px;
  text-align: left;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.persona-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--beige-light);
  vertical-align: top;
  background: var(--white);
}

.persona-content tr:last-child td {
  border-bottom: none;
}

.persona-content tr:nth-child(even) td {
  background: rgba(254, 250, 241, 0.6);
}

.persona-content pre {
  background: var(--navy);
  color: #e8e8e8;
  padding: 20px;
  border-radius: 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 20px 0;
  white-space: pre;
}

.persona-content code {
  background: var(--navy);
  color: #e8e8e8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
}

.persona-content pre code {
  background: none;
  padding: 0;
}

.persona-content hr {
  border: none;
  border-top: 1px solid var(--beige-light);
  margin: 32px 0;
}

/* ── PERSONA CARDS ── */
.persona-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 8px rgba(0, 0, 45, 0.07);
  border: 1px solid var(--beige-light);
}

.persona-card:first-child {
  border-top: 3px solid var(--red);
}

.persona-card h2 {
  margin-top: 0;
  padding-top: 0;
  border-bottom: 1px solid var(--beige-light);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.persona-card h3 {
  margin-top: 16px;
}

/* ── VOC IFRAMES ── */
.voc-panel {
  height: calc(100vh - var(--topbar-height) - 60px - 28px);
}

.voc-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 45, 0.08);
}

/* ── LOGIN PAGE ── */
.login-body {
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card__logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-card__logo-title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}

.login-card__logo-sub {
  font-family: var(--font-head);
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.login-card label {
  display: block;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin: 16px 0 6px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--beige-light);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--navy);
  background: var(--cream);
  outline: none;
  transition: border-color 0.15s;
}

.login-card input:focus {
  border-color: var(--navy);
}

.btn-primary {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  opacity: 0.88;
}

.flash-error {
  background: rgba(211, 25, 0, 0.08);
  border: 1px solid rgba(211, 25, 0, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: var(--sidebar-width);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    grid-column: 1;
  }

  .main {
    grid-column: 1;
  }

  .hamburger {
    display: flex;
  }

  .content {
    padding: 20px 16px;
  }

  .voc-panel {
    height: calc(100vh - var(--topbar-height) - 60px - 20px);
  }
}
