/* =============================================================
   PAIDIN USER — Consolidated Stylesheet
   =============================================================
   Sections:
    1. Design tokens
    2. Base / reset
    3. Layout
    4. Page structure
    5. Grid
    6. Cards
    7. Buttons
    8. Forms
    9. Tables
   10. Modals
   11. Alerts
   12. Action cards
   13. Dashboard
   14. Settings
   15. Onboarding
   16. Auth pages (login/register/forgot/reset)
   17. Expenses Upload
   18. Invoice Editor
   19. Compact density
   20. Expense layout
   21. Utility classes
   22. Responsive overrides
   ============================================================= */


/* =============================================================
   1. DESIGN TOKENS
   ============================================================= */

:root {
    --pi-green: #77C043;
    --pi-green-dark: #5ea335;
    --pi-green-hover: #65a838;
    --pi-green-light: #e8f5de;
    --pi-green-surface: #f4faf0;
    --pi-green-ring: rgba(119, 192, 67, 0.20);

    --pi-brand-gray: #4F4E4F;
    --pi-amber: #f59e0b;
    --pi-amber-light: #fef3c7;

    --pi-text: #1e293b;
    --pi-text-muted: #6b7280;
    --pi-text-subtle: #4b5563;
    --pi-text-faint: #9ca3af;

    --pi-bg: #f7f9f5;
    --pi-bg-white: #ffffff;
    --pi-bg-hover: #f9fafb;

    --pi-border: #d1d5db;
    --pi-border-light: #e5e7eb;
    --pi-border-subtle: rgba(0, 0, 0, 0.08);

    --pi-radius-sm: 6px;
    --pi-radius-md: 10px;
    --pi-radius-lg: 12px;
    --pi-radius-xl: 18px;

    --pi-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --pi-shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --pi-shadow-lg: 0 12px 32px rgba(0,0,0,.12);
    --pi-shadow-card: 0 6px 16px rgba(0, 0, 0, 0.08);
    --pi-shadow-login: 0 20px 50px rgba(15, 23, 42, 0.25);

    --pi-error-border: #ff9b9b;
    --pi-error-bg: #fff4f4;
}


/* =============================================================
   2. BASE / RESET
   ============================================================= */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--pi-bg);
    color: var(--pi-text);
    margin-bottom: 60px;
}

a {
    color: var(--pi-green);
}

a:hover {
    color: var(--pi-green-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


/* =============================================================
   3. LAYOUT
   ============================================================= */

.pi-admin {
    background-color: var(--pi-bg);
}

.pi-topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--pi-border-light);
    box-shadow: var(--pi-shadow-sm);
}

.pi-topnav-inner {
    display: flex;
    align-items: center;
    padding: 12px 32px;
}

/* Nav toggle (hamburger) — hidden on lg+ by Bootstrap navbar-expand-lg */
.pi-nav-toggle.navbar-toggler {
    border: none;
    padding: 6px;
    box-shadow: none;
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .pi-nav-toggle.navbar-toggler {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
}

.pi-nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--pi-brand-gray);
    border-radius: 2px;
    transition: background .15s ease;
}

.pi-nav-toggle:hover .pi-nav-toggle-bar {
    background: var(--pi-green);
}

/* Nav links — display managed by Bootstrap collapse; flex props apply when visible */
.pi-nav-links {
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.pi-nav-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pi-brand-gray);
    text-decoration: none;
    border-radius: var(--pi-radius-sm);
    transition: color .12s ease, background .12s ease;
}

.pi-nav-link:hover,
.pi-nav-link:focus {
    color: var(--pi-green);
    background: var(--pi-green-light);
    text-decoration: none;
}

.pi-nav-link-logout {
    color: #b91c1c;
}

.pi-nav-link-logout:hover,
.pi-nav-link-logout:focus {
    color: #991b1b;
    background: #fef2f2;
}

@media (max-width: 991.98px) {
    .pi-nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }

    .pi-nav-link {
        padding: 10px 12px;
    }
}

.pi-header-logo-link {
    display: inline-flex;
    align-items: center;
}

.pi-header-logo {
    height: 36px;
}

.pi-topnav-spacer {
    flex: 1 1 auto;
}

/* Footer */
.pi-footer {
    margin-top: 2rem;
}

.pi-footer-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--pi-green) 0%, var(--pi-green-light) 100%);
}

.pi-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}


/* =============================================================
   4. PAGE STRUCTURE
   ============================================================= */

.pi-page {
    padding-top: 1.25rem;
}

.pi-page-header {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}

.pi-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: inline-block;
    border-bottom: 3px solid var(--pi-green);
    padding-bottom: 4px;
}

.pi-page-subtitle {
    margin: 0;
    color: var(--pi-text-muted);
}


/* =============================================================
   5. GRID
   ============================================================= */

.pi-grid {
    display: grid;
    gap: 1rem;
}

.pi-grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.pi-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

@media (min-width: 992px) {
    .pi-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .pi-grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .pi-grid-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pi-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pi-grid-6 {
        grid-template-columns: 1fr;
    }

    .pi-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Grid spans (Invoice editor) */
.pi-span-2 {
    grid-column: span 2;
}

.pi-span-3 {
    grid-column: span 3;
}

.pi-span-4 {
    grid-column: span 4;
}

@media (max-width: 900px) {
    .pi-span-2,
    .pi-span-3,
    .pi-span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .pi-span-2,
    .pi-span-3,
    .pi-span-4 {
        grid-column: span 1;
    }
}

/* Prevent inputs from blowing out grid */
.pi-field {
    min-width: 0;
}


/* =============================================================
   6. CARDS
   ============================================================= */

.pi-card {
    border: 1px solid rgba(0,0,0,.04);
    border-radius: var(--pi-radius-lg);
    background: var(--pi-bg-white);
    padding: 1rem;
    box-shadow: var(--pi-shadow-sm);
    transition: box-shadow .15s ease;
}

.pi-card:hover {
    box-shadow: var(--pi-shadow-md);
}

.pi-card-title {
    font-weight: 700;
    margin: 0 0 .25rem 0;
}

.pi-card-text {
    margin: 0;
    color: var(--pi-text-muted);
}


/* =============================================================
   7. BUTTONS
   ============================================================= */

.pi-btn {
    border: 1px solid var(--pi-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #f3f4f6;
    color: var(--pi-text);
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease;
}

.pi-btn:hover,
.pi-btn:focus {
    background: var(--pi-border-light);
    border-color: var(--pi-border);
    color: var(--pi-text);
}

.pi-btn-ok,
.pi-btn-cancel {
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease, box-shadow .12s ease;
}

.pi-btn-ok {
    background: linear-gradient(135deg, #77C043 0%, #5ea335 100%);
    color: var(--pi-bg-white);
    box-shadow: 0 2px 8px rgba(119,192,67,.25);
}

.pi-btn-ok:hover,
.pi-btn-ok:focus {
    background: linear-gradient(135deg, #84cc50 0%, #6ab33e 100%);
    color: var(--pi-bg-white);
    box-shadow: 0 4px 14px rgba(119,192,67,.35);
}

.pi-btn-primary {
    border: 1px solid var(--pi-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--pi-bg-white);
    color: var(--pi-text);
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease;
}

.pi-btn-primary:hover,
.pi-btn-primary:focus {
    background: var(--pi-bg-hover);
    border-color: var(--pi-green);
    color: var(--pi-text);
}

.pi-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pi-btn-cancel {
    border: 1px solid var(--pi-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--pi-bg-white);
    color: var(--pi-text);
    transition: background .12s ease, border-color .12s ease;
}

.pi-btn-cancel:hover,
.pi-btn-cancel:focus {
    background-color: var(--pi-bg-hover);
    border-color: var(--pi-border);
    color: var(--pi-text);
}

.pi-btn-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pi-btn-block {
    width: 100%;
    display: block;
}

.pi-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}


/* =============================================================
   8. FORMS
   ============================================================= */

.pi-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pi-border);
    border-radius: 8px;
    background: var(--pi-bg-white);
    font-size: 14px;
}

.pi-input:focus {
    outline: none;
    border-color: var(--pi-green);
    box-shadow: 0 0 0 3px var(--pi-green-ring), 0 0 0 1px var(--pi-green);
}

.pi-input-error {
    border: 2px solid var(--pi-error-border) !important;
    background-color: var(--pi-error-bg) !important;
    transition: border-color .15s ease, background-color .15s ease;
}

.pi-error-message {
    color: #ff9b9b;
    font-size: 14px;
    display: none;
    margin-top: 5px;
}

.pi-save-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.pi-save-enabled {
    opacity: 1;
    pointer-events: auto;
}

.pi-help-text {
    font-size: 0.85rem;
    color: var(--pi-text-muted);
}

.pi-upload-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pi-upload-file {
    flex: 1 1 auto;
    min-width: 0;
}

.pi-upload-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .pi-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pi-upload-btn {
        width: 100%;
    }
}


/* =============================================================
   9. TABLES
   ============================================================= */

.pi-table-card {
    padding: 0;
}

.pi-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.pi-table thead th {
    padding: 10px 12px;
    background: var(--pi-bg-hover);
    border-bottom: 1px solid var(--pi-border-subtle);
    font-weight: 600;
    white-space: nowrap;
    text-align: left;
}

.pi-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: top;
}

.pi-table tbody tr:nth-child(even) {
    background: rgba(119,192,67,.03);
}

.pi-table tbody tr:hover {
    background: var(--pi-green-light);
}

.pi-table tfoot th {
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--pi-bg-white);
    font-weight: 600;
}


/* =============================================================
   10. MODALS
   ============================================================= */

.pi-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    padding: 24px;
    overflow: auto;
}

.pi-modal-inner {
    max-width: 900px;
    margin: 0 auto;
    background: var(--pi-bg-white);
    border-radius: var(--pi-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.pi-modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid #e6e6e6;
}

.pi-modal-body {
    padding: 16px 18px;
    max-height: 70vh;
    overflow: auto;
}

.pi-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid #e6e6e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* =============================================================
   11. ALERTS
   ============================================================= */

.pi-alert {
    border-radius: var(--pi-radius-md);
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--pi-bg-hover);
}

.pi-alert-error {
    background: #fff5f5;
    border-color: #fecaca;
    color: #991b1b;
}


/* =============================================================
   12. ACTION CARDS
   ============================================================= */

.pi-action {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, .04);
    border-left: 3px solid var(--pi-green);
    border-radius: 14px;
    background: var(--pi-bg-white);
    padding: 1rem;
    box-shadow: var(--pi-shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    min-height: 92px;
}

.pi-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--pi-shadow-md);
    border-left-color: var(--pi-green-dark);
    color: inherit;
}

.pi-action-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pi-green-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pi-action-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--pi-green-dark);
}

.pi-action-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 .25rem 0;
}

.pi-action-desc {
    margin: 0;
    color: var(--pi-text-muted);
}


/* =============================================================
   13. DASHBOARD
   ============================================================= */

/* Top row grid */
.pi-dash-top-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pi-dash-top-row > div {
    min-width: 0;
}

@media (min-width: 992px) {
    .pi-dash-top-row {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
        align-items: flex-start;
    }
}

/* Main card + admin card base */
.pi-dash-main-card,
.pi-dash-admin-card {
    border-radius: 1rem;
    border: 1px solid var(--pi-border);
    background: linear-gradient(135deg, #f9fafb, #edf7e7);
    padding: 16px 20px;
    transition: box-shadow 0.15s ease, transform 0.08s ease;
    min-height: 88px;
}

.pi-dash-main-card:hover,
.pi-dash-admin-card:hover {
    box-shadow: 0 0.7rem 1.3rem rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.pi-dash-main-title-large {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

.pi-dash-main-values {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--pi-text);
    display: flex;
    align-items: center;
}

.pi-dash-main-card {
    display: flex;
    align-items: center;
}

.pi-dash-main-card > .pi-flex-between {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

/* Admin card (Genvagar) */
.pi-dash-admin-card {
    display: block;
}

.pi-dash-admin-toggle {
    width: 100%;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.pi-dash-admin-toggle:hover,
.pi-dash-admin-toggle:focus {
    background: transparent;
    outline: none;
}

.pi-dash-admin-toggle-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

.pi-dash-admin-toggle-sub {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.15rem;
}

.pi-dash-admin-chevron {
    width: 14px;
    height: 14px;
    border-right: 2px solid var(--pi-text);
    border-bottom: 2px solid var(--pi-text);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.pi-dash-admin-toggle[aria-expanded="true"] .pi-dash-admin-chevron {
    transform: rotate(-135deg);
}

.pi-dash-admin-body {
    padding: 8px 0 4px 0;
}

.pi-dash-admin-body-intro {
    font-size: 0.85rem;
    color: var(--pi-text-muted);
    margin-bottom: 8px;
}

.pi-dash-admin-links a {
    display: block;
    margin-bottom: 4px;
}

/* Sidenav / systemstatus */
.pi-dash-sidenav-box {
    background: #f5faf3;
    border-radius: 0.8rem;
    border: 1px solid #d9e7d1;
    padding: 0.85rem;
}

.pi-sidenav-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6c757d;
    margin-bottom: 0.35rem;
    padding: 0 0.35rem;
}

/* Status cards */
.pi-dash-status-card {
    border-radius: 0.9rem;
    border: 1px solid var(--pi-border-light);
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pi-dash-status-ok {
    background: linear-gradient(135deg, #f1fbf3, #e3f6e4);
    border-color: #c7e7c8;
}

.pi-dash-status-warn {
    background: linear-gradient(135deg, #fff9ec, #ffeeda);
    border-color: #ffe0b5;
}

.pi-dash-status-error {
    background: linear-gradient(135deg, #fff5f5, #ffe4e4);
    border-color: #f5b5b5;
}

.pi-dash-status-muted {
    background: var(--pi-bg-hover);
    border-style: dashed;
}

.pi-dash-status-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pi-text-muted);
    margin-bottom: 0.25rem;
}

/* KPI cards */
.pi-dash-kpi-card {
    border-radius: 0.9rem;
    height: 100%;
    transition: box-shadow 0.15s ease, transform 0.08s ease;
    border: 1px solid var(--pi-border-light);
    border-top: 3px solid var(--pi-green-light);
}

.pi-dash-kpi-card:hover {
    box-shadow: 0 0.6rem 1.2rem rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.pi-dash-kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.pi-dash-kpi-sub {
    font-size: 0.9rem;
    color: var(--pi-text-muted);
}

.pi-dash-card-link {
    text-decoration: none;
    color: inherit;
}

.pi-dash-kpi-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pi-dash-kpi-row > * {
    min-width: 0;
}

@media (min-width: 992px) {
    .pi-dash-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Dashboard table */
.pi-dash-table {
    font-size: 0.9rem;
}

.pi-dash-table thead th {
    white-space: nowrap;
    font-weight: 600;
}

.pi-dash-table tbody tr:hover {
    background-color: var(--pi-bg-hover);
}

/* Global search */
.pi-dash-search-card {
    border-radius: 1rem;
    border: 1px solid var(--pi-border);
    background: var(--pi-bg-white);
}

.pi-dash-search-input {
    border-radius: 0.6rem;
}

.pi-dash-search-help {
    font-size: 0.85rem;
    color: var(--pi-text-muted);
}

.pi-dash-search-results-card {
    border-radius: 0.9rem;
    border: 1px solid var(--pi-border-light);
    background: var(--pi-bg-white);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}

.pi-dash-search-list {
    max-height: 260px;
    overflow-y: auto;
}

.pi-dash-search-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pi-dash-search-grid > * {
    min-width: 0;
}

@media (min-width: 992px) {
    .pi-dash-search-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Bottom row */
.pi-dash-list {
    font-size: 0.9rem;
}

.pi-dash-bottom-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pi-dash-bottom-row > * {
    min-width: 0;
}

@media (min-width: 992px) {
    .pi-dash-bottom-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: flex-start;
    }
}

.pi-dash-right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pi-dash-right-column > * {
    min-width: 0;
}

.pi-dash-bottom-row .pi-card {
    max-width: 100%;
    overflow-x: auto;
}

.pi-dash-bottom-row .pi-card .pi-table {
    width: 100%;
    table-layout: fixed;
}

.pi-dash-bottom-row .pi-card .pi-table th,
.pi-dash-bottom-row .pi-card .pi-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Logout link under Genvagar */
.pi-dash-admin-logout-form {
    margin-top: 8px;
}

.pi-dash-admin-logout-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #b91c1c;
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
}

.pi-dash-admin-logout-link:hover,
.pi-dash-admin-logout-link:focus {
    text-decoration: none;
    outline: none;
}

/* Mini status cards */
.pi-dash-status-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-dash-status-mini-form {
    margin: 0;
}

.pi-dash-status-mini-card {
    width: 100%;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid var(--pi-border-light);
    background-color: var(--pi-bg-hover);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: default;
}

.pi-dash-status-mini-form .pi-dash-status-mini-card {
    cursor: pointer;
}

.pi-dash-status-mini-card:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.pi-dash-status-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
}

.pi-dash-status-mini-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pi-dash-status-mini-sub {
    margin-top: 2px;
    font-size: 12px;
}

.pi-dash-status-mini-meta {
    margin-top: 2px;
    font-size: 11px;
    color: var(--pi-text-muted);
}

.pi-dash-status-mini-pill {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.pi-dash-status-mini-ok {
    background-color: #ecfdf3;
    border-color: #bbf7d0;
}

.pi-dash-status-mini-ok .pi-dash-status-mini-pill {
    background-color: #22c55e;
    color: var(--pi-bg-white);
}

.pi-dash-status-mini-error {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.pi-dash-status-mini-error .pi-dash-status-mini-pill {
    background-color: #dc2626;
    color: var(--pi-bg-white);
}

.pi-dash-status-mini-muted {
    background-color: var(--pi-bg-hover);
    border-color: var(--pi-border-light);
}

.pi-dash-status-mini-pill-muted {
    background-color: var(--pi-border-light);
    color: #4b5563;
}

/* Mini KPI grid */
.pi-dash-mini-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1100px) {
    .pi-dash-mini-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pi-dash-mini-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.pi-dash-mini-kpi-grid a {
    text-decoration: none;
    color: inherit;
}

.pi-dash-mini-kpi-card {
    padding: 14px;
    border-radius: var(--pi-radius-lg);
}

.pi-dash-mini-kpi-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.pi-dash-mini-kpi-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.pi-dash-mini-kpi-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--pi-text-muted);
}

.pi-dash-sidenav-divider {
    height: 1px;
    background: var(--pi-border-light);
    margin: 12px 0;
}

/* KPI side nav */
.pi-dash-mini-kpi-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.pi-dash-mini-kpi-side a {
    text-decoration: none;
    color: inherit;
}

.pi-dash-mini-kpi-side .pi-dash-mini-kpi-card {
    padding: 12px;
    border-radius: var(--pi-radius-lg);
}

.pi-dash-mini-kpi-side .pi-dash-mini-kpi-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.pi-dash-mini-kpi-side .pi-dash-mini-kpi-sub {
    font-size: 12px;
    color: var(--pi-text-muted);
    margin-top: 6px;
}

.pi-kpi-spark {
    width: 120px;
    height: 28px;
    opacity: 0.75;
}

.pi-dash-mini-kpi-card:hover .pi-kpi-spark {
    opacity: 1;
}

/* Budget card */
.pi-dash-mini-kpi-budget-card {
    padding: 10px 12px;
}

.pi-dash-mini-kpi-budget-chart {
    height: 64px;
    position: relative;
    margin-top: 6px;
}

.pi-dash-mini-kpi-budget-chart canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}


/* =============================================================
   14. SETTINGS
   ============================================================= */

.pi-settings-page {
    max-width: 1200px;
    margin: 0 auto 32px auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pi-settings-header {
    margin-bottom: 8px;
}

.pi-settings-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pi-settings-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--pi-text-muted);
}

.pi-settings-alert {
    margin-top: 8px;
}

.pi-settings-kpi-card {
    border-radius: 1rem;
    border: 1px solid var(--pi-border);
    background: linear-gradient(135deg, #f9fafb, #edf7e7);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
}

.pi-settings-kpi-card:hover {
    box-shadow: 0 0.7rem 1.3rem rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.pi-settings-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pi-settings-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.pi-settings-card-text {
    font-size: 13px;
    color: var(--pi-text-muted);
    margin: 0;
}

.pi-settings-card-active {
    border-color: var(--pi-green);
}

.pi-settings-section {
    margin-top: 32px;
}

.pi-settings-block {
    padding: 18px 20px;
}

.pi-settings-block-header {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--pi-border-light);
    padding-bottom: 8px;
}

.pi-settings-section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.pi-settings-section-text {
    font-size: 13px;
    color: var(--pi-text-muted);
    margin: 0;
}

.pi-settings-block-body > .card {
    border: none;
    box-shadow: none;
    background: transparent;
    margin: 0;
}

.pi-settings-block-body > .card .card-body {
    padding: 0;
}

.pi-settings-block-body label,
.pi-settings-block-body .form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.pi-settings-block-body .form-control {
    font-size: 14px;
    border-radius: var(--pi-radius-sm);
    border-color: var(--pi-border);
}

.pi-settings-block-body .table {
    font-size: 13px;
}

.pi-settings-block-body .table thead th {
    font-weight: 600;
    border-bottom-width: 1px;
}

.pi-settings-block-body .table tbody tr:hover {
    background-color: var(--pi-bg-hover);
}


/* =============================================================
   15. ONBOARDING
   ============================================================= */

.pi-onb-card {
    border-left: 3px solid rgba(119, 192, 67, 0.65);
}

.pi-onb-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pi-onb-subtitle {
    opacity: 0.75;
    font-size: 0.95rem;
    margin-top: 2px;
}

.pi-onb-progress {
    opacity: 0.75;
    white-space: nowrap;
}

.pi-onb-welcome {
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--pi-radius-md);
    margin-bottom: 12px;
}

.pi-onb-welcome-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.pi-onb-welcome-body {
    opacity: 0.85;
    margin-bottom: 10px;
}

.pi-onb-welcome-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pi-onb-link {
    background: transparent;
    border: 0;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.85;
}

.pi-onb-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pi-onb-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--pi-radius-md);
    text-decoration: none;
    color: inherit;
}

.pi-onb-step.is-next {
    border-left: 3px solid rgba(119, 192, 67, 0.65);
}

.pi-onb-step.is-complete {
    opacity: 0.65;
}

.pi-onb-icon svg {
    fill: currentColor;
    opacity: 0.85;
}

.pi-onb-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pi-onb-step-title {
    font-weight: 700;
}

.pi-onb-step-desc {
    opacity: 0.8;
    font-size: 0.95rem;
}

.pi-onb-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 140px;
}

.pi-onb-status {
    opacity: 0.8;
    font-size: 0.9rem;
}

.pi-onb-cta {
    font-weight: 600;
}


/* =============================================================
   16. AUTH PAGES (Login / Register / Forgot / Reset)
   ============================================================= */

/* Auth body class — applied to <body> when hideChrome is true */
html:has(.pi-auth-body) {
    height: 100%;
}

.pi-auth-body {
    height: 100%;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    .pi-auth-body {
        overflow-y: hidden;
    }
}

.pi-page.pi-login-page {
    background-color: var(--pi-bg);
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.pi-login-container {
    width: 100%;
    max-width: 480px;
    padding: 24px 16px 32px;
}

.pi-login-card {
    background-color: var(--pi-bg-white);
    border-radius: var(--pi-radius-xl);
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: var(--pi-shadow-login);
    padding: 28px 28px 24px;
}

.pi-login-header {
    text-align: center;
    margin-bottom: 22px;
}

.pi-login-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--pi-text);
}

.pi-login-subtitle {
    margin-top: 8px;
    color: var(--pi-text-subtle);
    font-size: 0.95rem;
    line-height: 1.35;
}

.pi-login-field {
    position: relative;
    margin-bottom: 18px;
}

.pi-login-label-floating {
    position: absolute;
    left: 14px;
    top: -11px;
    background-color: var(--pi-bg-white);
    padding: 0 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--pi-text-subtle);
    border-radius: 999px;
}

.pi-login-input.form-control {
    width: 100%;
    border-radius: var(--pi-radius-md);
    padding: 10px 12px;
    border-color: var(--pi-border);
    background-color: #f3f4ff;
    font-size: 0.95rem;
}

.pi-login-input.form-control:focus {
    border-color: var(--pi-green);
    box-shadow: 0 0 0 1px rgba(119, 192, 67, 0.3);
    outline: none;
}

.pi-login-remember {
    font-size: 0.9rem;
    color: var(--pi-text-subtle);
    margin-bottom: 10px;
}

.pi-login-btn.btn {
    border-radius: var(--pi-radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background-color: var(--pi-green);
    color: var(--pi-bg-white);
    border: none;
    width: 100%;
}

.pi-login-btn.btn:hover,
.pi-login-btn.btn:focus {
    background-color: var(--pi-green-hover);
    color: var(--pi-bg-white);
}

.pi-login-bankid-btn {
    display: none;
}

.pi-login-bankid-btn.btn {
    border-radius: var(--pi-radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.15);
    background: var(--pi-bg-white);
    color: var(--pi-text);
    margin-bottom: 12px;
}

.pi-login-bankid-btn.btn:hover,
.pi-login-bankid-btn.btn:focus {
    background: rgba(17, 24, 39, 0.03);
    color: var(--pi-text);
}

.pi-login-meta {
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--pi-text-faint);
    text-align: center;
}

.pi-login-field-password {
    position: relative;
}

.pi-login-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--pi-text-subtle);
    padding: 2px 4px;
    cursor: pointer;
}

.pi-login-password-toggle:focus {
    outline: none;
    text-decoration: underline;
}

.pi-login-links {
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}

.pi-login-link {
    color: var(--pi-text-subtle);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pi-login-link:hover,
.pi-login-link:focus {
    color: var(--pi-text);
}

.pi-login-policy {
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--pi-text-subtle);
}

/* Auth centered text variant for confirmation pages */
.pi-login-card-centered {
    text-align: center;
}

.pi-login-btn-mt {
    margin-top: 16px;
}

@media (max-width: 767.98px) {
    .pi-login-card {
        padding: 24px 18px 20px;
        border-radius: 14px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
    }

    .pi-login-title {
        font-size: 1.5rem;
    }

    .pi-login-container {
        padding-top: 16px;
        padding-bottom: 24px;
    }
}


/* =============================================================
   17. EXPENSES UPLOAD
   ============================================================= */

.pi-step-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pi-step-sub {
    font-size: 13px;
    color: var(--pi-text-muted);
}

.pi-draft-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.pi-draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--pi-border-subtle);
    border-radius: var(--pi-radius-md);
    background: var(--pi-bg-white);
}

.pi-draft-item-active {
    border-color: rgba(119, 192, 67, 0.55);
    box-shadow: 0 0 0 3px rgba(119, 192, 67, 0.12);
}

.pi-draft-item-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pi-draft-item-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 520px;
}

.pi-draft-item-meta {
    font-size: 12px;
    color: var(--pi-text-muted);
}

.pi-preview-frame {
    border: 1px solid var(--pi-border-subtle);
    border-radius: var(--pi-radius-md);
    overflow: hidden;
    background: var(--pi-bg-white);
}

.pi-preview-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.pi-preview-docs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.pi-preview-docs a {
    font-size: 13px;
}

.pi-table tr.pi-is-editing td {
    background: #fff7ed;
}


/* =============================================================
   18. INVOICE EDITOR
   ============================================================= */

.pi-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#pi_rowsTable {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    table-layout: fixed;
}

#pi_rowsTable thead th,
#pi_rowsTable tbody td {
    vertical-align: top;
    padding: 8px;
    white-space: nowrap;
}

#pi_rowsTable tbody td:first-child {
    white-space: normal;
}

#pi_rowsTable .pi-input {
    width: 100%;
    box-sizing: border-box;
}

#pi_rowsTable tr {
    display: table-row !important;
}

#pi_rowsTable td {
    display: table-cell !important;
}

#pi_rowsTable th {
    display: table-cell !important;
}

#pi_rowsTable th:last-child,
#pi_rowsTable td:last-child {
    width: 140px;
}

#pi_rowsTable td.pi-actions {
    white-space: nowrap;
    display: table-cell !important;
}

#pi_rowsTable td.pi-actions > * {
    vertical-align: middle;
}

#pi_rowsTable .pi-drag-handle {
    display: inline-block;
    padding: 6px 8px;
    cursor: grab;
    user-select: none;
}

#pi_rowsTable .pi-row.pi-dragging {
    outline: 2px dashed #c7e7cf;
}

#pi_rowsTable .pi-icon-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

#pi_rowsTable .pi-drag-handle[aria-disabled="true"] {
    opacity: .45;
    cursor: not-allowed;
}


/* =============================================================
   19. COMPACT DENSITY
   ============================================================= */

.pi-compact .pi-card-body {
    padding: 12px 14px;
}

.pi-compact .pi-card-header {
    padding: 12px 14px;
}

.pi-compact .pi-card-title {
    font-size: 18px;
    line-height: 1.2;
}

.pi-compact .pi-grid {
    gap: 10px;
}

.pi-compact .pi-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.pi-compact .pi-field-hint {
    font-size: 12px;
    margin-top: 4px;
}

.pi-compact .pi-input,
.pi-compact select.pi-input,
.pi-compact input.pi-input {
    height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

.pi-compact .pi-input-readonly {
    height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

.pi-compact .pi-checkbox {
    font-size: 14px;
}

.pi-compact #pi_rowsTable thead th,
.pi-compact #pi_rowsTable tbody td {
    padding: 6px 6px;
}

.pi-compact #pi_rowsTable .pi-input {
    height: 34px;
    padding: 6px 8px;
    font-size: 14px;
}

.pi-compact .pi-totals {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.35;
}

.pi-compact .pi-totals strong {
    font-weight: 700;
}

.pi-compact .pi-actionbar {
    margin-top: 10px;
    gap: 10px;
}

.pi-compact .pi-btn {
    padding: 8px 14px;
    font-size: 14px;
}

.pi-compact .pi-page-header {
    margin-bottom: 12px;
}

.pi-compact .pi-page-title {
    font-size: 24px;
    margin-bottom: 4px;
}

.pi-compact .pi-page-subtitle {
    font-size: 14px;
}

.pi-compact .pi-modal-header {
    padding: 12px 14px;
}

.pi-compact .pi-modal-body {
    padding: 12px 14px;
}

.pi-compact .pi-modal-footer {
    padding: 10px 14px;
}

@media (max-width: 600px) {
    .pi-compact .pi-input,
    .pi-compact select.pi-input,
    .pi-compact input.pi-input,
    .pi-compact .pi-input-readonly {
        height: 44px;
        font-size: 16px;
    }

    .pi-compact .pi-btn {
        padding: 10px 16px;
    }
}


/* =============================================================
   20. EXPENSE LAYOUT
   ============================================================= */

.pi-expense-layout-left {
    flex: 0 0 380px;
    max-width: 420px;
}

.pi-expense-layout-right {
    flex: 1 1 520px;
    min-width: 0;
}

@media (max-width: 991.98px) {
    .pi-expense-layout-left,
    .pi-expense-layout-right {
        flex: 1 1 100%;
        max-width: none;
    }
}


/* =============================================================
   21. UTILITY CLASSES
   ============================================================= */

/* Typography */
.pi-text-small {
    font-size: 13px;
}

.pi-text-muted {
    color: var(--pi-text-muted);
}

.pi-text-semibold {
    font-weight: 600;
}

.pi-text-right {
    text-align: right;
}

.pi-muted {
    color: var(--pi-text-muted);
}

.pi-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--pi-text);
}

/* Links */
.pi-link {
    color: inherit;
    text-decoration: underline;
}

.pi-link:hover {
    text-decoration: none;
}

/* List */
.pi-list {
    margin: 0;
    padding-left: 1rem;
}

.pi-list li {
    margin: .25rem 0;
}

/* Form row */
.pi-form-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Spacing */
.pi-mt-1 {
    margin-top: .25rem;
}

.pi-mt-2 {
    margin-top: .5rem;
}

.pi-mt-3 {
    margin-top: 1rem;
}

.pi-mb-1 {
    margin-bottom: .25rem;
}

.pi-mb-2 {
    margin-bottom: .5rem;
}

.pi-mb-3 {
    margin-bottom: 1rem;
}

.pi-p-3 {
    padding: 1rem;
}

/* Display */
.pi-inline {
    display: inline;
}

.pi-inline-block {
    display: inline-block;
}

.pi-flex {
    display: flex;
}

.pi-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pi-flex-wrap {
    flex-wrap: wrap;
}

/* Gap */
.pi-gap-2 {
    gap: .5rem;
}

.pi-gap-3 {
    gap: .75rem;
}

/* Font */
.pi-font-4xl {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pi-green);
}

/* Search box min width */
.pi-min-w-search {
    min-width: min(360px, 100%);
}

/* Action meta text (small muted below action cards) */
.pi-action-meta {
    margin-top: .35rem;
    font-size: .85rem;
}


/* =============================================================
   22. INVOICE LIST
   ============================================================= */

/* Header row */
.pi-inv-headerrow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pi-inv-headright {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Toolbar */
.pi-inv-toolbar {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 12px;
}

@media (max-width: 992px) {
    .pi-inv-toolbar {
        grid-template-columns: 1fr;
    }
}

.pi-inv-searchrow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.pi-inv-searchinput {
    width: 420px;
    max-width: 100%;
    height: 40px;
}

/* Filter chips */
.pi-inv-filterrow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pi-inv-filter-btn {
    border: 1px solid #d9d9d9;
    background: #fff;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.pi-inv-filter-btn.is-active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.pi-inv-selectall {
    margin-left: auto;
    user-select: none;
}

.pi-inv-metrics {
    text-align: right;
    min-width: 220px;
}

/* Table */
.pi-inv-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--pi-radius-lg);
    border: 1px solid var(--pi-border-light);
    background: var(--pi-bg-white);
}

.pi-inv-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.pi-inv-table thead th {
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--pi-text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--pi-border-light);
    white-space: nowrap;
    background: var(--pi-bg-hover);
}

.pi-inv-table tbody td {
    font-size: 13px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .04);
    vertical-align: middle;
}

/* Override server-side inline row colors with a cleaner palette */
.pi-inv-table tbody tr.pi-inv-row {
    background-color: var(--pi-bg-white) !important;
}

.pi-inv-table tbody tr.pi-inv-row:nth-child(even) {
    background-color: var(--pi-bg-hover) !important;
}

.pi-inv-table tbody tr.pi-inv-row:hover {
    background-color: var(--pi-green-light) !important;
    outline: none;
    filter: none;
}

/* Column widths — auto layout, just set minimums */
.pi-inv-col-check {
    width: 36px;
    text-align: center;
}

.pi-inv-col-invno {
    width: 70px;
}

.pi-inv-col-date {
    white-space: nowrap;
}

.pi-inv-col-amount {
    white-space: nowrap;
}

.pi-inv-col-status {
    white-space: nowrap;
}

.pi-inv-col-customer {
    max-width: 240px;
}

/* Hide less important columns on smaller screens */
@media (max-width: 1200px) {
    .pi-inv-table thead th:nth-child(8),
    .pi-inv-table tbody td:nth-child(8),
    .pi-inv-table thead th:nth-child(9),
    .pi-inv-table tbody td:nth-child(9) {
        display: none;
    }
}

@media (max-width: 768px) {
    .pi-inv-table thead th:nth-child(4),
    .pi-inv-table tbody td:nth-child(4),
    .pi-inv-table thead th:nth-child(6),
    .pi-inv-table tbody td:nth-child(6),
    .pi-inv-table thead th:nth-child(10),
    .pi-inv-table tbody td:nth-child(10) {
        display: none;
    }

    .pi-inv-col-customer {
        max-width: 140px;
    }
}

.pi-inv-invno {
    font-weight: 800;
}

.pi-inv-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pi-inv-status {
    font-weight: 600;
}

/* Paging */
.pi-inv-paging {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.pi-inv-pagebuttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pi-inv-pagebtn {
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.pi-inv-pagebtn.is-active {
    border-color: var(--pi-green);
    box-shadow: 0 0 0 2px rgba(119, 192, 67, .12);
    font-weight: 700;
}

/* Actionbar */
.pi-inv-actionsbar {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.pi-inv-actionsbar-left {
    min-width: 220px;
}

.pi-inv-selected-count {
    font-size: 22px;
    font-weight: 900;
}

.pi-inv-selected-list {
    white-space: pre-line;
    margin-top: 6px;
}

.pi-inv-actionsbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Status panel */
.pi-inv-statuspanel {
    margin-top: 12px;
}

.pi-inv-statuspanel-box {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
}

.pi-inv-row {
    cursor: pointer;
}

.pi-inv-row td.pi-inv-col-check,
.pi-inv-row td.pi-inv-col-check * {
    cursor: default;
}


/* =============================================================
   23. RESPONSIVE OVERRIDES
   ============================================================= */

@media (max-width: 767.98px) {
    .pi-dash-main-values {
        font-size: 1.6rem;
    }

    .pi-dash-main-legend span {
        display: block;
        margin-right: 0;
    }
}
