:root {
    --navy: #102a2b;
    --navy-soft: #183b3d;
    --teal: #1b766f;
    --teal-light: #dff2ee;
    --mint: #63c6ad;
    --cream: #f5f3ec;
    --paper: #fffefa;
    --ink: #172626;
    --muted: #687777;
    --line: #dde4df;
    --danger: #b4493d;
    --warning: #a56818;
    --success: #26765b;
    --shadow: 0 18px 50px rgba(16, 42, 43, .09);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--cream);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
    line-height: 1.45;
}

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

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

.skip-link {
    position: fixed;
    z-index: 100;
    left: 16px;
    top: -60px;
    padding: 10px 16px;
    color: white;
    background: var(--navy);
    border-radius: 8px;
}

.skip-link:focus {
    top: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 258px;
    padding: 28px 22px 22px;
    color: #eff8f5;
    background:
        radial-gradient(circle at 25% 5%, rgba(99, 198, 173, .16), transparent 30%),
        var(--navy);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 42px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--navy);
    background: var(--mint);
    border-radius: 13px 13px 13px 4px;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    letter-spacing: .2px;
}

.brand span {
    margin-top: 1px;
    color: #a9bfbc;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-list {
    display: grid;
    gap: 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #bfd0cd;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: .18s ease;
}

.nav-item:hover,
.nav-item:focus-visible {
    color: white;
    background: rgba(255, 255, 255, .07);
}

.nav-item.active {
    color: white;
    background: rgba(99, 198, 173, .14);
    border-color: rgba(99, 198, 173, .17);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    color: var(--mint);
    font-size: 20px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.service-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-indicator strong,
.service-indicator span {
    display: block;
}

.service-indicator strong {
    font-size: 13px;
}

.service-indicator span {
    color: #93aaa7;
    font-size: 11px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: #ddb35f;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(221, 179, 95, .12);
}

.status-dot.ok {
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(99, 198, 173, .13);
}

.status-dot.error {
    background: #e78377;
    box-shadow: 0 0 0 4px rgba(231, 131, 119, .13);
}

.api-link {
    display: inline-block;
    margin-top: 18px;
    color: #8fa9a5;
    font-size: 12px;
    text-decoration: none;
}

.api-link:hover {
    color: white;
}

.workspace {
    min-height: 100vh;
    margin-left: 258px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 92px;
    padding: 20px clamp(24px, 4vw, 58px);
    background: rgba(245, 243, 236, .92);
    border-bottom: 1px solid rgba(16, 42, 43, .08);
    backdrop-filter: blur(14px);
}

.topbar h1,
.section-heading h2,
.panel h2,
.customer-toolbar h2,
.drawer-header h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 600;
}

.topbar h1 {
    font-size: clamp(26px, 3vw, 34px);
}

.eyebrow {
    margin: 0 0 3px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.signed-in-user {
    display: grid;
    justify-items: end;
    line-height: 1.2;
}

.signed-in-user span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.signed-in-user strong {
    font-size: 12px;
}

.logout-button {
    white-space: nowrap;
}

.as-of {
    padding-right: 17px;
    text-align: right;
    border-right: 1px solid var(--line);
}

.as-of span,
.as-of strong {
    display: block;
}

.as-of span {
    color: var(--muted);
    font-size: 11px;
}

.as-of strong {
    font-size: 13px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    color: white;
    background: var(--teal);
    border: 1px solid var(--teal);
    border-radius: 10px;
    font-weight: 650;
}

.button.secondary {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--line);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 42, 43, .09);
}

.button:disabled {
    cursor: wait;
    opacity: .55;
    transform: none;
}

.menu-button {
    display: none;
    width: 40px;
    height: 40px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}

main {
    display: grid;
    gap: 24px;
    padding: 34px clamp(24px, 4vw, 58px) 60px;
}

.section-heading,
.panel-heading,
.customer-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading h2,
.panel h2,
.customer-toolbar h2 {
    font-size: 23px;
}

.sync-state {
    color: var(--muted);
    font-size: 12px;
}

.sync-state.error {
    color: var(--danger);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.kpi-card {
    position: relative;
    min-height: 148px;
    padding: 21px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid rgba(16, 42, 43, .08);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(16, 42, 43, .04);
}

.kpi-card.primary {
    color: white;
    background:
        radial-gradient(circle at 100% 0, rgba(99, 198, 173, .28), transparent 45%),
        var(--navy);
}

.kpi-card.primary::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -45px;
    width: 130px;
    height: 130px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
}

.kpi-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .02em;
}

.primary .kpi-label,
.primary .kpi-meta {
    color: #b8cdca;
}

.kpi-value {
    margin: 13px 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
}

.kpi-meta {
    color: var(--muted);
    font-size: 11px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
    gap: 18px;
}

.panel {
    padding: 24px;
    background: var(--paper);
    border: 1px solid rgba(16, 42, 43, .08);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(16, 42, 43, .04);
}

.panel-badge {
    padding: 5px 9px;
    color: var(--success);
    background: var(--teal-light);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.aging-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.aging-row {
    display: grid;
    grid-template-columns: 90px minmax(100px, 1fr) 120px;
    align-items: center;
    gap: 14px;
}

.aging-label {
    color: var(--muted);
    font-size: 12px;
}

.aging-track {
    height: 8px;
    overflow: hidden;
    background: #edf0ec;
    border-radius: 99px;
}

.aging-bar {
    width: 0;
    height: 100%;
    background: var(--teal);
    border-radius: inherit;
    transition: width .45s ease;
}

.aging-row.overdue .aging-bar {
    background: #c89046;
}

.aging-row.severe .aging-bar {
    background: var(--danger);
}

.aging-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-align: right;
}

.skeleton-row {
    height: 17px;
    background: linear-gradient(90deg, #edf0ec 25%, #f7f8f5 50%, #edf0ec 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

.attention-list {
    display: grid;
    gap: 8px;
    margin-top: 19px;
}

.attention-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.attention-item:last-child {
    border-bottom: 0;
}

.attention-item button {
    padding: 0;
    color: var(--ink);
    background: none;
    border: 0;
    font-weight: 700;
    text-align: left;
}

.attention-item button:hover {
    color: var(--teal);
}

.attention-item span {
    color: var(--muted);
    font-size: 11px;
}

.attention-amount {
    grid-row: span 2;
    align-self: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.customer-panel {
    padding: 0;
    overflow: hidden;
}

.customer-toolbar {
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.toolbar-controls {
    display: flex;
    gap: 10px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    font-size: 19px;
}

.search-box input,
.select-control select {
    height: 40px;
    color: var(--ink);
    background: #fafaf6;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.search-box input {
    width: min(310px, 32vw);
    padding: 8px 12px 8px 39px;
}

.select-control select {
    min-width: 132px;
    padding: 8px 30px 8px 11px;
}

.search-box input:focus,
.select-control select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(27, 118, 111, .1);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    background: #fafaf6;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

td {
    font-size: 13px;
}

tbody tr {
    transition: background .15s ease;
}

tbody tr:hover {
    background: #fbfcf8;
}

.account-number {
    color: var(--teal);
    font-weight: 750;
}

.customer-name {
    font-weight: 650;
}

.numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

.status-active,
.status-paid,
.status-sent {
    color: var(--success);
    background: #e5f3ed;
}

.status-onhold,
.status-partiallypaid,
.status-pending {
    color: var(--warning);
    background: #f8efdf;
}

.status-closed,
.status-archived,
.status-voided,
.status-failed {
    color: #6d7776;
    background: #edf0ee;
}

.row-action {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    color: var(--teal);
    background: var(--teal-light);
    border: 0;
    border-radius: 9px;
    font-size: 17px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 20px;
    color: var(--muted);
    background: #fafaf6;
    font-size: 11px;
}

.table-loading {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(9, 27, 28, .35);
    backdrop-filter: blur(2px);
}

.detail-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 50;
    width: min(620px, 94vw);
    padding: 26px;
    overflow-y: auto;
    background: var(--paper);
    box-shadow: -20px 0 60px rgba(16, 42, 43, .2);
    transform: translateX(104%);
    transition: transform .24s ease;
}

.detail-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--line);
}

.drawer-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--ink);
    background: #f4f5f1;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 25px;
}

.drawer-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 19px 0;
}

.summary-tile {
    padding: 13px;
    background: #f6f7f3;
    border-radius: 12px;
}

.summary-tile span,
.summary-tile strong {
    display: block;
}

.summary-tile span {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.summary-tile strong {
    font-size: 14px;
}

.tab-list {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f1f3ef;
    border-radius: 11px;
}

.tab {
    flex: 1;
    padding: 9px 10px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.tab.active {
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 3px 10px rgba(16, 42, 43, .07);
}

.drawer-content {
    display: grid;
    gap: 10px;
    padding-top: 17px;
}

.activity-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.activity-card[role="button"] {
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease;
}

.activity-card[role="button"]:hover,
.activity-card[role="button"]:focus-visible {
    border-color: var(--teal);
    transform: translateY(-1px);
    outline: none;
}

.activity-card strong {
    font-size: 13px;
}

.activity-card p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.activity-amount {
    grid-row: span 2;
    align-self: center;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.statement-settings {
    display: grid;
    gap: 9px;
    margin-bottom: 7px;
    padding: 15px;
    background: #f5f8f4;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 12px;
}

.settings-row span {
    color: var(--muted);
}

.empty-state {
    padding: 34px 20px;
    color: var(--muted);
    background: #f8f9f5;
    border: 1px dashed #d6dfd9;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
}

.empty-state.compact {
    padding: 24px 12px;
}

[hidden] {
    display: none !important;
}

.drawer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 1px;
    margin: -4px 0 18px;
}

.action-button {
    min-height: 36px;
    padding: 7px 11px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}

.action-button:hover:not(:disabled) {
    color: var(--teal);
    border-color: var(--teal);
    background: #f5fbf8;
}

.action-button.warning {
    color: var(--warning);
}

.action-button.danger {
    color: var(--danger);
}

.action-button:disabled {
    cursor: not-allowed;
    color: #9ba6a4;
    background: #f3f4f1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(9, 27, 28, .55);
    backdrop-filter: blur(5px);
}

.modal-card {
    width: min(500px, 100%);
    padding: 25px;
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 18px;
    box-shadow: 0 25px 80px rgba(7, 28, 29, .3);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.modal-header h2,
.confirm-card h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 600;
}

.modal-context {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
    margin-bottom: 17px;
}

.form-field label {
    font-size: 12px;
    font-weight: 750;
}

.form-field input,
.form-field textarea {
    width: 100%;
    height: 44px;
    padding: 9px 12px;
    color: var(--ink);
    background: #fafaf6;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
}

.form-field textarea {
    height: auto;
    min-height: 82px;
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(27, 118, 111, .1);
}

.form-field input:disabled {
    color: var(--muted);
    background: #f0f2ee;
}

.field-help {
    color: var(--muted);
    font-size: 10px;
}

.form-error {
    margin: 4px 0 16px;
    padding: 11px 13px;
    color: #8f352d;
    background: #fceae7;
    border: 1px solid #f3c9c3;
    border-radius: 9px;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 23px;
}

.confirm-card {
    width: min(440px, 100%);
    text-align: center;
}

.confirm-card p {
    margin: 12px auto 0;
    max-width: 340px;
    color: var(--muted);
    font-size: 13px;
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    color: var(--warning);
    background: #f9edda;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
}

.confirm-icon.danger {
    color: var(--danger);
    background: #f9e4e1;
}

.confirm-card .modal-actions {
    justify-content: center;
}

.confirm-card .form-error {
    text-align: left;
}

.button.danger {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
}

.invoice-detail-card {
    width: min(560px, 100%);
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.invoice-detail-tile {
    display: grid;
    gap: 5px;
    padding: 13px;
    background: #f4f5f1;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.invoice-detail-tile span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invoice-detail-tile strong {
    font-size: 14px;
}

.invoice-detail-description {
    min-height: 42px;
    margin: 16px 0 0;
    padding: 13px;
    color: var(--muted);
    background: #fafaf6;
    border-radius: 10px;
    font-size: 12px;
}

.login-backdrop {
    z-index: 120;
    background:
        radial-gradient(
            circle at 25% 20%,
            rgba(52, 167, 151, .25),
            transparent 38%),
        rgba(7, 28, 29, .94);
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
}

.login-card h2 {
    margin: 5px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 600;
}

.login-brand {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 22px;
    color: var(--navy);
    background: var(--mint);
    border-radius: 13px;
    font-family: Georgia, serif;
    font-size: 27px;
    font-weight: 700;
}

.login-intro {
    margin: 9px 0 24px;
    color: var(--muted);
    font-size: 13px;
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 5px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    max-width: min(420px, calc(100vw - 48px));
    padding: 13px 16px;
    color: white;
    background: var(--danger);
    border-radius: 11px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

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

@media (max-width: 1080px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(8, 27, 28, .25);
    }

    .workspace {
        margin-left: 0;
    }

    .menu-button {
        display: block;
    }

    .as-of {
        display: none;
    }

    .customer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-controls {
        width: 100%;
    }

    .search-box {
        flex: 1;
    }

    .search-box input {
        width: 100%;
    }
}

@media (max-width: 580px) {
    .form-grid,
    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 15px 16px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .button.secondary {
        width: 40px;
        padding: 8px;
        justify-content: center;
        font-size: 0;
    }

    .button.secondary span {
        font-size: 18px;
    }

    main {
        padding: 24px 14px 40px;
    }

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

    .toolbar-controls {
        flex-direction: column;
    }

    .select-control select {
        width: 100%;
    }

    .drawer-summary {
        grid-template-columns: 1fr;
    }

    th:nth-child(4),
    td:nth-child(4) {
        display: none;
    }

    th,
    td {
        padding: 12px 13px;
    }

    .table-footer {
        flex-direction: column;
        gap: 3px;
    }
}

.user-management-card {
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.user-management-layout {
    display: grid;
    gap: 24px;
}

.user-create-form {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--cream);
}

.user-create-form h3,
.managed-users h3 {
    margin: 0 0 16px;
}

.managed-users-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.user-table-wrap {
    max-height: 430px;
}

.user-table {
    min-width: 1050px;
}

.user-table td {
    vertical-align: top;
}

.user-table select {
    min-width: 135px;
}

.user-display-name,
.user-username {
    display: block;
}

.user-username {
    margin-top: 4px;
    color: var(--muted);
    font-size: .82rem;
}

.compact-button {
    display: block;
    width: 100%;
    margin-bottom: 6px;
    padding: 7px 10px;
    white-space: nowrap;
    font-size: .78rem;
}

.password-reset-card {
    width: min(520px, calc(100vw - 32px));
}

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