@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #f4f7f6;
    --panel: #ffffff;
    --text: #16201d;
    --muted: #65736f;
    --line: #dce6e2;
    --primary: #087f7a;
    --primary-dark: #05615d;
    --accent: #f2a541;
    --danger: #b42318;
    --success: #11845b;
    --warning: #b7791f;
    --shadow: 0 18px 45px rgba(12, 32, 28, 0.09);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(8, 127, 122, 0.08), transparent 260px),
        var(--bg);
    color: var(--text);
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
    letter-spacing: 0;
}

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

code {
    direction: ltr;
    display: inline-block;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    background: #10231f;
    color: #eef8f6;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 20px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 23px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    border-radius: var(--radius);
    background: #fff;
}

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

.brand small {
    margin-top: 4px;
    color: rgba(238, 248, 246, 0.72);
    font-size: 12px;
}

.nav-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.nav-group {
    display: grid;
    gap: 5px;
}

.nav-group-toggle,
.nav-list a {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: rgba(238, 248, 246, 0.78);
    font-weight: 800;
    text-align: right;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-group-toggle {
    justify-content: space-between;
}

.nav-group-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-group-toggle:hover,
.nav-group-toggle.active,
.nav-list a:hover,
.nav-list a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-chevron {
    font-size: 13px;
    transition: transform 0.18s ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.nav-group-items {
    display: grid;
    gap: 4px;
    padding: 2px 10px 4px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-group-items a {
    min-height: 38px;
    padding: 8px 10px;
    color: rgba(238, 248, 246, 0.68);
    font-size: 14px;
    font-weight: 700;
}

.content-shell {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    padding: 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 28px;
    font-weight: 800;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar-user > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 800;
}

.topbar-logout {
    min-width: 92px;
    min-height: 42px;
    padding-inline: 16px;
    font-weight: 900;
}

.topbar-logout i {
    font-size: 17px;
}

.swal2-popup.app-swal {
    direction: rtl;
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
}

.swal2-popup.app-swal .swal2-title {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.swal2-popup.app-swal .swal2-html-container {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
}

.swal2-popup.app-swal .swal2-actions {
    gap: 10px;
}

.swal2-popup.app-swal .swal-action-button {
    min-width: 120px;
    margin: 0 !important;
}

.swal2-popup.app-swal .swal2-icon.swal2-warning {
    border-color: var(--accent);
    color: var(--accent);
}

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.topbar-action,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-danger-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
}

.topbar-action,
.btn-outline {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
}

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

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

.btn-secondary {
    background: #233f39;
    color: #fff;
}

.btn-danger-soft {
    background: #fff1f0;
    color: var(--danger);
    border-color: #ffd7d2;
}

.page-content {
    display: grid;
    flex: 1 0 auto;
    gap: 18px;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    gap: 12px;
    margin-top: 24px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(12, 32, 28, 0.06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.app-footer span {
    min-width: 0;
}

.app-footer strong {
    color: var(--text);
    font-weight: 900;
}

.landing-splash {
    display: grid;
    min-height: min(640px, calc(100vh - 190px));
    place-items: center;
    padding: clamp(28px, 7vw, 82px);
    background:
        linear-gradient(135deg, rgba(8, 127, 122, 0.11), rgba(242, 165, 65, 0.1)),
        #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.landing-brand-lockup {
    display: grid;
    justify-items: center;
    max-width: 680px;
    text-align: center;
}

.landing-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(96px, 14vw, 150px);
    height: clamp(96px, 14vw, 150px);
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #c9d9d5;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(12, 32, 28, 0.12);
    color: var(--primary);
    font-size: clamp(48px, 8vw, 78px);
}

.landing-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.landing-brand-lockup h2 {
    margin: 0;
    color: #10231f;
    font-size: clamp(32px, 6vw, 58px);
    font-weight: 900;
    line-height: 1.25;
}

.landing-brand-lockup p {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 700;
    line-height: 1.8;
}

.panel,
.stat-card,
.table-panel,
.install-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel,
.table-panel {
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 14px;
}

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

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

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

.grid-span-all {
    grid-column: 1 / -1;
    box-shadow: none;
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
}

.modal-body {
    background: #fbfdfc;
}

.tier-box {
    padding: 16px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.remote-select {
    position: relative;
}

.remote-select-results {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 280px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
}

.remote-select-option {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 10px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    text-align: right;
}

.remote-select-option:hover,
.remote-select-option:focus {
    background: #eef5f3;
    outline: 0;
}

.remote-select-option small,
.remote-select-empty {
    color: var(--muted);
    font-size: 12px;
}

.remote-select-empty {
    padding: 12px;
    text-align: center;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 14px;
}

.page-link-btn,
.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-weight: 800;
}

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

.page-link-btn.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.mobile-entry-screen {
    min-height: 100vh;
    background: #eef5f3;
}

.mobile-entry {
    width: min(560px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    align-content: start;
    gap: 14px;
}

.mobile-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.mobile-entry-head h1 {
    margin: 8px 0 4px;
    font-size: 26px;
    font-weight: 900;
}

.mobile-entry-head p {
    margin: 0;
    color: var(--muted);
}

.mobile-reading-form {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.camera-reader {
    display: grid;
    gap: 10px;
    padding: 14px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.camera-reader p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.camera-button {
    width: 100%;
}

.ocr-preview {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: #10231f;
    border-radius: var(--radius);
}

.ocr-status {
    min-height: 22px;
    color: var(--primary);
    font-weight: 800;
}

.ocr-candidates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 2px;
}

.ocr-candidates-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ocr-candidate {
    min-height: 34px;
    padding: 5px 11px;
    border: 1px solid #cfdcda;
    border-radius: 8px;
    background: #fff;
    color: #182522;
    font-weight: 800;
    line-height: 1;
}

.ocr-candidate.is-selected {
    border-color: var(--primary);
    background: #e5f3f0;
    color: var(--primary);
}

.mobile-submit {
    width: 100%;
    min-height: 52px;
    font-size: 17px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #2a3834;
    font-size: 13px;
    font-weight: 800;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #cfdcda;
    border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(8, 127, 122, 0.14);
}

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

.compact-actions {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
}

.compact-actions form {
    margin: 0;
}

.icon-action {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
}

.icon-action i {
    margin: 0;
    font-size: 15px;
    line-height: 1;
}

.action-cell {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

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

.stat-card {
    padding: 16px;
}

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

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    font-weight: 900;
}

.stat-card i {
    float: left;
    color: var(--primary);
    font-size: 24px;
}

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

.dashboard-insights article,
.chart-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-insights article {
    display: grid;
    gap: 5px;
    padding: 14px;
    background:
        linear-gradient(135deg, rgba(8, 127, 122, 0.09), transparent 70%),
        #fff;
}

.dashboard-insights span,
.dashboard-insights small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-insights strong {
    color: #10231f;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

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

.chart-card {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(8, 127, 122, 0.045), transparent 120px),
        #fff;
}

.chart-card-wide {
    grid-column: span 2;
}

.chart-card .panel-header {
    margin-bottom: 0;
}

.chart-card .panel-header h3 {
    font-size: 17px;
}

.chart-card .panel-header p {
    font-size: 13px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 285px;
    min-height: 285px;
    overflow: hidden;
}

.chart-card-wide .chart-box {
    height: 320px;
    min-height: 320px;
}

.chart-box-donut {
    height: 260px;
    min-height: 260px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: rgba(8, 127, 122, 0.04);
}

.table-panel {
    overflow: hidden;
}

.table-responsive {
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #eef5f3;
    color: #273b36;
    font-size: 13px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.badge-status,
.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-soft {
    background: rgba(8, 127, 122, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(17, 132, 91, 0.12);
    color: var(--success);
}

.badge-warning {
    background: rgba(183, 121, 31, 0.14);
    color: var(--warning);
}

.badge-danger {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.badge-muted {
    background: rgba(101, 115, 111, 0.14);
    color: var(--muted);
}

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

.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    border: 1px solid var(--line);
}

.alert-success {
    background: rgba(17, 132, 91, 0.12);
    color: var(--success);
    border-color: rgba(17, 132, 91, 0.28);
}

.alert-danger {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.24);
}

.filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
}

.filters .field {
    min-width: 170px;
}

.customers-filters {
    width: 100%;
}

.customers-filters .customer-search-field {
    flex: 1 1 560px;
    min-width: 420px;
}

.customers-filters .field:not(.customer-search-field) {
    flex: 0 0 180px;
}

.statement-filters {
    width: 100%;
}

.statement-filters .field:first-child {
    flex: 0 1 430px;
    min-width: 340px;
}

.statement-filters .field:not(:first-child) {
    flex: 0 0 170px;
}

.statement-filters .btn-secondary {
    margin-inline-start: auto;
}

.company-profile-form {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.company-logo-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.company-logo-preview {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    background: #fff;
    border: 1px dashed #b8c8c4;
    border-radius: var(--radius);
}

.company-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.company-logo-preview span {
    color: var(--primary);
    font-size: 54px;
}

.company-logo-remove {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--danger);
    font-weight: 800;
}

.company-profile-fields {
    align-self: stretch;
}

.company-profile-actions {
    grid-column: 2;
}

.payment-customer-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.payment-customer-summary > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.payment-customer-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.payment-customer-summary strong {
    font-size: 15px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.receipt-paper {
    display: grid;
    gap: 16px;
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.receipt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #10231f;
}

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

.receipt-brand img,
.receipt-brand span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: #eef5f3;
    color: var(--primary);
    font-size: 28px;
    object-fit: contain;
}

.receipt-brand img {
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
}

.receipt-brand strong,
.receipt-brand small,
.receipt-number-box span,
.receipt-number-box strong {
    display: block;
}

.receipt-brand strong {
    font-size: 21px;
    font-weight: 900;
}

.receipt-brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.receipt-number-box {
    min-width: 180px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.receipt-number-box span,
.receipt-info-grid span,
.receipt-amount-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.receipt-number-box strong {
    margin-top: 3px;
    font-size: 18px;
    font-weight: 900;
}

.receipt-title {
    text-align: center;
}

.receipt-title h2 {
    margin: 0 0 4px;
    font-size: 25px;
    font-weight: 900;
}

.receipt-title p,
.receipt-notes {
    margin: 0;
    color: var(--muted);
}

.receipt-amount-box,
.receipt-info-grid {
    display: grid;
    gap: 10px;
}

.receipt-amount-box {
    grid-template-columns: minmax(0, 1fr) 210px;
    padding: 12px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.receipt-amount-box strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
    font-weight: 900;
}

.receipt-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.receipt-info-grid > div {
    display: grid;
    gap: 3px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.receipt-info-grid strong {
    font-size: 14px;
    font-weight: 900;
}

.receipt-lines {
    width: 100%;
    border-collapse: collapse;
}

.receipt-lines th,
.receipt-lines td {
    padding: 9px;
    border: 1px solid #d8e2df;
    vertical-align: middle;
}

.receipt-lines th {
    background: #eef5f3;
    color: #273b36;
    font-size: 13px;
}

.receipt-lines tfoot th {
    background: #f7faf9;
    font-weight: 900;
}

.receipt-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding-top: 24px;
}

.receipt-footer div {
    padding-top: 18px;
    border-top: 1px solid #94a29f;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.install-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.login-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(8, 127, 122, 0.12), transparent 300px),
        var(--bg);
}

.login-panel {
    display: grid;
    gap: 16px;
    width: min(460px, 100%);
}

.login-brand,
.login-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.login-brand strong,
.login-brand small {
    display: block;
}

.login-brand strong {
    font-size: 20px;
    font-weight: 900;
}

.login-brand small {
    margin-top: 3px;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.login-form h1 {
    margin: 10px 0 0;
    font-size: 28px;
    font-weight: 900;
}

.login-submit {
    min-height: 48px;
}

.permissions-box {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.permissions-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.permissions-head strong {
    font-size: 16px;
    font-weight: 900;
}

.permissions-head span {
    color: var(--muted);
    font-size: 13px;
}

.permissions-table th,
.permissions-table td {
    text-align: center;
}

.permissions-table th:nth-child(1),
.permissions-table th:nth-child(2),
.permissions-table td:nth-child(1),
.permissions-table td:nth-child(2) {
    text-align: right;
}

.permissions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.user-flags {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-flags label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.install-panel {
    width: min(760px, 100%);
    padding: 28px;
}

.install-panel h1 {
    margin: 12px 0 8px;
    font-size: 30px;
    font-weight: 900;
}

.install-panel pre {
    margin-top: 18px;
    max-height: 240px;
    overflow: auto;
    direction: ltr;
    text-align: left;
    background: #10231f;
    color: #e8fff9;
    border-radius: var(--radius);
    padding: 14px;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.invoice-paper {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.statement-paper {
    display: grid;
    gap: 16px;
}

.statement-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-paper {
    display: grid;
    gap: 18px;
}

.report-print-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.report-print-head h2 {
    margin: 6px 0 3px;
    font-size: 26px;
    font-weight: 900;
}

.report-print-head p {
    margin: 0 0 4px;
    color: var(--muted);
}

.report-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-filters .field {
    min-width: 160px;
}

.official-report-paper {
    display: grid;
    gap: 14px;
    width: min(1060px, 100%);
    margin: 0 auto;
    padding: 22px;
    background: #fff;
    border: 1px solid #c8d5d1;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.official-report-wide {
    width: min(1240px, 100%);
}

.official-report-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #10231f;
}

.official-report-brand {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 12px;
}

.official-report-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: 0 0 auto;
}

.official-report-brand strong,
.official-report-brand small,
.official-report-meta strong,
.official-report-meta span,
.official-report-table small {
    display: block;
}

.official-report-brand strong {
    font-size: 22px;
    font-weight: 900;
}

.official-report-brand small,
.official-report-meta span,
.official-report-table small {
    color: var(--muted);
    font-size: 12px;
}

.official-report-meta {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid #c8d5d1;
    border-radius: 4px;
    text-align: right;
}

.official-report-meta strong {
    font-size: 16px;
    font-weight: 900;
}

.official-report-titlebar {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    background: #f3f6f5;
    border: 1px solid #c8d5d1;
    border-radius: 4px;
    text-align: center;
}

.official-report-titlebar h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
}

.official-report-titlebar p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.official-report-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1.5px solid #53645f;
    font-size: 13px;
    line-height: 1.45;
}

.official-report-table th,
.official-report-table td {
    padding: 7px 8px;
    border: 1px solid #879792;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.official-report-table th {
    background: #eaf1ef;
    color: #10231f;
    font-weight: 900;
    white-space: nowrap;
    text-align: center;
}

.official-report-table tfoot th {
    background: #edf3f1;
    font-weight: 900;
}

.official-report-table tbody tr:nth-child(even) td {
    background: #fbfdfc;
}

.official-report-table-compact {
    font-size: 12px;
}

.official-report-table-compact th,
.official-report-table-compact td {
    padding: 6px;
}

.official-report-table .num,
.official-report-table .money-cell {
    direction: ltr;
    text-align: center;
    white-space: nowrap;
}

.official-report-table .money-cell {
    text-align: left;
}

.official-report-table .text-cell {
    text-align: right;
}

.official-report-table .col-seq {
    width: 28px;
}

.official-report-table .col-date {
    width: 78px;
}

.official-report-table .col-invoice {
    width: 118px;
}

.official-report-table .col-customer-no {
    width: 58px;
}

.official-report-table .col-customer-name {
    width: 190px;
}

.official-report-table .col-city,
.official-report-table .col-period,
.official-report-table .col-status,
.official-report-table .col-category,
.official-report-table .col-method {
    width: 78px;
}

.official-report-table .col-number {
    width: 82px;
}

.official-report-table .col-money {
    width: 92px;
}

.official-report-table .col-description {
    width: 260px;
}

.official-report-table .col-payee {
    width: 120px;
}

.official-report-table .col-reference {
    width: 100px;
}

.official-report-signatures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding-top: 34px;
}

.official-report-signatures div {
    padding-top: 16px;
    border-top: 1px solid #94a29f;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.invoice-batch-print {
    display: grid;
    gap: 18px;
}

.batch-print-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-print-summary strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 36px;
    color: #fff;
    background: var(--primary);
    border-radius: var(--radius);
}

.invoice-a5-paper {
    direction: ltr;
    display: grid;
    grid-template-columns: 68mm minmax(0, 1fr);
    width: min(1060px, 100%);
    min-height: 520px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.invoice-stub,
.invoice-consumer {
    direction: rtl;
}

.invoice-stub {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    border-right: 1px dashed #7b8a86;
    background: #f7faf9;
}

.stub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

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

.stub-brand img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 auto;
}

.stub-header strong {
    font-size: 14px;
    font-weight: 900;
}

.stub-header span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}

.stub-number {
    padding: 7px;
    background: #10231f;
    color: #fff;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 900;
}

.stub-list {
    display: grid;
    grid-template-columns: 22mm minmax(0, 1fr);
    gap: 5px 7px;
    margin: 0;
    font-size: 12px;
}

.stub-list dt {
    color: var(--muted);
    font-weight: 800;
}

.stub-list dd {
    margin: 0;
    font-weight: 900;
}

.stub-signature {
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid #94a29f;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.invoice-consumer {
    padding: 12px;
}

.a5-header,
.a5-info-grid,
.a5-meter-grid,
.a5-total-grid {
    display: grid;
    gap: 8px;
}

.a5-header {
    grid-template-columns: minmax(0, 1fr) 42mm;
    align-items: start;
    padding-bottom: 8px;
    border-bottom: 2px solid #10231f;
}

.a5-brand-block {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 9px;
}

.a5-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.a5-header h2 {
    margin: 4px 0 1px;
    font-size: 21px;
    font-weight: 900;
}

.a5-header p,
.a5-company-meta,
.a5-notes {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.a5-invoice-no {
    display: grid;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.a5-invoice-no span,
.a5-info-grid span,
.a5-meter-grid span,
.a5-total-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.a5-invoice-no strong {
    font-size: 17px;
    font-weight: 900;
}

.a5-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 8px 0;
}

.a5-info-grid > div,
.a5-meter-grid > div,
.a5-total-grid > div {
    display: grid;
    gap: 3px;
    padding: 6px;
    background: #f3f8f6;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.a5-info-grid strong,
.a5-meter-grid strong,
.a5-total-grid strong {
    font-size: 13px;
    font-weight: 900;
}

.a5-body {
    display: grid;
    grid-template-columns: 50mm minmax(0, 1fr);
    gap: 8px;
}

.a5-history {
    padding: 6px;
    background: #f7faf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.a5-history h3 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 900;
}

.a5-history table,
.a5-lines {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
}

.a5-history table {
    table-layout: fixed;
    font-size: 10px;
}

.a5-history th,
.a5-history td,
.a5-lines th,
.a5-lines td {
    padding: 4px;
    border: 1px solid #d8e2df;
    vertical-align: middle;
}

.a5-history th,
.a5-lines th {
    background: #eef5f3;
    font-weight: 900;
}

.a5-history th:nth-child(1),
.a5-history td:nth-child(1) {
    width: 30%;
}

.a5-history th:nth-child(2),
.a5-history td:nth-child(2) {
    width: 18%;
}

.a5-history th:nth-child(3),
.a5-history td:nth-child(3),
.a5-history th:nth-child(4),
.a5-history td:nth-child(4) {
    width: 26%;
}

.a5-main {
    display: grid;
    align-content: start;
    gap: 7px;
}

.a5-meter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.stub-list dd,
.a5-info-grid strong,
.a5-meter-grid strong,
.a5-total-grid strong,
.a5-lines td,
.a5-history td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.a5-total-grid .due {
    background: #10231f;
    color: #fff;
}

.a5-total-grid .due span {
    color: rgba(255, 255, 255, 0.72);
}

.invoice-a5-paper {
    border-color: #c8d5d1;
    background: #ffffff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.invoice-stub {
    background: #edf6f4;
}

.stub-header {
    background: #dcefeb;
    margin: -4px -4px 0;
    padding: 8px;
    border: 1px solid #b9ccc7;
    border-radius: 6px;
}

.stub-number {
    background: #e8f1ef;
    color: #10231f;
    border: 1px solid #879792;
}

.stub-list {
    padding: 8px;
    background: #fff;
    border: 1px solid #c8d5d1;
    border-radius: 6px;
}

.stub-list dt {
    color: #10231f;
    font-weight: 900;
}

.stub-list dd {
    font-weight: 500;
}

.invoice-consumer {
    background: #fbfdfc;
}

.a5-header {
    padding: 8px;
    background: #f0f6f4;
    border: 1px solid #c8d5d1;
    border-bottom: 2px solid var(--primary);
    border-radius: 6px;
}

.a5-header h2 {
    color: #10231f;
}

.a5-invoice-no {
    background: #fff;
    border-color: #b9ccc7;
}

.a5-invoice-no span,
.a5-info-grid span,
.a5-meter-grid span,
.a5-total-grid span {
    color: #10231f;
    font-weight: 900;
}

.a5-invoice-no strong,
.a5-info-grid strong,
.a5-meter-grid strong,
.a5-total-grid strong {
    color: #1d2b27;
    font-weight: 500;
}

.a5-section-title {
    padding: 4px 8px;
    background: #e8f1ef;
    border: 1px solid #c8d5d1;
    border-radius: 6px;
    color: #10231f;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
}

.a5-info-grid {
    margin: 6px 0 8px;
}

.a5-info-grid > div,
.a5-meter-grid > div,
.a5-total-grid > div,
.a5-history {
    background: #fff;
    border-color: #c8d5d1;
}

.a5-info-grid > div:nth-child(odd),
.a5-meter-grid > div:nth-child(odd),
.a5-total-grid > div:nth-child(odd) {
    background: #f4f8f7;
}

.a5-history h3 {
    padding: 4px 6px;
    background: #e8f1ef;
    border: 1px solid #c8d5d1;
    border-radius: 5px;
}

.a5-history th,
.a5-lines th {
    background: #e8f1ef;
    color: #10231f;
    font-weight: 900;
}

.a5-history td,
.a5-lines td {
    background: #fff;
    font-weight: 500;
}

.a5-history tr:nth-child(even) td,
.a5-lines tr:nth-child(even) td {
    background: #f8fbfa;
}

.a5-total-grid .due {
    background: #d8ebe7;
    border-color: #8fb2aa;
    color: #10231f;
}

.a5-total-grid .due span {
    color: #10231f;
}

.a5-total-grid .due strong {
    font-weight: 900;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .stats-grid,
    .dashboard-insights,
    .dashboard-charts,
    .report-summary,
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .content-shell {
        padding: 16px;
    }

    .app-footer {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .grid-2,
    .grid-3,
    .grid-4,
    .report-summary,
    .dashboard-insights,
    .dashboard-charts,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    .chart-box,
    .chart-card-wide .chart-box,
    .chart-box-donut {
        height: 250px;
        min-height: 250px;
    }

    .panel-header,
    .invoice-head {
        flex-direction: column;
    }

    .invoice-a5-paper {
        grid-template-columns: 1fr;
    }

    .invoice-stub {
        border-right: 0;
        border-bottom: 1px dashed #7b8a86;
    }

    .a5-body,
    .a5-header,
    .a5-info-grid,
    .a5-meter-grid,
    .a5-total-grid {
        grid-template-columns: 1fr;
    }

    .statement-filters .field:first-child,
    .statement-filters .field:not(:first-child),
    .customers-filters .customer-search-field,
    .customers-filters .field:not(.customer-search-field) {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .statement-filters .btn-secondary {
        margin-inline-start: 0;
    }

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

    .company-profile-actions {
        grid-column: 1;
    }

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

    .receipt-head,
    .receipt-amount-box {
        grid-template-columns: 1fr;
    }

    .receipt-head {
        flex-direction: column;
    }

    .receipt-info-grid,
    .receipt-footer {
        grid-template-columns: 1fr;
    }

    .official-report-head {
        grid-template-columns: 1fr;
    }

    .official-report-meta {
        min-width: 0;
        text-align: right;
    }

    .official-report-signatures {
        grid-template-columns: 1fr;
    }
}

@page invoiceA5 {
    size: A5 landscape;
    margin: 3mm;
}

@page statementA4 {
    size: A4 portrait;
    margin: 10mm;
}

@page reportA4 {
    size: A4 portrait;
    margin: 9mm;
}

@page officialReportA4 {
    size: A4 landscape;
    margin: 8mm;
}

@page receiptA5 {
    size: A5 portrait;
    margin: 7mm;
}

@media print {
    html,
    body,
    .page-content {
        background: #fff !important;
    }

    .sidebar,
    .topbar,
    .app-footer,
    .print-actions,
    .no-print,
    .pagination-wrap,
    .alert {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .content-shell {
        padding: 0;
    }

    .invoice-paper {
        border: 0;
        box-shadow: none;
    }

    .statement-paper {
        page: statementA4;
        display: grid;
        gap: 4mm;
        width: 190mm;
        margin: 0 auto;
        padding: 0;
        background: #fff;
        color: #1f2926;
        font-size: 9pt;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .statement-paper .invoice-head {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
        gap: 8mm;
        align-items: start;
        margin: 0;
        padding-bottom: 4mm;
        border-bottom: 1px solid #cfdcda;
    }

    .statement-paper .badge-soft {
        min-height: auto;
        padding: 0;
        background: transparent;
        color: var(--primary);
        font-size: 8pt;
        font-weight: 700;
    }

    .statement-paper .invoice-head h2 {
        margin: 1mm 0;
        font-size: 16pt;
        font-weight: 600;
        line-height: 1.25;
    }

    .statement-paper .invoice-head p {
        margin: 0 0 1mm;
        font-size: 9pt;
        line-height: 1.45;
    }

    .statement-paper .invoice-head strong,
    .statement-paper .table strong,
    .statement-paper tfoot th {
        font-weight: 700;
    }

    .statement-paper .statement-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2mm;
    }

    .statement-paper .stat-card {
        padding: 2.2mm;
        border: 1px solid #d7e3e0;
        border-radius: 4px;
        box-shadow: none;
        background: #fff;
    }

    .statement-paper .stat-card span {
        font-size: 8pt;
        font-weight: 600;
    }

    .statement-paper .stat-card strong {
        margin-top: 1mm;
        font-size: 11pt;
        font-weight: 700;
        line-height: 1.3;
    }

    .statement-paper .table-responsive {
        margin-top: 1mm !important;
        overflow: visible;
        background: #fff;
        border: 1px solid #cfdcda;
        border-radius: 4px;
    }

    .statement-paper .table {
        margin-bottom: 0;
        background: #fff;
        font-size: 8.6pt;
        line-height: 1.35;
    }

    .statement-paper .table tbody,
    .statement-paper .table tr,
    .statement-paper .table td,
    .statement-paper .table tfoot th {
        background: #fff;
    }

    .statement-paper .table thead th {
        padding: 1.6mm 1.8mm;
        background: #f4f7f6;
        color: #263632;
        font-size: 8pt;
        font-weight: 700;
    }

    .statement-paper .table td,
    .statement-paper .table tfoot th {
        padding: 1.6mm 1.8mm;
        vertical-align: top;
    }

    .statement-paper .table small {
        font-size: 7.5pt;
    }

    .statement-paper .invoice-head,
    .statement-paper .statement-summary,
    .statement-paper .table tr {
        break-inside: avoid;
    }

    .report-paper {
        page: reportA4;
        display: grid;
        gap: 4mm;
        width: 192mm;
        margin: 0 auto;
        color: #1f2926;
        font-size: 8.6pt;
    }

    .report-paper .report-print-head {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        gap: 8mm;
        padding: 0 0 3mm;
        border: 0;
        border-bottom: 1px solid #cfdcda;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }

    .report-paper .badge-soft {
        min-height: auto;
        padding: 0;
        background: transparent;
        color: var(--primary);
        font-size: 8pt;
        font-weight: 700;
    }

    .report-paper .report-print-head h2 {
        margin: 1mm 0;
        font-size: 15pt;
        font-weight: 700;
        line-height: 1.25;
    }

    .report-paper .report-print-head p {
        margin: 0 0 1mm;
        font-size: 8.5pt;
        line-height: 1.4;
    }

    .report-paper .report-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2mm;
    }

    .report-paper .stat-card {
        padding: 2mm;
        border: 1px solid #d7e3e0;
        border-radius: 4px;
        box-shadow: none;
        background: #fff;
        break-inside: avoid;
    }

    .report-paper .stat-card i {
        display: none;
    }

    .report-paper .stat-card span {
        font-size: 7.8pt;
        font-weight: 600;
    }

    .report-paper .stat-card strong {
        margin-top: 1mm;
        font-size: 10.5pt;
        font-weight: 700;
        line-height: 1.25;
    }

    .report-paper .grid-2 {
        grid-template-columns: 1fr;
        gap: 4mm;
    }

    .report-paper .table-panel {
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        break-inside: avoid;
    }

    .report-paper .panel-header {
        margin: 0 0 1.5mm;
        padding-bottom: 1mm;
        border-bottom: 1px solid #d7e3e0;
    }

    .report-paper .panel-header h3 {
        font-size: 10pt;
        font-weight: 700;
    }

    .report-paper .panel-header p {
        font-size: 8pt;
    }

    .report-paper .table-responsive {
        overflow: visible;
        border: 1px solid #cfdcda;
        border-radius: 4px;
    }

    .report-paper .table {
        margin-bottom: 0;
        font-size: 8.2pt;
        line-height: 1.3;
    }

    .report-paper .table thead th {
        padding: 1.4mm 1.7mm;
        background: #f4f7f6;
        color: #263632;
        font-size: 7.8pt;
        font-weight: 700;
    }

    .report-paper .table td {
        padding: 1.3mm 1.7mm;
        background: #fff;
        vertical-align: top;
    }

    .report-paper .table strong {
        font-weight: 700;
    }

    .report-paper .table small {
        font-size: 7.3pt;
    }

    .report-paper .empty-state {
        padding: 3mm;
    }

    .official-report-paper,
    .official-report-wide {
        page: officialReportA4;
        gap: 2.5mm;
        width: 281mm;
        margin: 0 auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        color: #10231f;
        font-size: 8pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .official-report-head {
        grid-template-columns: minmax(0, 1fr) 52mm;
        padding-bottom: 2.5mm;
        gap: 6mm;
    }

    .official-report-brand img {
        width: 12mm;
        height: 12mm;
    }

    .official-report-brand strong,
    .official-report-titlebar h2 {
        font-size: 12pt;
    }

    .official-report-brand small,
    .official-report-meta span,
    .official-report-titlebar p,
    .official-report-table small {
        font-size: 7.2pt;
    }

    .official-report-meta {
        padding: 1.6mm 2mm;
    }

    .official-report-meta strong {
        font-size: 9pt;
    }

    .official-report-titlebar {
        padding: 1.8mm 2mm;
        border: 1px solid #879792;
        border-radius: 0;
    }

    .official-report-table,
    .official-report-table-compact {
        border: 1.5px solid #263632;
        font-size: 7.2pt;
        line-height: 1.35;
        table-layout: fixed;
    }

    .official-report-table th,
    .official-report-table td,
    .official-report-table-compact th,
    .official-report-table-compact td {
        padding: 1.15mm 1.2mm;
        border: 1px solid #53645f;
        background: #fff;
    }

    .official-report-table th,
    .official-report-table tfoot th {
        background: #eaf1ef;
        font-weight: 700;
    }

    .official-report-table tbody tr:nth-child(even) td {
        background: #fbfdfc;
    }

    .official-report-table .col-seq {
        width: 7mm;
    }

    .official-report-table .col-date {
        width: 20mm;
    }

    .official-report-table .col-invoice {
        width: 32mm;
    }

    .official-report-table .col-customer-no {
        width: 14mm;
    }

    .official-report-table .col-customer-name {
        width: 46mm;
    }

    .official-report-table .col-city,
    .official-report-table .col-period,
    .official-report-table .col-status,
    .official-report-table .col-category,
    .official-report-table .col-method {
        width: 18mm;
    }

    .official-report-table .col-number {
        width: 20mm;
    }

    .official-report-table .col-money {
        width: 24mm;
    }

    .official-report-table .col-description {
        width: 72mm;
    }

    .official-report-table .col-payee {
        width: 32mm;
    }

    .official-report-table .col-reference {
        width: 28mm;
    }

    .official-report-table tr {
        break-inside: avoid;
    }

    .official-report-signatures {
        gap: 18mm;
        padding-top: 11mm;
        break-inside: avoid;
    }

    .official-report-signatures div {
        padding-top: 4mm;
        font-size: 8pt;
    }

    .receipt-paper {
        page: receiptA5;
        gap: 3mm;
        width: 134mm;
        margin: 0 auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        color: #10231f;
        font-size: 8.6pt;
    }

    .receipt-head {
        padding-bottom: 3mm;
    }

    .receipt-brand img,
    .receipt-brand span {
        width: 13mm;
        height: 13mm;
        font-size: 18pt;
    }

    .receipt-brand strong {
        font-size: 13pt;
    }

    .receipt-brand small,
    .receipt-title p,
    .receipt-notes,
    .receipt-number-box span,
    .receipt-info-grid span,
    .receipt-amount-box span {
        font-size: 7.8pt;
    }

    .receipt-number-box {
        min-width: 42mm;
        padding: 2mm;
    }

    .receipt-number-box strong {
        font-size: 10.5pt;
    }

    .receipt-title h2 {
        font-size: 15pt;
    }

    .receipt-amount-box {
        grid-template-columns: minmax(0, 1fr) 42mm;
        padding: 2mm;
    }

    .receipt-amount-box strong {
        margin-top: 0.8mm;
        font-size: 11.5pt;
    }

    .receipt-info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5mm;
    }

    .receipt-info-grid > div {
        padding: 1.6mm;
    }

    .receipt-info-grid strong {
        font-size: 8.6pt;
    }

    .receipt-lines {
        font-size: 8pt;
    }

    .receipt-lines th,
    .receipt-lines td {
        padding: 1.4mm 1.6mm;
    }

    .receipt-footer {
        gap: 8mm;
        padding-top: 6mm;
    }

    .receipt-footer div {
        padding-top: 4mm;
        font-size: 8pt;
    }

    .invoice-a5-paper {
        page: invoiceA5;
        width: 202mm;
        height: 140mm;
        min-height: 140mm;
        grid-template-columns: 64mm 138mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        break-inside: avoid;
        color: #10231f;
        background: #fff;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .invoice-batch-print {
        display: block;
    }

    .invoice-batch-print .invoice-a5-paper {
        break-after: page;
        page-break-after: always;
    }

    .invoice-batch-print .invoice-a5-paper:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .invoice-stub {
        gap: 1.2mm;
        padding: 2mm;
        border-right: 1px dashed #7b8a86;
        border-bottom: 0;
        background: #edf6f4;
    }

    .invoice-consumer {
        padding: 2mm;
        background: #fbfdfc;
    }

    .stub-header {
        margin: -0.5mm -0.5mm 0;
        padding: 1mm;
        background: #dcefeb;
        border: 1px solid #b9ccc7;
        border-radius: 3px;
    }

    .stub-header strong {
        font-size: 8.8pt;
    }

    .stub-brand img {
        width: 6mm;
        height: 6mm;
    }

    .stub-header span,
    .stub-signature,
    .a5-header p,
    .a5-company-meta,
    .a5-notes {
        font-size: 7.3pt;
    }

    .stub-number {
        padding: 1.2mm;
        background: #e8f1ef;
        color: #10231f;
        border: 1px solid #879792;
        font-size: 8.8pt;
    }

    .stub-list {
        grid-template-columns: 18mm minmax(0, 1fr);
        gap: 0.8mm 1.2mm;
        padding: 1.1mm;
        background: #fff;
        border: 1px solid #c8d5d1;
        border-radius: 3px;
        font-size: 7.6pt;
        line-height: 1.15;
    }

    .stub-list dt {
        font-weight: 800;
    }

    .stub-list dd {
        font-weight: 500;
    }

    .a5-header h2 {
        margin: 0.5mm 0 0;
        font-size: 13pt;
        line-height: 1.1;
    }

    .a5-logo {
        width: 8mm;
        height: 8mm;
    }

    .a5-brand-block {
        gap: 1.5mm;
    }

    .a5-header {
        grid-template-columns: minmax(0, 1fr) 36mm;
        padding: 1mm;
        background: #f0f6f4;
        border: 1px solid #c8d5d1;
        border-bottom: 2px solid var(--primary);
        border-radius: 3px;
    }

    .a5-invoice-no {
        padding: 1.1mm;
        background: #fff;
        border-color: #b9ccc7;
    }

    .a5-invoice-no strong {
        font-size: 9pt;
    }

    .a5-body {
        grid-template-columns: 48mm minmax(0, 1fr);
        gap: 1.2mm;
    }

    .a5-section-title {
        padding: 0.45mm 1mm;
        background: #e8f1ef;
        border: 1px solid #c8d5d1;
        border-radius: 3px;
        font-size: 6.7pt;
        font-weight: 800;
        line-height: 1.1;
    }

    .a5-info-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin: 1mm 0;
    }

    .a5-meter-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .a5-total-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .a5-info-grid,
    .a5-meter-grid,
    .a5-total-grid {
        gap: 0.8mm;
    }

    .a5-info-grid > div,
    .a5-meter-grid > div,
    .a5-total-grid > div {
        gap: 0.3mm;
        min-height: 0;
        padding: 0.8mm;
        border-color: #c8d5d1;
    }

    .a5-info-grid span,
    .a5-meter-grid span,
    .a5-total-grid span {
        font-size: 6.3pt;
        font-weight: 800;
        line-height: 1.05;
    }

    .a5-info-grid strong,
    .a5-meter-grid strong,
    .a5-total-grid strong {
        font-size: 7.5pt;
        font-weight: 500;
        line-height: 1.12;
    }

    .a5-history {
        padding: 0.9mm;
        background: #fff;
        border-color: #c8d5d1;
    }

    .a5-history h3 {
        margin-bottom: 0.7mm;
        padding: 0.45mm 0.8mm;
        background: #e8f1ef;
        border: 1px solid #c8d5d1;
        border-radius: 3px;
        font-size: 7.4pt;
        line-height: 1.1;
    }

    .a5-lines {
        table-layout: fixed;
        font-size: 6.6pt;
    }

    .a5-history table {
        table-layout: fixed;
        font-size: 5.8pt;
    }

    .a5-lines th,
    .a5-lines td {
        padding: 0.55mm 0.7mm;
        border-color: #879792;
        line-height: 1.08;
    }

    .a5-history th,
    .a5-history td {
        padding: 0.45mm;
        border-color: #879792;
        line-height: 1.05;
    }

    .a5-history th,
    .a5-lines th {
        background: #e8f1ef;
    }

    .a5-total-grid .due {
        background: #d8ebe7;
        color: #10231f;
    }

    .a5-total-grid .due strong {
        font-weight: 800;
    }

    .a5-lines th:nth-child(1),
    .a5-lines td:nth-child(1) {
        width: 36%;
    }

    .a5-lines th:nth-child(2),
    .a5-lines td:nth-child(2) {
        width: 18%;
    }

    .a5-lines th:nth-child(3),
    .a5-lines td:nth-child(3),
    .a5-lines th:nth-child(4),
    .a5-lines td:nth-child(4) {
        width: 23%;
    }

    .a5-main {
        gap: 0.8mm;
    }

    .a5-notes {
        margin-top: 0.4mm;
        line-height: 1.15;
    }

    a {
        text-decoration: none;
    }
}
