* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #172033;
    background: #f4f7fb;
}

.login-body {
    background: #FFA7A7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dashboard-body,
.portal-body {
    background: #FFA7A7;
    min-height: 100vh;
}

.login-shell,
.dashboard-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.admin-sidebar {
    background: linear-gradient(180deg, #FEDCDC 0%, #f6c9c9 100%);
    color: #172033;
    padding: 28px 18px;
    box-shadow: 16px 0 34px rgba(17, 45, 92, 0.14);
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.admin-sidebar-brand strong,
.admin-sidebar-brand span {
    display: block;
}

.admin-sidebar-brand span {
    opacity: 0.82;
    font-size: 0.9rem;
}

.admin-sidebar-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    padding: 6px;
}

.admin-sidebar-nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #172033;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.35);
}

.admin-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.58);
}

.admin-sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.admin-main {
    padding: 28px 28px 42px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-page-subtitle {
    margin: 8px 0 0;
    color: #5d6c82;
    max-width: 720px;
}

.admin-stats {
    margin-top: 0;
}

.admin-content-stack {
    display: grid;
    gap: 22px;
}

.admin-hero {
    margin-bottom: 20px;
}

.admin-hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(42, 116, 255, 0.16), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.admin-hero-card h2 {
    margin: 10px 0 8px;
    font-size: 2rem;
}

.admin-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-card-red { background: #df4b59; }
.admin-card-slate { background: #65707d; }
.admin-card-teal { background: #18a8bf; }
.admin-card-gold { background: #f0b315; color: #4a3800; }

.module-grid,
.admin-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.admin-page-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
}

.single-report-grid {
    grid-template-columns: 1fr;
}

.module-card {
    display: grid;
    gap: 14px;
    min-height: 220px;
}

.dashboard-actions-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.compact-module-card {
    min-height: 150px;
}

.stacked-actions {
    display: grid;
    gap: 10px;
}

.module-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.summary-list,
.notice-stack {
    display: grid;
    gap: 14px;
}

.summary-list-item,
.notice-card {
    padding: 16px;
    border: 1px solid #e1e9f5;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.summary-list-item strong {
    display: block;
    margin-top: 4px;
    font-size: 1.35rem;
}

.notice-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-link-row {
    margin-top: 16px;
}

.notice-card-danger {
    border-color: #f3cad1;
    background: #fff7f8;
}

.notice-card-warning {
    border-color: #f1dfb0;
    background: #fffaf0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.status-pending {
    background: #eef4ff;
    color: #31537d;
}

.status-completed,
.status-checked {
    background: #e8f8ef;
    color: #1a7444;
}

.status-high {
    background: #fde8ec;
    color: #b32743;
}

.status-medium {
    background: #fff4d8;
    color: #8a6500;
}

.status-low {
    background: #ebf8f0;
    color: #1a7444;
}

.status-visit {
    background: #f0f4fa;
    color: #42536a;
}

.report-chart-box {
    min-height: 320px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    align-items: center;
}

.centered-login {
    max-width: 760px;
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

.login-page-brand {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.login-page-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: 0 16px 34px rgba(131, 61, 71, 0.14);
    overflow: hidden;
    flex: 0 0 112px;
}

.login-page-copy {
    display: grid;
    gap: 10px;
    justify-items: start;
    align-content: start;
    padding-top: 2px;
}

.login-page-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1;
}

.login-page-copy p {
    margin: 0;
    max-width: 520px;
    color: rgba(23, 32, 51, 0.74);
    font-size: 1rem;
    line-height: 1.55;
}

.login-page-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0d5cd7;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    min-width: 94px;
    min-height: 40px;
    margin: 0 0 4px;
}

.centered-login .login-panel {
    width: 100%;
    margin: 0 auto;
    max-width: 700px;
}

.login-brand-shell {
    display: flex;
    align-items: center;
    min-height: auto;
    margin-bottom: 18px;
}

.login-brand-heading {
    min-height: auto;
}

.login-brand-heading h2 {
    margin: 8px 0 0;
    line-height: 1.1;
}

.login-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex: 0 0 auto;
    display: block;
}

.login-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 100%);
    color: #0d5cd7;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.gateway-shell {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 24px;
    display: grid;
    gap: 20px;
    align-content: center;
}

.gateway-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.gateway-list {
    margin: 0 0 20px;
    padding-left: 18px;
    color: #67768a;
}

.gateway-card .btn {
    width: 100%;
}

.gateway-actions {
    display: grid;
    gap: 10px;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 14px 30px rgba(18, 42, 77, 0.08);
}

.two-col > .card:first-child {
    width: calc(100% + 260px);
    max-width: none;
}

.badge,
.pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0d5cd7;
    font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.feature-list,
.quick-stats,
.stats-grid,
.two-col,
.chart-grid,
.records-layout,
.flow-grid,
.tag-list {
    display: grid;
    gap: 16px;
}

.feature-list,
.quick-stats,
.flow-grid {
    grid-template-columns: repeat(3, 1fr);
}

.feature-item,
.flow-item,
.quick-stats div {
    padding: 16px;
    border: 1px solid #e3eaf4;
    border-radius: 14px;
    background: #fbfdff;
}

.feature-item strong,
.flow-item strong,
.quick-stats strong {
    display: block;
    margin-bottom: 8px;
}

.muted {
    color: #67768a;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.birthdate-age-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-choice {
    display: grid;
    gap: 10px;
}

.role-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.role-option input {
    width: auto;
    margin: 0;
}

.patient-extra {
    grid-template-columns: 1fr 1fr;
}

label {
    display: grid;
    gap: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    background: #fff;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus,
.custom-select-trigger:focus {
    outline: none;
    border-color: #9db9df;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.14);
}

input.field-invalid,
select.field-invalid,
textarea.field-invalid,
.custom-select.field-invalid .custom-select-trigger {
    border-color: #d93025;
    background: #fff2f2;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.14);
}

input.field-invalid::placeholder,
textarea.field-invalid::placeholder {
    color: #bf5f5f;
}

label:has(.field-invalid) > span,
label:has(.custom-select.field-invalid) > span {
    color: #b42318;
}

textarea {
    resize: vertical;
}

.hidden {
    display: none !important;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.custom-select-trigger.placeholder #roleTriggerText {
    color: #5f6f85;
}

.custom-select.open .custom-select-trigger {
    border-color: #b8cae3;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
}

.custom-select.field-invalid.open .custom-select-trigger {
    border-color: #d93025;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.14);
}

.custom-select-arrow {
    flex: 0 0 auto;
    color: #172033;
    font-size: 0.95rem;
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid #d7e1ee;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(18, 42, 77, 0.14);
}

.custom-select-option {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus,
.custom-select-option.active {
    background: #f3f7fd;
    color: #172033;
}

.otp-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.btn.primary,
.btn.small {
    background: #0d6efd;
    color: #fff;
}

.btn.secondary {
    background: #eaf2ff;
    color: #0d5cd7;
}

.btn.danger {
    background: #e54761;
    color: #fff;
}

.btn.small {
    padding: 8px 10px;
    font-size: 0.9rem;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
}

.alert.info {
    background: #eef4ff;
    color: #31537d;
}

.alert.success {
    background: #e8f8ef;
    color: #1a7444;
}

.alert.error {
    background: #fde8ec;
    color: #b32743;
}

.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1000;
    width: min(420px, calc(100% - 32px));
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(18, 42, 77, 0.16);
    transform: translateX(-50%);
    animation: toast-in-out 3s ease-in-out forwards;
}

.toast.success {
    background: #e8f8ef;
    color: #1a7444;
}

.toast.error {
    background: #fde8ec;
    color: #b32743;
}

.toast.info {
    background: #eef4ff;
    color: #31537d;
}

@keyframes toast-in-out {
    0% {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
    10%,
    85% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -12px);
        visibility: hidden;
    }
}

.helper {
    margin-bottom: 0;
    color: #67768a;
}

.hidden {
    display: none !important;
}

.topbar,
.portal-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    min-height: 132px;
    margin-bottom: 22px;
}

.brand-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 125px;
}

.brand-logo {
    width: 125px;
    height: 125px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-heading h1 {
    margin: 8px 0 0;
    line-height: 1.1;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hero-grid,
.two-col,
.records-layout {
    grid-template-columns: 1.2fr 0.8fr;
    margin-top: 28px;
}

.single-col {
    grid-template-columns: 1fr;
}

.hero-card h2 {
    font-size: 2rem;
}

.tag-list {
    grid-template-columns: repeat(5, 1fr);
}

.tag-list span {
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff5ff;
    text-align: center;
    font-weight: 700;
}

.stats-grid {
    grid-template-columns: repeat(4, 1fr);
    margin: 18px 0;
}

.stat-card {
    border-radius: 18px;
    padding: 18px;
    color: #fff;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.blue { background: #0d6efd; }
.green { background: #198754; }
.amber { background: #f2b100; color: #443200; }
.cyan { background: #1fb8d8; }

.chart-grid {
    grid-template-columns: 1fr;
}

.combined-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-panel h4 {
    margin: 0 0 12px;
}

canvas {
    width: 100% !important;
    height: 280px !important;
}

.record-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.record-type-sections {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
}

.form-section {
    padding: 16px;
    border: 1px solid #e3eaf4;
    border-radius: 16px;
    background: #fbfdff;
}

.form-section h4 {
    margin-bottom: 14px;
}

.split-field-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.record-type-sections .form-section {
    margin: 0;
}

.worker-layout {
    grid-template-columns: 1.4fr 0.8fr;
}

.worker-form {
    grid-template-columns: repeat(3, 1fr);
}

.full-span {
    grid-column: 1 / -1;
}

.worker-secondary-title {
    margin-top: 18px;
}

.high-alert {
    border-color: #f3c4cd;
    background: #fff6f8;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e9f2;
    text-align: left;
}

th {
    color: #67768a;
    font-size: 0.92rem;
}

.actions,
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-status-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.section-title {
    margin-bottom: 14px;
}

.qr-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.qr-shell {
    width: min(480px, calc(100% - 32px));
    text-align: center;
}

.qr-box {
    min-height: 250px;
    display: grid;
    place-items: center;
    border: 1px dashed #cfdae8;
    border-radius: 16px;
    margin: 20px 0;
}

.portal-qr-image {
    width: 220px;
    height: 220px;
    object-fit: contain;
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(20, 32, 51, 0.55);
}

.modal-card {
    width: min(440px, 100%);
    position: relative;
    padding: 28px 24px 22px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(18, 42, 77, 0.22);
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #eef4ff;
    color: #172033;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.qr-payload {
    background: #eef4ff;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    white-space: pre-wrap;
    margin-bottom: 18px;
}

.portal-shell {
    max-width: 1260px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.portal-actions {
    display: flex;
    gap: 12px;
}

.inline-space {
    margin-top: 18px;
}

.portal-hero-grid,
.portal-content-grid,
.summary-grid,
.portal-record-grid {
    display: grid;
    gap: 16px;
}

.portal-hero-grid,
.portal-content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
    align-items: start;
    margin-bottom: 22px;
}

.portal-intro,
.portal-summary-card {
    box-shadow: 0 18px 40px rgba(18, 42, 77, 0.07);
}

.portal-intro h2 {
    font-size: 1.55rem;
    margin-bottom: 18px;
}

.portal-summary-card {
    position: sticky;
    top: 20px;
}

.summary-grid {
    grid-template-columns: repeat(2, 1fr);
}

.summary-box,
.reminder-item,
.portal-record-card {
    border: 1px solid #e3eaf4;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 16px;
}

.summary-box strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.15;
    margin-bottom: 6px;
    color: #7d4252;
    overflow-wrap: anywhere;
}

.summary-meta {
    display: block;
    color: #5c6f88;
    margin-bottom: 10px;
}

.summary-status-row {
    margin-bottom: 10px;
}

.summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-actions form {
    margin: 0;
}

.summary-appointments {
    margin-top: 24px;
}

.reminder-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.compact-appointment-form {
    padding-top: 4px;
}

.portal-tags {
    margin-top: 16px;
}

.portal-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-pill {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0d5cd7;
    text-decoration: none;
    font-weight: 700;
}

.filter-pill.active {
    background: #0d6efd;
    color: #fff;
}

.portal-records,
.reminder-list {
    display: grid;
    gap: 14px;
}

.appointment-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.appointment-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e3eaf4;
}

.appointment-form h4 {
    margin-bottom: 0;
}

.appointment-submit {
    background: #15965f;
}

.portal-record-head,
.portal-record-actions {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.portal-record-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 0;
}

.portal-info-section {
    margin-top: 12px;
    padding: 0;
    border: 1px solid #e3eaf4;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    overflow: hidden;
}

.portal-info-section summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-weight: 800;
    color: #172033;
    letter-spacing: 0.01em;
}

.portal-info-section summary::-webkit-details-marker {
    display: none;
}

.portal-info-section summary::after {
    content: "Open";
    float: right;
    color: #0d5cd7;
    font-size: 0.86rem;
}

.portal-info-section[open] summary {
    border-bottom: 1px solid #e3eaf4;
}

.portal-info-section[open] summary::after {
    content: "Close";
}

.portal-info-section .portal-record-grid {
    padding: 16px;
}

.history-stack,
.history-text-grid {
    display: grid;
    gap: 14px;
}

.history-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}

.history-pre {
    margin: 10px 0 0;
    white-space: pre-wrap;
    font: inherit;
    color: #172033;
}

.label {
    display: block;
    margin-bottom: 6px;
    color: #67768a;
    font-size: 0.9rem;
}

.portal-record-grid strong {
    display: block;
    min-height: 20px;
    overflow-wrap: anywhere;
}

.priority-pill {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.priority-low {
    background: #ebf8f0;
    color: #1a7444;
}

.priority-medium {
    background: #fff4d8;
    color: #8a6500;
}

.priority-high {
    background: #fde8ec;
    color: #b32743;
}

@media (max-width: 1100px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        padding: 18px;
    }

    .admin-sidebar-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-shell,
    .module-grid,
    .admin-page-grid,
    .feature-list,
    .quick-stats,
    .stats-grid,
    .two-col,
    .records-layout,
    .flow-grid,
    .record-form,
    .split-field-grid,
    .tag-list,
    .gateway-grid,
    .portal-hero-grid,
    .portal-content-grid,
    .summary-grid,
    .role-choice-grid,
    .patient-extra,
    .portal-record-grid,
    .worker-layout,
    .worker-form {
        grid-template-columns: 1fr;
    }

    .birthdate-age-row {
        grid-template-columns: 1fr;
    }

    .admin-hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-summary-card {
        position: static;
    }

    .history-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-sidebar-nav {
        grid-template-columns: 1fr;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar,
    .portal-topbar,
    .otp-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .login-brand-shell {
        min-height: auto;
    }

    .login-page-brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 0 0 10px;
    }

    .login-page-copy {
        justify-items: center;
    }

    .login-page-copy p {
        max-width: 100%;
    }
}
