/* ==========================================================================
   ESMO console - design tokens
   Palette taken from the ESMO logo: black field, signal yellow, white.
   ========================================================================== */
:root {
  --esmo-black: #0b0b0c;
  --esmo-black-soft: #17181b;
  --esmo-black-line: #2a2c31;
  --esmo-yellow: #ffd200;
  --esmo-yellow-dark: #e0b900;
  --esmo-yellow-tint: #fff8d9;

  --ink: #14161a;
  --ink-muted: #5c6470;
  --ink-faint: #8a929e;

  --surface: #f4f5f7;
  --surface-card: #ffffff;
  --border: #e3e6ea;
  --border-strong: #cdd2d9;

  --ok: #12805c;
  --ok-tint: #e6f5ef;
  --warn: #a86a00;
  --warn-tint: #fdf3e0;
  --danger: #c0332f;
  --danger-tint: #fdeceb;
  --info: #2a5fb8;
  --info-tint: #eaf1fd;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 20, 27, .06), 0 1px 3px rgba(16, 20, 27, .04);
  --shadow-md: 0 4px 12px rgba(16, 20, 27, .08), 0 2px 4px rgba(16, 20, 27, .04);
  --shadow-lg: 0 18px 40px rgba(16, 20, 27, .16);

  --sidebar-w: 252px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========================================================================== base */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid rgba(255, 210, 0, .55);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: .8125rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ========================================================================== app shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--esmo-black);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .22s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid var(--esmo-black-line);
  color: #fff;
  text-decoration: none;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand img { width: 34px; height: 34px; display: block; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar__brand-name {
  font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; color: var(--esmo-yellow);
}
.sidebar__brand-sub {
  font-size: .5rem; letter-spacing: .085em; text-transform: uppercase;
  color: #9aa1ad; margin-top: 3px; white-space: nowrap;
}

.sidebar__nav { flex: 1; overflow-y: auto; padding: .9rem .7rem; }

.nav-section {
  font-size: .625rem; text-transform: uppercase; letter-spacing: .12em;
  color: #6f7683; margin: 1.1rem .55rem .4rem; font-weight: 700;
}
.nav-section:first-child { margin-top: .2rem; }

.sidebar__nav .nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #c9cdd4; font-weight: 500; text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.sidebar__nav .nav-link:hover { background: var(--esmo-black-soft); color: #fff; text-decoration: none; }
.sidebar__nav .nav-link.is-active { background: var(--esmo-yellow); color: var(--esmo-black); font-weight: 650; }
.sidebar__nav .nav-link.is-active .nav-link__icon { opacity: 1; }
.nav-link__icon { width: 18px; height: 18px; flex: none; opacity: .8; }

.sidebar__footer { border-top: 1px solid var(--esmo-black-line); padding: .8rem .75rem; }

.user-chip { display: flex; align-items: center; gap: .6rem; padding: .35rem .3rem; }
.user-chip__meta { min-width: 0; line-height: 1.2; }
.user-chip__name { font-size: .8125rem; font-weight: 600; color: #fff; }
.user-chip__mail { font-size: .6875rem; color: #8a929e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar__actions { display: flex; gap: .4rem; margin-top: .5rem; }
.sidebar__action {
  flex: 1; text-align: center; font-size: .75rem; font-weight: 600;
  padding: .4rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--esmo-black-line); background: transparent; color: #c9cdd4;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.sidebar__action:hover { background: var(--esmo-black-soft); color: #fff; text-decoration: none; }

/* ========================================================================== main column */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  background: var(--esmo-black);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__toggle {
  background: transparent; border: 1px solid var(--esmo-black-line); color: #fff;
  border-radius: var(--radius-sm); padding: .35rem .5rem; cursor: pointer; line-height: 0;
}
.topbar__title { font-weight: 800; letter-spacing: .06em; color: var(--esmo-yellow); }

.page { padding: 1.75rem 2rem 3rem; max-width: 1240px; width: 100%; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem;
}
.page-head__title { display: flex; flex-direction: column; gap: .25rem; }
.page-head__eyebrow {
  font-size: .6875rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint);
}
.page-head__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.scrim {
  position: fixed; inset: 0; background: rgba(11, 11, 12, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 50;
}

/* ========================================================================== cards */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1.25rem; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.card__body { padding: 1.25rem; }
.card__foot {
  padding: .85rem 1.25rem; border-top: 1px solid var(--border);
  background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius);
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
}

.grid { display: grid; gap: 1.25rem; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }

.stat { padding: 1.15rem 1.25rem; }
.stat__label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.stat__value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-top: .3rem; }
.stat__hint { font-size: .8125rem; color: var(--ink-muted); margin-top: .15rem; }
.stat--accent { border-top: 3px solid var(--esmo-yellow); }

/* ========================================================================== buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem .95rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .875rem; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--esmo-yellow); color: var(--esmo-black); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--esmo-yellow-dark); }

.btn--dark { background: var(--esmo-black); color: #fff; }
.btn--dark:hover { background: #26282d; }

.btn--ghost { background: var(--surface-card); color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { background: #f7f8fa; border-color: var(--ink-faint); }

.btn--quiet { background: transparent; color: var(--ink-muted); }
.btn--quiet:hover { background: #eceef1; color: var(--ink); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #a52a26; }

.btn--sm { padding: .3rem .6rem; font-size: .8125rem; }
.btn--block { width: 100%; }
.btn__icon { width: 16px; height: 16px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ========================================================================== forms */
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.field__hint { font-size: .8125rem; color: var(--ink-muted); margin-top: .35rem; }
.field__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; }

.input, .textarea, .select {
  width: 100%;
  padding: .55rem .7rem;
  font-family: inherit;
  font-size: .9375rem;
  color: var(--ink);
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--esmo-yellow-dark);
  box-shadow: 0 0 0 3px rgba(255, 210, 0, .28);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.textarea { min-height: 96px; resize: vertical; }
.select { padding-right: 2rem; }

.input.input-validation-error, .textarea.input-validation-error, .select.input-validation-error {
  border-color: var(--danger);
}
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: .8125rem; }
.field-validation-error { display: block; margin-top: .3rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none; }

.checkbox, .radio { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; }
.checkbox input, .radio input { margin-top: .25rem; accent-color: var(--esmo-yellow-dark); width: 16px; height: 16px; flex: none; }

.option-card {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .75rem .85rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-card);
  transition: border-color .14s ease, background .14s ease;
}
.option-card:hover { border-color: var(--ink-faint); }
.option-card:has(input:checked) { border-color: var(--esmo-yellow-dark); background: var(--esmo-yellow-tint); }
.option-card input { margin-top: .2rem; accent-color: var(--esmo-yellow-dark); flex: none; }
.option-card__title { display: block; font-weight: 600; font-size: .875rem; }
.option-card__hint { display: block; font-size: .8125rem; color: var(--ink-muted); margin-top: .1rem; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .7rem; }

/* picker for multi-select lists (group members, contact groups) */
.picker {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  max-height: 320px; overflow-y: auto; background: var(--surface-card);
}
.picker__item {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .75rem; border-bottom: 1px solid var(--border); cursor: pointer;
}
.picker__item:last-child { border-bottom: 0; }
.picker__item:hover { background: #f7f8fa; }
.picker__item input { accent-color: var(--esmo-yellow-dark); width: 16px; height: 16px; flex: none; }
.picker__empty { padding: 1.25rem; text-align: center; color: var(--ink-muted); font-size: .875rem; }

/* ========================================================================== recipient picker */
.recipients {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  padding: .35rem .4rem; min-height: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-card); cursor: text;
}
.recipients.is-focused { border-color: var(--esmo-yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 0, .28); }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .3rem .2rem .55rem;
  background: #eef0f3; border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); font-size: .8125rem; max-width: 100%;
}
.chip--group { background: var(--esmo-yellow-tint); border-color: #e8d484; }
.chip__label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__sub { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip__remove {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-muted);
  line-height: 1; padding: 0 .25rem; font-size: 1rem; border-radius: var(--radius-pill);
}
.chip__remove:hover { background: rgba(0, 0, 0, .1); color: var(--ink); }

.recipients__input {
  flex: 1 1 130px; min-width: 130px; border: 0; outline: 0;
  font-family: inherit; font-size: .9375rem; padding: .25rem; background: transparent; color: var(--ink);
}

.combo { position: relative; }
.combo__menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-height: 300px; overflow-y: auto; padding: .25rem;
}
.combo__menu[hidden] { display: none; }
.combo__option {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .55rem; border-radius: var(--radius-sm); cursor: pointer;
}
.combo__option:hover, .combo__option.is-active { background: var(--esmo-yellow-tint); }
.combo__option-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.combo__option-label { font-weight: 600; font-size: .875rem; }
.combo__option-sub { font-size: .75rem; color: var(--ink-muted); }
.combo__empty { padding: .6rem .55rem; font-size: .8125rem; color: var(--ink-muted); }

/* ========================================================================== rich text editor */
.editor { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-card); }
.editor.is-focused { border-color: var(--esmo-yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 0, .28); }
.editor__toolbar {
  display: flex; flex-wrap: wrap; gap: .15rem; align-items: center;
  padding: .35rem; background: #fafbfc; border-bottom: 1px solid var(--border);
}
.editor__btn {
  border: 0; background: transparent; cursor: pointer;
  min-width: 30px; height: 30px; padding: 0 .4rem;
  border-radius: var(--radius-sm); color: var(--ink); font-family: inherit;
  font-size: .8125rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.editor__btn:hover { background: #e8eaee; }
.editor__btn.is-active { background: var(--esmo-yellow); }
.editor__sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 .25rem; }
.editor__surface {
  min-height: 300px; max-height: 620px; overflow-y: auto;
  padding: 1rem 1.1rem; outline: none; font-size: .9375rem; line-height: 1.6;
}
.editor__surface:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.editor__surface img { max-width: 100%; height: auto; }
.editor__surface blockquote {
  margin: .5rem 0; padding-left: .9rem; border-left: 3px solid var(--esmo-yellow); color: var(--ink-muted);
}
.editor__surface a { color: var(--info); }

.merge-tags { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .5rem; }
.merge-tag {
  border: 1px dashed var(--border-strong); background: var(--surface-card);
  border-radius: var(--radius-pill); padding: .15rem .55rem; font-family: ui-monospace, Consolas, monospace;
  font-size: .75rem; cursor: pointer; color: var(--ink-muted);
}
.merge-tag:hover { border-color: var(--esmo-yellow-dark); background: var(--esmo-yellow-tint); color: var(--ink); }

/* ========================================================================== attachments */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 1.4rem; text-align: center; background: #fafbfc;
  transition: border-color .14s ease, background .14s ease;
}
.dropzone.is-over { border-color: var(--esmo-yellow-dark); background: var(--esmo-yellow-tint); }
.dropzone__hint { font-size: .8125rem; color: var(--ink-muted); margin-top: .3rem; }
.dropzone__warning { font-size: .8125rem; color: var(--danger); font-weight: 600; margin-top: .5rem; }

.file-list { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.file-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-card); font-size: .875rem;
}
.file-item__name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item__size { color: var(--ink-muted); font-size: .8125rem; margin-left: auto; white-space: nowrap; }

/* ========================================================================== tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; font-size: .6875rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: .7rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfc; }
.table__actions { text-align: right; white-space: nowrap; }

.cell-primary { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.cell-primary__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cell-primary__title { font-weight: 600; }
.cell-primary__sub { font-size: .8125rem; color: var(--ink-muted); }

.avatar {
  width: 34px; height: 34px; flex: none; border-radius: var(--radius-pill);
  background: var(--esmo-black); color: var(--esmo-yellow);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.avatar--sm { width: 26px; height: 26px; font-size: .625rem; }
.avatar--yellow { background: var(--esmo-yellow); color: var(--esmo-black); }

/* ========================================================================== badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .5rem; border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 650; white-space: nowrap;
  background: #eef0f3; color: var(--ink-muted);
}
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--danger { background: var(--danger-tint); color: var(--danger); }
.badge--info { background: var(--info-tint); color: var(--info); }
.badge--yellow { background: var(--esmo-yellow-tint); color: #7a6300; }
.badge--muted { background: #eef0f3; color: var(--ink-faint); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag-list { display: flex; flex-wrap: wrap; gap: .25rem; }

/* ========================================================================== alerts */
.alert {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: 1.25rem; font-size: .875rem;
}
.alert--success { background: var(--ok-tint); border-color: #bfe3d4; color: #0d5f45; }
.alert--warn { background: var(--warn-tint); border-color: #f0dcb4; color: #7d4f00; }
.alert--danger { background: var(--danger-tint); border-color: #f2c4c2; color: #8f2622; }
.alert--info { background: var(--info-tint); border-color: #c6d8f6; color: #1f4a91; }
.alert__icon { flex: none; margin-top: 1px; }
.alert p { margin: 0; }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* ==========================================================================
   Identity default UI pages (Account -> Manage). They ship Bootstrap class
   names, so map the handful this app actually renders onto the ESMO look.
   ========================================================================== */
.identity-page { max-width: 900px; }
.identity-page h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.identity-page h2 { font-size: 1.15rem; margin-bottom: .75rem; }
.identity-page h3 { font-size: 1rem; margin-bottom: .5rem; }
.identity-page > h1 + p, .identity-page > p:first-of-type { color: var(--ink-muted); }
.identity-page hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.identity-page .row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.identity-page .row .row { display: block; }
.identity-page [class*="col-md-"], .identity-page [class*="col-lg-"] { min-width: 0; }

.identity-page .nav-pills { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; }
.identity-page .nav-pills .nav-link {
  display: block; padding: .5rem .7rem; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: .875rem; text-decoration: none;
}
.identity-page .nav-pills .nav-link:hover { background: #eceef1; text-decoration: none; }
.identity-page .nav-pills .nav-link.active { background: var(--esmo-yellow); color: var(--esmo-black); font-weight: 650; }

.identity-page .form-control, .identity-page select, .identity-page textarea:not(.textarea) {
  width: 100%; padding: .55rem .7rem; font-family: inherit; font-size: .9375rem; color: var(--ink);
  background: var(--surface-card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.identity-page .form-control:focus, .identity-page select:focus {
  outline: none; border-color: var(--esmo-yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 0, .28);
}
.identity-page .form-control:disabled { background: #f2f3f5; color: var(--ink-muted); }

/* Bootstrap floating labels put the label after the input; flip the visual order. */
.identity-page .form-floating { display: flex; flex-direction: column-reverse; margin-bottom: 1rem; }
.identity-page .form-floating > label { font-weight: 600; font-size: .875rem; margin: 0 0 .35rem; padding: 0; position: static; }
.identity-page .form-label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.identity-page .form-group, .identity-page .mb-3 { margin-bottom: 1rem; }

.identity-page .btn, .identity-page button[type="submit"], .identity-page .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem .95rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
  background: var(--esmo-yellow); color: var(--esmo-black); text-decoration: none;
}
.identity-page .btn:hover, .identity-page button[type="submit"]:hover { background: var(--esmo-yellow-dark); text-decoration: none; }
.identity-page .btn-danger { background: var(--danger); color: #fff; }
.identity-page .btn-danger:hover { background: #a52a26; }
.identity-page .w-100 { width: 100%; }

.identity-page .text-danger, .identity-page .validation-summary-errors { color: var(--danger); font-size: .8125rem; }
.identity-page .text-success { color: var(--ok); }
.identity-page .alert-success { background: var(--ok-tint); border: 1px solid #bfe3d4; color: #0d5f45; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.identity-page .alert-danger { background: var(--danger-tint); border: 1px solid #f2c4c2; color: #8f2622; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; }

.identity-page .list-group { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.identity-page .list-group-item { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.identity-page .list-group-item:last-child { border-bottom: 0; }

@media (max-width: 767px) {
  .identity-page .row { grid-template-columns: minmax(0, 1fr); }
  .identity-page .nav-pills { flex-direction: row; flex-wrap: wrap; }
}

/* ========================================================================== toolbar / filters */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .85rem 1.25rem; border-bottom: 1px solid var(--border);
}
.toolbar__search { position: relative; flex: 1 1 260px; min-width: 200px; }
.toolbar__search .input { padding-left: 2.2rem; }
.toolbar__search-icon {
  position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none; line-height: 0;
}
.toolbar__spacer { flex: 1; }

/* ========================================================================== empty + pagination */
.empty { padding: 3rem 1.5rem; text-align: center; }
.empty__icon { width: 46px; height: 46px; margin: 0 auto .75rem; color: var(--border-strong); }
.empty__title { font-weight: 700; margin-bottom: .25rem; }
.empty__text { color: var(--ink-muted); font-size: .875rem; margin-bottom: 1rem; }

.pagination { display: flex; align-items: center; gap: .5rem; }
.pagination__info { color: var(--ink-muted); font-size: .8125rem; margin-right: auto; }

/* ========================================================================== detail rows */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.1rem; font-size: .875rem; }
.detail-list dt { color: var(--ink-muted); }
.detail-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.email-preview {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem; background: #fff; overflow-x: auto;
  font-size: .9375rem; line-height: 1.6;
}
.email-preview img { max-width: 100%; height: auto; }

.progress { height: 6px; border-radius: var(--radius-pill); background: #e8eaee; overflow: hidden; }
.progress__bar { height: 100%; background: var(--esmo-yellow); transition: width .3s ease; }
.progress__bar--ok { background: var(--ok); }
.progress__bar--danger { background: var(--danger); }

/* ========================================================================== auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--esmo-black); }
.auth__aside {
  padding: 3rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 15% 15%, rgba(255, 210, 0, .16), transparent 62%),
    var(--esmo-black);
}
.auth__logo { width: min(330px, 80%); height: auto; }
.auth__tagline { font-size: 1.05rem; color: #b9bfc9; max-width: 34ch; margin-top: 1.6rem; line-height: 1.6; }
.auth__foot { font-size: .75rem; color: #6f7683; }

.auth__panel { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth__card .card__body { padding: 1.5rem; }
.auth__intro { color: var(--ink-muted); font-size: .875rem; margin-bottom: 1.4rem; }

/* Identity default UI ships Bootstrap class names; map the ones that matter. */
.auth__card .form-control {
  width: 100%; padding: .55rem .7rem; font-family: inherit; font-size: .9375rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.auth__card .form-control:focus { outline: none; border-color: var(--esmo-yellow-dark); box-shadow: 0 0 0 3px rgba(255, 210, 0, .28); }
/* Bootstrap floating labels put the label after the input; flip the visual order. */
.auth__card .form-floating { display: flex; flex-direction: column-reverse; margin-bottom: 1rem; }
.auth__card .form-floating > label { font-weight: 600; font-size: .875rem; margin: 0 0 .35rem; padding: 0; position: static; }
.auth__card .form-label { font-weight: 600; font-size: .875rem; }
.auth__card .btn-primary, .auth__card .btn-lg, .auth__card .w-100 {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--esmo-yellow); color: var(--esmo-black); border: 0;
  padding: .6rem 1rem; border-radius: var(--radius-sm); font-weight: 700; font-size: .9375rem;
  cursor: pointer; width: 100%; text-decoration: none; font-family: inherit;
}
.auth__card .btn-primary:hover, .auth__card .btn-lg:hover { background: var(--esmo-yellow-dark); }
.auth__card .checkbox label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.auth__card hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.auth__card h2 { font-size: 1rem; margin-bottom: .5rem; }
.auth__card ul { padding-left: 1.1rem; }
.auth__card .text-danger { color: var(--danger); font-size: .8125rem; }
.auth__links { display: flex; flex-direction: column; gap: .4rem; margin-top: 1rem; font-size: .875rem; }

/* ========================================================================== responsive */
@media (max-width: 1100px) {
  .grid--split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .page { padding: 1.25rem 1.1rem 3rem; }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { padding: 2rem 1.5rem; }
  .auth__tagline, .auth__foot { display: none; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions .btn { flex: 1; }
  .card__head { flex-direction: column; align-items: flex-start; }
  .table th, .table td { padding: .6rem .9rem; }
  .stat__value { font-size: 1.7rem; }
  .detail-list { grid-template-columns: 1fr; gap: .15rem .5rem; }
  .detail-list dd { margin-bottom: .6rem; }
}

@media print {
  .sidebar, .topbar, .page-head__actions, .card__foot, .scrim { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
}


/* ========================================================================== manual
   The in-app user manual. Reference layout: a contents column that sticks while the
   reader scrolls, and numbered sections so people can point each other at one.
   ========================================================================== */
.manual { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2rem; align-items: start; }

.manual__toc { position: sticky; top: 1rem; }

.manual__toc-label {
  font-size: .625rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-faint); font-weight: 700; margin-bottom: .5rem;
}

.manual__toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }

.manual__toc-link {
  display: grid; grid-template-columns: 1.4rem 1fr; gap: .4rem; align-items: baseline;
  padding: .3rem .5rem; border-radius: var(--radius-sm);
  color: var(--ink-muted); text-decoration: none; font-size: .82rem;
  border-left: 2px solid transparent;
}

.manual__toc-link:hover { background: var(--surface-card); color: var(--ink); border-left-color: var(--esmo-yellow); }

.manual__toc-num { font-family: ui-monospace, Consolas, monospace; font-size: .7rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.manual__body { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }

.manual__section { scroll-margin-top: 1rem; }

.manual__section h2 {
  display: flex; align-items: baseline; gap: .6rem;
  font-size: 1.15rem;
}

.manual__num {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem; font-weight: 500; color: var(--esmo-yellow-dark);
  font-variant-numeric: tabular-nums;
}

.manual__body h3 { font-size: .98rem; margin: 1.35rem 0 .4rem; }
.manual__body h3:first-child { margin-top: 0; }

.manual__body p { margin: 0 0 .7rem; }
.manual__body p:last-child { margin-bottom: 0; }

.manual__body ul, .manual__body ol { margin: 0 0 .7rem; padding-left: 1.15rem; }
.manual__body li { margin-bottom: .3rem; }

.manual__body code {
  font-family: ui-monospace, Consolas, monospace; font-size: .85em;
  background: var(--esmo-yellow-tint); border: 1px solid var(--border);
  border-radius: 4px; padding: .05em .35em; white-space: nowrap;
}

.manual__body pre {
  font-family: ui-monospace, Consolas, monospace; font-size: .8rem; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--esmo-yellow); border-radius: var(--radius-sm);
  padding: .7rem .85rem; overflow-x: auto; margin: 0 0 .7rem;
}

.manual__body pre code { background: none; border: 0; padding: 0; white-space: pre; }

.manual__path {
  display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: .76rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .3rem .55rem; color: var(--ink-muted); margin-bottom: .9rem;
}

.manual__path b { color: var(--ink); font-weight: 500; }

/* A numbered walk-through, for the few places order actually matters. */
.manual__steps { counter-reset: mstep; list-style: none; padding: 0; margin: 0 0 .7rem; }
.manual__steps li { counter-increment: mstep; position: relative; padding-left: 1.9rem; margin-bottom: .45rem; }
.manual__steps li::before {
  content: counter(mstep); position: absolute; left: 0; top: .1rem;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--esmo-yellow); color: #14161a;
  font-family: ui-monospace, Consolas, monospace; font-size: .7rem; font-weight: 600;
  display: grid; place-items: center;
}

@media (max-width: 900px) {
  .manual { grid-template-columns: 1fr; gap: 1rem; }
  .manual__toc { position: static; }
  .manual__toc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
