/* Current redesign tokens, layout, buttons and shared surfaces. */
/* Variant 4 redesign */
:root {
  --cream: #f4f6f8;
  --paper: rgba(255, 255, 255, 0.96);
  --ink: #202c31;
  --muted: #74828c;
  --accent: #4c8dff;
  --accent-2: #1c5fbd;
  --line: #e3e8ee;
  --danger: #d14d4d;
  --success: #21845a;
  --warning: #a66b00;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3fb;
  --blue-soft: #eaf2ff;
  --blue-line: #d8e7ff;
  --shadow: 0 18px 50px rgba(30, 53, 83, 0.1);
  --soft-shadow: 0 10px 24px rgba(30, 53, 83, 0.08);
  --radius: 24px;
  --radius-lg: 28px;
  --radius-md: 16px;
}

html {
  min-height: 100%;
  background: #f4f6f8;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 36px;
}

.topbar {
  min-height: 72px;
  padding: 0 32px;
  gap: 18px;
  flex-wrap: nowrap;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  min-width: min(520px, 42vw);
  color: #273236;
  font-family: inherit;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

.main-nav {
  gap: 8px;
  margin-left: auto;
  margin-right: auto;
}

.nav-link {
  padding: 12px 18px;
  border-radius: 999px;
  color: #6d7b80;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1;
}

.nav-link:hover {
  background: #f2f6fb;
  color: #273236;
}

.nav-link-active {
  background: #eef3fb;
  color: #23313a;
  box-shadow: inset 0 0 0 1px #dce7f7;
}

.topbar-meta {
  min-width: min(240px, 24vw);
  justify-content: flex-end;
  color: #728089;
  font-size: 14px;
  font-weight: 700;
  gap: 14px;
}

.topbar-logout-button,
.topbar-login-link {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(76, 141, 255, 0.22);
}

.layout,
.detail-layout,
.admin-shell {
  width: min(1472px, calc(100% - 64px));
  margin: 0 auto;
  padding-top: 22px;
}

.layout,
.detail-layout {
  gap: 18px;
}

.admin-shell {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-content {
  gap: 18px;
}

.auth-shell {
  min-height: 100vh;
  padding: 32px;
  background: #f4f6f8;
}

.auth-card,
.hero,
.detail-hero,
.search-panel,
.detail-card,
.recipe-card,
.chat-result-card,
.admin-table-card,
.document-card,
.empty-state,
.admin-sidebar-card,
.access-stat-card,
.permission-group-card,
.role-card,
.role-detail-summary-card,
.role-detail-editor-card,
.role-danger-zone,
.modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  gap: 18px;
}

.auth-copy h1,
.hero-copy h1,
.detail-hero h1 {
  color: #202c31;
  font-family: inherit;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-copy h1 {
  font-size: 29px;
}

.eyebrow,
.role-panel-title,
.role-group-title,
.search-mode-label {
  color: #4c8dff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted,
.lede,
.form-hint,
.role-panel-subtitle {
  color: var(--muted);
}

.section-heading {
  align-items: end;
  gap: 16px;
}

.section-heading h2,
.detail-card h2 {
  margin: 0;
  color: #202c31;
  font-family: inherit;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-heading > div {
  min-width: 0;
}

.section-heading-actions {
  align-items: center;
  justify-items: end;
}

.section-heading h3 {
  margin: 0;
  color: #202c31;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.banner {
  border-radius: 18px;
  padding: 13px 16px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 53, 83, 0.05);
}

.banner-success {
  background: #eaf8f1;
  border-color: #ccebdc;
  color: var(--success);
}

.banner-error {
  background: #fff0f0;
  border-color: #ffd4d4;
  color: var(--danger);
}

label {
  gap: 7px;
  color: #344047;
  font-size: 14px;
  font-weight: 800;
}

.form-field,
.admin-filter-field,
.role-compose-field,
.recipe-edit-grid label,
.recipe-edit-nutrition-grid label,
.recipe-edit-cover-controls > label:not(.checkbox-row),
.recipe-edit-section > label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #344047;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.form-field > span,
.admin-filter-field > span {
  min-height: 1.1em;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9e3ec;
  border-radius: 16px;
  background: #fff;
  color: #26343c;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(30, 53, 83, 0.05);
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9fc2ff;
  box-shadow: 0 0 0 4px rgba(76, 141, 255, 0.14);
}

button,
.secondary-button,
.danger-button,
.detail-action-button,
.recipe-open-button,
.chip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

button,
.recipe-open-button,
.detail-action-button:not(.secondary-button):not(.detail-action-button-danger) {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(76, 141, 255, 0.22);
}

button:hover,
.recipe-open-button:hover,
.detail-action-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.chip-link {
  background: #fff;
  border-color: #d9e2eb;
  color: #344047;
  box-shadow: 0 3px 10px rgba(19, 41, 75, 0.04);
}

.secondary-button:hover,
.chip-link:hover {
  background: #f8fafc;
  border-color: #cdd9e6;
}

.danger-button,
.detail-action-button-danger,
.icon-button-danger {
  background: #fff3f3;
  border-color: #ffd6d6;
  color: #b53a3a;
  box-shadow: none;
}

.danger-button:hover,
.detail-action-button-danger:hover,
.icon-button-danger:hover {
  background: #ffe8e8;
}

button:disabled,
.secondary-button:disabled,
.detail-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
  padding: 28px;
}

.hero-panel,
.stacked-form,
.compact-form {
  gap: 14px;
}

.hero-panel {
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #edf2f6;
  border-radius: 20px;
  box-shadow: none;
}

.admin-hero {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-hero .hero-panel {
  width: min(720px, 100%);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.upload-limits-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

.hero-stats article,
.document-card dl div,
.nutrition-grid div,
.recipe-fact,
.role-card-stats div,
.diagnostics-backup-summary > div {
  background: #f8fafc;
  border: 1px solid #edf2f6;
  border-radius: 14px;
}

.sample-list span,
.chip,
.document-status-pill,
.diagnostic-status,
.role-card-badges code {
  border-radius: 999px;
  border: 1px solid #e1e8ef;
  background: #f4f7fa;
  color: #687781;
  font-size: 12px;
  font-weight: 850;
}

.chip-row,
.sample-list {
  gap: 7px;
}
