/* ==========================================================
   SMART RW 09 - CORE UI
   Includes dashboard, public portal, forms, data tables,
   column filters and Pemilu-style pagination.
   ========================================================== */

:root {
    --rw-primary: #0f3d68;
    --rw-primary-2: #185b91;
    --rw-primary-soft: #eaf2f9;
    --rw-text: #172033;
    --rw-muted: #667085;
    --rw-bg: #f5f7fb;
    --rw-surface: #ffffff;
    --rw-border: #e3e8ef;
    --rw-border-strong: #d3dae5;
    --rw-success: #16794a;
    --rw-success-bg: #e8f7ef;
    --rw-warning: #9a6700;
    --rw-warning-bg: #fff5d6;
    --rw-danger: #b42318;
    --rw-danger-bg: #fdecea;
    --rw-radius-sm: 7px;
    --rw-radius: 11px;
    --rw-radius-lg: 16px;
    --rw-shadow: 0 4px 16px rgba(24, 39, 75, .06);
    --rw-shadow-lg: 0 12px 30px rgba(24, 39, 75, .10);
    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--rw-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--rw-text);
    background: var(--rw-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

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

/* ==========================================================
   PUBLIC LAYOUT
   ========================================================== */

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--rw-border);
    backdrop-filter: blur(12px);
}

.nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.nav-links > a:not(.btn) {
    padding: 9px 11px;
    border-radius: 8px;
    color: #475467;
    font-weight: 600;
}

.nav-links > a:not(.btn):hover {
    color: var(--rw-primary);
    background: var(--rw-primary-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--rw-text);
    font-weight: 800;
    letter-spacing: -.01em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--rw-primary), var(--rw-primary-2));
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(15,61,104,.18);
}

.hero {
    padding: 58px 0 46px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 34px;
    align-items: center;
}

.hero h1 {
    margin: 0 0 16px;
    max-width: 760px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.04;
    letter-spacing: -.035em;
}

.hero p {
    max-width: 720px;
    color: var(--rw-muted);
    font-size: 17px;
}

.hero-card {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-lg);
    box-shadow: var(--rw-shadow-lg);
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--rw-primary-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.section {
    padding: 34px 0;
}

.section-title {
    margin: 0 0 18px;
}

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

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

.footer {
    margin-top: 48px;
    padding: 34px 0;
    color: #64748b;
    background: #fff;
    border-top: 1px solid var(--rw-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
}

/* ==========================================================
   APP SHELL
   ========================================================== */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 12px 30px;
    color: #dbe7f2;
    background: #102a43;
    border-right: 1px solid rgba(255,255,255,.05);
}


.sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-head .brand {
    flex: 1;
    min-width: 0;
}

.sidebar-close,
.sidebar-toggle,
.sidebar-overlay {
    display: none;
}


.sidebar .brand {
    width: 100%;
    margin-bottom: 20px;
    padding: 4px 10px 14px;
    color: #fff;
}

.sidebar .brand-mark {
    background: #fff;
    color: #12395d;
    box-shadow: none;
}

.side-section {
    margin: 18px 10px 7px;
    color: #8fabbe;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.side-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    margin: 2px 0;
    padding: 9px 11px;
    border-radius: 8px;
    color: #d6e2eb;
    font-weight: 550;
    transition: .14s ease;
}

.side-link:hover {
    color: #fff;
    background: rgba(255,255,255,.09);
}

.main {
    min-width: 0;
}

.app-top {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 28px;
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid var(--rw-border);
    backdrop-filter: blur(10px);
}

.app-top .spacer {
    flex: 1;
}

.content {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 26px 28px 42px;
}

/* ==========================================================
   PAGE / CARDS
   ========================================================== */

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-head h1 {
    margin: 0 0 5px;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.page-head p {
    margin: 0;
    color: var(--rw-muted);
}

.card,
.form-card,
.table-card,
.filter-card,
.stat {
    background: var(--rw-surface);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    box-shadow: var(--rw-shadow);
}

.card,
.form-card,
.filter-card {
    padding: 20px;
}

.card {
    margin-bottom: 18px;
}

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

.stat {
    min-width: 0;
    padding: 18px;
}

.stat .label {
    color: var(--rw-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat .num {
    margin-top: 5px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.mini {
    padding: 13px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid var(--rw-border);
}

.muted {
    color: var(--rw-muted);
}

.row-subtext {
    margin-top: 3px;
    font-size: 12px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: .14s ease;
}

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

.btn-sm {
    min-height: 31px;
    padding: 6px 9px;
    font-size: 12px;
}

.btn-primary {
    color: #fff;
    background: var(--rw-primary);
    border-color: var(--rw-primary);
}

.btn-primary:hover {
    background: #0b3359;
}

.btn-light {
    color: #344054;
    background: #fff;
    border-color: var(--rw-border-strong);
}

.btn-light:hover {
    background: #f8fafc;
}

.btn-soft {
    color: var(--rw-primary);
    background: var(--rw-primary-soft);
    border-color: #d7e7f5;
}

.btn-danger {
    color: #fff;
    background: var(--rw-danger);
    border-color: var(--rw-danger);
}

.actions,
.row-actions,
.filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

/* ==========================================================
   FORMS
   ========================================================== */

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

.address-filter-grid {
    grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
}

.user-filter-grid {
    grid-template-columns: 2fr 1fr 1fr auto;
}

.field {
    min-width: 0;
}

.field.full,
.full {
    grid-column: 1 / -1;
}

.field label,
.form-card label,
.filter-card label {
    display: block;
    margin-bottom: 6px;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    color: var(--rw-text);
    background: #fff;
    border: 1px solid var(--rw-border-strong);
    border-radius: 8px;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}

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

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: #88afd0;
    box-shadow: 0 0 0 3px rgba(24,91,145,.10);
}

.filter-actions {
    align-self: end;
}


/* ==========================================================
   CHECKBOX / RADIO CONTROL
   ========================================================== */

/*
 * IMPORTANT:
 * Checkbox/radio must never inherit the generic 100% form-input width.
 * This is the root fix for oversized checkboxes on User/Role forms.
 */
input[type="checkbox"],
input[type="radio"] {
    appearance: auto;
    -webkit-appearance: auto;
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin: 0;
    flex: 0 0 18px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: var(--rw-primary);
    box-shadow: none;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 3px solid rgba(24,91,145,.18);
    outline-offset: 2px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* Simple line checkbox */
.check-row {
    width: 100%;
    min-width: 0;
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    padding: 10px 12px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--rw-border);
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 650 !important;
    line-height: 1.35;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.check-row:hover {
    background: #f8fafc;
    border-color: #cdd7e3;
}

.check-row:focus-within {
    border-color: #88afd0;
    box-shadow: 0 0 0 3px rgba(24,91,145,.08);
}

.check-row .check-input {
    margin-top: 1px;
}

.check-content {
    min-width: 0;
    display: block;
}

.check-title {
    display: block;
    color: #243247;
    font-size: 13px;
    font-weight: 750;
}

.check-description {
    display: block;
    margin-top: 3px;
    color: var(--rw-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.check-row.is-highlight {
    background: #f8fbfe;
    border-color: #d8e6f2;
}

/* Role selector on User form */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.choice-card {
    min-width: 0;
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    padding: 11px 12px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--rw-border);
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 650 !important;
    line-height: 1.35;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.choice-card:hover {
    background: #f8fafc;
    border-color: #cdd7e3;
}

.choice-card:focus-within {
    border-color: #88afd0;
    box-shadow: 0 0 0 3px rgba(24,91,145,.08);
}

.choice-card input[type="checkbox"],
.choice-card input[type="radio"] {
    margin-top: 1px;
}

.choice-card .choice-title {
    min-width: 0;
    display: block;
    overflow-wrap: anywhere;
    color: #243247;
    font-weight: 750;
}

/* Permission page */
.permission-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.permission-toolbar > label {
    margin: 0 !important;
}

.permission-group {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 14px !important;
    box-shadow: none !important;
}

.permission-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    background: #f8fafc;
    border-bottom: 1px solid var(--rw-border);
}

.permission-group-title {
    min-width: 0;
}

.permission-group-title strong {
    color: #243247;
    font-size: 14px;
}

.permission-group-title .muted {
    margin-top: 2px;
    font-size: 11px;
}

.permission-group-toggle {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 6px 9px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--rw-border-strong);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

.permission-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 0;
}

.permission-item {
    min-width: 0;
    min-height: 66px;
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    padding: 12px 15px;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: background .12s ease;
}

.permission-item:hover {
    background: #fbfcfe;
}

.permission-item input[type="checkbox"] {
    margin-top: 2px;
}

.permission-item-text {
    min-width: 0;
}

.permission-item-name {
    display: block;
    color: #243247;
    font-weight: 750;
    line-height: 1.35;
}

.permission-item-code {
    display: block;
    margin-top: 3px;
    color: var(--rw-muted);
    font-size: 11px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.permission-item-code code {
    color: #53657b;
    background: #f3f6f9;
    border: 1px solid #e8edf3;
    border-radius: 5px;
    padding: 1px 5px;
}

/* Compact checkbox for tables/toolbars if added later */
.check-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 650 !important;
}

@media (max-width: 760px) {
    .choice-grid,
    .permission-items {
        grid-template-columns: 1fr;
    }

    .permission-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .permission-group-toggle {
        align-self: flex-start;
    }
}

/* ==========================================================
   DATA TABLE - PEMILU STYLE
   ========================================================== */

.table-filter-form {
    margin: 0;
}

.table-card {
    overflow: hidden;
}

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

.data-table,
.table-wrap > table {
    width: 100%;
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.data-table th,
.data-table td,
.table-wrap > table th,
.table-wrap > table td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: middle;
    text-align: left;
}

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

.data-table tbody tr:hover,
.table-wrap > table tbody tr:hover {
    background: #fbfcfe;
}

.data-table .table-heading-row th,
.data-table thead > tr:first-child th,
.table-wrap > table thead > tr:first-child th {
    padding-top: 12px;
    padding-bottom: 9px;
    color: #344054;
    background: #f8fafc;
    border-bottom: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
    white-space: nowrap;
}

.data-table .table-filter-row th {
    padding: 4px 5px 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--rw-border-strong);
}

.column-filter {
    width: 100%;
    min-width: 62px;
    min-height: 32px;
    height: 32px;
    padding: 4px 7px;
    color: #344054;
    background: #fff;
    border: 1px solid #d7dde6;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.column-filter::placeholder {
    color: #98a2b3;
}

.column-filter:focus {
    border-color: #7aa6ca;
    box-shadow: 0 0 0 2px rgba(24,91,145,.09);
}

.filter-action-buttons {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

.filter-search-btn,
.filter-reset-btn {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.filter-search-btn {
    color: #fff;
    background: var(--rw-primary);
    border: 1px solid var(--rw-primary);
}

.filter-reset-btn {
    color: #475467;
    background: #fff;
    border: 1px solid #d7dde6;
}

.filter-placeholder {
    display: block;
    text-align: center;
    color: #c0c7d0;
}

.col-rt {
    width: 72px;
}

.col-block {
    width: 85px;
}

.col-house {
    width: 105px;
}

.col-status {
    width: 115px;
}

.col-action {
    width: 112px;
}

.col-name {
    min-width: 180px;
}

.users-table {
    min-width: 1120px;
}

.nowrap {
    white-space: nowrap;
}

.empty,
.empty-state,
.table-empty {
    padding: 34px 18px !important;
    color: var(--rw-muted);
    text-align: center !important;
}

/* ==========================================================
   PAGINATION - PEMILU STYLE
   ========================================================== */

.pager-wrap {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid var(--rw-border);
}

.pager-summary {
    flex: 0 0 auto;
    color: var(--rw-muted);
    font-size: 13px;
    white-space: nowrap;
}

.pager-summary strong {
    color: var(--rw-text);
    font-weight: 800;
}

.pager-right {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.pager-size-form {
    margin: 0;
}

.pager-size-form label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rw-muted);
    font-size: 12px;
    white-space: nowrap;
}

.pager-size-form select {
    width: auto;
    min-width: 62px;
    min-height: 31px;
    height: 31px;
    padding: 3px 24px 3px 7px;
    border-radius: 6px;
    font-size: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    color: #344054;
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
}

.pagination a:hover {
    color: var(--rw-primary);
    background: #f4f8fb;
    border-color: #cbd9e5;
}

.pagination .active {
    color: #fff;
    background: var(--rw-primary);
    border-color: var(--rw-primary);
}

.pagination .disabled {
    color: #b7bec8;
    background: #fafbfc;
    cursor: default;
}

.pagination .dots {
    min-width: 22px;
    padding: 0 2px;
    background: transparent;
    border-color: transparent;
}

.pagination .page-nav {
    font-size: 17px;
    font-weight: 500;
}

/* ==========================================================
   BADGES / FLASH
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.green,
.green {
    color: var(--rw-success);
    background: var(--rw-success-bg);
}

.badge.amber,
.amber {
    color: var(--rw-warning);
    background: var(--rw-warning-bg);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 9px;
}

.flash.success {
    color: var(--rw-success);
    background: var(--rw-success-bg);
    border-color: #bee6cf;
}

.flash.error {
    color: var(--rw-danger);
    background: var(--rw-danger-bg);
    border-color: #f4c7c2;
}

.kpi-positive {
    color: var(--rw-success);
}

.kpi-negative {
    color: var(--rw-danger);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

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

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

@media (max-width: 980px) {
    :root {
        --sidebar-width: 210px;
    }

    .content {
        padding-left: 20px;
        padding-right: 20px;
    }

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

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

@media (max-width: 760px) {
    .container {
        width: min(100% - 26px, 1180px);
    }

    .nav {
        min-height: 62px;
    }

    .nav-links > a:not(.btn) {
        display: none;
    }

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

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 90;
        width: min(86vw, 320px);
        height: 100dvh;
        max-height: 100vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: max(14px, env(safe-area-inset-top)) 12px max(22px, env(safe-area-inset-bottom));
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 18px 0 40px rgba(2, 15, 28, .24);
        border-right: 0;
        -webkit-overflow-scrolling: touch;
    }

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

    .sidebar-head {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: -4px -2px 8px;
        padding: 4px 2px 10px;
        background: #102a43;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .sidebar .brand {
        min-width: 0;
        margin: 0;
        padding: 2px 6px;
        font-size: 15px;
    }

    .sidebar .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .sidebar-close {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        color: #dbe7f2;
        background: rgba(255,255,255,.07);
        border: 1px solid rgba(255,255,255,.10);
        border-radius: 9px;
        cursor: pointer;
        font-size: 24px;
        line-height: 1;
    }

    .sidebar-close:hover {
        color: #fff;
        background: rgba(255,255,255,.12);
    }

    .side-section {
        margin: 16px 8px 6px;
        font-size: 10px;
        letter-spacing: .10em;
    }

    .side-link {
        width: 100%;
        min-height: 42px;
        display: flex;
        margin: 2px 0;
        padding: 9px 10px;
        border-radius: 8px;
        font-size: 13px;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 80;
        width: 100%;
        height: 100%;
        display: block;
        padding: 0;
        background: rgba(15, 23, 42, .48);
        border: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .sidebar-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .app-top {
        position: sticky;
        top: 0;
        z-index: 50;
        min-height: 58px;
        padding: 8px 12px;
    }

    .sidebar-toggle {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        color: var(--rw-primary);
        background: #fff;
        border: 1px solid var(--rw-border-strong);
        border-radius: 9px;
        cursor: pointer;
    }

    .sidebar-toggle span {
        width: 17px;
        height: 2px;
        display: block;
        background: currentColor;
        border-radius: 999px;
    }

    .app-top > b {
        max-width: min(46vw, 220px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
    }

    .app-top form .btn {
        min-height: 36px;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 12px;
    }

    .content {
        padding: 18px 13px 30px;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-head .btn {
        align-self: flex-start;
    }

    .form-grid,
    .filter-grid,
    .address-filter-grid,
    .user-filter-grid,
    .stat-grid,
    .grid,
    .cards,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .pager-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .pager-right {
        width: 100%;
        justify-content: space-between;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 460px) {
    .sidebar {
        width: min(91vw, 310px);
    }

    .content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-top {
        gap: 8px;
    }

    .app-top > b {
        max-width: 34vw;
    }

    .pager-right {
        align-items: flex-start;
        flex-direction: column;
    }

    .pager-summary {
        white-space: normal;
    }

    .pagination a,
    .pagination span {
        min-width: 30px;
        height: 30px;
    }
}
