:root {
    --primary: #5b4fe9;
    --primary-dark: #4238c4;
    --primary-light: #7c71f0;
    --primary-soft: #efedfd;
    --nav-background: #1c1b2e;
    --nav-background-soft: #27263d;
    --accent: #f5a623;
    --success: #2e9e5b;
    --success-soft: #e4f6eb;
    --warning: #e2a03f;
    --warning-soft: #fbf1df;
    --danger: #e24c4b;
    --danger-soft: #fceaea;
    --info: #2e7be0;
    --background: #f6f7fb;
    --card-bg: #ffffff;
    --text-dark: #1c1b2e;
    --text-muted: #7a7a90;
    --text-inverse: #ffffff;
    --border: #e7e7f0;
    --border-strong: #d3d3e2;
    --shadow-sm: 0 1px 2px rgba(28, 27, 46, 0.04), 0 5px 18px rgba(28, 27, 46, 0.04);
    --shadow-md: 0 18px 45px rgba(28, 27, 46, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --sidebar-width: 268px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text-dark);
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(91, 79, 233, 0.24);
    outline-offset: 2px;
}

svg {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Login and registration */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    background:
        radial-gradient(circle at 18% 14%, rgba(124, 113, 240, 0.22), transparent 31%),
        radial-gradient(circle at 84% 86%, rgba(91, 79, 233, 0.16), transparent 34%),
        var(--nav-background);
}

.login-box {
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 34px;
    overflow: hidden;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.login-box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--primary);
}

.login-logo {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 18px;
}

.login-logo svg {
    width: 30px;
    height: 30px;
}

.login-box h1 {
    margin: 0 0 6px;
    color: var(--text-dark);
    font-size: 24px;
    line-height: 1.35;
}

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

.login-box > label {
    display: block;
    margin: 13px 0 6px;
    color: var(--text-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
}

.login-box input,
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-box input:hover,
.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
    border-color: #b9b7d2;
}

.login-box input:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 79, 233, 0.1);
}

.server-config {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.login-links {
    margin-top: 16px;
    text-align: center;
}

.login-links a {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Buttons */

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    transform: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-block {
    width: 100%;
    margin-top: 16px;
}

.btn-small {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
}

.btn-primary {
    color: var(--text-inverse);
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(91, 79, 233, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-accent {
    color: #513200;
    background: #fac96b;
}

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

.btn-outline {
    color: var(--primary-dark);
    background: transparent;
    border-color: var(--border-strong);
}

.btn-outline:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}

/* App shell */

.app-shell {
    min-height: 100vh;
    display: flex;
    direction: rtl;
}

.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex: 0 0 var(--sidebar-width);
    flex-direction: column;
    color: var(--text-inverse);
    background: var(--nav-background);
    z-index: 50;
}

.sidebar-header {
    position: relative;
    min-height: 106px;
    display: flex;
    align-items: center;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    flex: 0 0 45px;
    color: #c7c2ff;
    background: rgba(124, 113, 240, 0.16);
    border: 1px solid rgba(199, 194, 255, 0.18);
    border-radius: 14px;
}

.sidebar-logo svg {
    width: 23px;
    height: 23px;
}

.brand-name {
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-name {
    margin-top: 3px;
    overflow: hidden;
    color: #aaa8c1;
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-close {
    display: none;
    color: #c9c7db;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-list {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-item {
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 4px;
    padding: 10px 14px;
    color: #c0bfd1;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    color: #fff;
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 9px 23px rgba(55, 44, 193, 0.32);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px 4px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    color: #dedcff;
    background: rgba(124, 113, 240, 0.17);
    border-radius: 50%;
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.current-user {
    min-width: 0;
    overflow: hidden;
    color: #c0bfd1;
    font-size: 11.5px;
    line-height: 1.7;
    text-overflow: ellipsis;
}

.sidebar-logout {
    min-height: 39px;
    color: #cfcede;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-logout:hover {
    color: #fff;
    background: rgba(226, 76, 75, 0.13);
    border-color: rgba(226, 76, 75, 0.3);
}

.sidebar-backdrop {
    display: none;
}

.content {
    min-width: 0;
    min-height: 100vh;
    flex: 1;
    direction: rtl;
    overflow-x: hidden;
}

.app-topbar {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 30px;
    background: rgba(246, 247, 251, 0.92);
    border-bottom: 1px solid var(--border);
}

.topbar-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-heading h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.35;
}

.topbar-heading p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
}

.mobile-menu {
    display: none;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.online-status,
.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.online-status i {
    width: 8px;
    height: 8px;
    display: block;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--success-soft);
}

.online-status.is-checking i {
    background: var(--warning);
    box-shadow: 0 0 0 4px var(--warning-soft);
}

.online-status.is-offline {
    color: var(--danger);
}

.online-status.is-offline i {
    background: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.topbar-date svg {
    width: 17px;
    height: 17px;
}

.page-content {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 28px 30px 38px;
}

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

/* Dashboard contract */

.dashboard-summary {
    display: grid;
    gap: 18px;
}

.hero-kpi {
    min-height: 168px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 30px 34px;
    overflow: hidden;
    color: var(--text-dark);
    background:
        radial-gradient(circle at 10% 50%, rgba(124, 113, 240, 0.13), transparent 26%),
        linear-gradient(135deg, #fff, #f5f4ff);
    border: 1px solid #dcd8ff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.hero-kpi-copy {
    min-width: 0;
}

.hero-kpi .kpi-label {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 800;
}

.hero-kpi-value {
    margin-top: 10px;
    color: var(--primary-dark);
    font-size: clamp(32px, 4vw, 50px);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    direction: ltr;
    text-align: right;
}

.hero-kpi-icon {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    flex: 0 0 96px;
    color: var(--primary);
    background: rgba(91, 79, 233, 0.1);
    border-radius: 50%;
}

.hero-kpi-icon svg {
    width: 44px;
    height: 44px;
}

.dashboard-kpi-grid,
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-summary .dashboard-kpi-grid {
    margin-bottom: 0;
}

.dashboard-kpi-grid--compact {
    grid-template-columns: repeat(2, minmax(180px, 260px));
}

.kpi-card {
    min-width: 0;
    min-height: 132px;
    padding: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.kpi-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.kpi-label {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-value {
    margin-top: 16px;
    overflow-wrap: anywhere;
    color: var(--primary-dark);
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    direction: ltr;
    text-align: right;
}

.kpi-card--success .kpi-value,
.kpi-card--success .kpi-icon {
    color: var(--success);
}

.kpi-card--success .kpi-icon {
    background: var(--success-soft);
}

.kpi-card--warning .kpi-value,
.kpi-card--warning .kpi-icon {
    color: #d6810b;
}

.kpi-card--warning .kpi-icon {
    background: var(--warning-soft);
}

.kpi-card--danger .kpi-value,
.kpi-card--danger .kpi-icon {
    color: var(--danger);
}

.kpi-card--danger .kpi-icon {
    background: var(--danger-soft);
}

.dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.9fr);
    gap: 18px;
    margin-top: 22px;
}

.dashboard-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.card-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    margin: 2px 0 0;
    font-size: 16px;
}

.card-header > svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.dashboard-panel--stock .card-header > svg {
    color: var(--danger);
}

.eyebrow {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* Shared surfaces and data */

.card {
    margin-bottom: 18px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card h3 {
    margin-top: 0;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    min-width: 560px;
    border-spacing: 0;
    border-collapse: separate;
    background: var(--card-bg);
}

table.data-table th {
    padding: 12px 16px;
    color: var(--text-muted);
    background: #fafafd;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

table.data-table td {
    padding: 13px 16px;
    color: #444357;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    text-align: right;
    vertical-align: middle;
}

table.data-table tbody tr:last-child td,
table.data-table > tbody:last-child > tr:last-child td {
    border-bottom: 0;
}

table.data-table tbody tr:hover td {
    background: #fafafe;
}

.table-id {
    color: var(--primary) !important;
    font-weight: 700;
}

.money-cell {
    color: var(--success) !important;
    font-weight: 800;
    direction: ltr;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 700;
}

.form-row textarea {
    min-height: 100px;
    resize: vertical;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px;
    flex-wrap: wrap;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.alert {
    margin-bottom: 16px;
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}

.alert-danger {
    color: #a43131;
    background: var(--danger-soft);
    border-color: #f7cece;
}

.alert-success {
    color: #1e7942;
    background: var(--success-soft);
    border-color: #c8ecd5;
}

.state-box {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 34px 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.state-box > svg {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
}

.state-box--error > svg {
    color: var(--danger);
}

.state-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: state-spin 700ms linear infinite;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 10px;
    color: var(--text-dark);
    background: #f1f1f7;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.nav-badge {
    min-width: 21px;
    margin-inline-start: auto;
    padding: 2px 7px;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
}

.grow-field { flex: 1 1 240px; }
.table-card { padding: 0; overflow: hidden; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 220px; }
.modal-box-wide { max-width: 820px; }
.modal-actions-row { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions-row .btn { flex: 1; }
.danger-text { color: var(--danger) !important; }
.success-text { color: var(--success) !important; }

.summary-strip {
    display: flex;
    gap: 22px;
    margin-bottom: 16px;
    padding: 14px 18px;
    flex-wrap: wrap;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.section-heading,
.profile-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.section-heading > svg {
    width: 42px;
    height: 42px;
    padding: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 13px;
}

.section-heading h3,
.profile-heading h3 { margin: 0 0 4px; }
.section-heading p,
.profile-heading p,
.plan-card p { margin: 0; color: var(--text-muted); font-size: 12.5px; }

.profile-avatar {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    flex: 0 0 68px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 21px;
    font-size: 25px;
    font-weight: 800;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
}
.profile-photo-actions small {
    flex-basis: 100%;
    color: var(--text-muted);
}
.plan-card strong { display: block; margin: 10px 0; color: var(--primary); font-size: 34px; }
.server-readout { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.server-readout span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 11px; }
.server-readout bdi { overflow-wrap: anywhere; color: var(--text-dark); font-size: 12px; }

.debt-list,
.notification-list { display: grid; gap: 12px; }

.debt-card,
.notification-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.debt-card { flex-wrap: wrap; }
.debt-card small { display: block; margin-top: 4px; color: var(--text-muted); }
.debt-amount { margin-inline-start: auto; color: var(--danger); }
.debt-payment { display: flex; gap: 8px; flex: 1 1 100%; }
.debt-payment input { flex: 1; min-width: 0; }

.notification-card.is-unread { border-color: #cfcaff; box-shadow: inset -4px 0 0 var(--primary); }
.notification-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; color: var(--primary); background: var(--primary-soft); border-radius: 14px; }
.notification-icon svg { width: 21px; height: 21px; }
.notification-copy { min-width: 0; flex: 1; }
.notification-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notification-title-row h3 { margin: 0; font-size: 15px; }
.notification-title-row time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.notification-copy p { margin: 8px 0 12px; color: #555467; font-size: 13px; line-height: 1.8; white-space: pre-wrap; }

.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;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(17, 16, 31, 0.62);
    backdrop-filter: blur(3px);
}

.modal-box {
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    padding: 24px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.modal-box h3 {
    margin: 0 0 18px;
    font-size: 19px;
}

@media (max-width: 1180px) {
    .dashboard-kpi-grid,
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .section-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: min(86vw, 300px);
        height: 100dvh;
        transform: translateX(110%);
        transition: transform 190ms ease;
        box-shadow: -20px 0 50px rgba(17, 16, 31, 0.25);
    }

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

    .sidebar-close,
    .mobile-menu {
        display: inline-grid;
    }

    .sidebar-close {
        margin-right: auto;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        padding: 0;
        visibility: hidden;
        opacity: 0;
        background: rgba(17, 16, 31, 0.48);
        border: 0;
        cursor: default;
        transition: opacity 190ms ease, visibility 190ms ease;
    }

    .sidebar-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .app-topbar {
        padding: 15px 18px;
    }

    .page-content {
        padding: 20px 18px 30px;
    }
}

@media (max-width: 650px) {
    .notification-card { align-items: flex-start; }
    .notification-title-row { display: block; }
    .notification-title-row time { display: block; margin-top: 4px; }
    .debt-payment { flex-direction: column; }
    .login-box {
        padding: 28px 21px;
    }

    .app-topbar {
        min-height: 76px;
    }

    .topbar-heading h1 {
        font-size: 21px;
    }

    .topbar-heading p,
    .topbar-date {
        display: none;
    }

    .hero-kpi {
        min-height: 145px;
        padding: 24px;
    }

    .hero-kpi-value {
        font-size: 30px;
    }

    .hero-kpi-icon {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .hero-kpi-icon svg {
        width: 31px;
        height: 31px;
    }

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

    .kpi-card {
        min-height: 118px;
        padding: 15px;
    }

    .kpi-value {
        font-size: 22px;
    }

    .filter-bar > .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 430px) {
    .hero-kpi-icon {
        display: none;
    }

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

    .page-content {
        padding-inline: 13px;
    }
}

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