* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #0b73b7;
    --primary-dark: #075b92;
    --accent: #17a2b8;
    --success: #218838;
    --danger: #c82333;
    --warning: #b7791f;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #d9e2ec;
    --surface: #ffffff;
    --page: #f4f8fb;
}

html,
body {
    scrollbar-gutter: stable;
}

body {
    overflow-y: scroll !important;
    scrollbar-gutter: stable;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #e7eef4;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: #8aa0b2;
    border: 3px solid #e7eef4;
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: #61798c;
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

.login-page {
    align-items: center;
    background:
        radial-gradient(circle at 20% 12%, rgba(23, 162, 184, 0.22), transparent 28%),
        linear-gradient(135deg, #f7fbff 0%, #e7f4f2 48%, #d9ecf8 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 20px;
    position: relative;
}

.login-page::before {
    background: linear-gradient(160deg, #0b73b7 0%, #0f9f9a 68%, #ffffff 68%);
    content: "";
    inset: 0;
    opacity: 0.11;
    position: absolute;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-menu {
    align-items: center;
    background: linear-gradient(135deg, #0b73b7 0%, #0f9f9a 100%);
    box-shadow: 0 2px 12px rgba(15, 35, 52, 0.18);
    color: #fff;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 6px 20px;
}

.brand {
    align-items: center;
    color: #fff;
    display: inline-flex;
    gap: 10px;
    min-width: 220px;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: #fff;
    border-radius: 8px;
    color: var(--primary);
    display: inline-flex;
    font-size: 22px;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    position: relative;
    width: 36px;
}

.brand-mark::after {
    background: var(--accent);
    border-radius: 50% 50% 50% 0;
    bottom: 5px;
    content: "";
    height: 10px;
    position: absolute;
    right: 4px;
    transform: rotate(-45deg);
    width: 10px;
}

.login-container {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 35, 52, 0.18);
    max-width: 460px;
    padding: 42px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.login-brand {
    margin-bottom: 30px;
    text-align: center;
}

.login-logo {
    background: #fff;
    border: 4px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 18px 34px rgba(11, 115, 183, 0.2);
    display: block;
    height: 128px;
    margin: 0 auto 18px;
    object-fit: contain;
    width: 128px;
}

.login-brand .brand-mark {
    border-radius: 18px;
    box-shadow: 0 18px 34px rgba(11, 115, 183, 0.2);
    font-size: 54px;
    height: 96px;
    margin: 0 auto 18px;
    width: 96px;
}

.login-brand .brand-mark::after {
    bottom: 13px;
    height: 24px;
    right: 11px;
    width: 24px;
}

.login-brand h1 {
    color: #083f66;
    font-size: 42px;
    line-height: 1;
    margin: 0;
}

.login-brand p {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
}

.login-home-link {
    color: var(--primary-dark);
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-top: 22px;
    text-align: center;
}

.brand-name,
.brand-subtitle {
    display: block;
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 600;
}

.menu-items {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.menu-items a {
    border-radius: 5px;
    color: #fff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 9px;
    text-decoration: none;
}

.menu-items a:hover,
.menu-items a:focus,
.menu-items a.active {
    background: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.dashboard-content,
.content,
.container {
    margin: 0 auto;
    max-width: 1400px;
    padding: 28px;
    width: 100%;
}

.page-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

h1 {
    font-size: 30px;
    margin-bottom: 18px;
}

h2,
h3 {
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 24px 0;
}

.stat-card,
.form-container,
.generator-box,
.filter-bar,
.panel,
.quick-actions,
.report-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 35, 52, 0.08);
    padding: 20px;
}

.stat-card {
    text-align: center;
}

.stat-card h3 {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
}

.stat-number {
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
}

.data-table,
.bill-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-collapse: collapse;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 35, 52, 0.08);
    margin: 18px 0;
    overflow: hidden;
    width: 100%;
}

.data-table th,
.data-table td,
.bill-table th,
.bill-table td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th,
.bill-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.data-table tr:hover,
.bill-table tr:hover {
    background: #edf7fb;
}

input,
select,
textarea,
.form-container input,
.form-container select,
.form-container textarea,
.generator-box input,
.generator-box select,
.search-box input {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 15px;
    margin: 8px 0;
    padding: 10px 12px;
}

.login-container input,
.form-container input,
.form-container select,
.form-container textarea,
.search-box input {
    width: 100%;
}

.login-container input {
    background: #f8fbfd;
    border-color: #d7e3ec;
    border-radius: 8px;
    margin: 6px 0 0;
    padding: 13px 14px;
}

.login-container input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 115, 183, 0.12);
    outline: none;
}

.login-container button {
    background: linear-gradient(135deg, #0b73b7 0%, #0f9f9a 100%);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(11, 115, 183, 0.2);
    font-size: 15px;
    margin: 12px 0 0;
    padding: 13px 16px;
    width: 100%;
}

.login-container button:hover {
    background: linear-gradient(135deg, #075b92 0%, #0d837f 100%);
}

.login-container .form-group {
    display: block;
    margin: 0 0 16px;
    width: 100%;
}

.form-group {
    display: inline-block;
    margin: 0 15px 10px 0;
    vertical-align: bottom;
}

.monthly-generator-form {
    margin-top: 14px;
}

.monthly-generator-main {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.4fr);
}

.monthly-generator-left,
.monthly-generator-right {
    min-width: 0;
}

.monthly-generator-left .form-group,
.monthly-generator-right .form-group {
    display: block;
    margin: 0 0 14px;
    width: 100%;
}

.monthly-generator-form input,
.monthly-generator-form select,
.monthly-generator-form textarea {
    width: 100%;
}

.monthly-generator-form textarea {
    min-height: 132px;
    resize: vertical;
}

.monthly-generator-form small {
    color: var(--muted);
    display: block;
    line-height: 1.4;
    margin-top: 2px;
}

.monthly-generator-actions {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 16px;
}

label {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

button,
.btn-primary,
.btn-secondary,
.btn-print,
.btn-success {
    background: var(--primary);
    border: 0;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    margin: 6px 6px 6px 0;
    padding: 10px 16px;
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-print:hover,
.btn-success:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-print,
.btn-success {
    background: var(--success);
}

.btn-print:hover,
.btn-success:hover {
    background: #17692a;
}

.search-box {
    margin: 18px 0;
}

.payment-search {
    margin-bottom: 18px;
}

.payment-flow-selector {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.payment-flow-option {
    align-items: center;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    min-height: 112px;
    padding: 16px 20px;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.payment-flow-option:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    box-shadow: 0 8px 24px rgba(17, 20, 24, 0.08);
    color: var(--ink);
    transform: translateY(-1px);
}

.payment-flow-option.active {
    background: var(--primary);
    box-shadow: 0 8px 24px rgba(11, 115, 183, 0.22);
    color: #fff;
}

.payment-flow-option strong {
    font-size: 18px;
}

.payment-flow-option span {
    font-weight: 700;
}

.payment-flow-option small,
.payment-card-intro {
    color: var(--muted);
}

.payment-flow-option.active small {
    color: rgba(255, 255, 255, 0.82);
}

.no-account-payment-card {
    margin-left: auto;
    margin-right: auto;
    max-width: 820px;
}

.payment-page {
    max-width: 1180px;
}

.payment-titlebar,
.page-titlebar {
    align-items: flex-end;
    background: linear-gradient(135deg, #18344a 0%, #1f6f78 58%, #b8872b 100%);
    border-radius: 8px;
    box-shadow: 0 16px 35px rgba(24, 52, 74, 0.2);
    color: #fff;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 22px 24px;
}

.payment-titlebar h1,
.page-titlebar h1 {
    font-size: 28px;
    margin: 0 0 4px;
}

.payment-titlebar p,
.page-titlebar p {
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
}

.payment-titlebar .payment-badge,
.page-titlebar .page-badge {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    color: #fff;
    font-weight: 800;
    padding: 8px 12px;
}

.payment-card {
    background: var(--surface);
    border: 1px solid #d7c69b;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(24, 52, 74, 0.1);
    margin-bottom: 18px;
    padding: 20px;
}

.payment-card h2 {
    color: #18344a;
    font-size: 20px;
    margin-bottom: 14px;
}

.payment-card input,
.payment-card select {
    width: 100%;
}

.inline-search {
    align-items: center;
    display: flex;
    gap: 10px;
}

.inline-search input {
    flex: 1;
}

.payment-workspace {
    align-items: stretch;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    width: 100%;
}

.payment-workspace .payment-card {
    height: 100%;
    margin-bottom: 0;
}

.payment-workspace .payment-summary-card {
    flex: 0 0 380px;
}

.payment-workspace > .payment-card:not(.payment-summary-card) {
    flex: 1 0 620px;
}

.payment-summary-card {
    border-color: #b8d9dc;
}

.payment-summary-top {
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.payment-summary-top h2 {
    margin-bottom: 6px;
}

.payment-summary-top p {
    margin: 4px 0;
}

.payment-summary-list {
    display: grid;
    gap: 10px;
}

.payment-summary-list div {
    align-items: center;
    background: #f8fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.payment-summary-list strong {
    color: var(--muted);
    font-size: 13px;
}

.payment-summary-list span {
    color: var(--ink);
    font-weight: 800;
    text-align: right;
}

.payment-summary-link {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.payment-summary-link:hover {
    color: var(--primary-dark);
}

.payment-summary-list .balance {
    background: #fff8e8;
    border-color: #d7c69b;
}

.payment-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: calc(100% - 38px);
}

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

.payment-field input,
.payment-field select {
    margin-bottom: 0;
}

.payment-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 12px;
    place-self: end stretch;
}

.payment-actions button {
    background: #18344a;
    min-width: 170px;
}

.payment-actions button:hover {
    background: #10283a;
}

.consumer-payment-summary {
    margin-bottom: 18px;
}

.consumer-payment-summary h2 {
    margin-bottom: 6px;
}

.consumer-payment-summary p {
    margin: 4px 0;
}

.summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 16px;
}

.summary-grid div {
    background: #f8fbfd;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

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

.summary-grid strong {
    color: var(--muted);
    font-size: 13px;
}

.summary-grid span {
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    margin-top: 4px;
}

.summary-grid .balance {
    background: #e8f7f9;
    border-color: #abdde5;
}

.success,
.message {
    background: #d4edda;
    border: 1px solid #b7dfc2;
    color: #155724;
    padding: 12px 14px;
    border-radius: 5px;
    margin: 12px 0 18px;
}

.error {
    background: #f8d7da;
    border: 1px solid #f1b0b7;
    color: #721c24;
    padding: 12px 14px;
    border-radius: 5px;
    margin: 12px 0 18px;
}

.info,
.notice {
    background: #d1ecf1;
    border: 1px solid #abdde5;
    color: #0c5460;
    padding: 12px 14px;
    border-radius: 5px;
    margin: 12px 0;
}

.notice.warning {
    background: #fff3cd;
    border-color: #ffe08a;
    color: #664d03;
}

.filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.filter-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.status-paid {
    color: var(--success);
    font-weight: 800;
}

.status-unpaid,
.red-alert {
    color: var(--danger);
    font-weight: 800;
}

.red-bill-row {
    background: #ffe5e8;
}

.empty-state {
    color: var(--muted);
    padding: 36px;
    text-align: center;
}

.modal-backdrop {
    align-items: center;
    background: rgba(15, 35, 52, 0.58);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 1000;
}

.modal-backdrop.is-visible {
    display: flex;
}

.modal-panel {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(15, 35, 52, 0.3);
    max-width: 520px;
    padding: 24px;
    position: relative;
    width: 100%;
}

.modal-close {
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    margin: 0;
    padding: 0 4px;
    position: absolute;
    right: 14px;
    top: 10px;
}

.modal-close:hover {
    background: transparent;
    color: var(--ink);
}

.modal-account {
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.modal-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.modal-details div {
    display: grid;
    gap: 12px;
    grid-template-columns: 150px 1fr;
    padding: 10px 12px;
}

.modal-details div + div {
    border-top: 1px solid var(--line);
}

.modal-details strong {
    color: var(--muted);
}

.site-footer {
    color: var(--muted);
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: auto;
    padding: 18px;
}

@media (max-width: 860px) {
    .top-menu {
        align-items: flex-start;
        flex-direction: column;
    }

    .menu-items {
        justify-content: flex-start;
    }

    .dashboard-content,
    .content,
    .container {
        padding: 18px;
    }

    .form-group,
    .generator-box input,
    .generator-box select {
        width: 100%;
    }

    .monthly-generator-main {
        grid-template-columns: 1fr;
    }

    .payment-titlebar,
    .page-titlebar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .payment-form-grid {
        grid-template-columns: 1fr;
    }

    .payment-flow-selector {
        grid-template-columns: 1fr;
    }

    .payment-workspace {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .inline-search {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 22px 14px;
    }

    .login-container {
        padding: 30px 22px;
    }

    .login-logo {
        height: 108px;
        width: 108px;
    }

    .login-brand .brand-mark {
        font-size: 46px;
        height: 82px;
        width: 82px;
    }

    .login-brand .brand-mark::after {
        bottom: 11px;
        height: 20px;
        right: 9px;
        width: 20px;
    }

    .login-brand h1 {
        font-size: 36px;
    }
}

/* Codex-inspired app shell refresh */
:root {
    --primary: #2f6fed;
    --primary-dark: #2458bd;
    --accent: #0f9f8f;
    --success: #138a63;
    --danger: #c2413b;
    --warning: #a66b00;
    --ink: #1b1f24;
    --muted: #66707c;
    --line: #d8dee6;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --page: #f2f4f7;
    --nav: #111418;
    --nav-muted: #9aa3ad;
    --nav-line: #252a31;
    --focus: rgba(47, 111, 237, 0.18);
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a {
    color: #2458bd;
}

.app-container {
    background: var(--page);
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.top-menu {
    align-content: start;
    align-items: stretch;
    background: var(--nav);
    border-right: 1px solid var(--nav-line);
    box-shadow: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100vh;
    justify-content: flex-start;
    left: 0;
    padding: 18px 14px;
    position: sticky;
    top: 0;
}

.brand {
    border: 1px solid var(--nav-line);
    border-radius: 8px;
    color: #fff;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    width: 100%;
}

.brand-mark {
    background: #f4f7fb;
    border-radius: 7px;
    color: #111418;
    flex: 0 0 34px;
    font-size: 20px;
    height: 34px;
    width: 34px;
}

.brand-mark::after {
    background: var(--accent);
    bottom: 5px;
    height: 8px;
    right: 5px;
    width: 8px;
}

.brand-name {
    color: #fff;
    font-size: 16px;
    font-weight: 750;
}

.brand-subtitle {
    color: var(--nav-muted);
    font-size: 11px;
    font-weight: 600;
}

.menu-items {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
}

.menu-items a {
    align-items: center;
    border-radius: 7px;
    color: #d7dde5;
    display: flex;
    font-size: 14px;
    font-weight: 650;
    min-height: 38px;
    padding: 9px 11px;
}

.menu-items a:hover,
.menu-items a:focus,
.menu-items a.active {
    background: #20262e;
    color: #fff;
}

.menu-items a.active {
    box-shadow: inset 3px 0 0 var(--accent);
}

.dashboard-content,
.content,
.container {
    max-width: 1480px;
    padding: 28px 32px;
}

.page-titlebar,
.payment-titlebar {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--ink);
    margin-bottom: 18px;
    padding: 18px 20px;
}

.page-titlebar h1,
.payment-titlebar h1 {
    color: #111418;
    font-size: 26px;
    font-weight: 760;
    letter-spacing: 0;
}

.page-titlebar p,
.payment-titlebar p {
    color: var(--muted);
}

.page-titlebar .page-badge,
.payment-titlebar .payment-badge {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #39414d;
    font-size: 12px;
    padding: 7px 11px;
}

.stat-card,
.form-container,
.generator-box,
.filter-bar,
.panel,
.quick-actions,
.report-menu,
.payment-card,
.search-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.stat-card {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 118px;
    text-align: left;
}

.stat-card h3 {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
}

.stat-number {
    color: #111418;
    font-size: 30px;
    font-weight: 780;
}

.quick-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-actions h2 {
    flex-basis: 100%;
}

h1,
h2,
h3 {
    color: #151a20;
    font-weight: 750;
    letter-spacing: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

label {
    color: #4d5662;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea,
.form-container input,
.form-container select,
.form-container textarea,
.generator-box input,
.generator-box select,
.search-box input {
    background: #fff;
    border: 1px solid #cfd6df;
    border-radius: 7px;
    color: var(--ink);
    font-size: 14px;
    margin: 6px 0 10px;
    min-height: 40px;
    padding: 9px 11px;
}

textarea {
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus);
    outline: none;
}

button,
.btn-primary,
.btn-secondary,
.btn-print,
.btn-success {
    background: #111418;
    border: 1px solid #111418;
    border-radius: 7px;
    box-shadow: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 13px;
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-print:hover,
.btn-success:hover {
    background: #2b323b;
    border-color: #2b323b;
}

.btn-print,
.btn-success {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-print:hover,
.btn-success:hover {
    background: #0b7f73;
    border-color: #0b7f73;
}

.data-table,
.bill-table {
    border: 1px solid var(--line);
    border-collapse: separate;
    border-radius: 8px;
    border-spacing: 0;
    box-shadow: none;
    overflow: hidden;
}

.data-table th,
.bill-table th {
    background: #f4f6f8;
    border-bottom: 1px solid var(--line);
    color: #3d4652;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

.data-table th,
.data-table td,
.bill-table th,
.bill-table td {
    border-bottom: 1px solid #e7ebf0;
    padding: 10px 12px;
}

.data-table tr:hover,
.bill-table tr:hover {
    background: #f8fafc;
}

.success,
.message,
.error,
.info,
.notice {
    border-radius: 8px;
    box-shadow: none;
}

.success,
.message {
    background: #eefaf4;
    border-color: #bfe8d3;
    color: #125a3e;
}

.error {
    background: #fff0ef;
    border-color: #f0c2bf;
    color: #8f241e;
}

.info,
.notice {
    background: #eef6ff;
    border-color: #bdd9f8;
    color: #1f4d7a;
}

.notice.warning {
    background: #fff8e8;
    border-color: #ead19a;
    color: #6f4b00;
}

.payment-card h2 {
    color: #151a20;
}

.payment-summary-list div,
.summary-grid div {
    background: var(--surface-soft);
    border-color: var(--line);
}

.payment-summary-list .balance,
.summary-grid .balance {
    background: #edf9f7;
    border-color: #b9e3dd;
}

.payment-actions button {
    background: #111418;
}

.payment-actions button:hover {
    background: #2b323b;
}

.login-page {
    background: #111418;
}

.login-page::before {
    display: none;
}

.login-container {
    border: 1px solid #dce2ea;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.login-brand h1 {
    color: #111418;
}

.login-container button {
    background: #111418;
}

.login-container button:hover {
    background: #2b323b;
}

@media (max-width: 980px) {
    .app-container {
        display: flex;
        flex-direction: column;
    }

    .top-menu {
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .brand {
        width: auto;
    }

    .menu-items {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 2px;
        width: 100%;
    }

    .menu-items a {
        white-space: nowrap;
    }

    .dashboard-content,
    .content,
    .container {
        padding: 18px;
    }
}

/* Compact top menu refresh */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
}

html {
    min-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body:not(.login-page) {
    min-height: 100vh;
    overflow-y: scroll !important;
    padding-bottom: 34px;
    scrollbar-gutter: stable;
}

.app-container {
    background: var(--page);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-menu {
    align-items: center;
    background: #111418;
    border-bottom: 1px solid #252a31;
    border-right: 0;
    box-shadow: none;
    color: #d8dde5;
    display: flex;
    flex-direction: row;
    gap: 10px;
    height: 42px;
    justify-content: flex-start;
    padding: 0 10px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    align-items: center;
    border: 0;
    border-radius: 0;
    color: #eef1f5;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 7px;
    min-width: 0;
    padding: 0 10px 0 0;
    width: auto;
}

.brand-mark {
    background: #eef1f5;
    border-radius: 5px;
    color: #111418;
    flex: 0 0 22px;
    font-size: 13px;
    font-weight: 500;
    height: 22px;
    width: 22px;
}

.brand-mark::after {
    bottom: 3px;
    height: 5px;
    right: 3px;
    width: 5px;
}

.brand-name {
    color: #eef1f5;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.1;
}

.brand-subtitle {
    color: #9aa3af;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.1;
}

.menu-items {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    gap: 2px;
    justify-content: flex-start;
    min-width: 0;
}

.header-status {
    align-items: center;
    color: #aeb7c2;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 400;
    gap: 10px;
    line-height: 1;
    margin-left: auto;
    white-space: nowrap;
}

.header-status span {
    display: inline-flex;
}

.header-time {
    border-left: 1px solid #343a43;
    color: #d8dde5;
    padding-left: 10px;
}

.menu-group {
    position: relative;
}

.menu-trigger {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: #d8dde5;
    cursor: default;
    display: inline-flex;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    min-height: 28px;
    padding: 0 9px;
}

.menu-trigger:hover,
.menu-trigger:focus,
.menu-trigger.active,
.menu-group:focus-within .menu-trigger,
.menu-group:hover .menu-trigger {
    background: #252a31;
    color: #fff;
    outline: none;
}

.dropdown-menu {
    background: #181c22;
    border: 1px solid #303640;
    border-radius: 7px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
    display: none;
    left: 0;
    min-width: 210px;
    padding: 5px;
    position: absolute;
    top: calc(100% + 4px);
    z-index: 1200;
}

.menu-group:hover .dropdown-menu,
.menu-group:focus-within .dropdown-menu {
    display: grid;
    gap: 1px;
}

.dropdown-wide {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    min-width: 420px;
}

.menu-items a,
.dropdown-menu a {
    align-items: center;
    background: transparent;
    border-radius: 5px;
    box-shadow: none;
    color: #d8dde5;
    display: flex;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    min-height: 28px;
    padding: 6px 9px;
    text-decoration: none;
    white-space: nowrap;
}

.menu-items a:hover,
.menu-items a:focus,
.menu-items a.active,
.dropdown-menu a:hover,
.dropdown-menu a:focus,
.dropdown-menu a.active {
    background: #2a3038;
    color: #fff;
    outline: none;
    text-decoration: none;
}

.menu-items a.active {
    box-shadow: none;
}

.dashboard-content,
.content,
.container {
    max-width: 1480px;
    padding: 22px 28px 64px;
}

.site-footer {
    align-items: center;
    background: #111418;
    border-top: 1px solid #252a31;
    bottom: 0;
    color: #d8dde5;
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 400;
    gap: 9px;
    justify-content: center;
    left: 0;
    line-height: 1;
    margin: 0;
    min-height: 30px;
    padding: 7px 12px;
    position: fixed;
    right: 0;
    z-index: 1100;
}

.site-footer span + span::before {
    color: #69717d;
    content: "|";
    margin-right: 9px;
}

.footer-note {
    display: none;
}

h1 {
    font-size: 24px;
    font-weight: 500;
}

h2 {
    font-size: 18px;
    font-weight: 500;
}

h3 {
    font-size: 15px;
    font-weight: 500;
}

label,
.data-table th,
.bill-table th,
button,
.btn-primary,
.btn-secondary,
.btn-print,
.btn-success {
    font-weight: 500;
}

input,
select,
textarea,
.form-container input,
.form-container select,
.form-container textarea,
.generator-box input,
.generator-box select,
.search-box input {
    font-size: 13px;
}

@media (max-width: 980px) {
    .top-menu {
        align-items: flex-start;
        flex-wrap: wrap;
        height: auto;
        padding: 8px 10px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .brand {
        width: 100%;
    }

    .menu-items {
        overflow-x: auto;
        padding-bottom: 2px;
        width: 100%;
    }

    .header-status {
        justify-content: space-between;
        margin-left: 0;
        padding-top: 2px;
        width: 100%;
    }

    .dropdown-menu {
        position: fixed;
        top: 76px;
    }

    .dropdown-wide {
        grid-template-columns: 1fr;
        min-width: min(300px, calc(100vw - 20px));
    }

    .dashboard-content,
    .content,
    .container {
        padding: 16px 16px 64px;
    }
}

/* Matching compact menu for older Bootstrap report pages */
.navbar.navbar-expand-lg {
    background: #111418 !important;
    border-bottom: 1px solid #252a31;
    box-shadow: none !important;
    min-height: 42px;
    padding: 0 10px !important;
    position: sticky !important;
    top: 0;
    z-index: 1200;
}

.navbar.navbar-expand-lg .container-fluid {
    align-items: center;
    display: flex;
    min-height: 42px;
}

.navbar.navbar-expand-lg .navbar-brand {
    color: #eef1f5 !important;
    font-size: 13px;
    font-weight: 400 !important;
    margin-right: 18px;
    padding: 0;
}

.navbar.navbar-expand-lg .navbar-nav {
    align-items: center;
    flex-direction: row;
    gap: 2px;
}

.navbar.navbar-expand-lg .nav-link {
    border-radius: 5px;
    color: #d8dde5 !important;
    font-size: 12px;
    font-weight: 400 !important;
    line-height: 1;
    min-height: 28px;
    padding: 8px 9px !important;
}

.navbar.navbar-expand-lg .nav-link:hover,
.navbar.navbar-expand-lg .nav-link:focus {
    background: #252a31;
    color: #fff !important;
}

.navbar.navbar-expand-lg .header-status {
    margin-left: auto;
}

@media print {
    body {
        padding-bottom: 0 !important;
    }

    .site-footer {
        display: none !important;
    }
}

/* Admin user creation */
.user-create-panel {
    margin-top: 18px;
}

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

.user-create-form .form-group {
    display: block;
    margin: 0;
    width: auto;
}

.user-create-form input,
.user-create-form select {
    width: 100%;
}

.user-create-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    grid-column: 1 / -1;
    margin-top: 4px;
}

.user-create-actions span {
    color: var(--muted);
    font-size: 12px;
}

.user-list-heading {
    margin-top: 26px;
}

@media (max-width: 720px) {
    .user-create-form {
        grid-template-columns: 1fr;
    }

    .user-create-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Keep one document scroller so sticky navigation remains pinned. */
html {
    overflow-y: auto !important;
}

html body:not(.login-page) {
    overflow-y: visible !important;
}

/* Daily database backup */
.menu-link-form {
    margin: 0;
}

.dropdown-menu .menu-link-form button {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
    display: block;
    font: inherit;
    font-weight: 500;
    min-height: 0;
    padding: 9px 12px;
    text-align: left;
    width: 100%;
}

.dropdown-menu .menu-link-form button:hover {
    background: #eef3f7;
    color: #111418;
}

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

.backup-status-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backup-status-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.backup-status-value {
    color: #18212a;
    font-size: 22px;
}

.backup-status-value.is-current {
    color: #14734f;
}

.backup-status-value.is-due {
    color: #9a4d12;
}

.backup-create-panel {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.backup-create-panel h2,
.backup-create-panel p {
    margin-bottom: 5px;
}

.backup-create-panel form,
.backup-download-form {
    margin: 0;
}

.backup-advice {
    margin-top: 18px;
}

.backup-history-heading {
    margin-top: 28px;
}

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

.backup-table-wrap .data-table {
    min-width: 700px;
}

.backup-table-wrap code {
    color: #34495e;
    font-size: 12px;
}

@media (max-width: 720px) {
    .backup-summary-grid {
        grid-template-columns: 1fr;
    }

    .backup-create-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}
