/* ============================================================
   Smart Ledger - Complete Shared CSS
   ============================================================
   This is the single CSS file used throughout Smart Ledger.

   No Bootstrap or external CSS framework is used.
   ============================================================ */


/* ============================================================
   1. GLOBAL RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    color: #1f2937;

    background: #f4f6f8;
}

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

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

button {
    cursor: pointer;
}


/* ============================================================
   2. LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: #f4f6f8;
}

.login-box {
    width: 100%;
    max-width: 420px;

    background: #ffffff;

    border: 1px solid #e1e5e9;

    border-radius: 10px;

    padding: 35px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.08);
}

.login-box h1 {
    margin: 0;

    text-align: center;

    font-size: 28px;

    color: #1f2937;
}

.login-subtitle {
    margin: 8px 0 28px;

    text-align: center;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   3. FORM ELEMENTS
   ============================================================ */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 600;

    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea,

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;

    border: 1px solid #d1d5db;

    border-radius: 6px;

    background: #ffffff;

    color: #1f2937;

    padding: 10px 12px;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(107, 114, 128, 0.10);
}

textarea {
    min-height: 100px;

    resize: vertical;
}

input[readonly],
select[disabled],
textarea[readonly] {
    background: #f3f4f6;

    color: #6b7280;

    cursor: not-allowed;
}


/* ============================================================
   4. BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 9px 16px;

    border: 1px solid transparent;

    border-radius: 6px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #1f2937;

    border-color: #1f2937;

    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;

    border-color: #d1d5db;

    color: #374151;
}

.btn-success {
    background: #166534;

    border-color: #166534;

    color: #ffffff;
}

.btn-danger {
    background: #b91c1c;

    border-color: #b91c1c;

    color: #ffffff;
}

.btn-warning {
    background: #b45309;

    border-color: #b45309;

    color: #ffffff;
}

.btn-small {
    min-height: 34px;

    padding: 7px 12px;

    font-size: 13px;
}

.login-button {
    width: 100%;

    margin-top: 5px;
}


/* ============================================================
   5. ALERTS
   ============================================================ */

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 6px;

    font-size: 14px;
}

.alert-success {
    background: #ecfdf5;

    border: 1px solid #a7f3d0;

    color: #065f46;
}

.alert-danger {
    background: #fef2f2;

    border: 1px solid #fecaca;

    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;

    border: 1px solid #fde68a;

    color: #92400e;
}

.alert-info {
    background: #eff6ff;

    border: 1px solid #bfdbfe;

    color: #1e40af;
}


/* ============================================================
   6. MAIN APPLICATION LAYOUT
   ============================================================ */

.app-layout {
    min-height: 100vh;

    display: flex;
}

.sidebar {
    width: 250px;

    min-height: 100vh;

    flex-shrink: 0;

    background: #1f2937;

    color: #ffffff;
}

.main-area {
    flex: 1;

    min-width: 0;

    min-height: 100vh;

    display: flex;

    flex-direction: column;
}


/* ============================================================
   7. SIDEBAR BRAND
   ============================================================ */

.sidebar-brand {
    min-height: 82px;

    padding: 18px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    max-width: 65px;

    max-height: 55px;

    object-fit: contain;

    margin-bottom: 8px;
}

.sidebar-brand-name {
    font-size: 18px;

    font-weight: 700;

    line-height: 1.3;
}


/* ============================================================
   8. SIDEBAR NAVIGATION
   ============================================================ */

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-link {
    width: 100%;

    min-height: 44px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 11px 20px;

    border: none;

    background: transparent;

    color: #ffffff;

    font-size: 14px;

    text-align: left;

    text-decoration: none;

    cursor: pointer;
}

.sidebar-link:hover {
    background:
        rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    background:
        rgba(255, 255, 255, 0.14);

    font-weight: 700;
}

.sidebar-logout {
    margin-top: 15px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}


/* ============================================================
   9. SIDEBAR DROPDOWN
   ============================================================ */

.sidebar-dropdown-button {
    font-family: inherit;
}

.menu-arrow {
    font-size: 9px;

    margin-left: 10px;
}

.sidebar-submenu {
    display: none;

    background:
        rgba(0, 0, 0, 0.16);
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-submenu a {
    display: block;

    padding: 10px 20px 10px 38px;

    color: #dbe3ea;

    font-size: 13px;

    text-decoration: none;
}

.sidebar-submenu a:hover {
    background:
        rgba(255, 255, 255, 0.08);

    color: #ffffff;
}


/* ============================================================
   10. TOP HEADER
   ============================================================ */

.top-header {
    min-height: 82px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 25px;

    background: #ffffff;

    border-bottom:
        1px solid #e1e5e9;
}

.header-company {
    min-width: 0;
}

.header-company-name {
    margin-bottom: 4px;

    font-size: 20px;

    font-weight: 700;

    color: #111827;
}

.header-company-detail {
    margin-top: 2px;

    font-size: 12px;

    color: #6b7280;
}

.header-user {
    flex-shrink: 0;

    text-align: right;
}

.header-date-time {
    margin-bottom: 5px;

    font-size: 12px;

    color: #6b7280;
}

.header-user-name {
    font-size: 14px;

    font-weight: 700;

    color: #1f2937;
}


/* ============================================================
   11. PAGE CONTENT
   ============================================================ */

.page-content {
    flex: 1;

    padding: 25px;
}

.page-heading {
    margin-bottom: 25px;
}

.page-heading h1 {
    margin: 0 0 6px;

    font-size: 28px;

    color: #111827;
}

.page-heading p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   12. DASHBOARD HEADER
   ============================================================ */

.dashboard-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;
}

.dashboard-header h1 {
    margin: 0 0 6px;

    font-size: 28px;

    color: #111827;
}

.dashboard-header p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   13. DASHBOARD CARDS
   ============================================================ */

.dashboard-cards {
    display: grid;

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

    gap: 18px;

    margin-bottom: 25px;
}

.dashboard-card {
    min-height: 115px;

    padding: 20px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.04);
}

.dashboard-card-label {
    margin-bottom: 12px;

    color: #6b7280;

    font-size: 13px;

    font-weight: 500;
}

.dashboard-card-value {
    color: #111827;

    font-size: 26px;

    font-weight: 700;
}

.dashboard-card-money .dashboard-card-value {
    font-size: 22px;
}


/* ============================================================
   14. DASHBOARD SECTIONS
   ============================================================ */

.dashboard-section {
    margin-bottom: 25px;

    overflow: hidden;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.dashboard-section-header {
    padding: 20px 22px;

    border-bottom:
        1px solid #e5e7eb;
}

.dashboard-section-header h2 {
    margin: 0 0 5px;

    font-size: 19px;

    color: #111827;
}

.dashboard-section-header p {
    margin: 0;

    color: #6b7280;

    font-size: 13px;
}


/* ============================================================
   15. TABLES
   ============================================================ */

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.data-table {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;
}

.data-table th {
    padding: 13px 18px;

    background: #f8fafc;

    border-bottom:
        1px solid #e5e7eb;

    color: #4b5563;

    font-size: 12px;

    font-weight: 700;

    text-align: left;

    white-space: nowrap;
}

.data-table td {
    padding: 13px 18px;

    border-bottom:
        1px solid #eef0f2;

    color: #374151;

    font-size: 13px;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.empty-table {
    padding: 35px !important;

    color: #9ca3af !important;

    text-align: center !important;
}


/* ============================================================
   16. ENTRY TYPE
   ============================================================ */

.entry-type {
    font-size: 13px;

    font-weight: 600;
}


/* ============================================================
   17. GENERAL CONTENT BOX
   ============================================================ */

.content-box {
    margin-bottom: 25px;

    padding: 22px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.content-box-title {
    margin: 0 0 18px;

    font-size: 18px;

    font-weight: 700;

    color: #111827;
}


/* ============================================================
   18. FORM LAYOUT
   ============================================================ */

.form-card {
    margin-bottom: 25px;

    padding: 22px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.form-card-title {
    margin: 0 0 20px;

    padding-bottom: 12px;

    border-bottom:
        1px solid #e5e7eb;

    font-size: 18px;

    font-weight: 700;
}

.form-grid {
    display: grid;

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

    gap: 18px;
}

.form-grid-3 {
    display: grid;

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

    gap: 18px;
}

.form-grid-4 {
    display: grid;

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

    gap: 18px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 20px;

    padding-top: 18px;

    border-top:
        1px solid #e5e7eb;
}


/* ============================================================
   19. SEARCH / FILTER AREA
   ============================================================ */

.filter-card {
    margin-bottom: 20px;

    padding: 18px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.filter-grid {
    display: grid;

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

    gap: 15px;
}

.filter-actions {
    display: flex;

    align-items: flex-end;

    gap: 8px;
}


/* ============================================================
   20. ACTION BUTTONS
   ============================================================ */

.action-buttons {
    display: flex;

    align-items: center;

    gap: 6px;

    flex-wrap: wrap;
}

.action-buttons .btn {
    white-space: nowrap;
}


/* ============================================================
   21. FOOTER
   ============================================================ */

.app-footer {
    min-height: 55px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 15px;

    padding: 14px 25px;

    background: #ffffff;

    border-top:
        1px solid #e1e5e9;

    color: #6b7280;

    font-size: 12px;
}


/* ============================================================
   22. STATUS LABELS
   ============================================================ */

.status-label {
    display: inline-block;

    padding: 4px 9px;

    border-radius: 4px;

    font-size: 11px;

    font-weight: 600;
}

.status-active {
    background: #ecfdf5;

    color: #065f46;
}

.status-inactive {
    background: #f3f4f6;

    color: #4b5563;
}

.status-pending {
    background: #fffbeb;

    color: #92400e;
}


/* ============================================================
   23. MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.45);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: 100%;

    max-width: 600px;

    max-height: 90vh;

    overflow-y: auto;

    padding: 25px;

    background: #ffffff;

    border-radius: 8px;
}

.modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.modal-title {
    margin: 0;

    font-size: 20px;
}

.modal-close {
    border: none;

    background: transparent;

    font-size: 22px;

    cursor: pointer;
}


/* ============================================================
   24. PRINT
   ============================================================ */

@media print {

    .sidebar,
    .top-header,
    .app-footer,
    .no-print {
        display: none !important;
    }

    .main-area {
        width: 100%;

        min-height: auto;
    }

    .page-content {
        padding: 0;
    }

    body {
        background: #ffffff;
    }

    .content-box,
    .form-card,
    .dashboard-section {
        border: none;

        box-shadow: none;
    }

}


/* ============================================================
   25. RESPONSIVE - TABLET
   ============================================================ */

@media (max-width: 1100px) {

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

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

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

}


/* ============================================================
   26. RESPONSIVE - SMALL TABLET
   ============================================================ */

@media (max-width: 800px) {

    .sidebar {
        width: 215px;
    }

    .top-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .header-user {
        text-align: left;
    }

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

}


/* ============================================================
   27. RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;

        min-height: auto;
    }

    .sidebar-nav {
        max-height: 500px;

        overflow-y: auto;
    }

    .top-header {
        padding: 15px;
    }

    .page-content {
        padding: 15px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .dashboard-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .form-grid,
    .form-grid-4,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .filter-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .app-footer {
        padding: 15px;

        align-items: flex-start;

        flex-direction: column;
    }

    .login-box {
        padding: 25px 20px;
    }

}

/* ============================================================
   SIDEBAR MENU ICONS
   ============================================================ */

.sidebar-link-left {
    display: flex;

    align-items: center;

    gap: 11px;

    min-width: 0;
}

.menu-icon {
    width: 22px;

    min-width: 22px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 17px;

    line-height: 1;
}

.submenu-icon {
    width: 20px;

    min-width: 20px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-right: 8px;

    font-size: 14px;

    line-height: 1;
}

.sidebar-submenu a {
    display: flex;

    align-items: center;

    padding: 10px 20px 10px 38px;

    color: #dbe3ea;

    font-size: 13px;

    text-decoration: none;
}


/* ============================================================
   END OF SMART LEDGER CSS
   ============================================================ */

/* ============================================================
   Searchable account / party selector
   Adds a compact searchable list while matching existing form fields.
   ============================================================ */
.sl-searchable-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.sl-searchable-select.is-open {
    z-index: 5000;
}

.form-group.sl-searchable-select-active {
    position: relative;
    z-index: 5000;
}

.sl-searchable-select-input {
    display: block;
    width: 100%;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sl-searchable-select-input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.10);
}

.sl-searchable-select-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.sl-searchable-select-native {
    display: none !important;
}

.sl-searchable-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 5001;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sl-searchable-select-options[hidden] {
    display: none !important;
}

.sl-searchable-select-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f1f2;
    background: #ffffff;
    color: #1f2937;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.sl-searchable-select-option:last-child {
    border-bottom: 0;
}

.sl-searchable-select-option:hover,
.sl-searchable-select-option.is-active {
    background: #f3f4f6;
}

.sl-searchable-select-option:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.sl-searchable-select-empty {
    padding: 12px;
    color: #6b7280;
    font-size: 13px;
}
/* ============================================================
   Smart Ledger - Responsive layout (desktop / tablet / mobile)
   Loaded after style.css by header.php. Adds:
   - sticky sidebar on desktop
   - slide-in menu (hamburger) on tablet and mobile
   - compact top header on small screens
   ============================================================ */

.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ---------- Desktop (wider than 900px) ---------- */
@media (min-width: 901px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        align-self: flex-start;
        overflow-y: auto;
    }
}

/* ---------- Tablet and mobile (900px and below) ---------- */
@media (max-width: 900px) {

    .app-layout { display: block; }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 3000;
        width: 270px;
        max-width: 85vw;
        min-height: 0;
        overflow-y: auto;
        transform: translateX(-102%);
        transition: transform 0.2s ease;
        box-shadow: none;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    .sidebar-nav { max-height: none; }

    .sidebar-backdrop {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: 2999;
        background: rgba(17, 24, 39, 0.5);
    }
    body.nav-open .sidebar-backdrop { display: block; }
    body.nav-open { overflow: hidden; }

    .main-area { width: 100%; min-height: 100vh; }

    .top-header {
        position: sticky;
        top: 0;
        z-index: 100;
        flex-direction: row;
        align-items: center;
        min-height: 64px;
        padding: 10px 16px;
        gap: 12px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        background: #1f2937;
        border: 0;
        border-radius: 8px;
        color: #ffffff;
        font-size: 22px;
        line-height: 1;
    }

    .header-company { flex: 1; min-width: 0; }
    .header-company-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-user { text-align: right; flex-shrink: 0; }

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

/* ---------- Mobile (650px and below) ---------- */
@media (max-width: 650px) {
    .header-company-detail { display: none; }
    .header-date-time { display: none; }
    .header-company-name { font-size: 16px; }
    .page-content { padding: 14px; }
    .app-footer { flex-direction: column; text-align: center; gap: 4px; }
}


/* ============================================================
   Shared components used by several pages but never styled
   (.card, .content-card, .card-header, .card-body, .table-responsive,
   .page-header, .page-header-row, .form-grid-2, .form-group-full ...)
   ============================================================ */

.card,
.content-card {
    margin-bottom: 22px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 22px;
    border-bottom: 1px solid #e5e7eb;
}
.card-header h2 { margin: 0; font-size: 18px; color: #111827; }
.card-header p  { margin: 4px 0 0; color: #6b7280; font-size: 13px; }

.card-body { padding: 20px 22px; }

.content-card > form,
.card > form { padding: 20px 22px; }

.page-header,
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}
.page-header h1,
.page-header-row h1 { margin: 0 0 6px; font-size: 28px; color: #111827; }
.page-header p,
.page-header-row p  { margin: 0; color: #6b7280; font-size: 14px; }

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

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.form-group-full { grid-column: 1 / -1; }

.btn-light { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }
.inline-form { display: inline; margin: 0; }
.required { color: #dc2626; }
.empty-state { padding: 30px; text-align: center; color: #9ca3af; }

@media print {
    .card, .content-card { border: 0; box-shadow: none; }
}

/* ============================================================
   Phone-friendly tables: script.js adds .sl-stack and data-label
   to every .data-table, so rows become cards on small screens.
   ============================================================ */
@media (max-width: 650px) {
    .data-table.sl-stack { min-width: 0; }
    .data-table.sl-stack thead { display: none; }
    .data-table.sl-stack,
    .data-table.sl-stack tbody,
    .data-table.sl-stack tr,
    .data-table.sl-stack td { display: block; width: 100%; }

    .data-table.sl-stack tbody tr {
        margin: 0 0 12px;
        padding: 4px 0;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }
    .data-table.sl-stack tbody tr:hover { background: #ffffff; }

    .data-table.sl-stack td {
        position: relative;
        min-height: 36px;
        padding: 9px 14px 9px 38%;
        border-bottom: 1px dashed #eef0f2;
        text-align: left !important;
        white-space: normal;
    }
    .data-table.sl-stack td:last-child { border-bottom: none; }
    .data-table.sl-stack td::before {
        content: attr(data-label);
        position: absolute;
        top: 9px;
        left: 14px;
        width: 32%;
        color: #6b7280;
        font-size: 12px;
        font-weight: 700;
    }
    .data-table.sl-stack td:not([data-label]) { padding-left: 14px; }
    .data-table.sl-stack td:not([data-label])::before { display: none; }

    .table-wrapper, .table-responsive, .table-wrap { padding: 10px; }

    /* Easier touch + no iPhone zoom-on-focus */
    input, select, textarea { font-size: 16px !important; }
    .btn { min-height: 44px; }
    .btn-small { min-height: 38px; }

    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .page-header, .page-header-row { flex-direction: column; align-items: stretch; }
    .page-header h1, .page-header-row h1 { font-size: 23px; }
    .card-header { flex-wrap: wrap; padding: 14px; }
    .card-body, .content-card > form, .card > form { padding: 14px; }
    .table-actions, .action-buttons { flex-wrap: wrap; }
}


/* ============================================================
   Page tabs (Sales: Sale Contract / Sale Invoice)
   ============================================================ */
.sl-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid #e5e7eb; }
.sl-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; margin-bottom: -2px;
    border-bottom: 2px solid transparent; color: #4b5563; font-size: 14px; font-weight: 600;
}
.sl-tab:hover { color: #111827; }
.sl-tab.active { color: #111827; border-bottom-color: #1f2937; }
.sl-tab-count { padding: 1px 8px; background: #f3f4f6; border-radius: 999px; color: #6b7280; font-size: 11px; }
.sl-tab.active .sl-tab-count { background: #1f2937; color: #ffffff; }

/* Some pages wrap their content in a second .page-content: remove the double padding. */
.page-content .page-content { padding: 0; }

@media (max-width: 760px) {
    .sl-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .sl-tabs::-webkit-scrollbar { display: none; }
    .sl-tab { flex-shrink: 0; white-space: nowrap; }
}

/* ---------- Desktop: keep dates and action buttons on one line in every list ---------- */
@media (min-width: 1101px) {
    .data-table td:nth-child(-n+2) { white-space: nowrap; }
    .table-actions, .action-buttons { flex-wrap: nowrap; white-space: nowrap; }
    .table-actions .btn, .action-buttons .btn { white-space: nowrap; }
}


/* ============================================================
   Shared pop-up form (Sale Contract, Sale Invoice ...)
   ============================================================ */
.sl-modal {
    display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 4000;
    padding: 24px 12px; background: rgba(17, 24, 39, 0.55); overflow-y: auto;
}
.sl-modal.is-open { display: block; }
.sl-modal-box {
    max-width: 1100px; margin: 0 auto; background: #ffffff; border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.30);
}
.sl-modal-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; background: #ffffff; border-bottom: 1px solid #e5e7eb; border-radius: 10px 10px 0 0;
}
.sl-modal-head h2 { margin: 0; font-size: 19px; color: #111827; }
.sl-modal-x {
    width: 36px; height: 36px; background: #f3f4f6; border: 0; border-radius: 6px;
    color: #374151; font-size: 24px; line-height: 1; cursor: pointer;
}
.sl-modal-x:hover { background: #e5e7eb; }
.sl-modal-body { padding: 20px 22px 26px; }
.sl-modal-body > form { padding: 0; }
body.sl-noscroll { overflow: hidden; }

/* List header with an Add button on the right */
.sl-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

@media (max-width: 760px) {
    .sl-modal { padding: 0; }
    .sl-modal-box { border-radius: 0; min-height: 100%; }
    .sl-modal-body { padding: 14px 14px 20px; }
    .sl-head-row, .card-header { flex-wrap: wrap; }
    .sl-head-row .btn, .card-header .btn-primary { width: 100%; }
}


/* ============================================================
   Embedded forms (inside the Dashboard pop-up, ?embed=1)
   Only the entry form is shown: no menu, header, tabs or list.
   ============================================================ */
body.is-embed { background: #ffffff; overflow: auto !important; }
.is-embed .sidebar,
.is-embed .sidebar-backdrop,
.is-embed .top-header,
.is-embed .menu-toggle,
.is-embed .app-footer,
.is-embed .ve-head,
.is-embed .ve-tabs,
.is-embed .sl-tabs,
.is-embed .page-header,
.is-embed .page-header-row,
.is-embed .ve-card,
.is-embed .page-content > .content-card,
.is-embed .alert-success,
.is-embed .ve-modal-head,
.is-embed .sl-modal-head { display: none !important; }

.is-embed .app-layout { display: block; min-height: 0; }
.is-embed .main-area { min-height: 0; }
.is-embed .page-content { padding: 0; }
.is-embed .ve-modal,
.is-embed .sl-modal {
    position: static; display: block; padding: 0; background: none; overflow: visible;
}
.is-embed .ve-modal-box,
.is-embed .sl-modal-box { box-shadow: none; border-radius: 0; max-width: none; margin: 0; border: 0; }


/* ---------- Reports page: report buttons stay compact on phones ---------- */
@media (max-width: 650px) {
    .report-navigation .form-actions { flex-direction: row; flex-wrap: wrap; align-items: stretch; border-top: 0; padding-top: 0; margin-top: 0; padding: 14px; }
    .report-navigation .form-actions .btn { width: auto; flex: 1 1 calc(50% - 8px); min-height: 40px; font-size: 13px; }
}


/* ---------- Quick search above a list (Accounts, Products) ---------- */
.sl-filter { margin: 0 0 14px; }
.sl-filter input[type=search] {
    width: 100%; min-height: 40px; padding: 9px 12px; background: #ffffff;
    border: 1px solid #d1d5db; border-radius: 6px; color: #1f2937; font-size: 14px;
}
.sl-filter input[type=search]:focus { outline: none; border-color: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,.12); }
.sl-head-row .content-box-title { margin-bottom: 0; }
.sl-head-row { margin-bottom: 14px; }
.sl-no-match td { padding: 26px; color: #9ca3af; text-align: center; }
/* ============================================================
   Smart Ledger - Advanced Dashboard styles
   ============================================================
   Loaded only by index.php. All classes start with "dx-" so
   nothing in style.css is changed or overridden.
   ============================================================ */

.dx-wrap { max-width: none; width: 100%; }

/* ---------- Header ---------- */
.dx-head {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    justify-content: space-between; gap: 14px; margin-bottom: 18px;
}
.dx-head h1 { margin: 0 0 6px; font-size: 28px; color: #111827; }
.dx-head p  { margin: 0; color: #6b7280; font-size: 14px; }

.dx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dx-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-pill {
    padding: 7px 13px; background: #ffffff; border: 1px solid #d1d5db;
    border-radius: 999px; color: #374151; font-size: 13px; font-weight: 600;
}
.dx-pill:hover { border-color: #1f2937; }
.dx-pill.active { background: #1f2937; border-color: #1f2937; color: #ffffff; }
.dx-refresh {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
    background: #ffffff; border: 1px solid #d1d5db; border-radius: 6px;
    color: #374151; font-size: 13px; font-weight: 600;
}
.dx-refresh:hover { border-color: #1f2937; }
.dx-auto { display: inline-flex; align-items: center; gap: 5px; color: #6b7280; font-size: 12px; cursor: pointer; }
.dx-updated { color: #9ca3af; font-size: 12px; margin: -8px 0 16px; }

/* ---------- Quick actions ---------- */
.dx-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dx-quick a {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
    background: #ffffff; border: 1px solid #e1e5e9; border-radius: 8px;
    color: #1f2937; font-size: 13px; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dx-quick a:hover { border-color: #1f2937; background: #f9fafb; }

/* ---------- Alerts ---------- */
.dx-alert {
    margin-bottom: 12px; padding: 12px 16px; border: 1px solid; border-radius: 8px;
    font-size: 13px; line-height: 1.5;
}
.dx-alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.dx-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.dx-alert strong  { display: block; font-size: 14px; margin-bottom: 2px; }
.dx-alert details { margin-top: 6px; }
.dx-alert summary { cursor: pointer; font-weight: 600; }
.dx-alert ul { margin: 6px 0 0; padding-left: 18px; }
.dx-alert a { text-decoration: underline; font-weight: 600; }

/* ---------- KPI cards ---------- */
.dx-section-title {
    margin: 22px 0 10px; font-size: 13px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; color: #6b7280;
}
.dx-kpis {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px; margin-bottom: 8px;
}
.dx-kpi {
    display: block; padding: 18px 20px; background: #ffffff;
    border: 1px solid #e1e5e9; border-top: 3px solid #1f2937;
    border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
a.dx-kpi:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.dx-kpi.green  { border-top-color: #16a34a; }
.dx-kpi.blue   { border-top-color: #2563eb; }
.dx-kpi.red    { border-top-color: #dc2626; }
.dx-kpi.amber  { border-top-color: #d97706; }
.dx-kpi-label  { margin-bottom: 8px; color: #6b7280; font-size: 13px; font-weight: 600; }
.dx-kpi-value  { color: #111827; font-size: 26px; font-weight: 700; line-height: 1.15; }
.dx-kpi-value small { font-size: 13px; font-weight: 600; color: #6b7280; margin-left: 3px; }
.dx-kpi-sub    { margin-top: 7px; color: #9ca3af; font-size: 12px; }
.dx-neg { color: #b91c1c; }

/* ---------- Cards / rows ---------- */
.dx-row { display: grid; gap: 18px; margin-top: 18px; }
.dx-row-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dx-row-11 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dx-row-1  { grid-template-columns: minmax(0, 1fr); }

.dx-card {
    min-width: 0; overflow: hidden; background: #ffffff;
    border: 1px solid #e1e5e9; border-radius: 8px;
}
.dx-card-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
}
.dx-card-head h2 { margin: 0 0 3px; font-size: 17px; color: #111827; }
.dx-card-head p  { margin: 0; color: #6b7280; font-size: 12px; }
.dx-card-head a  { color: #1d4ed8; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dx-card-body { padding: 16px 20px; }
.dx-empty { padding: 28px 20px; color: #9ca3af; text-align: center; font-size: 13px; }

/* ---------- Month chart ---------- */
.dx-legend { display: flex; gap: 14px; margin-bottom: 8px; font-size: 12px; color: #4b5563; }
.dx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.dx-chart { display: flex; align-items: flex-end; gap: 10px; height: 230px; padding-top: 20px; }
.dx-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.dx-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.dx-bar-wrap { flex: 1; max-width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.dx-bar-val { font-size: 10px; color: #6b7280; margin-bottom: 3px; white-space: nowrap; }
.dx-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.dx-bar.sales { background: #1f2937; }
.dx-bar.coll  { background: #16a34a; }
.dx-bar.zero  { background: #e5e7eb; }
.dx-mlabel { margin-top: 6px; text-align: center; font-size: 12px; color: #6b7280; }
.dx-mlabel.now { color: #111827; font-weight: 700; }

/* ---------- Horizontal bar lists ---------- */
.dx-list { list-style: none; margin: 0; padding: 0; }
.dx-list li { padding: 9px 0; border-bottom: 1px solid #f3f4f6; }
.dx-list li:last-child { border-bottom: none; }
.dx-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.dx-line .name { color: #1f2937; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-line .amt  { color: #111827; font-weight: 700; white-space: nowrap; }
.dx-line .meta { color: #9ca3af; font-size: 12px; font-weight: 400; }
.dx-track { height: 6px; margin-top: 6px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.dx-fill  { height: 100%; background: #1f2937; border-radius: 999px; }
.dx-fill.green { background: #16a34a; }
.dx-fill.blue  { background: #2563eb; }
.dx-fill.amber { background: #d97706; }
.dx-fill.red   { background: #dc2626; }

/* ---------- Tables ---------- */
.dx-table { width: 100%; border-collapse: collapse; }
.dx-table th {
    padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
    color: #4b5563; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap;
}
.dx-table td { padding: 11px 16px; border-bottom: 1px solid #eef0f2; color: #374151; font-size: 13px; vertical-align: middle; }
.dx-table tbody tr:hover { background: #fafafa; }
.dx-table tbody tr:last-child td { border-bottom: none; }
.dx-table .r { text-align: right; }
.dx-table .prog { min-width: 120px; }

/* ---------- Badges ---------- */
.dx-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.dx-b-sale { background: #dbeafe; color: #1e40af; }
.dx-b-in   { background: #dcfce7; color: #166534; }
.dx-b-out  { background: #fee2e2; color: #991b1b; }
.dx-b-jv   { background: #f3e8ff; color: #6b21a8; }
.dx-amt-in  { color: #166534; font-weight: 700; }
.dx-amt-out { color: #991b1b; font-weight: 700; }
.dx-link { color: #1d4ed8; font-weight: 600; font-size: 12px; }

/* ---------- Footer chips ---------- */
.dx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dx-chip { padding: 6px 12px; background: #ffffff; border: 1px solid #e1e5e9; border-radius: 999px; font-size: 12px; color: #4b5563; }
.dx-chip b { color: #111827; }

.dx-note { margin: 14px 0 0; color: #9ca3af; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .dx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dx-row-21, .dx-row-11 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
    .dx-kpis { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .dx-head h1 { font-size: 23px; }
    .dx-kpi-value { font-size: 23px; }
    .dx-chart { height: 190px; gap: 6px; }
    .dx-bar-val { display: none; }
    .dx-card-body { padding: 14px; }
    .dx-table th, .dx-table td { padding: 10px 10px; }
}
@media print {
    .dx-tools, .dx-quick, .dx-refresh, .dx-auto { display: none !important; }
}


/* ---------- Mobile: card-style tables ---------- */
@media (max-width: 650px) {
    .dx-table { min-width: 0; }
    .dx-table thead { display: none; }
    .dx-table, .dx-table tbody, .dx-table tr, .dx-table td { display: block; width: 100%; }
    .dx-table tbody tr { margin: 0 0 10px; padding: 4px 0; border: 1px solid #e5e7eb; border-radius: 8px; }
    .dx-table tbody tr:hover { background: #ffffff; }
    .dx-table td {
        position: relative; min-height: 34px; padding: 8px 12px 8px 38%;
        border-bottom: 1px dashed #eef0f2; text-align: left;
    }
    .dx-table td:last-child { border-bottom: none; }
    .dx-table td::before {
        content: attr(data-label); position: absolute; top: 8px; left: 12px; width: 32%;
        color: #6b7280; font-size: 12px; font-weight: 700;
    }
    .dx-table .r { text-align: left; }
    .dx-table .prog { min-width: 0; }
    .dx-table td.dx-empty { padding-left: 12px; text-align: center; }
    .dx-table td.dx-empty::before { display: none; }
    .dx-card .table-wrapper { padding: 10px; }
    .dx-chips { gap: 6px; }
}


/* ---------- Quick action pop-up (form shown inside the Dashboard) ---------- */
.dx-frame { display: block; width: 100%; height: calc(100vh - 150px); min-height: 420px; border: 0; background: #ffffff; border-radius: 0 0 10px 10px; }
.dx-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 6000; max-width: 92vw; padding: 12px 20px;
    background: #166534; border-radius: 8px; color: #ffffff; font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none;
    transform: translateX(-50%) translateY(30px); transition: all .25s;
}
.dx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 760px) {
    .dx-frame { height: calc(100vh - 70px); border-radius: 0; }
}
/* ============================================================
   Smart Ledger - Voucher pages (all 5 voucher types)
   Loaded by voucher_engine.php. Classes start with "ve-" so
   nothing in style.css is changed.
   ============================================================ */

.ve-wrap { max-width: none; }

.ve-head { margin-bottom: 18px; }
.ve-head h1 { margin: 0 0 6px; font-size: 28px; color: #111827; }
.ve-head p  { margin: 0; color: #6b7280; font-size: 14px; }

/* ---------- Cards ---------- */
.ve-card {
    margin-bottom: 22px; background: #ffffff;
    border: 1px solid #e1e5e9; border-radius: 8px;
}
.ve-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 16px 22px; border-bottom: 1px solid #e5e7eb;
}
.ve-card-head h2 { margin: 0; font-size: 18px; color: #111827; }
.ve-count { color: #9ca3af; font-size: 13px; }


/* ---------- Form grid ---------- */
.ve-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ve-grid-after { margin-top: 18px; }
.ve-field label { display: block; margin-bottom: 6px; color: #374151; font-size: 13px; font-weight: 600; }
.ve-field input[type=text],
.ve-field input[type=date],
.ve-field input[type=number],
.ve-field input[type=file],
.ve-field select,
.ve-field textarea {
    width: 100%; min-height: 40px; padding: 9px 12px; background: #ffffff;
    border: 1px solid #d1d5db; border-radius: 6px; color: #1f2937; font-size: 14px;
}
.ve-field textarea { resize: vertical; }
.ve-field input[readonly], .ve-field textarea[readonly] { background: #f3f4f6; color: #4b5563; }
.ve-field small { display: block; margin-top: 5px; color: #9ca3af; font-size: 12px; }
.ve-full { grid-column: 1 / -1; }
.ve-req { color: #dc2626; }
.ve-current-file { margin-top: 8px; font-size: 13px; }
.ve-current-file a { color: #1d4ed8; font-weight: 600; }

/* ---------- Entry lines ---------- */
.ve-lines-head {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
    gap: 6px 16px; margin: 24px 0 10px; padding-top: 18px; border-top: 1px dashed #d1d5db;
}
.ve-lines-head h3 { margin: 0; font-size: 16px; color: #111827; }
.ve-hint { color: #6b7280; font-size: 12px; }

.ve-line-head {
    display: grid; gap: 10px; padding: 8px 13px; margin-bottom: 6px;
    grid-template-columns: 34px minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.3fr) 38px;
    background: #1f2937; border-radius: 8px; color: #ffffff;
    font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.ve-line-head-journal {
    grid-template-columns: 34px minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 38px;
}
.ve-line-head .r { text-align: right; }

.ve-lines { display: flex; flex-direction: column; gap: 8px; }
.ve-line {
    display: grid; align-items: end; gap: 10px; padding: 10px 12px;
    grid-template-columns: 34px minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.3fr) 38px;
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
}
.ve-line-journal {
    grid-template-columns: 34px minmax(0, 3fr) minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 38px;
}
.ve-no {
    align-self: center; width: 28px; height: 28px; line-height: 28px; text-align: center;
    background: #1f2937; color: #ffffff; border-radius: 50%; font-size: 12px; font-weight: 700;
}
.ve-mini { display: none; margin-bottom: 4px; color: #6b7280; font-size: 11px; font-weight: 600; }
.ve-cell input[type=text],
.ve-cell input[type=number] {
    width: 100%; min-height: 40px; padding: 9px 12px; background: #ffffff;
    border: 1px solid #d1d5db; border-radius: 6px; color: #1f2937; font-size: 14px;
}
.ve-cell input[type=number] { text-align: right; font-weight: 600; }
.ve-cell input:focus { outline: none; border-color: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,.12); }
.ve-cell-x { display: flex; align-items: center; justify-content: center; }
.ve-remove {
    width: 34px; height: 34px; background: #ffffff; border: 1px solid #fecaca;
    border-radius: 6px; color: #b91c1c; font-size: 20px; line-height: 1; cursor: pointer;
}
.ve-remove:hover { background: #fef2f2; }

.ve-lines-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 12px;
}
.ve-totals { display: flex; flex-wrap: wrap; gap: 10px; }
.ve-totals > div {
    min-width: 130px; padding: 8px 14px; background: #f3f4f6; border-radius: 8px; text-align: right;
}
.ve-totals span { display: block; color: #6b7280; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ve-totals strong { display: block; margin-top: 2px; color: #111827; font-size: 18px; }
.ve-totals strong.ve-ok  { color: #166534; }
.ve-totals strong.ve-bad { color: #b91c1c; }

.ve-actions { margin-top: 20px; }

/* ---------- List ---------- */
.ve-table-wrap { overflow-x: auto; }
.ve-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.ve-table th {
    padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
    color: #4b5563; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap;
}
.ve-table td { padding: 12px 16px; border-bottom: 1px solid #eef0f2; color: #374151; font-size: 13px; vertical-align: top; }
.ve-table tbody tr:hover { background: #fafafa; }
.ve-table tbody tr:last-child td { border-bottom: none; }
.ve-table .r { text-align: right; }
.ve-bold { font-weight: 700; color: #111827; }
.ve-note { min-width: 160px; white-space: normal; }
.ve-empty { padding: 32px !important; color: #9ca3af !important; text-align: center !important; }
.ve-sub { display: inline-block; margin-left: 6px; color: #9ca3af; font-size: 12px; }
.ve-entry { margin-bottom: 2px; }
.ve-dc { display: inline-block; min-width: 22px; margin-right: 4px; color: #6b7280; font-size: 11px; font-weight: 700; }
.ve-badge {
    display: inline-block; margin-top: 4px; padding: 2px 9px; background: #dbeafe;
    border-radius: 999px; color: #1e40af; font-size: 11px; font-weight: 700;
}
.ve-row-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ve-row-actions .inline-form { display: inline; margin: 0; }

.ve-pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px; border-top: 1px solid #e5e7eb; font-size: 13px; color: #6b7280; }
.ve-pager a { color: #1d4ed8; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .ve-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .ve-grid { grid-template-columns: minmax(0, 1fr); }
    .ve-line {
        grid-template-columns: 30px minmax(0, 1fr) 38px;
        grid-template-areas: "no account x" "note note note" "amt amt amt";
        align-items: start;
    }
    .ve-line .ve-no { grid-area: no; }
    .ve-line .ve-cell-account { grid-area: account; }
    .ve-line .ve-cell-note { grid-area: note; }
    .ve-line .ve-cell-amt { grid-area: amt; }
    .ve-line .ve-cell-x { grid-area: x; }

    .ve-line-journal {
        grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 38px;
        grid-template-areas: "no account account x" "note note note note" ". debit credit .";
    }
    .ve-line-journal .ve-cell-debit { grid-area: debit; }
    .ve-line-journal .ve-cell-credit { grid-area: credit; }

    .ve-line-head { display: none; }
    .ve-mini { display: block; }
    .ve-head h1 { font-size: 23px; }
    .ve-modal-body { padding: 14px 14px 20px; }
    .ve-totals > div { flex: 1; min-width: 100px; }
}


/* ---------- Tabs ---------- */
.ve-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid #e5e7eb; }
.ve-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; margin-bottom: -2px;
    border-bottom: 2px solid transparent; color: #4b5563; font-size: 14px; font-weight: 600;
}
.ve-tab:hover { color: #111827; }
.ve-tab.active { color: #111827; border-bottom-color: #1f2937; }
.ve-tab-count { padding: 1px 8px; background: #f3f4f6; border-radius: 999px; color: #6b7280; font-size: 11px; }
.ve-tab.active .ve-tab-count { background: #1f2937; color: #ffffff; }

/* ---------- Search ---------- */
.ve-search { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-bottom: 1px solid #e5e7eb; }
.ve-search input[type=search] {
    flex: 1; min-width: 220px; min-height: 40px; padding: 9px 12px; background: #ffffff;
    border: 1px solid #d1d5db; border-radius: 6px; color: #1f2937; font-size: 14px;
}
.ve-search input[type=search]:focus { outline: none; border-color: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,.12); }

/* ---------- Pop-up form ---------- */
.ve-modal {
    display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 4000;
    padding: 24px 12px; background: rgba(17, 24, 39, 0.55); overflow-y: auto;
}
.ve-modal.is-open { display: block; }
.ve-modal-box {
    max-width: 1100px; margin: 0 auto; background: #ffffff; border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.30);
}
.ve-modal-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; background: #ffffff; border-bottom: 1px solid #e5e7eb; border-radius: 10px 10px 0 0;
}
.ve-modal-head h2 { margin: 0; font-size: 19px; color: #111827; }
.ve-modal-x {
    width: 36px; height: 36px; background: #f3f4f6; border: 0; border-radius: 6px;
    color: #374151; font-size: 24px; line-height: 1; cursor: pointer;
}
.ve-modal-x:hover { background: #e5e7eb; }
.ve-modal-body { padding: 20px 22px 26px; }
body.ve-noscroll { overflow: hidden; }

.ve-page-now {
    padding: 4px 11px; background: #1f2937; border-radius: 6px; color: #ffffff; font-weight: 700;
}
@media (max-width: 760px) {
    .ve-modal { padding: 0; }
    .ve-modal-box { border-radius: 0; min-height: 100%; }
    .ve-search { padding: 12px 14px; }
    .ve-tab { padding: 9px 11px; font-size: 13px; }
}


/* ---------- Mobile: scrolling tabs and card-style list ---------- */
@media (max-width: 760px) {
    .ve-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .ve-tabs::-webkit-scrollbar { display: none; }
    .ve-tab { flex-shrink: 0; white-space: nowrap; }

    .ve-card-head { flex-wrap: wrap; }
    .ve-card-head .btn { width: 100%; }
    .ve-search .btn { flex: 1; }

    .ve-table { min-width: 0; }
    .ve-table thead { display: none; }
    .ve-table, .ve-table tbody, .ve-table tr, .ve-table td { display: block; width: 100%; }
    .ve-table tbody tr {
        margin: 0 0 12px; padding: 6px 0; background: #ffffff;
        border: 1px solid #e5e7eb; border-radius: 8px;
    }
    .ve-table tbody tr:hover { background: #ffffff; }
    .ve-table td {
        position: relative; display: block; min-height: 38px; padding: 9px 14px 9px 36%;
        border-bottom: 1px dashed #eef0f2; text-align: left;
    }
    .ve-table td:last-child { border-bottom: none; }
    .ve-table td::before {
        content: attr(data-label); position: absolute; top: 9px; left: 14px; width: 30%;
        color: #6b7280; font-size: 12px; font-weight: 700; text-align: left;
    }
    .ve-table td.r { text-align: left; }
    .ve-table td[data-label="Actions"] { padding-left: 14px; }
    .ve-table td[data-label="Actions"]::before { display: none; }
    .ve-row-actions { flex-wrap: wrap; }
    .ve-row-actions .btn { flex: 1; }
    .ve-table td.ve-empty { padding-left: 14px; text-align: center; }
    .ve-table td.ve-empty::before { display: none; }
    .ve-table-wrap { padding: 12px; }
    .ve-pager { flex-wrap: wrap; gap: 10px; }
}

/* ---------- Tablet: keep the table readable without side-scrolling ---------- */
.ve-table td[data-label="Date"], .ve-table td[data-label="Voucher No."] { white-space: nowrap; }

@media (min-width: 761px) and (max-width: 1100px) {
    .ve-table { min-width: 0; }
    .ve-table th, .ve-table td { padding: 10px 9px; }
    .ve-row-actions { flex-wrap: wrap; white-space: normal; max-width: 200px; }
    .ve-note { min-width: 0; }
}


/* ---------- Desktop: full-width table, all action buttons on one line ---------- */
@media (min-width: 1101px) {
    .ve-table { min-width: 0; }
    .ve-table th, .ve-table td { padding: 12px 18px; }
    .ve-row-actions { flex-wrap: nowrap; white-space: nowrap; max-width: none; }
}

.demo-banner{position:sticky;top:0;z-index:200;background:#fef3c7;border-bottom:1px solid #fde68a;color:#92400e;padding:8px 16px;font-size:13px;text-align:center}
.demo-note{margin:0 0 14px;padding:10px 14px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;color:#1e40af;font-size:13px}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(30px);opacity:0;pointer-events:none;background:#166534;color:#fff;padding:12px 20px;border-radius:8px;font-size:14px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.25);transition:all .25s;z-index:6000;max-width:92vw}
.print-company-header{display:none}
.screen-summary-table{width:260px;max-width:100%;border-collapse:collapse;margin:12px 0 16px;background:transparent}
.screen-summary-table th,.screen-summary-table td{padding:6px 10px;border:0;font-size:13px;text-align:left}
.screen-summary-table th{width:68%;font-weight:600;color:#374151}.screen-summary-table td{text-align:right;font-weight:700;color:#111827}
.report-print-area{padding-bottom:6px}.report-print-area .card-header{border-bottom:0}.report-print-area > .table-wrap{margin:0 18px 14px;width:auto}@media(max-width:650px){.report-print-area > .table-wrap{margin:0 10px 12px}}.screen-summary-table td{white-space:nowrap}
.report-print-area .data-table tfoot th{padding:12px 18px;background:#f3f4f6;border-top:2px solid #9ca3af;font-size:13px;text-align:left}
.report-print-area .balance-cell{white-space:nowrap;font-weight:600}.report-summary-box{padding:0 22px 16px}.report-summary-box h3{margin:6px 0}
.report-summary-box table.plain{width:320px}.report-summary-box table.plain th{width:60%}
.card>p{margin:0;padding:18px 22px;color:#6b7280}
@media print{.demo-banner,.sidebar,.top-header,.no-print,.report-navigation,.report-filter,.page-header,.toast,.sidebar-backdrop{display:none!important}.app-layout{display:block}.print-company-header{display:block;text-align:center;margin-bottom:10px}.print-company-name{font-size:20px;font-weight:700}.card{border:0}}
.sidebar{background:#ffffff !important;border-right:1px solid #e5e7eb;color:#111827;width:268px;display:flex;flex-direction:column;box-shadow:none}
.sb-brand{display:flex;align-items:center;gap:12px;padding:18px 18px 12px}
.sb-logo{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,#111827,#374151);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:17px;flex-shrink:0;box-shadow:0 4px 10px rgba(17,24,39,.25)}
.sb-brand-name{font-size:15px;font-weight:700;color:#111827;line-height:1.25}.sb-brand-sub{font-size:12px;color:#6b7280;margin-top:2px}
.sidebar-nav{padding:4px 12px 12px;flex:1;overflow-y:auto}
.sb-label{margin:16px 10px 6px;font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#9ca3af}
.sb-link{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:11px;color:#374151;font-size:14px;font-weight:600;margin-bottom:2px;transition:background .15s,color .15s}
.sb-link:hover{background:#f3f4f6;color:#111827}
.sb-ico{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;background:#f3f4f6;flex-shrink:0}
.sb-main .sb-ico{background:#e0e7ff}.sb-ops .sb-ico{background:#dcfce7}.sb-data .sb-ico{background:#fef3c7}.sb-rep .sb-ico{background:#ede9fe}
.sb-link.active{background:#1f2937;color:#fff;box-shadow:0 6px 14px rgba(31,41,55,.28)}
.sb-link.active .sb-ico{background:rgba(255,255,255,.16)}
.sb-foot{display:flex;align-items:center;gap:10px;margin:6px 12px 14px;padding:12px;border:1px solid #e5e7eb;border-radius:14px;background:#f9fafb}
.sb-avatar{width:36px;height:36px;border-radius:50%;background:#1f2937;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.sb-user{font-size:14px;font-weight:700;color:#111827}.sb-role{font-size:12px;color:#6b7280}
tr.is-x td{color:#9ca3af;text-decoration:line-through;background:#fafafa}tr.is-x td .dx-badge,tr.is-x td .btn,tr.is-x td .ve-row-actions{text-decoration:none}
.leaf-grid{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.leaf{padding:7px 10px;border-radius:8px;border:1px solid #d1d5db;background:#fff;font-size:12px;font-weight:700;cursor:pointer;min-width:74px;text-align:center}
.leaf-available{background:#eff6ff;border-color:#bfdbfe;color:#1e40af}.leaf-used{background:#dcfce7;border-color:#bbf7d0;color:#166534;cursor:default}.leaf-cancelled{background:#fee2e2;border-color:#fecaca;color:#991b1b;text-decoration:line-through;cursor:default}
.leaf-legend{display:flex;gap:8px;margin-top:6px}.leaf-legend .leaf{cursor:default;min-width:0}
.dx-table td[data-label="Date"],.ve-table td[data-label="Date"]{white-space:nowrap}
.rep-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.rep-card{display:block;padding:18px 20px;background:#fff;border:1px solid #e5e7eb;border-top:3px solid #1f2937;border-radius:10px;box-shadow:0 2px 6px rgba(0,0,0,.04);transition:box-shadow .15s,transform .15s}
.rep-card:hover{box-shadow:0 8px 20px rgba(0,0,0,.09);transform:translateY(-2px)}
.rep-card-title{font-size:16px;font-weight:700;color:#111827;margin-bottom:6px}.rep-card-desc{font-size:13px;color:#6b7280;line-height:1.5;min-height:40px}.rep-card-go{margin-top:12px;font-size:13px;font-weight:700;color:#1d4ed8}
@media(max-width:1100px){.rep-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.rep-grid{grid-template-columns:1fr}}
[data-cbank],[data-cstat],[data-txtype],[data-txstatus],[data-acat]{width:auto !important;min-width:190px}
.rep-presets{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px 22px 0;font-size:13px;color:#66758f}.rep-presets a{padding:4px 11px;border:1px solid #d3dbec;border-radius:999px;background:#fff;color:#3b4a63;font-weight:600}.rep-presets a:hover{border-color:#4a66e6;color:#2339a8}
tr.day-head td{background:#eef2fc;color:#0f1b33}tr.day-total td{background:#f7f9fe}.demo-tag{background:#fef3c7;color:#92400e;border-radius:6px;padding:0 6px;font-size:10px;font-weight:700}
.sb-badge{margin-left:auto;background:#dc2626;color:#fff;border-radius:999px;font-size:11px;font-weight:700;padding:1px 8px}
.dx-alert-warn{background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.rec-link{cursor:pointer;text-decoration:none}.rec-link:hover{filter:brightness(.92);text-decoration:underline}
.ref-link{color:#2339a8;font-weight:700;text-decoration:underline dotted;cursor:pointer}.ref-link:hover{text-decoration:underline;color:#1b2c86}
.wm-display{background:#000;border-radius:8px;padding:6px 22px;text-align:center;min-height:96px;display:flex;align-items:center;justify-content:center}
.wm-display span{color:#ff1f1f;font-size:64px;font-weight:700;font-family:"Courier New",monospace;letter-spacing:2px}
.wm-scale-row{display:grid;grid-template-columns:minmax(260px,420px) 1fr;gap:18px;align-items:start;margin:16px 0}
.wm-display-wrap{position:relative}.wm-stab{display:inline-block;margin-top:8px;padding:3px 12px;border-radius:999px;font-size:12px;font-weight:700}
.wm-stab.ok{background:#d9f5ea;color:#046c4e}.wm-stab.mv{background:#fef3c7;color:#92400e}.wm-stab.off{background:#fde4e4;color:#b42318}
.wm-caprow{display:flex;gap:10px;flex-wrap:wrap}.wm-pad{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.wm-raw{background:#0f1b33;color:#9fe7b5;padding:10px 14px;border-radius:8px;min-height:60px;font-size:12px;white-space:pre-wrap}
@media(max-width:900px){.wm-scale-row{grid-template-columns:1fr}.wm-display span{font-size:46px}}
#slipHost{display:none}
.slip{width:720px;max-width:100%;margin:0 auto 16px;border:1px solid #8a8a8a;border-radius:24px;padding:22px 30px 26px;background:#fff;color:#000;font-family:Arial,Helvetica,sans-serif;font-size:15px;box-sizing:border-box}
.slip-top{height:44px}.slip-title{text-align:center;font-size:27px;font-weight:700;text-decoration:underline;margin:0 0 4px}.slip-sub{text-align:center;font-size:12px;color:#444;margin-bottom:8px;letter-spacing:.04em}
.slip-row{display:flex;justify-content:space-between;align-items:baseline;gap:14px;margin:7px 0}.slip-row.slip-end{justify-content:flex-end;gap:36px;font-size:13px}
.slip-c{display:flex;gap:9px;align-items:baseline}.slip-l{font-weight:700;text-align:right;min-width:96px}.slip-v{min-width:20px}
.slip-frame{border:1px solid #d99;border-radius:4px;padding:2px 8px;display:inline-block;min-width:240px}
.slip-hr{border:0;border-top:2px solid #111;margin:10px 0}.slip-auto{font-size:14px;letter-spacing:.05em}
.slip-box{display:inline-block;border:1px solid #bbb;box-shadow:3px 3px 0 #bbb;padding:2px 10px;min-width:140px;text-align:right;font-weight:700}
.slip-sign{display:flex;justify-content:space-between;margin-top:38px;font-weight:700}.slip-sign div{width:230px;text-align:center}.slip-sign span{display:block;border-top:2px solid #111;margin-bottom:6px}
.slip-preview{background:#f4f6fb;border-radius:10px;padding:14px;overflow:auto}
@media print{body.print-slip > *:not(#slipHost){display:none !important}body.print-slip #slipHost{display:block !important}body.print-slip{background:#fff !important}.slip{margin:0 auto 0;page-break-after:always;break-after:page;box-shadow:none}.slip:last-child{page-break-after:auto}@page{size:A4;margin:12mm}}
.wm-ss{display:grid;grid-template-columns:1fr 1fr;gap:20px}.wm-ss-box{border:1px solid #e2e8f3;border-radius:10px;padding:14px 16px;background:#fbfcff}.wm-ss-box h3{margin:0 0 10px;font-size:14px;color:#3b4a63}
@media(max-width:900px){.wm-ss{grid-template-columns:1fr}}
.it-wmf{flex:1 1 200px}.it-usew{display:flex !important;gap:6px;align-items:center;font-weight:700 !important;color:#2339a8 !important;font-size:12px !important}.it-usew input{width:auto;min-height:0}
.slip2{width:720px;max-width:100%;margin:0 auto 16px;border:1.5px solid #222;border-radius:14px;padding:18px 26px 20px;background:#fff;color:#000;font-family:Arial,Helvetica,sans-serif;font-size:13px;box-sizing:border-box}
.sl2-co{text-align:center;font-weight:800;font-size:18px;letter-spacing:.02em;border-bottom:1px solid #999;padding-bottom:6px;margin-bottom:8px}.sl2-co small{display:block;font-weight:400;font-size:11px;color:#444}
.sl2-head{display:flex;justify-content:space-between;align-items:flex-end;border-bottom:3px double #111;padding-bottom:8px;margin-bottom:10px}
.sl2-title{font-size:23px;font-weight:800;line-height:1.15}.sl2-sub{font-size:11px;letter-spacing:.12em;color:#333;margin-top:3px}
.sl2-no{text-align:right;font-size:26px;font-weight:800}.sl2-no small{display:block;font-size:10px;font-weight:600;letter-spacing:.08em;color:#444;text-transform:uppercase}
.sl2-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}.sl2-box{border:1px solid #999;border-radius:8px;padding:6px 10px}.sl2-span{grid-column:1/-1}
.sl2-box h4{margin:0 0 3px;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#555}.sl2-big{font-size:15px;font-weight:800;margin-bottom:3px}
.sl2-kv{display:flex;gap:8px;align-items:baseline;margin:1px 0}.sl2-kv span{min-width:74px;color:#444;font-size:11px}.sl2-kv b{font-weight:700}
.sl2-vrow{display:grid;grid-template-columns:repeat(4,1fr);gap:4px 10px}.sl2-vrow .sl2-kv{flex-direction:column;gap:0}.sl2-vrow .sl2-kv span{min-width:0}
.sl2-tbl{width:100%;border-collapse:collapse;margin:0 0 8px}.sl2-tbl th,.sl2-tbl td{border:1px solid #999;padding:5px 9px;text-align:left}.sl2-tbl th{background:#eee;font-size:11px;letter-spacing:.06em;text-transform:uppercase}.sl2-tbl .r{text-align:right}.sl2-tbl small{color:#555;font-size:10px}
.sl2-final{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}.sl2-final div{border:2.5px solid #111;border-radius:8px;padding:6px 12px;box-shadow:3px 3px 0 #999}.sl2-final small{display:block;font-size:10px;letter-spacing:.12em;color:#444;font-weight:700}.sl2-final strong{font-size:25px;font-weight:800}
.sl2-rem{margin:8px 0 2px;min-height:22px}.sl2-sign{display:flex;justify-content:space-between;gap:20px;margin-top:30px;font-weight:700}.sl2-sign div{flex:1;text-align:center}.sl2-sign span{display:block;border-top:1.5px solid #111;margin-bottom:5px}
.sl2-foot{text-align:center;font-size:9.5px;color:#666;margin-top:12px}
@media print{.slip2{margin:0 auto;page-break-after:always;break-after:page}.slip2:last-child{page-break-after:auto}}
.wm-final-box{margin:14px 0 4px;padding:12px 14px;border:2px solid #2f4bd0;border-radius:10px;background:#f4f6ff}
.wm-manual{margin-top:10px;max-width:360px}.wm-manual label{font-size:12px;font-weight:700;color:#3b4a63;display:block;margin-bottom:4px}.wm-manrow{display:flex;gap:8px}.wm-manrow input{flex:1;min-width:0}.wm-manual small{display:block;color:#66758f;margin-top:4px;font-size:11px}
.wm-parts{display:flex;flex-direction:column;gap:8px;margin:10px 0}.wm-part{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid #d3dbec;border-radius:10px;cursor:pointer;background:#fff}.wm-part:hover{border-color:#4a66e6;background:#f4f6ff}.wm-part input{width:auto;min-height:0}

.rpv-modal{max-width:1180px;width:96vw}.rpv-bar{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.rpv-bar select{width:auto}.rpv-info{color:#66758f;font-size:12px}
.rpv-stage{background:#c9cfdd;padding:18px;border-radius:10px;max-height:68vh;overflow:auto}
.rpv-paper{background:#fff;margin:0 auto;padding:14mm 12mm;box-shadow:0 2px 12px rgba(0,0,0,.25);color:#000;font-family:Arial,Helvetica,sans-serif;font-size:11px}
.rpv-paper.portrait{width:210mm;min-height:297mm}.rpv-paper.landscape{width:297mm;min-height:210mm}
.rpv-sheet .card{border:0;box-shadow:none;background:none;margin:0;padding:0}.rpv-sheet .print-company-header{display:block;text-align:center;border-bottom:2px solid #111;padding-bottom:6px;margin-bottom:8px}
.rpv-sheet .print-company-name{font-size:20px;font-weight:800;letter-spacing:.02em}.rpv-sheet .print-company-header div{font-size:10.5px;color:#333}
.rpv-sheet .card-header{padding:0;margin:8px 0 6px;border:0;display:block;background:none !important;box-shadow:none !important}.rpv-sheet *{box-shadow:none !important}.rpv-sheet .report-summary-box table,.rpv-sheet .screen-summary-table{width:55%}.rpv-sheet .card-header h2{font-size:16px;margin:0}.rpv-sheet .card-header p{margin:2px 0 0;color:#333;font-size:11px}
.rpv-sheet table{width:100%;border-collapse:collapse;margin:6px 0}.rpv-sheet th,.rpv-sheet td{border:1px solid #777;padding:3px 6px;font-size:10.5px;text-align:left;vertical-align:top;background:none !important;color:#000 !important}
.rpv-sheet thead th{background:#e9ecf3 !important;font-weight:700;font-size:10px;text-transform:none}.rpv-sheet tfoot th,.rpv-sheet tfoot td{background:#f1f1f1 !important;font-weight:800;border-top:2px solid #333}
.rpv-sheet td.r,.rpv-sheet th.r,.rpv-sheet td[align=right]{text-align:right}.rpv-sheet .table-wrap{overflow:visible;margin:0}.rpv-sheet td.nw{white-space:nowrap}
.rpv-sheet .report-summary-box,.rpv-sheet .report-summary{padding:0;margin:4px 0}.rpv-sheet .dx-badge,.rpv-sheet .ve-sub{background:none !important;color:#000 !important;border:0;padding:0;display:inline;font-size:9.5px}.rpv-sheet .ve-sub{display:block;color:#444 !important}
.rpv-sheet tr.is-x td{text-decoration:line-through;color:#666 !important}.rpv-next{margin-top:14px;page-break-before:always}

.rpv-sheet .card-header h2{background:#1f2a55;color:#fff !important;padding:4px 10px;font-size:13px !important;letter-spacing:.05em;text-transform:uppercase;border-radius:3px 3px 0 0}
.rpv-sheet .card-header p{margin:0 !important;padding:3px 10px;border:1px solid #c9cfdd;border-top:0;background:#f4f6fb;font-size:10.5px;color:#222}
.rpv-sheet .print-company-header{border-bottom:3px double #1f2a55 !important}.rpv-sheet .print-company-name{color:#1f2a55;font-size:21px !important}
.rpv-sheet tbody tr:nth-child(even) td{background:#f6f7fb !important}
.rpv-sheet td.num,.rpv-sheet th.num{text-align:right !important;font-variant-numeric:tabular-nums}
.rpv-sheet thead th{background:#dfe4f1 !important;border-color:#8a93ad !important}.rpv-sheet tfoot th,.rpv-sheet tfoot td{background:#e6e9f3 !important}
.rpv-sheet .report-summary-box h3{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#1f2a55}
.rpv-sign{display:flex;gap:30px;margin-top:26px}.rpv-sign div{flex:1;text-align:center;font-size:10px;font-weight:700}.rpv-sign span{display:block;border-top:1.2px solid #111;margin-bottom:3px}
.rpv-foot{display:flex;justify-content:space-between;border-top:1px solid #999;margin-top:12px;padding-top:4px;font-size:9px;color:#555}
#rptHost{display:none}
@media print{body.print-rpt > *:not(#rptHost){display:none !important}body.print-rpt #rptHost{display:block !important}html:has(body.print-rpt),body.print-rpt{background:#fff !important}
 .rpv-print .rpv-sheet{width:100%;font-family:Arial,Helvetica,sans-serif;color:#000;font-size:10px}.rpv-print thead{display:table-header-group}.rpv-print tfoot{display:table-footer-group}.rpv-print tr{page-break-inside:avoid;break-inside:avoid}
 .rpv-print .card-header,.rpv-print .print-company-header{page-break-after:avoid}}

.party-table td,.party-table th{white-space:nowrap}.party-table td.party-addr{white-space:normal;min-width:190px;max-width:260px}.muted{color:#9aa5b8}
.party-card{margin-top:8px;padding:9px 12px;border:1px solid #d6def0;border-left:4px solid #2f4bd0;border-radius:8px;background:#f7f9ff;font-size:12.5px;line-height:1.5}.party-card small{color:#66758f}
.party-card-addr{color:#222;margin-top:2px}.party-card-rows{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:3px;color:#222}.party-card-rows i{font-style:normal;color:#66758f;margin-right:3px}.party-card-rem{margin-top:3px;color:#7a4b00}
.rep-party-d{margin:2px 0 0 !important;font-size:11px;color:#333}

.saved-tick{width:56px;height:56px;border-radius:50%;background:#d9f5ea;color:#047857;font-size:32px;line-height:56px;margin:0 auto;font-weight:800}
.dopaper{background:#fff;margin:0 auto;width:210mm;min-height:150mm;padding:8mm;box-shadow:0 2px 12px rgba(0,0,0,.25);box-sizing:border-box}
.docsheet.two{height:281mm}.docsheet.two .dochalf{height:139mm;overflow:hidden}.docsheet.one .dochalf{min-height:0}
.dc-cut{text-align:center;color:#777;font-size:9px;letter-spacing:.06em;margin:0;height:3mm;line-height:3mm}
.dc{font-family:Arial,Helvetica,sans-serif;color:#000;font-size:10.5px;border:1.4px solid #222;border-radius:6px;padding:7px 10px 6px;position:relative;box-sizing:border-box;background:#fff}
.dc-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:2px solid #111;padding-bottom:5px;margin-bottom:6px}
.dc-co{display:flex;gap:8px;align-items:center}.dc-co b{font-size:15px}.dc-co div div{font-size:9.5px;color:#333}
.dc-logo{width:38px;height:38px;border-radius:8px;background:#1f2a55;color:#fff;font-weight:800;font-size:14px;display:flex;align-items:center;justify-content:center}
.dc-title{text-align:right}.dc-t{font-size:15px;font-weight:800;letter-spacing:.03em}.dc-no{font-size:16px;font-weight:800;color:#1f2a55}.dc-sub{font-size:10px;color:#333}.dc-st{color:#b91c1c;border:1.5px solid #b91c1c;padding:0 5px;border-radius:3px}
.dc-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2px 14px;margin:4px 0 6px}.dc-kv{display:flex;flex-direction:column;border-bottom:1px dotted #bbb;padding:1px 0 2px}.dc-kv > span{font-size:8.5px;color:#555;text-transform:uppercase;letter-spacing:.06em}.dc-kv b{font-size:10.5px}.dc-kv small,.dc-tbl small{display:block;font-weight:400;color:#444;font-size:9px}
.dc-big{font-size:14px}.dc-sec{font-size:9px;letter-spacing:.1em;text-transform:uppercase;color:#333;font-weight:700;margin:5px 0 2px}
.dc-tbl{width:100%;border-collapse:collapse}.dc-tbl th,.dc-tbl td{border:1px solid #777;padding:2px 5px;font-size:9.8px;vertical-align:top;text-align:left}.dc-tbl th{background:#e9ecf3;font-size:9px;text-transform:uppercase;letter-spacing:.03em}.dc-tbl .r{text-align:right}.dc-tbl .c{text-align:center}.dc-tbl tfoot td{background:#f1f1f1;border-top:2px solid #333}
.dc-words{margin:5px 0 2px;font-size:10px}.dc-words span,.dc-narr span{color:#555}.dc-narr{margin:2px 0;font-size:10px}
.dc-sign{display:flex;gap:16px;margin-top:20px}.dc-sign div{flex:1;text-align:center;font-size:9.5px;font-weight:700}.dc-sign span{display:block;border-top:1.2px solid #111;margin-bottom:2px}
.dc-foot{display:flex;justify-content:space-between;font-size:8px;color:#666;border-top:1px solid #bbb;margin-top:6px;padding-top:2px}

.pd{font-family:"Segoe UI",Arial,Helvetica,sans-serif;color:#111;font-size:10.5px;border:1px solid #1f2a55;border-radius:8px;padding:9px 12px 7px;background:#fff;position:relative;box-sizing:border-box}
.pd-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.pd-co{display:flex;gap:9px;align-items:center}
.pd-logo{width:42px;height:42px;border-radius:9px;background:linear-gradient(135deg,#1f2a55,#3b4fb8);color:#fff;font-weight:800;font-size:15px;display:flex;align-items:center;justify-content:center;flex:none}
.pd-coname{font-size:16px;font-weight:800;color:#1f2a55;line-height:1.15}.pd-coaddr{font-size:9.3px;color:#444;line-height:1.35}
.pd-ti{text-align:right}.pd-title{font-size:17px;font-weight:800;color:#1f2a55;letter-spacing:.05em}.pd-no{display:inline-block;margin-top:2px;background:#1f2a55;color:#fff;font-weight:800;font-size:12px;padding:1px 10px;border-radius:99px}
.pd-copy{font-size:9px;color:#555;font-style:italic;margin-top:2px}.pd-cx{color:#b91c1c;border:1.5px solid #b91c1c;font-weight:800;font-size:10px;display:inline-block;padding:0 6px;border-radius:3px;margin-top:2px}
.pd-bar{height:3px;background:linear-gradient(90deg,#1f2a55,#3b4fb8 60%,#9fb0f0);margin:6px 0 7px;border-radius:2px}
.pd-two{display:grid;grid-template-columns:1fr 1fr 150px;gap:8px;margin-bottom:6px}.pd-two-inv{grid-template-columns:1.25fr 1fr}
.pd-box{border:1px solid #cfd6e6;border-radius:6px;padding:4px 8px;background:#fafbfe}.pd-boxt{font-size:8.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#1f2a55;border-bottom:1px solid #dde3f2;margin-bottom:2px;padding-bottom:1px}
.pd-row{display:flex;gap:6px;padding:1px 0}.pd-row span{width:62px;flex:none;color:#666;font-size:9.5px}.pd-row b{font-weight:600;flex:1}.pd-row small,.pd-tbl small{display:block;font-weight:400;color:#555;font-size:9px}.pd-hl{color:#1f2a55;font-weight:800}
.pd-amount{border:1.5px solid #1f2a55;border-radius:6px;background:#eef1fb;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px}.pd-amount span{font-size:8.5px;letter-spacing:.1em;text-transform:uppercase;color:#1f2a55;font-weight:800}.pd-amount b{font-size:16px;color:#111}
.pd-chq{display:flex;gap:14px;flex-wrap:wrap;border:1.5px dashed #1f2a55;border-radius:6px;padding:4px 10px;margin:0 0 6px;background:#fffdf3}.pd-chq div{display:flex;flex-direction:column}.pd-chq span{font-size:8.5px;text-transform:uppercase;letter-spacing:.08em;color:#666}.pd-chq b{font-size:11px}
.pd-chq-main b{font-size:15px;letter-spacing:.06em;color:#1f2a55}.pd-chq i{font-weight:400;color:#999;font-size:11px}
.pd-tbl{width:100%;border-collapse:collapse;border:1px solid #1f2a55}.pd-tbl th{background:#1f2a55;color:#fff;font-size:9px;text-transform:uppercase;letter-spacing:.05em;padding:3px 6px;text-align:left;border:0}.pd-tbl td{padding:3px 6px;border-bottom:1px solid #dde3f2;font-size:10px;vertical-align:top}
.pd-tbl tbody tr:nth-child(even) td{background:#f6f8fd}.pd-tbl .r{text-align:right}.pd-tbl .c{text-align:center}.pd-tbl tfoot td{background:#e6eaf6;font-weight:800;border-top:2px solid #1f2a55}
.pd-words{margin:6px 0 2px;font-size:10px}.pd-words span,.pd-narr span{display:block;font-size:8.5px;text-transform:uppercase;letter-spacing:.08em;color:#666}.pd-words b{font-size:10.5px}.pd-narr{margin-top:3px;font-size:10px}.pd-narr span{display:inline;margin-right:4px}
.pd-totwrap{display:flex;gap:14px;align-items:flex-start;justify-content:space-between;margin-top:4px}.pd-totwrap .pd-words{flex:1}
.pd-tot{border-collapse:collapse;min-width:210px;margin-top:6px}.pd-tot td{padding:2px 8px;font-size:10.5px;border-bottom:1px solid #dde3f2}.pd-tot .r{text-align:right}.pd-tot .pd-grand td{background:#1f2a55;color:#fff;font-weight:800;font-size:12.5px;border:0}
.pd-sign{display:flex;gap:18px;margin-top:22px}.pd-sign div{flex:1;text-align:center;font-size:9.3px;font-weight:700;color:#222}.pd-sign span{display:block;border-top:1.2px solid #1f2a55;margin-bottom:2px}
.pd-sec{font-size:8.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#1f2a55;margin:6px 0 2px}.pd-brk td{font-size:9.6px}

.dopaper-full{min-height:297mm}
.docsheet.fullpage{width:194mm;margin:0 auto}.docfull .dc.pd-full{min-height:277mm;display:flex;flex-direction:column;font-size:11.5px;padding:12px 16px 10px}.pd-full .pd-coname{font-size:19px}.pd-full .pd-title{font-size:21px}.pd-full .pd-tbl td{font-size:11.2px;padding:5px 7px}.pd-full .pd-tbl th{font-size:9.6px;padding:5px 7px}.pd-full .pd-tbl tfoot td{background:#e6eaf6;font-weight:800;border-top:2px solid #1f2a55}
.pd-grow{flex:1;min-height:14px}.pd-full .pd-sign{margin-top:26px}.pd-full .pd-tot td{font-size:12px;padding:4px 9px}.pd-full .pd-tot .pd-grand td{font-size:14px}.pd-full .pd-box{padding:6px 10px}

.rpv-letterhead-space{height:24mm}.pd-co-off{min-height:16mm}
.pd-two-v{grid-template-columns:1.15fr 1fr 170px}.pd-payee{border:1px solid #cfd6e6;border-radius:6px;padding:5px 10px;background:#fafbfe;display:flex;flex-direction:column;justify-content:center}.pd-payee span{font-size:8.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:#1f2a55}.pd-payee b{font-size:14px;line-height:1.2}.pd-payee small{color:#555;font-size:9.5px}
.pd-terms{margin:2px 0 0 18px;padding:0;font-size:11px;line-height:1.55;color:#222}.pd-contract .pd-row span{width:78px}
.pd-foot{display:flex;justify-content:space-between;font-size:8px;color:#777;border-top:1px solid #cfd6e6;margin-top:7px;padding-top:2px}
.dc-cancelled::after{content:"CANCELLED";position:absolute;left:50%;top:44%;transform:translate(-50%,-50%) rotate(-18deg);font-size:54px;font-weight:800;color:rgba(185,28,28,.16);border:6px solid rgba(185,28,28,.16);padding:0 18px;border-radius:10px;pointer-events:none}
#docHost,#savedHost:empty{display:none}
@media print{body.print-doc > *:not(#docHost){display:none !important}body.print-doc #docHost{display:block !important}html:has(body.print-doc),body.print-doc{background:#fff !important}
 .docsheet{page-break-after:always;break-after:page;width:194mm;margin:0 auto}.docsheet:last-child{page-break-after:auto;break-after:auto}.docsheet.tall .dochalf{height:auto}.dc{page-break-inside:avoid}}

.it-brk{margin:6px 0 2px;padding:6px 10px;border:1px dashed #b8c2dd;border-radius:8px;background:#fbfcff}.it-usebrk{display:flex !important;gap:6px;align-items:center;font-weight:700 !important;color:#7a4b00 !important;font-size:12px !important}.it-usebrk input{width:auto;min-height:0}
.it-brk-f{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:6px}.it-brk-f .it-f{flex:1 1 160px}.it-brk-amt{font-weight:800;font-size:15px;padding-top:6px;color:#1f2a55}.it-brk-note{flex:1 1 100%;font-size:11.5px;color:#7a4b00}
.brk-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.brk-grid3{grid-template-columns:repeat(3,1fr);margin-bottom:8px}.brk-hint{font-size:12px;color:#7a4b00;margin-bottom:6px}.it-brks{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:6px 0 2px}.it-brks .it-brk{margin:0}@media(max-width:900px){.it-brks{grid-template-columns:1fr}}.brk-grid small{display:block;color:#66758f;font-weight:600;margin-bottom:2px}@media(max-width:700px){.brk-grid{grid-template-columns:1fr 1fr}}

/* ================= REPORTS TAB - professional screen design ================= */
#page.rep-home .page-header,#page.rep-screen .page-header{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
#page.rep-home .page-header h1,#page.rep-screen .page-header h1{letter-spacing:-.01em}
.rep-search{display:flex;align-items:center;gap:10px}.rep-search input{width:300px;max-width:100%;min-height:42px;padding:0 14px 0 38px;border:1px solid #cdd6ec;border-radius:999px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2366758f' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;font-size:14px;box-shadow:0 1px 2px rgba(31,42,85,.05)}.rep-search input:focus{outline:0;border-color:#2f4bd0;box-shadow:0 0 0 3px rgba(47,75,208,.15)}#repSearchNote{font-size:12px;color:#66758f;white-space:nowrap}
#page.rep-home .sl-tabs{display:flex;flex-wrap:wrap;gap:4px;overflow:visible;padding:5px;background:#fff;border:1px solid #dfe5f4;border-radius:14px;box-shadow:0 1px 3px rgba(31,42,85,.06);margin-bottom:18px;scrollbar-width:thin}
#page.rep-home .sl-tab{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;border-radius:10px;padding:8px 11px;border:0;font-weight:600;font-size:13px;color:#4a5878}#page.rep-home .sl-tab.active{background:linear-gradient(135deg,#2f4bd0,#4a66e6);color:#fff;box-shadow:0 4px 10px rgba(47,75,208,.28)}
#page.rep-home .sl-tab:not(.active):hover{background:#eef2fd}.sl-tab-ico{font-size:15px}#page.rep-home .sl-tab .sl-tab-count{background:rgba(31,42,85,.09);color:inherit;border-radius:99px;padding:1px 8px;font-size:11.5px}#page.rep-home .sl-tab.active .sl-tab-count{background:rgba(255,255,255,.25)}
.rep-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.rep-card{border-top:1px solid #e0e6f4 !important;position:relative;display:flex;flex-direction:column;min-height:150px;padding:18px 20px 16px 74px;border:1px solid #e0e6f4;border-top:1px solid #e0e6f4;border-left:4px solid #2f4bd0;border-radius:12px;background:#fff;box-shadow:0 1px 3px rgba(31,42,85,.06);transition:box-shadow .15s,transform .15s}
.rep-card:hover{box-shadow:0 12px 26px rgba(47,75,208,.15);transform:translateY(-2px)}.rep-card-ico{position:absolute;left:18px;top:18px;width:42px;height:42px;border-radius:11px;background:#eef2fd;display:flex;align-items:center;justify-content:center;font-size:21px}
.rep-card-title{font-size:15.5px;font-weight:700;color:#1b2547;margin-bottom:5px}.rep-card-desc{font-size:12.8px;color:#66758f;line-height:1.5;flex:1}.rep-card-go{margin-top:10px;font-size:13px;font-weight:700;color:#2f4bd0}
/* report screen */
#page.rep-screen .page-header p{font-size:13.5px;color:#66758f}#page.rep-screen .page-header p a{color:#2f4bd0;font-weight:600;text-decoration:none}#page.rep-screen .page-header p a:hover{text-decoration:underline}#page.rep-screen .page-header p b{color:#1b2547}
.report-navigation{border-radius:14px;overflow:hidden}.report-navigation .card-header{padding:14px 20px;border-bottom:1px solid #edf0f8}.report-navigation .card-header h2{font-size:15px;letter-spacing:.01em}
.report-navigation .form-actions{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;padding:12px 18px 14px;margin:0;border-top:0;scrollbar-width:thin}.report-navigation .form-actions .btn{white-space:nowrap;flex:0 0 auto;min-height:36px;padding:0 14px;border-radius:999px;font-size:13px}
.report-navigation .form-actions .btn-primary{box-shadow:0 4px 10px rgba(47,75,208,.25)}
.report-filter{border-radius:14px}.report-filter .card-header{padding:14px 20px;border-bottom:1px solid #edf0f8}.report-filter .card-header h2{font-size:15px}
.report-filter .rep-presets{padding:12px 20px 0}.report-filter .rep-presets a{border:1px solid #d6def0;border-radius:99px;padding:4px 12px;background:#fff;color:#2f4bd0;font-weight:600;text-decoration:none}.report-filter .rep-presets a:hover{background:#eef2fd}
.report-filter .form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px 18px;padding:14px 20px 18px}
.report-filter .form-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:10px;align-items:center;border-top:1px solid #e8ecf6;padding:14px 0 0;margin:2px 0 0}.report-filter .form-actions .btn{white-space:nowrap;min-height:40px;padding:0 18px;border-radius:10px}.report-filter .form-actions [data-act="r-print"]{margin-left:auto}
.report-filter label{font-size:12px;font-weight:700;letter-spacing:.02em;color:#3b4a63}
/* result */
#page .report-print-area{border-radius:14px;overflow:hidden}#page .report-print-area .card-header{padding:18px 22px 6px}#page .report-print-area .card-header h2{font-size:19px;color:#1b2547}#page .report-print-area .card-header p{color:#66758f;font-size:13px}
#page .report-print-area .screen-summary-table,#page .report-print-area table.plain{border:1px solid #dfe5f4;border-radius:10px;border-collapse:separate;border-spacing:0;background:#f8faff;margin:8px 22px 16px;width:auto;min-width:340px;overflow:hidden}
#page .report-print-area .screen-summary-table th,#page .report-print-area .screen-summary-table td{padding:7px 16px;border-bottom:1px solid #e6ebf7;font-size:13px}#page .report-print-area .screen-summary-table tr:last-child th,#page .report-print-area .screen-summary-table tr:last-child td{border-bottom:0}#page .report-print-area .screen-summary-table th{font-weight:600;color:#4a5878;text-align:left;width:60%}#page .report-print-area .screen-summary-table td{text-align:right;font-weight:800;color:#1b2547;font-variant-numeric:tabular-nums}
#page .report-print-area .table-wrap{max-height:68vh;overflow:auto;border-top:1px solid #e6ebf7}
#page .report-print-area .data-table{border-collapse:separate;border-spacing:0;width:100%}#page .report-print-area .data-table thead th{position:sticky;top:0;z-index:2;background:#eef2fb;color:#2a3558;font-size:11.5px;letter-spacing:.05em;text-transform:uppercase;padding:11px 14px;border-bottom:2px solid #cdd6ec;white-space:nowrap}
#page .report-print-area .data-table td{padding:10px 14px;border-bottom:1px solid #edf0f8;font-size:13.2px}#page .report-print-area .data-table tbody tr:nth-child(even) td{background:#fafbfe}#page .report-print-area .data-table tbody tr:hover td{background:#eef3ff}
#page .report-print-area td.num,#page .report-print-area th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
#page .report-print-area .data-table tfoot th,#page .report-print-area .data-table tfoot td{position:sticky;bottom:0;background:#e6ebf8 !important;border-top:2px solid #9fb0e6;font-weight:800;color:#1b2547;padding:12px 14px}
@media(max-width:700px){#page .report-print-area .screen-summary-table,#page .report-print-area table.plain{min-width:0;width:calc(100% - 28px);margin-left:14px;margin-right:14px}.rep-search input{width:100%}.rep-search{width:100%}.rep-card{padding-left:64px}.report-filter .form-actions [data-act="r-print"]{margin-left:0}}

/* ============ table polish: sticky Actions column, no wrapping of short cells ============ */
td.nw{white-space:nowrap}.brk-tag{white-space:normal;max-width:200px;font-size:10.5px !important;line-height:1.35;margin-top:3px}
@media(min-width:901px){
 .sticky-act{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-10px 0 12px -10px rgba(31,42,85,.28)}
 th.sticky-act{background:#eef2fb;z-index:3}
 tr.is-x td.sticky-act{background:#fbf5f5}
 table tbody tr:hover td.sticky-act{background:#f4f7ff}
 .table-wrapper,.table-responsive,.ve-table-wrap{overflow-x:auto}
 td.sticky-act .ve-row-actions,td.sticky-act .table-actions,td.sticky-act .action-buttons{flex-direction:row;display:flex;flex-wrap:nowrap;justify-content:flex-start;gap:4px;white-space:nowrap}
 .sticky-act{width:1%;white-space:nowrap}
}
@media(max-width:700px){
 #page.rep-home .sl-tabs{flex-wrap:nowrap;overflow-x:auto}#page.rep-home .sl-tab{flex:0 0 auto}
 #page.rep-screen .page-header,#page.rep-home .page-header{display:block}#page.rep-screen .page-header>div,#page.rep-home .page-header>div{text-align:left}.rep-search{margin-top:10px}
}

/* dense list tables: every column fits on a normal screen */
#page td[data-label="Status"] .dx-badge{white-space:normal;display:inline-block;max-width:96px;line-height:1.25;text-align:center}
@media(min-width:901px){
 #page .content-box table th,#page .content-card table th{padding:9px 6px;font-size:11px}
 #page .content-box table td,#page .content-card table td{padding:8px 6px;font-size:12.4px}
 #page .content-box td .btn,#page .content-card td .btn{min-height:28px;padding:0 8px;font-size:11.5px;white-space:nowrap}
 #page .content-box td .dx-badge,#page .content-card td .dx-badge{font-size:11px;padding:2px 8px}
}

@media(min-width:901px) and (max-width:1420px){
 #page .content-box table th,#page .content-card table th{padding:8px 4px;font-size:10.5px;letter-spacing:0}
 #page .content-box table td,#page .content-card table td{padding:7px 4px;font-size:12px}
 #page .content-box td .btn,#page .content-card td .btn{min-height:26px;padding:0 6px;font-size:11px}
 td.sticky-act .ve-row-actions,td.sticky-act .table-actions,td.sticky-act .action-buttons{gap:3px}
 #page .content-box td .dx-badge,#page .content-card td .dx-badge{font-size:10.5px;padding:2px 6px}
}

/* voucher lists use their own table class */
@media(min-width:901px){
 #page table.ve-table th{padding:9px 6px;font-size:11px;white-space:normal;letter-spacing:.02em}
 #page table.ve-table td{padding:8px 6px;font-size:12.4px}
 #page table.ve-table .ve-note{min-width:110px}
 #page table.ve-table td .btn{min-height:28px;padding:0 8px;font-size:11.5px;white-space:nowrap}
 #page table.ve-table td .dx-badge{font-size:11px;padding:2px 8px}
 #page table.ve-table{min-width:0}
}
@media(min-width:901px) and (max-width:1420px){
 #page table.ve-table th{padding:8px 4px;font-size:10.5px}
 #page table.ve-table td{padding:7px 4px;font-size:12px}
 #page table.ve-table td .btn{min-height:26px;padding:0 6px;font-size:11px}
}
.sl-modal-box.wide{max-width:1320px}
.it-card{border:1px solid #e5e7eb;border-radius:8px;background:#f9fafb;padding:10px 12px;margin-bottom:10px}
.it-top{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}
.it-no{width:28px;height:28px;border-radius:50%;background:#1f2937;color:#fff;text-align:center;line-height:28px;font-size:12px;font-weight:700;align-self:center;flex-shrink:0}
.it-f{display:flex;flex-direction:column;min-width:0}.it-f label{font-size:11px;color:#6b7280;font-weight:600;margin-bottom:3px}
.it-f select,.it-f input{min-height:38px;padding:7px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:14px;background:#fff;width:100%}
.it-f input:disabled{background:#f3f4f6}.it-product{flex:2 1 190px}.it-contract{flex:2 1 230px}.it-s{flex:0 1 96px}.it-m{flex:1 1 120px}
.it-calc{display:flex;flex-wrap:wrap;gap:16px;margin-top:8px;padding-top:8px;border-top:1px dashed #e5e7eb;font-size:12.5px;color:#4b5563}.it-calc b{color:#111827}.it-stock{margin-left:auto;color:#1e40af}
.it-totals{justify-content:flex-end;margin-top:12px}
@media(max-width:760px){.it-f,.it-product,.it-contract,.it-s,.it-m{flex:1 1 45%}.it-product,.it-contract{flex:1 1 100%}.it-stock{margin-left:0}}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}.toast.bad{background:#b91c1c}
/* ============================================================
   Smart Ledger - Unified theme (one background, one colour set)
   Loaded LAST so every page, pop-up and report looks the same.
   Change the variables below to re-colour the whole software.
   ============================================================ */
:root {
    --sl-bg:        #eef2f9;
    --sl-bg-2:      #f6f8fc;
    --sl-card:      #ffffff;
    --sl-line:      #e2e8f3;
    --sl-line-2:    #edf1f8;
    --sl-text:      #0f1b33;
    --sl-text-2:    #3b4a63;
    --sl-muted:     #66758f;

    --sl-primary:   #2f4bd0;
    --sl-primary-2: #4a66e6;
    --sl-primary-d: #2339a8;
    --sl-tint:      #eaefff;
    --sl-tint-2:    #f4f6ff;

    --sl-success:   #059669;
    --sl-danger:    #dc2626;
    --sl-warning:   #d97706;
    --sl-info:      #0284c7;

    --sl-radius:    12px;
    --sl-shadow:    0 1px 2px rgba(15, 27, 51, .05), 0 6px 18px rgba(15, 27, 51, .05);
}

/* ---------- Page background + text ---------- */
html, body {
    background: linear-gradient(180deg, #e6ecf8 0, var(--sl-bg) 320px, var(--sl-bg-2) 100%) fixed;
    color: var(--sl-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
.main-area, .page-content { background: transparent; }
h1, h2, h3, .dx-head h1, .ve-head h1, .page-header h1, .page-heading h1 { color: var(--sl-text); letter-spacing: -.01em; }
p, .page-header p, .page-heading p, .dx-head p, .ve-head p { color: var(--sl-muted); }
a { color: var(--sl-primary); }

/* ---------- Top header ---------- */
.top-header { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--sl-line); box-shadow: 0 1px 0 rgba(15, 27, 51, .03); backdrop-filter: blur(6px); }
.header-company-name { color: var(--sl-text); }
.menu-toggle { background: var(--sl-primary) !important; }

/* ---------- Sidebar ---------- */
.sidebar { background: #ffffff !important; border-right: 1px solid var(--sl-line); }
.sb-logo { background: linear-gradient(135deg, var(--sl-primary-d), var(--sl-primary-2)); box-shadow: 0 6px 14px rgba(47, 75, 208, .35); }
.sb-brand-name { color: var(--sl-text); }
.sb-label { color: #93a0b8; }
.sb-link { color: var(--sl-text-2); }
.sb-link:hover { background: var(--sl-tint-2); color: var(--sl-primary-d); }
.sb-ico { background: var(--sl-tint-2); }
.sb-main .sb-ico { background: #e3e9ff; } .sb-ops .sb-ico { background: #d9f5ea; } .sb-data .sb-ico { background: #fdf0d4; } .sb-rep .sb-ico { background: #ece6ff; }
.sb-link.active { background: linear-gradient(135deg, var(--sl-primary-d), var(--sl-primary-2)); color: #fff; box-shadow: 0 8px 18px rgba(47, 75, 208, .32); }
.sb-link.active .sb-ico { background: rgba(255, 255, 255, .2); }
.sb-foot { background: var(--sl-tint-2); border-color: var(--sl-line); }
.sb-avatar { background: linear-gradient(135deg, var(--sl-primary-d), var(--sl-primary-2)); }
.sb-user { color: var(--sl-text); }

/* ---------- Cards / boxes ---------- */
.card, .content-card, .content-box, .form-card, .filter-card, .dx-card, .dx-kpi, .ve-card, .rep-card, .dx-chip {
    background: var(--sl-card); border: 1px solid var(--sl-line); border-radius: var(--sl-radius); box-shadow: var(--sl-shadow);
}
.dx-chip { box-shadow: none; }
.card-header, .dx-card-head, .ve-card-head, .sl-modal-head, .ve-modal-head, .content-box-header { border-bottom: 1px solid var(--sl-line-2); background: linear-gradient(180deg, #ffffff, #fbfcff); }
.sl-modal-head, .ve-modal-head { background: #ffffff; }
.dx-kpi { border-top-width: 3px; }
.dx-kpi { border-top-color: var(--sl-primary); }
.dx-kpi.green { border-top-color: var(--sl-success); } .dx-kpi.blue { border-top-color: var(--sl-info); } .dx-kpi.red { border-top-color: var(--sl-danger); } .dx-kpi.amber { border-top-color: var(--sl-warning); }
.rep-card { border-top: 3px solid var(--sl-primary); }
.rep-card:hover { box-shadow: 0 12px 26px rgba(47, 75, 208, .14); }
.rep-card-go { color: var(--sl-primary); }
.dx-section-title { color: var(--sl-muted); }
.dx-kpi-value, .dx-line .amt, .ve-bold { color: var(--sl-text); }
.dx-fill { background: var(--sl-primary); } .dx-fill.green { background: var(--sl-success); } .dx-fill.blue { background: var(--sl-info); } .dx-fill.amber { background: var(--sl-warning); } .dx-fill.red { background: var(--sl-danger); }
.dx-track { background: var(--sl-line-2); }
.dx-bar.sales { background: var(--sl-primary); } .dx-bar.coll { background: var(--sl-success); }
.dx-legend span:first-child i { background: var(--sl-primary) !important; }

/* ---------- Buttons ---------- */
.btn { border-radius: 9px; font-weight: 600; transition: background .15s, box-shadow .15s, border-color .15s; }
.btn-primary { background: linear-gradient(135deg, var(--sl-primary), var(--sl-primary-2)); border-color: var(--sl-primary); color: #fff; box-shadow: 0 3px 8px rgba(47, 75, 208, .25); }
.btn-primary:hover { background: linear-gradient(135deg, var(--sl-primary-d), var(--sl-primary)); border-color: var(--sl-primary-d); }
.btn-secondary { background: #fff; border-color: #d3dbec; color: var(--sl-text-2); }
.btn-secondary:hover { background: var(--sl-tint-2); border-color: var(--sl-primary-2); color: var(--sl-primary-d); }
.btn-light { background: var(--sl-tint-2); border-color: var(--sl-line); color: var(--sl-text-2); }
.btn-light:hover { background: var(--sl-tint); }
.btn-danger { background: var(--sl-danger); border-color: var(--sl-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-success { background: var(--sl-success); border-color: var(--sl-success); }
.dx-quick a, .dx-refresh { background: #fff; border: 1px solid var(--sl-line); border-radius: 10px; color: var(--sl-text-2); box-shadow: var(--sl-shadow); }
.dx-quick a:hover, .dx-refresh:hover { border-color: var(--sl-primary-2); background: var(--sl-tint-2); color: var(--sl-primary-d); }
.dx-pill { border-color: var(--sl-line); color: var(--sl-text-2); background: #fff; }
.dx-pill:hover { border-color: var(--sl-primary-2); }
.dx-pill.active { background: var(--sl-primary); border-color: var(--sl-primary); color: #fff; box-shadow: 0 3px 8px rgba(47, 75, 208, .28); }

/* ---------- Tabs ---------- */
.sl-tabs, .ve-tabs { border-bottom: 2px solid var(--sl-line); }
.sl-tab, .ve-tab { color: var(--sl-muted); }
.sl-tab:hover, .ve-tab:hover { color: var(--sl-primary-d); }
.sl-tab.active, .ve-tab.active { color: var(--sl-primary-d); border-bottom-color: var(--sl-primary); }
.sl-tab-count, .ve-tab-count { background: var(--sl-tint); color: var(--sl-primary-d); }
.sl-tab.active .sl-tab-count, .ve-tab.active .ve-tab-count { background: var(--sl-primary); color: #fff; }

/* ---------- Tables ---------- */
.data-table th, .ve-table th, .dx-table th { background: #f3f6fd; color: #4a5a78; border-bottom: 1px solid var(--sl-line); }
.data-table td, .ve-table td, .dx-table td { border-bottom: 1px solid var(--sl-line-2); color: var(--sl-text-2); }
.data-table tbody tr:hover, .ve-table tbody tr:hover, .dx-table tbody tr:hover { background: #f8faff; }
.report-print-area .data-table tfoot th, .ledger-totals-screen th { background: #eef2fc; border-top: 2px solid #b9c5e6; color: var(--sl-text); }
tr.is-x td { background: #f8f9fc; }
.ve-page-now { background: var(--sl-primary); }
.ve-pager a, .ve-link, .dx-link { color: var(--sl-primary); }
.ve-badge { background: var(--sl-tint); color: var(--sl-primary-d); }

/* ---------- Forms ---------- */
input, select, textarea { border-color: #d3dbec; background: #fff; color: var(--sl-text); }
input:focus, select:focus, textarea:focus, .ve-cell input:focus, .it-f input:focus, .it-f select:focus {
    outline: none; border-color: var(--sl-primary-2); box-shadow: 0 0 0 3px rgba(74, 102, 230, .18);
}
input[readonly], textarea[readonly], select[disabled] { background: #f3f6fc; color: #51607c; }
label { color: var(--sl-text-2); }
.ve-lines-head h3 { color: var(--sl-text); }
.ve-line-head { background: linear-gradient(135deg, var(--sl-primary-d), var(--sl-primary)); }
.ve-no, .it-no { background: var(--sl-primary); }
.ve-line, .it-card { background: var(--sl-tint-2); border-color: var(--sl-line); }
.ve-totals > div { background: var(--sl-tint); }
.ve-totals strong { color: var(--sl-primary-d); }
.demo-note { background: var(--sl-tint); border-color: #c9d4fb; color: var(--sl-primary-d); }

/* ---------- Pop-ups ---------- */
.sl-modal, .ve-modal { background: rgba(15, 27, 51, .55); }
.sl-modal-box, .ve-modal-box { border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 27, 51, .35); }

/* ---------- Status / badges ---------- */
.dx-b-sale { background: #e3e9ff; color: var(--sl-primary-d); }
.dx-b-in { background: #d9f5ea; color: #046c4e; }
.dx-b-out { background: #fde4e4; color: #b42318; }
.dx-b-jv { background: #ece6ff; color: #5b3fc4; }
.status-label, .status-active { border-radius: 999px; }
.status-active { background: #d9f5ea; color: #046c4e; } .status-pending { background: #eaefff; color: var(--sl-primary-d); } .status-warning { background: #fdf0d4; color: #92400e; }
.leaf-available { background: var(--sl-tint); border-color: #c9d4fb; color: var(--sl-primary-d); }

/* ---------- Alerts keep their meaning ---------- */
.alert, .dx-alert { border-radius: 10px; }

/* ---------- Footer / misc ---------- */
.app-footer { color: var(--sl-muted); }

/* ============================================================
   Pop-ups: centred on the screen, wide instead of tall,
   and sized to the screen (scrolls inside when really needed)
   ============================================================ */
.sl-modal, .ve-modal {
    display: none; align-items: center; justify-content: center;
    padding: 16px; overflow: hidden;
}
.sl-modal.is-open, .ve-modal.is-open { display: flex; }

.sl-modal-box, .ve-modal-box {
    width: min(1280px, 96vw); max-width: 1280px; margin: 0;
    max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column; overflow: hidden;
}
.sl-modal-head, .ve-modal-head { position: static; flex: 0 0 auto; }
.sl-modal-body, .ve-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 24px; }

/* Use the width: fields flow into as many columns as fit, so the form is short */
.sl-modal-body .form-grid, .sl-modal-body .form-grid-2, .ve-modal-body .ve-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px;
}
.sl-modal-body .form-group-full, .ve-modal-body .ve-full { grid-column: 1 / -1; }
.sl-modal-body .form-group, .ve-modal-body .ve-field { margin-bottom: 0; }
.sl-modal-body textarea, .ve-modal-body textarea { min-height: 56px; }
.sl-modal-body .form-actions, .ve-modal-body .form-actions { margin-top: 14px; padding-top: 12px; }
.ve-lines-head { margin-top: 14px; padding-top: 12px; }

/* Phones: use the whole screen */
@media (max-width: 760px) {
    .sl-modal, .ve-modal { padding: 0; }
    .sl-modal-box, .ve-modal-box { width: 100vw; max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
}

/* Forms shown inside the Dashboard pop-up (embedded) keep their own layout */
.is-embed .sl-modal, .is-embed .ve-modal { display: block; padding: 0; overflow: visible; }
.is-embed .sl-modal-box, .is-embed .ve-modal-box { width: auto; max-width: none; max-height: none; overflow: visible; display: block; }
.is-embed .sl-modal-body, .is-embed .ve-modal-body { overflow: visible; }

/* Amount-in-words and attachment sit side by side on wide screens (shorter pop-up) */
@media (min-width: 900px) {
    .ve-modal-body .ve-grid-after { grid-template-columns: 2fr 1fr; align-items: start; }
    .ve-modal-body .ve-grid-after .ve-full { grid-column: auto; }
    .ve-modal-body .ve-grid-after textarea { min-height: 44px; }
}

/* check boxes keep their natural size */
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; flex: 0 0 auto; }

/* ================= v2 additions: account pick box, pager, forms in pages ================= */
.acc-pick-wrap{position:relative}.acc-pick-list{position:absolute;left:0;right:0;top:100%;z-index:50;max-height:260px;overflow:auto;background:#fff;border:1px solid #cdd6ec;border-radius:8px;box-shadow:0 10px 24px rgba(31,42,85,.18)}
.acc-pick-item{padding:8px 12px;font-size:13px;cursor:pointer;border-bottom:1px solid #f0f3fa}.acc-pick-item:hover,.acc-pick-item.is-on{background:#eef2fd}.acc-pick-none{padding:10px 12px;font-size:13px;color:#66758f}
.sl-pager{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 18px;font-size:13px;color:#66758f;flex-wrap:wrap}.sl-pager-btn{display:flex;gap:8px;align-items:center}.sl-pager-now{font-weight:700;color:#1b2547}
.btn.is-sending{opacity:.6;cursor:wait}.page-content form.stack{display:block}.sl-note{font-size:12.5px;color:#66758f;margin-top:4px}
.sl-kv{display:grid;grid-template-columns:170px 1fr;gap:6px 14px;font-size:14px;padding:6px 0}.sl-kv dt{color:#66758f}.sl-kv dd{margin:0;font-weight:600}

/* ================= v2: invoice rows ================= */
.inv-row{border:1px solid #dfe5f4;border-radius:12px;padding:12px 14px;margin-bottom:12px;background:#fbfcff}.inv-row-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.inv-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 12px}.inv-grid .f-product{grid-column:span 2}.inv-grid label{font-size:11.5px;font-weight:700;color:#3b4a63;display:block;margin-bottom:3px}
.inv-calc{margin:8px 0;font-size:13px;color:#3b4a63;background:#eef2fd;border-radius:8px;padding:6px 10px;display:inline-block}.inv-totals{margin:12px 0;font-size:15px;padding:10px 14px;background:#eef2fd;border-radius:10px;display:inline-block}
.brk-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:10px;margin-top:6px}.brk-box{border:1px dashed #cdd6ec;border-radius:10px;padding:8px 10px;background:#fff}.brk-title{font-size:12.5px;font-weight:700;display:flex;gap:6px;align-items:center}
.brk-fields{display:grid;grid-template-columns:1fr 130px 110px;gap:8px;margin-top:6px}.brk-box.is-locked .brk-fields{pointer-events:none;opacity:.75}.brk-line td{background:#fafbff;color:#4a5878}

/* ================= v2: weighment scale panel ================= */
.wm-panel{margin-top:16px;padding:14px;border:1px solid #dfe5f4;border-radius:12px;background:#0f172a;color:#fff;display:flex;gap:16px;align-items:center;flex-wrap:wrap}.wm-live{font-size:44px;font-weight:800;font-family:Consolas,monospace;color:#ff4d4d;background:#000;border-radius:8px;padding:6px 18px;min-width:220px;text-align:right}
.wm-stab{font-size:12px;font-weight:800;padding:3px 10px;border-radius:99px}.wm-stab.ok{background:#16a34a}.wm-stab.mv{background:#d97706}.wm-stab.off{background:#6b7280}.wm-panel .sl-note{color:#cbd5e1}.wm-btns{display:flex;gap:10px}

/* ================= v2: pop-up windows ================= */
body.sl-modal-lock{overflow:hidden}.sl-modal .sl-modal-body{max-height:calc(100vh - 120px);overflow:auto}.sl-mc .content-card{box-shadow:none;border:0;margin:0}.sl-mc .card-body{padding:6px 4px}

.report-filter .form-group.span2{grid-column:span 2}@media(max-width:700px){.report-filter .form-group.span2{grid-column:span 1}}

/* print sheet inside the preview window */
.rpv-sheet .table-responsive{overflow:visible}.rpv-sheet .screen-summary-table{margin:4px 0;min-width:0}.rpv-sheet td.nw{white-space:nowrap}
.rpv-sheet tfoot th,.rpv-sheet tfoot td{font-size:10.5px !important;white-space:nowrap}
.rpv-sheet tfoot th,.rpv-sheet tfoot td{padding:3px 6px !important}

/* ============ report result pages fit the window: no browser-window scroll, only the table scrolls (large screens) ============ */
@media (min-width:900px) and (min-height:700px){
  body.rep-fit-page{overflow:hidden}
  body.rep-fit-page .app-layout{height:100vh}
  body.rep-fit-page .main-area{height:100vh;min-height:0;overflow:hidden}
  body.rep-fit-page .top-header{padding-top:7px;padding-bottom:7px;min-height:0;height:auto}
  body.rep-fit-page .page-content{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:8px 20px 10px}
  body.rep-fit-page .page-header{margin:0 0 6px;flex:0 0 auto}
  body.rep-fit-page .page-header > div{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
  body.rep-fit-page .page-header h1{font-size:21px;margin:0}
  body.rep-fit-page .page-header p{margin:0;font-size:12.5px}
  /* filter card: title + quick dates on one row, fields and buttons on the next row */
  body.rep-fit-page .report-filter{flex:0 0 auto;margin:0 0 8px;display:flex;flex-wrap:wrap;align-items:center}
  body.rep-fit-page .report-filter .card-header{order:1;padding:6px 18px;border:0;gap:14px;width:auto}
  body.rep-fit-page .report-filter .card-header h2{font-size:14px}
  body.rep-fit-page .report-filter .rep-presets{order:2;flex:1;padding:6px 18px 6px 0}
  body.rep-fit-page .report-filter .form-grid{order:3;flex:0 0 100%;display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 14px;padding:0 18px 10px}
  body.rep-fit-page .report-filter .form-group{margin:0;flex:1 1 170px;max-width:300px}
  body.rep-fit-page .report-filter .form-group:first-child{flex-basis:260px;max-width:340px}
  body.rep-fit-page .report-filter label{font-size:12px;margin-bottom:2px}
  body.rep-fit-page .report-filter input,body.rep-fit-page .report-filter select{height:34px;padding:3px 9px;font-size:13px}
  body.rep-fit-page .report-filter input[type=checkbox]{height:auto}
  body.rep-fit-page .report-filter small.sl-note{display:none}
  body.rep-fit-page .report-filter .form-actions{flex:1 1 auto;margin:0;padding:0;border:0;display:flex;gap:8px;justify-content:flex-end}
  body.rep-fit-page .report-filter .form-actions .btn{padding:6px 14px;min-height:34px}
  body.rep-fit-page .report-filter .form-actions [data-report-print]{margin-left:0 !important}
  /* result card: details on the left, the summary box on the right, the table below fills the rest */
  body.rep-fit-page #page > .report-print-area{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);margin:0;align-content:start}
  body.rep-fit-page .report-print-area .print-company-header{display:none}
  body.rep-fit-page .report-print-area .card-header{grid-column:1 / -1;grid-row:1;padding:8px 18px 4px}
  body.rep-fit-page .report-print-area:has(> .screen-summary-table) > .card-header{grid-column:1}
  body.rep-fit-page .report-print-area .card-header h2{font-size:17px;margin:0 0 2px}
  body.rep-fit-page .report-print-area .card-header p{display:inline-block;margin:0 22px 0 0;font-size:12.5px;line-height:1.45}
  body.rep-fit-page .report-print-area .screen-summary-table{grid-column:2;grid-row:1;align-self:start;margin:8px 18px 4px 0;min-width:250px;width:auto}
  body.rep-fit-page .report-print-area .screen-summary-table th,body.rep-fit-page .report-print-area .screen-summary-table td{padding:3px 12px;font-size:12.5px}
  body.rep-fit-page .report-print-area > .table-wrap{grid-column:1 / -1;grid-row:2;min-height:120px;max-height:none;margin-bottom:8px}
  body.rep-fit-page .report-print-area .data-table thead th{padding:8px 14px}
  body.rep-fit-page .report-print-area .data-table td{padding:7px 14px}
  body.rep-fit-page .report-print-area .data-table tfoot th{padding:8px 14px}
}

/* ============ company logo, company details form ============ */
.co-logo-img{object-fit:contain;border-radius:10px;background:#fff;flex-shrink:0}
.print-company-top{display:flex;align-items:center;justify-content:center;gap:14px}.print-company-top .co-logo-img{border-radius:6px}
.pd-co .co-logo-img{border-radius:6px;margin-right:2px}
h3.sl-sub{font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:#66758f;margin:16px 0 8px}h3.sl-sub:first-of-type{margin-top:0}

/* ============ the left menu fits the screen height: no scroll bar (large screens) ============ */
@media (min-width:901px){
  .sidebar{--si:clamp(27px, calc((100vh - 275px) / 18), 46px)}
  .sidebar .sb-brand{padding:clamp(8px,1.8vh,18px) 18px clamp(2px,.8vh,10px)}
  .sidebar .sidebar-nav{overflow:hidden;padding:0 12px 4px}
  .sidebar .sb-label{margin:clamp(5px,1.4vh,16px) 10px clamp(2px,.4vh,5px)}
  .sidebar .sb-link{height:var(--si);padding:0 10px;margin-bottom:1px;gap:11px;font-size:clamp(12px,calc(var(--si) * .4),14px)}
  .sidebar .sb-ico{width:calc(var(--si) - 8px);height:calc(var(--si) - 8px);font-size:clamp(11px,calc(var(--si) * .42),16px);border-radius:9px}
  .sidebar .sb-foot{padding-top:clamp(4px,1vh,10px);padding-bottom:clamp(4px,1vh,10px)}
}
@media (min-width:901px) and (max-height:670px){ .sidebar .sidebar-nav{overflow-y:auto} }

/* ============ the whole software: NO browser-window scroll (large screens) ============
   The menu and the top bar stay in place. A list (vouchers, invoices, contracts, transactions, accounts ...) fills the rest of the
   window height and only its TABLE scrolls (header row stays visible). A long form / view / dashboard scrolls inside the content area. */
@media (min-width:900px) and (min-height:560px){
  body.fit-page{overflow:hidden}
  body.fit-page .app-layout{height:100vh}
  body.fit-page .main-area{height:100vh;min-height:0;overflow:hidden}
  body.fit-page .page-content{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;padding:12px 22px 14px}
  body.fit-page .page-content > *{flex:0 0 auto}
  body.fit-page .page-header{margin:0 0 8px}
  body.fit-page .page-header h1{font-size:22px;margin:0}
  body.fit-page #page > .content-card:has(> .table-responsive){flex:1 1 auto;min-height:230px;display:flex;flex-direction:column;overflow:hidden;margin-bottom:0}
  body.fit-page #page > .content-card:has(> .table-responsive) > .table-responsive{flex:1 1 auto;min-height:0;overflow:auto}
  body.fit-page #page > .content-card:has(> .table-responsive) > .card-header,
  body.fit-page #page > .content-card:has(> .table-responsive) > form,
  body.fit-page #page > .content-card:has(> .table-responsive) > .sl-pager{flex:0 0 auto}
  body.fit-page #page > .content-card:has(> .table-responsive) .data-table thead th{position:sticky;top:0;z-index:2;background:#eef2fb}
}

/* ============ dashboard: sections that can be hidden and shown (buttons use the theme's own .btn styles) ============ */
.dx-sec{margin-bottom:6px}
.dx-sec-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 0 8px;padding:0}
.dx-sec-title{font-size:12.5px;letter-spacing:.07em;color:#66758f;text-transform:uppercase;font-weight:700}
.dx-sec.is-hidden .dx-sec-body{display:none}
.dx-sec.is-hidden{margin-bottom:2px}
