/*
 * ACF Pilot 3.20.1 — Design system SaaS Premium
 * Couche de présentation réversible chargée après les styles historiques.
 */

:root {
  --navy: #071d3a;
  --deep: #06162c;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eef4ff;
  --ink: #0f1f3d;
  --muted: #64748b;
  --line: #dce5f0;
  --line-strong: #c9d5e4;
  --bg: #f4f7fb;
  --white: #fff;
  --green: #087a55;
  --green-soft: #e9f8f1;
  --warning: #92400e;
  --warning-soft: #fff7e6;
  --danger: #b42318;
  --danger-soft: #fef2f2;
  --focus: #93c5fd;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgb(15 31 61 / 4%), 0 10px 30px rgb(15 31 61 / 6%);
  --shadow-float: 0 24px 70px rgb(7 29 58 / 24%);
  --sidebar-width: 272px;
  --sidebar-collapsed: 84px;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

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

.ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.ui-icon path:not([fill="none"]),
svg.ui-icon circle,
svg.ui-icon rect {
  vector-effect: non-scaling-stroke;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 58%, transparent);
  outline-offset: 2px;
}

/* Connexion */
.login-shell {
  background:
    radial-gradient(circle at 78% 12%, rgb(37 99 235 / 15%), transparent 32%),
    radial-gradient(circle at 15% 92%, rgb(7 29 58 / 9%), transparent 34%),
    linear-gradient(145deg, #f8faff, #edf3fb);
}

.login-card {
  border-color: rgb(201 213 228 / 85%);
  border-radius: 24px;
  padding: 42px;
  box-shadow: 0 28px 80px rgb(15 31 61 / 14%);
}

.login-card h1 {
  color: var(--ink);
  font-size: 29px;
  letter-spacing: -.025em;
}

.login-card input {
  height: 48px;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
}

/* Structure principale */
#app.app-shell {
  min-height: 100vh;
}

#app .app-sidebar {
  z-index: 40;
  width: var(--sidebar-width);
  padding: 20px 14px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgb(37 99 235 / 24%), transparent 26%),
    linear-gradient(180deg, #0b2850 0%, var(--navy) 45%, var(--deep) 100%);
  box-shadow: 10px 0 40px rgb(7 29 58 / 8%);
}

#app .app-main {
  min-width: 0;
  margin-left: var(--sidebar-width);
  background: var(--bg);
}

#app .app-sidebar,
#app .app-main {
  transition: width .22s ease, margin-left .22s ease, transform .22s ease;
}

#app .app-brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 66px;
  margin: 0 0 14px;
  padding: 8px 11px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 12px 32px rgb(2 12 27 / 24%);
}

#app .app-brand img {
  width: 54px;
  height: 48px;
  object-fit: contain;
}

#app .app-brand > span {
  color: #163761;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
}

#app .app-sidebar nav {
  display: block;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 2px 8px 0;
  scrollbar-color: rgb(255 255 255 / 22%) transparent;
  scrollbar-width: thin;
}

#app .nav-section {
  display: grid;
  gap: 3px;
  margin: 0 0 6px;
}

#app .nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  width: 100%;
  margin: 0;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  color: #8fa9c9;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-align: left;
  text-transform: uppercase;
}

#app .nav-section-toggle:hover {
  color: #d9e6f7;
  background: rgb(255 255 255 / 5%);
}

#app .nav-section-toggle .ui-icon {
  width: 15px;
  height: 15px;
  transition: transform .18s ease;
}

#app .nav-section.is-collapsed .nav-section-toggle .ui-icon {
  transform: rotate(-90deg);
}

#app .nav-section-items {
  display: grid;
  gap: 3px;
}

#app .nav-section.is-collapsed .nav-section-items {
  display: none;
}

#app .app-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c5d4e7;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

#app .app-sidebar nav a:hover {
  border-color: rgb(255 255 255 / 8%);
  color: #fff;
  background: rgb(255 255 255 / 7%);
  transform: translateX(2px);
}

#app .app-sidebar nav a.active {
  border-color: rgb(147 197 253 / 35%);
  color: #fff;
  background: linear-gradient(135deg, #2f6cf0, #1d4ed8);
  box-shadow: 0 8px 22px rgb(0 19 58 / 34%);
}

#app .app-sidebar nav a i,
#app .logout i {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #afc5df;
  background: rgb(255 255 255 / 7%);
  font-style: normal;
}

#app .app-sidebar nav a i .ui-icon,
#app .logout i .ui-icon {
  width: 18px;
  height: 18px;
}

#app .app-sidebar nav a.active i {
  color: var(--blue);
  background: #fff;
}

#app .sidebar-collapse,
#app .logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  width: 100%;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius-sm);
  color: #afc2da;
  background: rgb(255 255 255 / 4%);
  font-size: 12px;
  font-weight: 650;
}

#app .sidebar-collapse:hover,
#app .logout:hover {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

#app .sidebar-collapse {
  margin: 4px 0 7px;
}

#app .sidebar-collapse .ui-icon {
  width: 17px;
  height: 17px;
  transition: transform .2s ease;
}

#app .app-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

#app .app-sidebar.collapsed ~ .app-main {
  margin-left: var(--sidebar-collapsed);
}

#app .app-sidebar.collapsed .app-brand {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 58px;
  padding: 5px;
}

#app .app-sidebar.collapsed .app-brand img {
  width: 100%;
  height: 46px;
}

#app .app-sidebar.collapsed .app-brand > span,
#app .app-sidebar.collapsed .nav-section-toggle,
#app .app-sidebar.collapsed nav a span,
#app .app-sidebar.collapsed .sidebar-collapse span,
#app .app-sidebar.collapsed .logout span {
  display: none;
}

#app .app-sidebar.collapsed .nav-section.is-collapsed .nav-section-items,
#app .app-sidebar.collapsed .nav-section-items {
  display: grid;
}

#app .app-sidebar.collapsed nav a {
  justify-content: center;
  padding: 0;
}

#app .app-sidebar.collapsed nav a i {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
}

#app .app-sidebar.collapsed .sidebar-collapse .ui-icon {
  transform: rotate(180deg);
}

.sidebar-backdrop {
  display: none;
}

/* Barre supérieure */
#app .app-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 76px;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgb(220 229 240 / 85%);
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 4px 18px rgb(15 31 61 / 3%);
  backdrop-filter: blur(16px);
}

#app .topbar-context {
  display: grid;
  gap: 2px;
  min-width: 0;
}

#app .topbar-context span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#app .topbar-context strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .topbar-spacer {
  flex: 1;
}

#app .topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

#app .topbar-user > div:last-child {
  display: grid;
  gap: 1px;
  font-size: 13px;
}

#app .topbar-user small {
  color: var(--muted);
  font-size: 11px;
}

#app .avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 3px solid #e7efff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, var(--blue-hover));
  box-shadow: 0 4px 12px rgb(37 99 235 / 24%);
  font-size: 12px;
  font-weight: 800;
}

#app .menu {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
}

#app .menu svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Contenu et composants partagés */
#app .app-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 42px);
}

#app .heading {
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 26px;
}

#app .heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(29px, 3vw, 38px);
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.1;
}

#app .heading .muted {
  max-width: 760px;
  margin-top: 9px;
  font-size: 14px;
}

#app .eyebrow {
  color: var(--blue);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .11em;
}

#app .panel,
#app .program-card,
#app .empty-state,
#app .session-table,
#app .learner-table {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

#app .panel {
  padding: 22px;
}

#app .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#app .panel-title h2,
#app .panel-title h3,
#app .panel h2,
#app .panel h3 {
  color: var(--ink);
  letter-spacing: -.015em;
}

#app .primary,
#app .secondary,
#app .danger,
#app .close-button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 15px;
  font-size: 13px;
  font-weight: 730;
  line-height: 1.2;
  transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

#app .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 16px rgb(37 99 235 / 18%);
  text-decoration: none;
}

#app .primary:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
  box-shadow: 0 9px 22px rgb(37 99 235 / 25%);
  transform: translateY(-1px);
}

#app .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: var(--line-strong);
  color: #1f3658;
  background: #fff;
}

#app .secondary:hover {
  border-color: #a9c2ec;
  color: var(--blue-hover);
  background: #f8fbff;
}

#app button:disabled {
  cursor: wait;
  box-shadow: none;
  opacity: .58;
  transform: none;
}

#app input,
#app select,
#app textarea {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
}

#app input,
#app select {
  min-height: 44px;
}

#app input:hover,
#app select:hover,
#app textarea:hover {
  border-color: #aebed2;
}

#app input:focus,
#app select:focus,
#app textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgb(147 197 253 / 32%);
}

#app .status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .01em;
}

#app .status-active,
#app .status-confirmed,
#app .status-completed {
  color: var(--green);
  background: var(--green-soft);
}

#app .status-draft,
#app .status-planned,
#app .status-in_progress {
  color: var(--warning);
  background: var(--warning-soft);
}

/* Tableau de bord */
#app .dashboard-shell {
  display: grid;
  gap: 18px;
}

#app .dashboard-shell .dashboard-heading,
#app .dashboard-shell .dashboard-month-kpis {
  margin-bottom: 0;
}

#app .dashboard-create {
  display: flex;
  gap: 10px;
}

#app .dashboard-create button {
  min-height: 44px;
}

#app .dashboard-create .ui-icon {
  width: 18px;
  height: 18px;
}

#app .dashboard-month-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

#app .dashboard-month-kpis .metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
}

#app .dashboard-month-kpis .metric-card::after {
  position: absolute;
  inset: auto -20px -30px auto;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgb(37 99 235 / 4%);
  content: "";
}

#app .dashboard-month-kpis .metric-card > i {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}

#app .dashboard-month-kpis .metric-card > i .ui-icon {
  width: 21px;
  height: 21px;
}

#app .dashboard-month-kpis .metric-card > span {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 670;
}

#app .dashboard-month-kpis .metric-card strong {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 790;
  letter-spacing: -.025em;
}

#app .dashboard-month-kpis .metric-card small {
  overflow: hidden;
  color: #8794a8;
  font-size: 10px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .dashboard-month-kpis .metric-card.quality > i {
  color: var(--green);
  background: var(--green-soft);
}

#app .dashboard-month-kpis .metric-card.quality::after {
  background: rgb(8 122 85 / 5%);
}

#app .dashboard-grid,
#app .dashboard-lower {
  gap: 18px;
}

#app .dashboard-planning,
#app .dashboard-alerts,
#app .dashboard-lower .panel {
  margin-top: 0;
}

#app .dashboard-session-item {
  border-color: #e8eef6;
  border-radius: 10px;
  padding: 13px 8px;
  transition: background .15s ease, transform .15s ease;
}

#app .dashboard-session-item:hover {
  background: #f8fbff;
  transform: translateX(2px);
}

#app .dashboard-date {
  border: 1px solid #dce7fb;
  background: #f0f5ff;
}

#app .dashboard-alert {
  width: 100%;
  border-color: var(--line);
  background: #fff;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

#app .dashboard-alert:hover {
  border-color: #b9c9df;
  background: #f9fbfe;
}

#app .activity-bars i {
  background: linear-gradient(180deg, #60a5fa, var(--blue));
}

/* Fenêtres et dossier de session */
#app ~ dialog,
dialog.program-dialog {
  border: 1px solid rgb(220 229 240 / 85%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

dialog.program-dialog::backdrop {
  background: rgb(5 20 42 / 68%);
  backdrop-filter: blur(5px);
}

.program-dialog .dialog-head {
  border-color: var(--line);
}

.program-dialog .dialog-head h2 {
  color: var(--ink);
  letter-spacing: -.02em;
}

.program-dialog .close-button {
  display: grid;
  width: 40px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  color: #324968;
  background: #f1f5f9;
}

.session-dossier-dialog {
  width: min(1320px, 97vw);
  max-width: 1320px;
  max-height: 94vh;
}

.session-dossier-dialog .enrollment-shell {
  max-height: 92vh;
  padding: 0 26px 28px;
  overflow: auto;
}

.session-dossier-dialog .dossier-dialog-head {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 0 -26px 18px;
  padding: 22px 26px 18px;
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
}

.dossier-readiness {
  align-items: center;
  margin-bottom: 9px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.dossier-readiness.incomplete {
  border-color: #f0d7a0;
  color: var(--warning);
  background: var(--warning-soft);
}

.dossier-readiness.complete {
  border-color: #bfe7d6;
  color: var(--green);
  background: var(--green-soft);
}

.dossier-disclaimer {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
}

.dossier-progress {
  display: flex;
  gap: 0;
  margin: 0 0 20px;
  padding: 3px 2px 10px;
  overflow-x: auto;
  scrollbar-color: #cbd8e8 transparent;
  scrollbar-width: thin;
}

.dossier-step {
  position: relative;
  display: grid;
  flex: 1 0 98px;
  align-content: start;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 70px;
  padding: 0 5px;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  text-align: center;
}

.dossier-step::before {
  position: absolute;
  top: 17px;
  right: 50%;
  left: -50%;
  z-index: 0;
  height: 2px;
  background: #dce5f0;
  content: "";
}

.dossier-step:first-child::before {
  display: none;
}

.dossier-step span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #607089;
  background: #e5ebf3;
  box-shadow: 0 0 0 1px #d3deeb;
  font-size: 11px;
  font-weight: 820;
}

.dossier-step.done {
  color: var(--green);
  background: transparent;
}

.dossier-step.done::before {
  background: #79c6aa;
}

.dossier-step.done span {
  color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.dossier-step.next {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dossier-step.next span {
  color: var(--warning);
  background: #ffefc7;
  box-shadow: 0 0 0 2px #e8b85a;
}

.dossier-step small {
  position: relative;
  z-index: 1;
  max-width: 108px;
  font-size: 10px;
  font-weight: 690;
  line-height: 1.25;
}

.dossier-grid {
  grid-template-columns: minmax(250px, .56fr) minmax(0, 1.44fr);
  gap: 18px;
}

.dossier-grid > .panel {
  border-radius: var(--radius-md);
  box-shadow: none;
}

.dossier-summary {
  align-self: start;
  background: #f8fafc;
}

.dossier-summary dl {
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 16px 0 20px;
  font-size: 12px;
}

.dossier-summary dd {
  overflow-wrap: anywhere;
}

.dossier-shortcuts {
  gap: 7px;
}

.dossier-shortcuts .secondary {
  justify-content: flex-start;
  width: 100%;
}

.dossier-documents > .panel-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.dossier-download-bundle .ui-icon {
  width: 17px;
  height: 17px;
}

.document-workflow-grid {
  display: grid;
  gap: 9px;
}

.document-workflow-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.document-workflow-card > .document-workflow-main {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 11px 12px;
}

.document-workflow-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.document-workflow-title > i {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
}

.document-workflow-title > i .ui-icon {
  width: 17px;
  height: 17px;
}

.document-workflow-title > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.document-workflow-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-workflow-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-workflow-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.document-workflow-actions .secondary,
.document-workflow-actions .primary {
  min-height: 36px;
  padding: 0 11px;
  font-size: 11px;
  white-space: nowrap;
}

.document-workflow-card > .document-workflow-details {
  border-top: 1px solid #edf1f6;
  background: #fafcff;
}

.document-workflow-details > summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
  list-style: none;
}

.document-workflow-details > summary::-webkit-details-marker,
.generated-document-history > summary::-webkit-details-marker {
  display: none;
}

.document-workflow-details > summary .ui-icon {
  width: 14px;
  height: 14px;
  transition: transform .18s ease;
}

.document-workflow-details[open] > summary .ui-icon {
  transform: rotate(180deg);
}

.document-workflow-options {
  padding: 0 12px 12px;
}

.document-workflow-form {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(150px, .9fr) minmax(180px, 1.3fr) auto;
  gap: 8px;
  margin-top: 0;
}

.document-workflow-form input,
.document-workflow-form select,
.document-workflow-form button {
  min-height: 38px;
}

.convention-return-form {
  margin-top: 10px;
  padding-top: 10px;
}

.generated-document-history {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.generated-document-history > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  color: #29415f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.generated-document-history > summary span {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
}

.generated-document-history .generated-document-list {
  gap: 0;
  padding: 0 12px 12px;
}

.generated-document-list > a {
  border-width: 1px 0 0;
  border-radius: 0;
  padding: 10px 2px;
}

.dossier-supporting-documents {
  border-radius: var(--radius-md);
  box-shadow: none;
}

/* Responsive */
@media (max-width: 1280px) {
  #app .dashboard-month-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #app .dashboard-month-kpis .metric-card:nth-last-child(-n + 2) {
    grid-column: span 1;
  }

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

  .dossier-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .5fr);
    gap: 0 20px;
  }

  .dossier-summary h3 {
    grid-column: 1 / -1;
  }

  .dossier-summary dl {
    margin-bottom: 0;
  }

  .dossier-shortcuts {
    align-content: center;
  }
}

@media (max-width: 1040px) {
  #app .dashboard-month-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app .dashboard-month-kpis .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .document-workflow-card > .document-workflow-main {
    grid-template-columns: minmax(200px, 1fr) auto;
  }

  .document-workflow-actions {
    grid-column: 1 / -1;
  }

  .document-workflow-actions > * {
    flex: 1;
  }

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

@media (max-width: 760px) {
  :root {
    --sidebar-width: 272px;
  }

  #app .app-sidebar,
  #app .app-sidebar.collapsed {
    z-index: 60;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-104%);
  }

  #app .app-sidebar.open,
  #app .app-sidebar.collapsed.open {
    transform: translateX(0);
  }

  #app .app-sidebar.collapsed .app-brand {
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 66px;
    padding: 8px 11px;
  }

  #app .app-sidebar.collapsed .app-brand img {
    width: 54px;
    height: 48px;
  }

  #app .app-sidebar.collapsed .app-brand > span,
  #app .app-sidebar.collapsed .nav-section-toggle,
  #app .app-sidebar.collapsed nav a span,
  #app .app-sidebar.collapsed .logout span {
    display: initial;
  }

  #app .app-sidebar.collapsed .nav-section-toggle {
    display: flex;
  }

  #app .app-sidebar.collapsed nav a {
    justify-content: flex-start;
    padding: 0 10px;
  }

  #app .app-sidebar.collapsed .sidebar-collapse {
    display: none;
  }

  #app .app-main,
  #app .app-sidebar.collapsed ~ .app-main {
    margin-left: 0;
  }

  #app .app-sidebar.open + .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    border: 0;
    background: rgb(5 20 42 / 56%);
    backdrop-filter: blur(2px);
  }

  #app .app-topbar {
    height: 68px;
    padding: 0 16px;
  }

  #app .menu {
    display: grid;
  }

  #app .topbar-context span {
    display: none;
  }

  #app .topbar-user > div:last-child {
    display: none;
  }

  #app .app-content {
    padding: 24px 16px 36px;
  }

  #app .heading {
    align-items: stretch;
    flex-direction: column;
  }

  #app .heading h1 {
    font-size: 30px;
  }

  #app .dashboard-create {
    width: 100%;
  }

  #app .dashboard-create button {
    flex: 1;
  }

  #app .dashboard-grid,
  #app .dashboard-lower {
    grid-template-columns: 1fr;
  }

  .session-dossier-dialog {
    width: calc(100vw - 16px);
    max-height: 96vh;
  }

  .session-dossier-dialog .enrollment-shell {
    max-height: 94vh;
    padding: 0 16px 22px;
  }

  .session-dossier-dialog .dossier-dialog-head {
    margin: 0 -16px 16px;
    padding: 17px 16px 14px;
  }

  .dossier-readiness {
    align-items: stretch;
    flex-direction: column;
  }

  .dossier-summary {
    display: block;
  }

  .dossier-summary dl {
    margin-bottom: 18px;
  }

  .dossier-documents > .panel-title {
    flex-direction: column;
  }

  .dossier-download-bundle {
    width: 100%;
  }

  .document-workflow-card > .document-workflow-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .document-workflow-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 520px) {
  #app .dashboard-month-kpis {
    grid-template-columns: 1fr;
  }

  #app .dashboard-month-kpis .metric-card:last-child {
    grid-column: auto;
  }

  #app .dashboard-create {
    display: grid;
    grid-template-columns: 1fr;
  }

  #app .dashboard-session-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  #app .dashboard-session-item > .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .document-workflow-card > .document-workflow-main {
    grid-template-columns: 1fr;
  }

  .document-workflow-main > .status-pill {
    justify-self: start;
    margin-left: 44px;
  }

  .document-workflow-actions {
    grid-template-columns: 1fr;
  }

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

  .dossier-summary dl {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
