:root {
  --olive: #5f6f3e;
  --olive-dark: #3f4a2a;
  --sage: #9aaa7a;
  --sage-light: #dbe4c6;
  --beige: #d9c7a3;
  --cream: #f8f3e8;
  --warm-brown: #8a633f;
  --brown-dark: #5b3f2c;
  --charcoal: #2f332d;
  --muted: #737568;
  --line: #e5dccb;
  --white: #fffdf8;
  --danger: #a44734;
  --success: #537b49;
  --shadow: 0 20px 45px rgba(63, 74, 42, 0.14);
  --soft-shadow: 0 10px 24px rgba(47, 51, 45, 0.09);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  color: var(--charcoal);
  background:
    linear-gradient(135deg, rgba(219, 228, 198, 0.72), rgba(248, 243, 232, 0.92)),
    var(--cream);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(63, 74, 42, 0.9), rgba(95, 111, 62, 0.76)),
    var(--beige);
}

.auth-panel {
  width: min(430px, 100%);
  padding: 30px;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--cream);
  background: var(--olive-dark);
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark span {
  font-size: 0.9rem;
}

.brand-mark small {
  display: none;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--warm-brown);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 1.62rem;
  line-height: 1.16;
  text-align: center;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

h3 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

h4 {
  margin-bottom: 0;
  font-size: 1rem;
}

.auth-copy {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

.auth-form,
.modal-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.auth-location {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-switch {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.auth-switch button {
  padding: 4px 2px;
  color: var(--warm-brown);
  background: transparent;
  border: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--brown-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.password-field input {
  border-radius: 12px 0 0 12px;
}

.password-toggle {
  position: relative;
  width: 46px;
  min-width: 46px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #fbf7ef;
  color: var(--olive-dark);
}

.password-toggle::before,
.password-toggle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.password-toggle::before {
  width: 20px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.password-toggle::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle.hidden-password::after {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--danger);
  transform: translate(-50%, -50%) rotate(-38deg);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 4px rgba(95, 111, 62, 0.16);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
}

.primary-btn {
  color: var(--cream);
  background: var(--olive-dark);
  box-shadow: 0 8px 18px rgba(63, 74, 42, 0.22);
}

.secondary-btn {
  color: var(--olive-dark);
  background: var(--sage-light);
}

.ghost-btn {
  color: var(--olive-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.danger-btn {
  color: var(--cream);
  background: var(--danger);
}

.full-width {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  color: var(--cream);
  background: linear-gradient(180deg, var(--olive-dark), #59673a);
  overflow: hidden;
  transition: padding 0.22s ease, opacity 0.18s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(248, 243, 232, 0.08);
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(248, 243, 232, 0.72);
  font-size: 0.82rem;
}

.nav-list,
.mobile-nav {
  display: grid;
  gap: 8px;
}

.nav-section-label {
  margin: 12px 10px 2px;
  color: rgba(248, 243, 232, 0.58);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: inherit;
  text-align: left;
  background: rgba(248, 243, 232, 0.04);
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link.is-active,
.nav-link:hover {
  color: var(--olive-dark);
  background: var(--cream);
}

.nav-link:hover {
  transform: translateX(2px);
}

.nav-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--olive-dark);
  background: var(--sage-light);
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 900;
}

.nav-link.is-active .nav-icon,
.nav-link:hover .nav-icon {
  color: var(--cream);
  background: var(--olive-dark);
}

.nav-link-admin {
  color: var(--olive-dark);
  background: var(--cream);
  border: 1px solid rgba(248, 243, 232, 0.3);
}

.nav-link-admin .nav-icon {
  color: var(--cream);
  background: var(--warm-brown);
}

.main-column {
  position: relative;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.topbar > div:not(.topbar-actions) {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.role-badge {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--olive-dark);
  background: var(--sage-light);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.role-badge[data-role="administrator"] {
  color: var(--cream);
  background: var(--olive-dark);
}

.mobile-nav {
  display: none;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: var(--sage-light);
  border: 0;
  border-radius: 12px;
}

.icon-btn span {
  width: 18px;
  height: 2px;
  background: var(--olive-dark);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading,
.panel-heading,
.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.permission-panel {
  margin: 0;
  padding: 16px 18px;
  color: var(--charcoal);
  background: var(--sage-light);
  border-bottom: 1px solid var(--line);
}

.permission-panel strong {
  display: block;
  margin-bottom: 5px;
  color: var(--olive-dark);
}

.permission-panel p {
  margin: 0;
  color: var(--muted);
}

.admin-role-select {
  width: min(100%, 190px);
  min-height: 38px;
  padding: 8px 10px;
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
}

.admin-role-select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.admin-create-form {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
}

.admin-create-form strong {
  display: block;
  color: var(--olive-dark);
}

.admin-create-form p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-create-form input,
.admin-create-form select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.muted-action {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.summary-card,
.panel {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.summary-card {
  padding: 20px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  color: var(--olive-dark);
  font-size: clamp(2rem, 5vw, 3rem);
}

.summary-card.alert strong {
  color: var(--danger);
}

.modules-panel {
  margin-bottom: 18px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stage-card {
  overflow: hidden;
  background: #eef3e4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
}

.stage-card header {
  position: relative;
  z-index: 1;
  padding: 11px 12px;
  color: var(--cream);
  background: var(--olive-dark);
  font-weight: 800;
  text-align: center;
}

.stage-card header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.stage-body {
  margin-top: -1px;
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 26px 18px 18px;
  background: #eef3e4;
  text-align: center;
}

.stage-body strong {
  color: var(--charcoal);
  font-size: 1.05rem;
}

.stage-body span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.stage-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  color: var(--olive-dark);
}

.check-icon {
  border-radius: 50%;
  background: var(--olive-dark);
}

.check-icon::before {
  content: "";
  width: 30px;
  height: 16px;
  border-left: 8px solid var(--cream);
  border-bottom: 8px solid var(--cream);
  transform: rotate(-45deg) translate(3px, -2px);
}

.clock-icon {
  border: 6px solid var(--olive-dark);
  border-radius: 50%;
}

.clock-icon::before,
.clock-icon::after {
  content: "";
  position: absolute;
  background: var(--olive-dark);
  border-radius: 999px;
}

.clock-icon {
  position: relative;
}

.clock-icon::before {
  width: 5px;
  height: 20px;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
}

.clock-icon::after {
  width: 18px;
  height: 5px;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.flag-icon {
  position: relative;
}

.flag-icon::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 7px;
  width: 5px;
  height: 54px;
  background: var(--olive-dark);
}

.flag-icon::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 9px;
  width: 34px;
  height: 24px;
  background:
    linear-gradient(45deg, var(--cream) 25%, transparent 25%),
    linear-gradient(-45deg, var(--cream) 25%, transparent 25%),
    var(--olive-dark);
  background-size: 12px 12px;
  border: 2px solid var(--olive-dark);
}

.ring {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--olive-dark) var(--progress), var(--sage-light) 0);
}

.ring span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--charcoal);
  background: var(--cream);
  border-radius: 50%;
  font-weight: 800;
}

.content-grid,
.plans-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.compact-table table {
  min-width: 560px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--brown-dark);
  background: #f0e6d5;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: var(--charcoal);
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

.selected-row td {
  background: rgba(219, 228, 198, 0.36);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: var(--sage-light);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.danger {
  color: var(--cream);
  background: var(--danger);
}

.progress-list {
  display: grid;
  gap: 15px;
}

.progress-item {
  display: grid;
  gap: 8px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.progress-head span {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: var(--sage-light);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: var(--width);
  background: linear-gradient(90deg, var(--olive-dark), var(--sage));
  border-radius: inherit;
}

.progress-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.module-template-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #fbf7ef;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.module-template-card strong {
  color: var(--olive-dark);
}

.module-template-card span,
.module-template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.module-template-card span {
  font-weight: 800;
}

.actions-cell {
  width: 180px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--olive-dark);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
}

.table-actions .delete-action {
  color: var(--danger);
}

.details-panel {
  align-self: start;
}

.empty-state {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list span {
  color: var(--muted);
  font-weight: 700;
}

.item-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  background: #fbf7ef;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.item-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(47, 51, 45, 0.55);
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--cream);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.modal-form {
  padding: 22px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--olive-dark);
  background: var(--sage-light);
  border: 1px solid rgba(95, 111, 62, 0.2);
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.form-note.warning {
  color: var(--brown-dark);
  background: #f3e4c6;
  border-color: rgba(138, 99, 63, 0.24);
}

.form-note .ghost-btn {
  flex: 0 0 auto;
  background: var(--white);
}

.page-notice {
  margin-bottom: 16px;
}

.page-notice:empty {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.icon-close {
  width: 40px;
  height: 40px;
  color: var(--charcoal);
  background: var(--sage-light);
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(380px, calc(100vw - 40px));
  padding: 14px 16px;
  color: var(--cream);
  background: var(--charcoal);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.print-area {
  display: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--olive-dark);
  background: rgba(248, 243, 232, 0.62);
  backdrop-filter: blur(2px);
  font-weight: 800;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid var(--sage-light);
  border-top-color: var(--olive-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .summary-grid,
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-create-form > div,
  .admin-create-form button {
    grid-column: 1 / -1;
  }

  .content-grid,
  .plans-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-column {
    padding: 14px;
  }

  .mobile-nav.is-open {
    display: grid;
    margin: -10px 0 18px;
    padding: 12px;
    color: var(--olive-dark);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--soft-shadow);
  }

  .mobile-nav .nav-link.is-active,
  .mobile-nav .nav-link:hover {
    background: var(--sage-light);
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar > div:not(.topbar-actions) {
    flex-basis: calc(100% - 130px);
  }

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

  .section-heading .primary-btn,
  .section-heading .secondary-btn {
    width: 100%;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

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

@media (max-width: 560px) {
  .auth-panel {
    padding: 24px;
    border-radius: var(--radius);
  }

  .auth-panel h1 {
    font-size: 1.48rem;
    line-height: 1.18;
  }

  .auth-copy {
    margin-bottom: 18px;
    font-size: 0.94rem;
  }

  .summary-grid,
  .stage-grid,
  .module-template-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px;
    gap: 10px;
  }

  .topbar .secondary-btn {
    padding-inline: 12px;
  }

  .topbar > div:not(.topbar-actions) {
    flex-basis: 100%;
    order: 3;
  }

  .menu-toggle {
    order: 1;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
  }

  .panel {
    padding: 12px;
  }

  table {
    min-width: 620px;
  }

  .compact-table table {
    min-width: 520px;
  }

  .form-note {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: 94vh;
    border-radius: 18px;
  }

  .modal-form,
  .modal-header {
    padding: 16px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  body > :not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block !important;
    color: #2f332d;
    font-family: Arial, sans-serif;
  }

  .print-area h1 {
    margin: 0 0 2px;
    font-size: 18px;
    text-align: left;
  }

  .print-area p {
    margin: 0 0 8px;
    color: #737568;
  }

  .print-area h2 {
    margin: 0 0 8px;
    color: #3f4a2a;
    font-size: 16px;
  }

  .print-area h3 {
    margin: 10px 0 6px;
    color: #5b3f2c;
    font-size: 13px;
  }

  .print-area table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    border: 1px solid #8f826f;
    font-size: 11px;
    table-layout: fixed;
  }

  .print-area th,
  .print-area td {
    padding: 8px;
    border: 1px solid #8f826f !important;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
  }

  .print-area th {
    color: #3f4a2a;
    background: #dbe4c6;
  }

  .print-area tr:last-child td {
    border-bottom: 1px solid #8f826f !important;
  }

  .print-area thead {
    display: table-header-group;
  }

  .print-plan-group {
    break-inside: auto;
    page-break-inside: auto;
    margin-bottom: 8px;
  }

  .print-plan-group.page-break-after {
    break-after: auto;
    page-break-after: auto;
  }

  .plan-print h1 {
    font-size: 16px;
  }

  .plan-print p {
    margin-bottom: 6px;
    font-size: 9px;
  }

  .plan-print table {
    font-size: 8px;
    line-height: 1.15;
  }

  .plan-print th,
  .plan-print td {
    padding: 3px 4px;
  }

  .print-meta-table {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 6px;
  }

  .print-meta-table th {
    width: 10%;
  }

  .print-items-table th:nth-child(1) { width: 12%; }
  .print-items-table th:nth-child(2) { width: 18%; }
  .print-items-table th:nth-child(3) { width: 22%; }
  .print-items-table th:nth-child(4) { width: 12%; }
  .print-items-table th:nth-child(5) { width: 10%; }
  .print-items-table th:nth-child(6) { width: 7%; }
  .print-items-table th:nth-child(7) { width: 7%; }
  .print-items-table th:nth-child(8) { width: 12%; }
}
