:root {
  --bg: #f6f0e7;
  --bg-accent: #efe5d3;
  --panel: rgba(255, 252, 246, 0.9);
  --panel-strong: #fffaf0;
  --line: rgba(74, 55, 35, 0.12);
  --text: #23180d;
  --muted: #6d5a45;
  --brand: #b51d19;
  --brand-dark: #8f1713;
  --brand-blue: #145e8e;
  --brand-gold: #b7872f;
  --success: #2f7c59;
  --danger: #a93f31;
  --shadow: 0 20px 50px rgba(76, 51, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(181, 29, 25, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(20, 94, 142, 0.12), transparent 24%),
    linear-gradient(135deg, var(--bg) 0%, #fcf8f1 100%);
}

.site-shell {
  min-height: 100vh;
}

.brand-lines {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.brand-lines span {
  display: block;
}

.brand-lines__red {
  background: #df231d;
}

.brand-lines__blue {
  background: var(--brand-blue);
}

.brand-lines__gold {
  background: var(--brand-gold);
}

.brand-lines--internal {
  margin-bottom: 18px;
}

.eyebrow,
.section-tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd7b0;
}

.landing-view {
  padding: 24px;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(35, 10, 10, 0.92), rgba(52, 19, 19, 0.88)),
    linear-gradient(135deg, #2b120d, #6d1f0e);
  color: #fff8ef;
  box-shadow: var(--shadow);
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 205, 153, 0.12);
  filter: blur(10px);
}

.landing-topbar,
.landing-hero__content {
  position: relative;
  z-index: 1;
}

.landing-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup--compact .brand-mark {
  width: 54px;
  height: 54px;
}

.brand-mark {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 18px 18px 26px 26px;
  background: linear-gradient(180deg, #0e4a73, #175d86);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.brand-mark span {
  position: absolute;
  border: 2px solid #f0d7a0;
  border-radius: 22px 22px 12px 12px;
  border-top: 0;
}

.brand-mark span:nth-child(1) {
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 28px;
}

.brand-mark span:nth-child(2) {
  left: 24px;
  width: 12px;
  bottom: 38px;
  height: 18px;
  border-radius: 12px 12px 0 0;
  border-bottom: 0;
}

.brand-mark span:nth-child(3) {
  right: 24px;
  width: 12px;
  bottom: 38px;
  height: 18px;
  border-radius: 12px 12px 0 0;
  border-bottom: 0;
}

.brand-text {
  display: grid;
  gap: 4px;
}

.brand-text strong {
  color: #cc1f19;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: 0.03em;
}

.brand-text span {
  color: rgba(255, 248, 239, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.topbar__identity .brand-text span {
  color: var(--muted);
}

.landing-hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 480px);
  gap: 28px;
  align-items: center;
}

.landing-copy {
  max-width: 720px;
}

.landing-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.96;
}

.landing-copy p {
  margin: 18px 0 0;
  color: rgba(255, 248, 239, 0.82);
  font-size: 1rem;
  line-height: 1.6;
}

.landing-actions {
  margin-top: 22px;
}

.landing-preview {
  background: rgba(255, 250, 240, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff8ef;
}

.landing-preview .section-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd7b0;
}

.hero-grid {
  display: grid;
  gap: 14px;
}

.hero-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

.landing-info {
  margin-top: 24px;
}

.info-card {
  padding: 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-grid h3 {
  margin: 0 0 10px;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.app-panel {
  max-width: 1720px;
  margin: 0 auto;
  padding: 28px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.auth-card {
  position: relative;
  z-index: 2;
  max-width: 560px;
  width: min(560px, calc(100vw - 32px));
  margin: 8vh auto;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.section-heading h2,
.section-heading h3,
.section-heading h4 {
  margin: 0;
}

.section-tag {
  background: rgba(181, 29, 25, 0.1);
  color: var(--brand-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid rgba(83, 58, 31, 0.16);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  outline: 2px solid rgba(181, 29, 25, 0.16);
  border-color: rgba(181, 29, 25, 0.42);
}

.full-width {
  grid-column: 1 / -1;
}

.inline-toggle {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
}

.inline-toggle input {
  width: auto;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #d34823);
  color: white;
}

.btn-secondary {
  background: rgba(35, 24, 13, 0.08);
  color: var(--text);
}

.credentials-box,
.table-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.credentials-box code {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #23180d;
  color: #fff5ea;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
}

.message.is-error {
  color: var(--danger);
}

.message.is-success {
  color: var(--success);
}

.hidden {
  display: none !important;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.login-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(35, 24, 13, 0.52);
  backdrop-filter: blur(4px);
}

.dashboard-page {
  padding: 20px 0 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar__identity {
  display: grid;
  gap: 8px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 94, 142, 0.12);
  color: var(--brand-blue);
  font-weight: 700;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.74);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 1.8rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-tab {
  border: 1px solid rgba(20, 94, 142, 0.18);
  background: rgba(20, 94, 142, 0.06);
  color: var(--brand-blue);
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  background: linear-gradient(135deg, var(--brand-blue), #2b7eb6);
  color: white;
}

.admin-tab-panel {
  margin-bottom: 20px;
}

.support-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-list,
.user-list {
  display: grid;
  gap: 14px;
}

.dashboard-item,
.user-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
}

.dashboard-item.active {
  border-color: rgba(47, 124, 89, 0.28);
}

.dashboard-item header,
.user-item header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.dashboard-item h4,
.user-item h4 {
  margin: 0 0 8px;
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(35, 24, 13, 0.08);
  color: var(--muted);
}

.pill.is-success {
  background: rgba(47, 124, 89, 0.12);
  color: var(--success);
}

.pill.is-danger {
  background: rgba(169, 63, 49, 0.12);
  color: var(--danger);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 16px;
  text-decoration: none;
}

.viewer-card {
  min-height: 900px;
}

.viewer-empty {
  display: grid;
  place-items: center;
  min-height: 760px;
  border-radius: 24px;
  border: 1px dashed rgba(83, 58, 31, 0.24);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

#dashboardFrame {
  width: 100%;
  min-height: 820px;
  border: 0;
  border-radius: 24px;
  background: #fff;
}

@media (max-width: 1080px) {
  .landing-hero__content,
  .info-grid,
  .content-layout,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .app-panel {
    padding: 20px;
  }
}

@media (max-width: 680px) {
  .landing-view,
  .landing-hero {
    padding: 18px;
  }

  .landing-topbar,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  #dashboardFrame,
  .viewer-empty,
  .viewer-card {
    min-height: 520px;
  }
}
