/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === Design Tokens === */
:root {
  color-scheme: light;
  --bg: #edf2ee;
  --bg-deep: #dde7df;
  --ink: #101815;
  --ink-2: #26342f;
  --muted: #4f5f57;
  --text: #101815;
  --line: #b9c8bf;
  --line-light: #c5d3ca;
  --panel: #ffffff;
  --panel-alt: #eef5f1;
  --accent: #12613f;
  --accent-strong: #0b3b29;
  --accent-glow: rgba(18, 97, 63, 0.2);
  --accent-surface: #dff0e7;
  --brand-surface: #f8fbf8;
  --brand-border: rgba(255, 255, 255, 0.28);
  --success: #106332;
  --success-bg: #e1f3e7;
  --warning: #9a4c00;
  --warning-bg: #fff0d8;
  --error: #a51f25;
  --error-bg: #ffe6e7;
  --info: #16559b;
  --info-bg: #e2eefb;
  --gold: #8f681f;
  --gold-soft: #d7b65a;
  --font-display: var(--font-body);
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --shadow-xs: 0 1px 2px rgba(16, 24, 21, 0.08);
  --shadow-sm: 0 3px 12px rgba(16, 24, 21, 0.1), 0 1px 3px rgba(16, 24, 21, 0.06);
  --shadow-md: 0 8px 26px rgba(16, 24, 21, 0.12), 0 2px 5px rgba(16, 24, 21, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 21, 0.16), 0 4px 10px rgba(16, 24, 21, 0.08);
  --shadow-accent: 0 8px 22px rgba(18, 97, 63, 0.26);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --page-gutter: clamp(18px, 3vw, 64px);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8faf8 0%, var(--bg) 38%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); line-height: 1.15; }

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); letter-spacing: 0; }
h2 { font-size: 1.18rem; letter-spacing: 0; }

p { line-height: 1.7; }

/* === Links === */
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-strong); }

/* === Brand Mark === */
.site-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--ink);
}

.site-logo img,
.narrow-logo {
  display: block;
  flex: 0 0 auto;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 50, 43, 0.18), 0 2px 6px rgba(15, 50, 43, 0.08);
}

.site-logo span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.site-logo small {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-logo strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.site-logo h1 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.15;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-brand-lockup {
  position: relative;
  isolation: isolate;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 8px 18px 8px 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 14px 34px rgba(5, 31, 24, 0.18);
}

.hero-logo img {
  width: 62px;
  height: 62px;
  border-radius: 16px;
}

.hero-brand-lockup img {
  transform: translateY(-1px);
  background: var(--brand-surface);
  box-shadow: 0 12px 26px rgba(5, 31, 24, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.74);
}

.hero-logo h1 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(2.45rem, 4.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1;
}

.public-hero .hero-logo,
.public-hero .hero-logo h1 {
  color: #fff;
}

.login-logo {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  text-align: center;
}

.login-logo img {
  width: 68px;
  height: 68px;
  border-radius: 20px;
}

.login-logo span {
  justify-items: center;
}

.admin-logo img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.admin-logo small {
  color: #13725d;
}

.admin-logo strong {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

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

.narrow-header .back {
  margin: 0;
}

.narrow-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

/* === Layout Shell === */
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.shell.narrow {
  width: min(680px, calc(100% - 40px));
}

/* === Animations === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 92, 58, 0.15); }
  50%      { box-shadow: 0 0 0 8px rgba(26, 92, 58, 0); }
}
@keyframes modalIn {
  from { opacity: 0.88; transform: translate(-50%, calc(-50% + 12px)) scale(0.985); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.anim-up { animation: fadeUp 0.55s var(--ease-out) both; }
.anim-up-d1 { animation: fadeUp 0.55s var(--ease-out) 0.07s both; }
.anim-up-d2 { animation: fadeUp 0.55s var(--ease-out) 0.14s both; }
.anim-up-d3 { animation: fadeUp 0.55s var(--ease-out) 0.21s both; }
.anim-up-d4 { animation: fadeUp 0.55s var(--ease-out) 0.28s both; }
.anim-fade { animation: fadeIn 0.5s var(--ease-out) both; }

/* === Public Header === */
.public-shell {
  width: calc(100% - (var(--page-gutter) * 2));
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  row-gap: clamp(14px, 1.8dvh, 22px);
  padding: clamp(14px, 1.8dvh, 22px) 0 clamp(20px, 3dvh, 42px);
}

/* === Hero === */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.28fr);
  gap: 32px;
  align-items: stretch;
  margin-bottom: 18px;
}

.public-hero {
  min-height: clamp(220px, 22dvh, 300px);
  border: 1px solid #0b3b29;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(115deg, rgba(215, 182, 90, 0.14), transparent 38%),
    linear-gradient(135deg, #0b3b29 0%, #12613f 58%, #1d7650 100%);
  padding: clamp(24px, 3dvh, 36px) clamp(26px, 2.8vw, 42px);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.hero-copy {
  display: grid;
  align-content: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 660px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.75;
}

.lead > :first-child {
  margin-top: 0;
}

.lead > :last-child {
  margin-bottom: 0;
}

.lead p,
.lead ul,
.lead ol,
.lead blockquote {
  margin: 8px 0 0;
}

.lead ul,
.lead ol {
  padding-left: 20px;
}

.lead h2,
.lead h3,
.lead h4 {
  margin: 12px 0 0;
  color: #fff;
  font-size: 18px;
  line-height: 1.35;
}

.lead a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.42);
  text-underline-offset: 3px;
}

.lead code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.hero-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-self: center;
}

.hero-meta div {
  min-height: 78px;
}

.availability-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 18px 36px rgba(5, 31, 24, 0.18);
}

.availability-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-soft), rgba(255, 255, 255, 0.84), var(--gold));
}

.availability-card::after {
  content: '';
  position: absolute;
  right: -28px;
  bottom: -44px;
  width: 126px;
  height: 126px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
}

.hero-meta dt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-meta dt span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(215, 182, 90, 0.18);
}

.hero-meta dd {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 12px;
  color: #fff;
  line-height: 0.9;
}

.hero-meta dd strong {
  color: #fff;
  font-size: clamp(3.4rem, 7vw, 5.4rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.88;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.hero-meta dd small {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.availability-card p {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #a9bbb1;
  border-radius: var(--radius-lg);
  background: #a9bbb1;
  box-shadow: var(--shadow-xs);
}

.process-strip div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: clamp(52px, 6dvh, 68px);
  padding: 14px 18px;
  background: #fff;
}

.process-strip span {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.process-strip strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.metric-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.metric-card span {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Panels / Cards === */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease);
}

.panel-head {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 { margin: 0; }

.list-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  background: var(--accent-surface);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Workspace Layout === */
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.public-workspace {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
  min-height: clamp(520px, calc(100dvh - 410px), 720px);
}

.public-workspace .form {
  max-width: none;
}

.public-workspace > .panel {
  height: 100%;
  padding: clamp(24px, 3dvh, 34px);
}

.public-shell .hero,
.public-shell .process-strip {
  margin-bottom: 0;
}

.public-workspace .form {
  gap: clamp(20px, 2.2dvh, 28px);
  align-content: stretch;
}

.public-workspace input,
.public-workspace .fixed-deposit-value {
  min-height: clamp(52px, 5.6dvh, 64px);
}

.public-workspace button[type="submit"] {
  min-height: clamp(56px, 6.4dvh, 70px);
}

/* === Forms === */
.form { display: grid; gap: 20px; }

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid #aebfb5;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  background: #f7faf8;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

input::placeholder { color: #6f7f77; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--panel);
  outline: none;
}

.fixed-deposit-value {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1.5px solid #aebfb5;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  background: #eef6f1;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238a7e6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-note {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.trust-panel {
  position: relative;
  display: grid;
  align-content: stretch;
  gap: clamp(18px, 2.2dvh, 28px);
  overflow: hidden;
  border-color: #a8beb1;
}

.trust-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), var(--gold));
}

.rule-list {
  display: grid;
  gap: clamp(12px, 1.8dvh, 22px);
  list-style: none;
}

.rule-list li {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(12px, 1.8dvh, 22px);
}

.rule-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rule-list strong {
  color: var(--ink);
  font-size: 14px;
}

.rule-list span {
  color: #41524a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
}

.decision-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: clamp(18px, 2.2dvh, 26px);
}

.decision-item {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: clamp(138px, 14dvh, 168px);
  border: 1px solid #c0d0c7;
  border-radius: var(--radius-md);
  padding: clamp(13px, 1.5dvh, 18px) 14px;
  background: #f4f8f5;
}

.decision-item span {
  width: fit-content;
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  background: var(--info-bg);
  color: var(--info);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.decision-item strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.decision-item p {
  color: #41524a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
}

.decision-approved span {
  background: var(--success-bg);
  color: var(--success);
}

.decision-rejected span {
  background: var(--error-bg);
  color: var(--error);
}

/* === Buttons === */
button[type="submit"],
.btn-primary {
  min-height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}
button[type="submit"]:hover,
.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}
button[type="submit"]:active,
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.button-secondary {
  min-height: 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.button-secondary:hover {
  border-color: var(--muted);
  background: var(--bg);
  box-shadow: var(--shadow-xs);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius-md);
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

button.button-danger {
  min-height: 34px;
  border: 1px solid #f0c5c1;
  border-radius: 8px;
  background: #fff7f6;
  color: #a4362d;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

button.button-danger:hover {
  border-color: #d98980;
  background: #fff1f0;
  color: #84251e;
  box-shadow: none;
  transform: none;
}

/* === Status Badges === */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-approved, .status-available, .status-sent, .status-COMPLETED {
  background: var(--success-bg);
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(16, 99, 50, 0.14);
}
.status-approved::before, .status-available::before, .status-sent::before, .status-COMPLETED::before {
  background: var(--success);
}

.status-assigned, .status-pending, .status-waiting_payment, .status-PENDING, .status-PAID {
  background: var(--info-bg);
  color: var(--info);
  box-shadow: inset 0 0 0 1px rgba(22, 85, 155, 0.14);
}
.status-assigned::before, .status-pending::before, .status-waiting_payment::before, .status-PENDING::before, .status-PAID::before {
  background: var(--info);
}

.status-rejected, .status-failed {
  background: var(--error-bg);
  color: var(--error);
  box-shadow: inset 0 0 0 1px rgba(165, 31, 37, 0.14);
}
.status-rejected::before, .status-failed::before {
  background: var(--error);
}

.status-duplicate, .status-no_invite, .status-verification_error, .status-EXPIRED {
  background: var(--warning-bg);
  color: var(--warning);
  box-shadow: inset 0 0 0 1px rgba(154, 76, 0, 0.14);
}
.status-duplicate::before, .status-no_invite::before, .status-verification_error::before, .status-EXPIRED::before {
  background: var(--warning);
}

/* === Alerts & Notices === */
.alert {
  border: 1px solid rgba(192, 39, 43, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  animation: slideDown 0.3s var(--ease-out);
}

.notice {
  border: 1px solid rgba(26, 95, 180, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 14px;
  font-weight: 600;
  animation: slideDown 0.3s var(--ease-out);
}

/* === Request List === */
.table { display: grid; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) minmax(130px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.row:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.doi {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}

.empty {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* === Back Link === */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: color 0.2s var(--ease);
}
.back:hover { color: var(--accent); }
.back::before {
  content: '\2190';
  font-size: 16px;
  transition: transform 0.2s var(--ease);
}
.back:hover::before { transform: translateX(-3px); }

/* === Status Page === */
.status-panel h1 {
  font-size: 1.8rem;
  margin: 0;
}

.details {
  display: grid;
  gap: 0;
}

.details div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  border-top: 1px solid var(--line-light);
  padding: 12px 0;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.invite {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  background: var(--accent-surface);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(26, 92, 58, 0.15);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

/* === Login & Setup === */
.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  text-align: center;
}

.login-panel h1 {
  font-size: 2.4rem;
  margin-bottom: 4px;
}

.login-panel .eyebrow { margin-bottom: 8px; }

.login-panel .form { text-align: left; margin-top: 28px; }

.login-panel .back {
  margin-top: 20px;
  margin-bottom: 0;
}

/* === Admin Dashboard === */
.admin-page {
  background:
    linear-gradient(180deg, #f7faf8 0%, #e7efe9 48%, #dbe6df 100%);
  color: #17201d;
  --admin-line: #afc0b6;
  --admin-line-soft: #ccd9d1;
  --admin-panel: rgba(255, 255, 255, 0.96);
  --admin-panel-solid: #ffffff;
  --admin-muted: #53645c;
  --admin-gap: 16px;
  --admin-pad: 18px;
  --admin-control: 40px;
}

.admin-shell {
  width: calc(100% - (var(--page-gutter) * 2));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 52px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 4px 0 22px;
  border-bottom: 1px solid #aebfb6;
}

.admin-settings-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #9fb4a8;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f352b;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-settings-entry:hover,
.admin-settings-entry.is-active {
  border-color: #113f36;
  background: #113f36;
  color: #fff;
}

.admin-title {
  flex: 1;
  min-width: 0;
}

.admin-title .eyebrow {
  margin-bottom: 8px;
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 4px;
  color: #53645c;
  font-size: 13px;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
}

.admin-actions a,
.admin-actions .button-secondary {
  min-height: 38px;
  border: 1px solid #9fb4a8;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f352b;
}

.admin-actions a:hover,
.admin-actions .button-secondary:hover {
  border-color: #637c70;
  background: #fff;
}

.admin-actions .admin-settings-entry:hover,
.admin-actions .admin-settings-entry.is-active {
  border-color: #113f36;
  background: #113f36;
  color: #fff;
}

.admin-actions form { margin: 0; }

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.admin-metrics .metric-card {
  display: grid;
  align-content: space-between;
  min-height: 88px;
  border-color: var(--admin-line);
  border-radius: 8px;
  padding: 12px 14px 13px;
  background: var(--admin-panel);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(23, 32, 29, 0.08);
}
.admin-metrics .metric-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: #12613f;
  opacity: 0.78;
  transition: opacity 0.3s var(--ease);
}
.admin-metrics .metric-card:hover::after { opacity: 1; }

.admin-metrics .metric-primary {
  background: #113f36;
  color: #fff;
}

.admin-metrics .metric-primary small,
.admin-metrics .metric-primary span {
  color: #fff;
}

.admin-metrics .metric-primary::after {
  background: #d6c36a;
  opacity: 1;
}

.admin-metrics .metric-warning::after {
  background: var(--warning);
}

.admin-metrics span {
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.admin-metrics small {
  margin: 0;
  color: #53645c;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-view-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0 0 16px;
  overflow-x: auto;
}

.admin-view-tab {
  display: inline-flex;
  flex: 1 0 132px;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 46px;
  border: 1px solid #9fb4a8;
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  color: #193b32;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.admin-view-tab:hover {
  border-color: #637c70;
  background: #fff;
}

.admin-view-tab.is-active {
  border-color: #113f36;
  background: #113f36;
  color: #fff;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--admin-gap);
  align-items: start;
}

.admin-section {
  margin: 0;
  border-color: var(--admin-line);
  border-radius: 8px;
  padding: var(--admin-pad);
  box-shadow: 0 3px 14px rgba(23, 32, 29, 0.08);
}

.admin-section h2,
.admin-section h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-section h3 {
  font-size: 0.95rem;
}

.panel-subtitle {
  margin-top: 3px;
  color: #54675e;
  font-size: 12px;
  font-weight: 700;
}

.admin-section .panel-head {
  min-height: 36px;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.admin-view-panel {
  min-height: 0;
}

.invite-console .form,
.invite-console.admin-view-panel .form {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.invite-console.admin-view-panel button[type="submit"] {
  justify-self: end;
}

.invite-console textarea {
  min-height: 104px;
  max-height: 180px;
  resize: vertical;
}

.invite-console button[type="submit"] {
  min-width: 128px;
  min-height: 46px;
  padding: 0 18px;
}

.settings-stack {
  display: grid;
  border-top: 1px solid var(--admin-line-soft);
}

.settings-group {
  display: grid;
  grid-template-columns: minmax(190px, 0.24fr) minmax(0, 1fr);
  gap: clamp(18px, 2.2vw, 36px);
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--admin-line-soft);
}

.settings-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-group-head {
  display: grid;
  gap: 7px;
  align-content: start;
}

.settings-group-head h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
}

.settings-current {
  width: fit-content;
  max-width: 100%;
  border: 1px solid #b7cbbf;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  background: #e9f5ee;
  color: #174d36;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.settings-form {
  max-width: none;
  gap: 12px;
}

.settings-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.branding-settings-form {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.branding-settings-form textarea {
  min-height: 136px;
}

.branding-settings-form button[type="submit"] {
  justify-self: start;
  min-width: 180px;
  min-height: 42px;
  padding: 0 18px;
}

.compact-settings-form,
.notification-settings-form {
  grid-template-columns: minmax(240px, 0.46fr) max-content;
  align-items: end;
}

.notification-settings-form {
  grid-template-columns: minmax(300px, 0.56fr) max-content;
}

.notification-settings-form .settings-hint {
  grid-column: 1 / -1;
  grid-row: 2;
}

.compact-settings-form button[type="submit"],
.notification-settings-form button[type="submit"],
.smtp-settings-form button[type="submit"],
.payment-settings-form button[type="submit"],
.template-settings-form button[type="submit"],
.ai-admin-key-create-form button[type="submit"] {
  justify-self: start;
  min-width: 96px;
  min-height: 42px;
  padding: 0 18px;
}

.ai-admin-key-panel {
  display: grid;
}

.one-time-secret {
  display: grid;
  gap: 8px;
  border: 1px solid #caa45d;
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff7e8;
}

.one-time-secret span {
  color: #5e4214;
  font-size: 12px;
  font-weight: 800;
}

.one-time-secret input,
.ai-admin-key-panel input[readonly] {
  font-family: var(--font-mono);
}

.one-time-secret small {
  color: #6f5427;
  font-weight: 700;
}

.ai-admin-key-create-form {
  margin-top: 2px;
}

.ai-admin-key-table {
  margin-top: 2px;
}

.ai-admin-key-grid {
  grid-template-columns: minmax(150px, 1.1fr) minmax(120px, 0.7fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr) minmax(86px, 0.4fr);
}

.ai-admin-key-grid code {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-admin-key-grid form {
  justify-self: start;
}

.ai-admin-key-grid button[type="submit"] {
  min-height: 34px;
  padding: 0 12px;
}

.template-settings-form textarea {
  min-height: 280px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.settings-grid-wide {
  grid-column: 1 / -1;
}

.settings-toggle-row,
.settings-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.checkbox-line {
  display: inline-flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: #29443d;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #113f36;
}

.settings-hint {
  margin: -2px 0 0;
  color: #54675e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

/* === Inline Filter === */
.inline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-filter select { min-width: 132px; font-size: 13px; }

.admin-filter select {
  min-height: var(--admin-control);
  border-width: 1px;
  border-radius: 8px;
  background-color: #f7faf8;
  font-size: 13px;
}

.admin-filter .button-danger {
  min-height: var(--admin-control);
  flex-shrink: 0;
  white-space: nowrap;
}

/* === Data Table === */
.data-table {
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: var(--admin-panel-solid);
}

.table-head, .table-row {
  display: grid;
  gap: 12px;
  align-items: center;
  min-width: min(900px, 100%);
  padding: 10px 14px;
  border-bottom: 1px solid #d2ded6;
}

.table-head {
  min-height: 42px;
  background: #e8f0eb;
  color: #33453d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-row {
  min-height: 48px;
  color: var(--ink);
  font-size: 14px;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.table-row:hover {
  background: #edf7f1;
}
.table-row:focus-visible {
  background: #edf7f1;
  box-shadow: inset 0 0 0 2px #13725d;
  outline: none;
}

.table-row > span,
.table-row time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row .doi {
  display: -webkit-box;
  max-height: 38px;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.table-row .status {
  justify-self: start;
}

.table-row > .status-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.request-grid {
  grid-template-columns: minmax(240px, 1.45fr) minmax(220px, 1.1fr) 112px minmax(132px, 0.8fr) 148px 80px;
}

.payment-grid {
  grid-template-columns: minmax(190px, 1.1fr) minmax(220px, 1.1fr) 92px 92px 104px 148px 96px;
}

.payment-row-action {
  width: 96px;
}

.payment-row-action form {
  display: contents;
}

.payment-row-action .button-secondary {
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.payment-methods form {
  display: contents;
}

.payment-methods button {
  width: 100%;
  min-height: 46px;
}

.payment-method-primary {
  box-shadow: 0 10px 18px rgba(31, 118, 77, 0.16);
}

.notification-grid {
  min-width: min(760px, 100%);
  grid-template-columns: 148px minmax(220px, 1fr) 92px 110px minmax(260px, 1.25fr);
}

.admin-notifications-panel {
  margin-bottom: 0;
}

.admin-notifications-panel .panel-head {
  margin-bottom: 10px;
}

.admin-page .data-table.admin-notifications-table {
  max-height: min(64vh, 680px);
  overflow-y: auto;
}

.mono-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #26342f;
}

.row-action {
  display: inline-flex;
  justify-content: center;
  width: 48px;
  min-height: 28px;
  align-items: center;
  border: 1px solid #9fb4a8;
  border-radius: 999px;
  padding: 3px 9px;
  color: #0f352b;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
}

.admin-detail-button {
  min-height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #173f34;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-detail-button:hover {
  color: #0f6d58;
}

.admin-missing-detail {
  color: #8b9993;
  font-size: 12px;
  font-weight: 800;
}

.request-row-actions {
  gap: 6px;
  justify-content: flex-end;
  width: 80px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.request-row-actions form {
  display: contents;
}

.request-row-actions .button-secondary,
.request-row-actions .button-danger {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.admin-page .status {
  min-height: 24px;
  padding: 3px 10px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: none;
}

.admin-page .status::before {
  width: 6px;
  height: 6px;
}

.admin-page .status-verification_error {
  background: #fff1f0;
  color: #9f1d22;
}

.admin-page .status-verification_error::before {
  background: #9f1d22;
  box-shadow: 0 0 0 2px rgba(159, 29, 34, 0.12);
}

.admin-request-dialog {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 48px);
  margin: 0;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(16, 28, 24, 0.28);
  transform: translate(-50%, -50%);
}

.admin-request-dialog[open] {
  animation: modalIn 0.2s var(--ease-out) both;
}

.admin-request-dialog::backdrop {
  background: rgba(18, 30, 27, 0.42);
  backdrop-filter: blur(2px);
}

.admin-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 48px);
  background: linear-gradient(180deg, #fbfcfb 0%, #fff 44%);
}

.admin-dialog-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--admin-line-soft);
  padding: 22px 24px 18px;
}

.admin-dialog-head h2 {
  max-width: 100%;
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-size: 1.14rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-dialog-close-form {
  flex: 0 0 auto;
  margin: 0;
}

.admin-dialog-close {
  min-height: 34px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #29443d;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.admin-dialog-close:hover {
  border-color: #b7c5be;
  background: #f5f8f6;
  color: #143a30;
}

.admin-dialog-body {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 22px;
}

.admin-dialog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-dialog-summary > span,
.admin-dialog-summary > time {
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--admin-line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8faf8;
  color: #29443d;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-dialog-summary .status {
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
}

.admin-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--admin-line-soft);
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(16, 28, 24, 0.05);
}

.admin-dialog-decision {
  flex-shrink: 0;
  min-width: 128px;
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

.admin-dialog-details {
  overflow: hidden;
  border: 1px solid var(--admin-line-soft);
  border-radius: 8px;
  background: #fff;
}

.admin-dialog-details div {
  min-width: 0;
  grid-template-columns: 118px minmax(0, 1fr);
  padding: 13px 16px;
}

.admin-dialog-details dd {
  overflow-wrap: anywhere;
  color: #1d2924;
  font-size: 14px;
  font-weight: 650;
}

.admin-dialog-wide {
  grid-column: 1 / -1;
}

.admin-dialog-reason {
  display: grid;
  gap: 8px;
  color: #29443d;
  font-size: 13px;
  font-weight: 800;
}

.admin-dialog-reason textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
}

/* === Compact List === */
.compact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow: auto;
}

.admin-view-panel .compact-list {
  max-height: min(64vh, 680px);
}

.compact-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--admin-line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.compact-list > div:hover {
  border-color: #cbd7d0;
  background: #f7f9f7;
}

.compact-list > .invite-code-item {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.invite-pool-section .compact-list {
  grid-template-columns: 1fr;
  gap: 6px;
}

.invite-pool-section .invite-code-item {
  min-height: 50px;
  padding: 9px 12px 9px 14px;
  background: #fff;
}

.invite-pool-section .invite-code-item:hover {
  background: #f8faf8;
}

.invite-code-selector {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
}

.invite-code-selector input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #a33a3a;
}

.invite-code-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.invite-code-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.compact-list strong {
  min-width: 0;
  overflow: hidden;
  color: #17201d;
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list small {
  overflow-wrap: anywhere;
  color: #71817a;
  font-size: 12px;
  line-height: 1.45;
}

.inline-delete-form {
  display: flex;
  align-items: center;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* === Responsive === */
@media (max-width: 960px) {
  .admin-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .public-shell {
    display: block;
  }
  .hero, .workspace, .admin-layout {
    grid-template-columns: 1fr;
  }
  .public-shell .hero,
  .public-shell .process-strip {
    margin-bottom: 18px;
  }
  .public-workspace {
    min-height: 0;
  }
  .hero-meta {
    grid-template-columns: minmax(190px, max-content);
  }
  .process-strip {
    grid-template-columns: 1fr;
  }
  .decision-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-view-tabs {
    gap: 8px;
  }
  .admin-view-tab {
    min-height: 42px;
    padding: 0 12px;
    white-space: nowrap;
  }
  .row {
    grid-template-columns: 1fr auto;
  }
  .row .doi { grid-column: 1 / -1; }
  .details div { grid-template-columns: 1fr; gap: 4px; }
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .admin-actions { justify-content: flex-start; }
  .inline-filter { width: 100%; }
  .inline-filter select { min-width: 0; flex: 1; }
  .invite-console .form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .invite-console.admin-view-panel button[type="submit"] {
    justify-self: stretch;
    grid-column: auto;
  }
  .settings-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .compact-settings-form,
  .branding-settings-form,
  .notification-settings-form,
  .payment-settings-form,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .compact-settings-form button[type="submit"],
  .branding-settings-form button[type="submit"],
  .notification-settings-form button[type="submit"],
  .payment-settings-form button[type="submit"] {
    justify-self: stretch;
  }
  .invite-pool-section .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-page .data-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .admin-page .data-table.admin-notifications-table {
    overflow: auto;
    border: 1px solid var(--admin-line-soft);
    background: var(--admin-panel-solid);
  }
  .admin-page .table-head {
    display: none;
  }
  .admin-page .table-row,
  .admin-page .request-grid,
  .admin-page .payment-grid,
  .admin-page .notification-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .admin-page .table-head.request-grid,
  .admin-page .table-head.payment-grid,
  .admin-page .table-head.notification-grid {
    display: none;
  }
  .admin-page .table-row {
    gap: 8px;
    margin-bottom: 10px;
    border: 1px solid #e1e7e3;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
  }
  .admin-page .table-row > span,
  .admin-page .table-row time,
  .admin-page .table-row > strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .admin-page .table-row > span:not(.status)::before,
  .admin-page .table-row time::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #71817a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .admin-page .table-row .doi {
    display: flex;
    max-height: none;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
  }
  .admin-page .row-action {
    justify-content: center;
    width: 100%;
    margin-top: 4px;
  }
  .admin-page .row-action::before {
    content: none;
  }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1120px); padding: 28px 0 40px; }
  .public-shell {
    width: calc(100% - 28px);
    padding: 28px 0 40px;
  }
  h1 { font-size: 2rem; }
  .hero { gap: 18px; }
  .public-hero { padding: 22px; }
  .hero-logo {
    gap: 10px;
    margin-bottom: 10px;
  }
  .hero-logo img {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }
  .hero-brand-lockup {
    gap: 12px;
    padding: 7px 14px 7px 7px;
  }
  .hero-logo h1 {
    font-size: clamp(1.8rem, 10vw, 2.35rem);
  }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta div { min-height: 74px; }
  .availability-card {
    min-width: 0;
    padding: 16px;
  }
  .hero-meta dd strong {
    font-size: clamp(3rem, 18vw, 4.2rem);
  }
  .process-strip div {
    min-height: 52px;
    padding: 12px 14px;
  }
  .decision-flow {
    grid-template-columns: 1fr;
  }
  .decision-item {
    min-height: 0;
  }
  .metrics { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell {
    width: calc(100% - 28px);
    padding-top: 22px;
  }
  .panel { padding: 20px; }
  .admin-section { padding: 16px; }
  .admin-actions,
  .admin-filter {
    width: 100%;
  }
  .admin-view-tabs {
    gap: 8px;
  }
  .admin-actions a,
  .admin-actions form,
  .admin-actions .button-secondary {
    flex: 1;
    text-align: center;
  }
  .admin-request-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
  .admin-dialog-shell { max-height: calc(100dvh - 24px); }
  .admin-dialog-head,
  .admin-dialog-body,
  .admin-dialog-footer {
    padding-right: 16px;
    padding-left: 16px;
  }
  .admin-dialog-head {
    align-items: flex-start;
  }
  .admin-dialog-summary {
    grid-template-columns: 1fr;
  }
  .admin-dialog-details div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .admin-dialog-footer {
    flex-direction: column-reverse;
  }
  .admin-dialog-decision {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .admin-metrics { grid-template-columns: 1fr; }
}
