:root {
  color-scheme: light;
  --bg: #f3eadc;
  --bg-strong: #eadfce;
  --surface: rgba(255, 251, 246, 0.82);
  --surface-solid: #fffaf5;
  --surface-strong: #fffdf9;
  --ink: #201815;
  --muted: #6f6258;
  --line: rgba(32, 24, 21, 0.1);
  --line-strong: rgba(32, 24, 21, 0.16);
  --accent: #c65a3d;
  --accent-strong: #a9452b;
  --accent-soft: #f4dccf;
  --accent-glow: rgba(198, 90, 61, 0.22);
  --teal: #195f57;
  --teal-soft: #d9ece8;
  --gold: #c2952d;
  --danger: #ba4336;
  --success: #1d6a50;
  --warning: #9c6217;
  --shadow-lg: 0 28px 80px rgba(48, 29, 16, 0.14);
  --shadow-md: 0 18px 42px rgba(48, 29, 16, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(198, 90, 61, 0.18), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(25, 95, 87, 0.16), transparent 24%),
    linear-gradient(180deg, var(--surface-solid) 0%, var(--bg) 55%, var(--bg-strong) 100%);
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(16px);
}

body::before {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(198, 90, 61, 0.2), transparent 72%);
}

body::after {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(25, 95, 87, 0.18), transparent 70%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  isolation: isolate;
}

.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  z-index: -1;
}

.login-page::before {
  width: 420px;
  height: 420px;
  top: 10%;
  left: 8%;
  background: radial-gradient(circle, rgba(25, 95, 87, 0.18), transparent 68%);
}

.login-page::after {
  width: 480px;
  height: 480px;
  right: 6%;
  bottom: 4%;
  background: radial-gradient(circle, rgba(198, 90, 61, 0.18), transparent 68%);
}

.login-box {
  width: min(460px, 100%);
  padding: 34px;
  border-radius: var(--radius-xl);
  background: rgba(255, 251, 246, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), #d59047, var(--teal));
}

.login-kicker,
.brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 800;
}

.login-kicker {
  color: var(--accent);
  margin-bottom: 16px;
}

.login-box h1 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: clamp(34px, 5vw, 42px);
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
}

.login-note {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.login-box input,
.search-input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.login-box input,
.search-input {
  height: 50px;
  padding: 0 16px;
}

.login-box input {
  margin-bottom: 14px;
}

.login-box input:focus,
.search-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(198, 90, 61, 0.44);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(198, 90, 61, 0.12), 0 12px 30px rgba(198, 90, 61, 0.08);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(228, 221, 214, 0.65);
}

.error {
  color: var(--danger);
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  min-height: 20px;
}

.app {
  min-height: 100vh;
  display: flex;
  gap: 20px;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 280px;
  position: fixed;
  top: 18px;
  left: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  color: #fff6ef;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(21, 34, 32, 0.97), rgba(10, 19, 18, 0.95));
  box-shadow: 0 24px 60px rgba(14, 17, 16, 0.35);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 180px;
  background: linear-gradient(160deg, rgba(198, 90, 61, 0.22), transparent 55%);
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #d69848);
  color: #fff8f2;
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-weight: 700;
  letter-spacing: -0.06em;
  font-size: 22px;
  box-shadow: 0 18px 34px rgba(198, 90, 61, 0.28);
}

.brand-copy h2 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #fff8f2;
}

.brand-kicker {
  color: rgba(255, 244, 234, 0.62);
  margin-bottom: 7px;
}

.user-name {
  display: block;
  margin-top: 8px;
  color: rgba(255, 244, 234, 0.74);
  font-size: 13px;
  line-height: 1.4;
}

.nav-menu {
  list-style: none;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-menu a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 13px 18px;
  border-radius: 18px;
  color: rgba(255, 244, 234, 0.74);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.nav-menu a::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
  transition: inherit;
  flex: none;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: #fffdf8;
  transform: translateX(4px);
  background: linear-gradient(135deg, rgba(198, 90, 61, 0.22), rgba(25, 95, 87, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 16px 30px rgba(0, 0, 0, 0.18);
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
  background: #ffe7d7;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.logout-btn {
  margin: 12px 6px 4px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff1ea;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.logout-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 187, 173, 0.35);
  background: rgba(186, 67, 54, 0.16);
}

.content {
  flex: 1;
  margin-left: 302px;
  padding: 2px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section {
  position: relative;
  padding: 26px 28px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.76), rgba(255, 248, 241, 0.94));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  overflow-x: auto;
  animation: rise 0.55s ease both;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 130px;
  background: linear-gradient(135deg, rgba(198, 90, 61, 0.09), transparent 46%, rgba(25, 95, 87, 0.08));
  pointer-events: none;
}

.section > * {
  position: relative;
  z-index: 1;
}

.section h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  min-width: 280px;
}

.btn-primary,
.btn-secondary,
.btn-sm,
.modal-close {
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary,
.btn-secondary {
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.btn-primary {
  color: #fff9f4;
  background: linear-gradient(135deg, var(--accent), #d79245);
  box-shadow: 0 16px 32px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(198, 90, 61, 0.28);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(32, 24, 21, 0.08);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
}

.btn-sm {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  margin-right: 6px;
}

.btn-sm:hover {
  transform: translateY(-1px);
}

.btn-edit {
  background: rgba(194, 149, 45, 0.16);
  color: var(--warning);
}

.btn-delete {
  background: rgba(186, 67, 54, 0.12);
  color: var(--danger);
}

.btn-history {
  background: rgba(25, 95, 87, 0.12);
  color: var(--teal);
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.dash-card {
  position: relative;
  min-height: 144px;
  padding: 22px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 241, 0.9));
  box-shadow: 0 18px 36px rgba(54, 34, 21, 0.08);
}

.dash-card::before {
  content: '';
  position: absolute;
  width: 130px;
  height: 130px;
  top: -34px;
  right: -28px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(198, 90, 61, 0.18), transparent 68%);
}

.dash-card:nth-child(3n)::before {
  background: radial-gradient(circle, rgba(25, 95, 87, 0.18), transparent 68%);
}

.dash-card:nth-child(4n)::before {
  background: radial-gradient(circle, rgba(194, 149, 45, 0.18), transparent 68%);
}

.dash-card .label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dash-card .value {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.table-scroll {
  margin: 0 -4px -4px;
  padding: 6px 4px 4px;
  overflow-x: auto;
}

.table-scroll::-webkit-scrollbar,
body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-scroll::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(32, 24, 21, 0.18);
  border-radius: 999px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0 12px;
  background: transparent;
  box-shadow: none;
}

.data-table thead th {
  padding: 0 16px 2px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: transparent;
  border: none;
}

.data-table tbody td {
  padding: 16px;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(32, 24, 21, 0.06);
  transition: background 0.25s ease;
}

.data-table tbody td:first-child {
  border-left: 1px solid rgba(32, 24, 21, 0.06);
  border-radius: 18px 0 0 18px;
  font-weight: 700;
}

.data-table tbody td:last-child {
  border-right: 1px solid rgba(32, 24, 21, 0.06);
  border-radius: 0 18px 18px 0;
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.97);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.badge-active {
  color: var(--success);
  background: rgba(29, 106, 80, 0.12);
}

.badge-completed {
  color: var(--teal);
  background: rgba(25, 95, 87, 0.12);
}

.badge-cancelled,
.badge-inactive {
  color: var(--danger);
  background: rgba(186, 67, 54, 0.12);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(22, 17, 14, 0.38);
  backdrop-filter: blur(10px);
}

.modal-content {
  width: min(820px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.97), rgba(255, 248, 241, 0.94));
  box-shadow: 0 30px 90px rgba(30, 19, 12, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(198, 90, 61, 0.08), rgba(25, 95, 87, 0.08));
}

.modal-header h2 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(32, 24, 21, 0.06);
  color: var(--muted);
  font-size: 24px;
}

.modal-close:hover {
  background: rgba(32, 24, 21, 0.1);
  color: var(--ink);
}

#modal-body {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

#modal-body .form-group {
  margin-bottom: 0;
}

#modal-body .form-group:has(textarea),
#modal-body .form-group:has(input[type='file']),
#modal-body .form-group:has(.form-hint),
#modal-body .form-group:has(.document-list),
#modal-body .form-group:has(.input-with-action),
#modal-body .form-group:has(.contract-inline-summary),
#modal-body .form-group:has(.contract-payment-list),
#modal-body .form-group:has([data-contract-programs]) {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  min-height: 48px;
  padding: 12px 14px;
}

.form-group select[multiple] {
  min-height: 146px;
}

.form-group input[readonly] {
  background: rgba(248, 243, 238, 0.95);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  padding-top: 14px;
}

.input-with-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-with-action input {
  flex: 1;
}

.input-with-action .btn-secondary {
  min-width: 132px;
}

.form-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-hint {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(25, 95, 87, 0.08);
  color: var(--teal);
  font-size: 13px;
  line-height: 1.55;
}

.document-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.history-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.history-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(32, 24, 21, 0.08);
}

.history-time {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-description {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.history-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-text-list {
  display: grid;
  gap: 12px;
}

.history-text-entry {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(32, 24, 21, 0.08);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.contract-inline-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contract-inline-summary div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(32, 24, 21, 0.08);
}

.contract-inline-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contract-inline-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.contract-program-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(32, 24, 21, 0.08);
}

.contract-program-card + .contract-program-card {
  margin-top: 14px;
}

.contract-program-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.contract-program-header strong {
  font-size: 15px;
  color: var(--ink);
}

.contract-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.contract-payment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.contract-payment-item {
  display: grid;
  grid-template-columns: minmax(120px, 140px) minmax(110px, 140px) minmax(120px, 1fr) minmax(180px, 2fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(32, 24, 21, 0.08);
  color: var(--ink);
  font-size: 14px;
}

.contract-payment-item strong {
  font-size: 15px;
}

.document-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(32, 24, 21, 0.08);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, background 0.2s ease;
}

.document-list a::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  flex: none;
}

.document-list a:hover {
  transform: translateX(2px);
  background: #fff;
}

.modal-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.42);
}

::placeholder {
  color: #9f9288;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .sidebar {
    width: 260px;
  }

  .content {
    margin-left: 282px;
  }

  .section {
    padding: 22px;
  }
}

@media (max-width: 920px) {
  .app {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .sidebar {
    position: sticky;
    top: 12px;
    left: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    border-radius: 26px;
  }

  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }

  .nav-menu li {
    flex: 0 0 auto;
  }

  .nav-menu a {
    white-space: nowrap;
  }

  .content {
    margin-left: 0;
    padding: 0 0 12px;
  }

  .section-actions {
    width: 100%;
  }

  .search-input {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-table {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 16px;
  }

  .login-box {
    padding: 26px 20px;
    border-radius: 24px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 19px;
  }

  .section {
    padding: 18px;
    border-radius: 24px;
  }

  .section h1 {
    font-size: 26px;
  }

  .section-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section-actions > * {
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 12px;
  }

  .modal-header,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  #modal-body {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .input-with-action {
    flex-direction: column;
    align-items: stretch;
  }

  .input-with-action .btn-secondary {
    width: 100%;
  }

  .contract-inline-summary,
  .contract-program-grid,
  .contract-payment-item {
    grid-template-columns: 1fr;
  }
}
