/* =========================================================================
   Customer invoice page (/Invoice) + its modals.
   Self-contained, prefixed with `inv-` to avoid clashes with style.css.
   ========================================================================= */

.inv-page .main-content { padding-bottom: 40px; }

/* ---- top bar (reuses the app-standard .main-titlee/.main-title) ------ */
/* Full-width white header strip with a bottom divider, like the other pages. */
.inv-page .main-titlee { background: #fff; border-bottom: 1px solid #F1F2F3; }

/* Pin the title to the app-standard size/weight so it can't fall back to the
   default browser/Bootstrap h1. */
.inv-page .main-title h1 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark-txt);
    margin: 0;
}

/* Keep the Export/Send buttons in the title bar looking like the page's own
   buttons, overriding the global ".main-content .main-title button" skin. */
.inv-page .main-title button.inv-btn {
    height: 40px;
    padding: 9px 15px;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    border: 1px solid #E5E7EB;
    box-shadow: none;
    backdrop-filter: none;
}
.inv-page .main-title button.inv-btn-primary {
    background: #5263FF;
    color: #fff;
    border-color: transparent;
}
.inv-page .main-title button.inv-btn-primary:disabled { background: #B6BEFF; }

/* Page body aligned to the title bar (centered, 40px gutters like .main-title) */
.inv-body {
    max-width: 1680px;
    margin: 0 auto;
    padding: 20px 40px 40px;
}

/* ---- buttons --------------------------------------------------------- */
.inv-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 15px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.inv-btn i { font-size: 15px; }
.inv-btn-ghost { border-color: #E5E7EB; color: #374151; }
.inv-btn-ghost:hover { background: #F9FAFB; }
.inv-btn-primary { background: #5263FF; color: #fff; }
.inv-btn-primary:hover { background: #3f51f0; }
.inv-btn-primary:disabled { background: #B6BEFF; cursor: not-allowed; }
.inv-btn-accent { background: #4A45E0; color: #fff; }
.inv-btn-accent:hover { background: #3a36c4; }
.inv-btn-danger { border-color: #F2C0BB; color: #DF2917; background: #fff; }
.inv-btn-danger:hover { background: #FEF2F2; }

/* ---- toolbar --------------------------------------------------------- */
.inv-toolbar {
    background: #fff;
    border: 1px solid #EAECEF;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.inv-toolbar-row { width: 100%; }
.inv-search-wrap { flex: 1 1 280px; min-width: 220px; max-width: 520px; }

/* ---- tabs + chips row ------------------------------------------------ */
.inv-tabsrow { margin-bottom: 14px; }

.inv-tabs {
    display: inline-flex;
    gap: 4px;
    background: #F3F4F6;
    border-radius: 12px;
    padding: 4px;
    flex-wrap: wrap;
}
.inv-tabs button {
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.inv-tabs button.active {
    background: #fff;
    color: #5263FF;
    box-shadow: 0 1px 2px rgba(16,24,40,.08);
}
.inv-tab-count {
    background: #E5E7EB;
    color: #6B7280;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 8px;
}
.inv-tabs button.active .inv-tab-count { background: #5263FF; color: #fff; }

.inv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EEF0FF;
    color: #5263FF;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
}
.inv-chip i { cursor: pointer; font-size: 13px; }

.inv-filterbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #E5E7EB;
    background: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
}
.inv-filterbtn:hover { background: #F9FAFB; }

/* ---- table ----------------------------------------------------------- */
.inv-table-wrap {
    background: #fff;
    border: 1px solid #EAECEF;
    border-radius: 14px;
    overflow: visible;
}
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table thead th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .04em;
    color: #9CA3AF;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid #F1F2F4;
    background: #FBFBFC;
}
.inv-table thead th:first-child { border-top-left-radius: 14px; }
.inv-table thead th:last-child { border-top-right-radius: 14px; }
.inv-table tbody tr {
    border-bottom: 1px solid #F1F2F4;
    cursor: pointer;
    transition: background .1s ease;
}
.inv-table tbody tr:hover { background: #F8F9FF; }
.inv-table tbody tr.selected { background: #F2F4FF; }
.inv-table td { padding: 14px 16px; vertical-align: middle; font-size: 14px; color: #1E293B; }
.inv-check-col { width: 44px; }

.inv-name { font-weight: 600; color: #111827; }
.inv-subname { font-size: 12.5px; color: #94A3B8; margin-top: 2px; }
.inv-amount { font-weight: 600; color: #111827; white-space: nowrap; }
.inv-nr-muted { color: #94A3B8; }

/* checkbox */
.inv-check {
    width: 18px; height: 18px;
    accent-color: #5263FF;
    cursor: pointer;
}

/* ---- status pills ---------------------------------------------------- */
.inv-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 8px;
    white-space: nowrap;
}
.inv-status i { font-size: 14px; }
.inv-status-sent     { background: #E9F7EE; color: #2E8B4F; }
.inv-status-draft    { background: #E7F3FB; color: #1583C4; }
.inv-status-error    { background: #FDECEA; color: #DF2917; }
.inv-status-archived { background: #FBF3E2; color: #B47500; }

/* ---- kebab + dropdown menus ----------------------------------------- */
.inv-dropdown { position: relative; display: inline-block; }
.inv-kebab {
    border: none;
    background: transparent;
    color: #64748B;
    border-radius: 8px;
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 18px;
}
.inv-kebab:hover { background: #F1F2F4; }

.inv-menu {
    position: absolute;
    z-index: 1001;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ECECEC;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16,24,40,.14);
    padding: 6px;
    display: none;
}
.inv-menu.show { display: block; }
.inv-menu-right { left: auto; right: 0; }
.inv-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    color: #374151;
    text-align: left;
    cursor: pointer;
}
.inv-menu button:hover { background: #F5F6F8; }
.inv-menu button.danger { color: #DF2917; }
.inv-menu button:disabled { color: #C0C5CD; cursor: not-allowed; }
.inv-menu button:disabled:hover { background: transparent; }
.inv-menu i { font-size: 15px; width: 16px; }

.inv-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
}

/* ---- bottom selection bar ------------------------------------------- */
.inv-selbar {
    border-top: 1px solid #F1F2F4;
    padding: 12px 16px;
    background: #FBFBFD;
}
.inv-selcount {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}
.inv-selcount i { cursor: pointer; color: #94A3B8; }

.inv-empty { padding: 56px; text-align: center; color: #9CA3AF; font-size: 14px; }
.inv-loading { display: flex; justify-content: center; align-items: center; height: 320px; color: #5263FF; }

/* =========================================================================
   Modals (Create invoice / Seasonal invoicing / Invoice detail)
   ========================================================================= */
.inv-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(15,23,42,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-modal {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(16,24,40,.28);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.inv-modal-lg { max-width: 1180px; }

.inv-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 26px 8px;
}
.inv-modal-title { font-size: 22px; font-weight: 700; color: #111827; margin: 0; }
.inv-modal-sub { font-size: 14px; color: #6B7280; margin: 6px 0 0; line-height: 1.45; }
.inv-modal-close {
    border: 1px solid #E5E7EB;
    background: #fff;
    border-radius: 10px;
    width: 38px; height: 38px;
    font-size: 18px;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
}
.inv-modal-close:hover { background: #F5F6F8; }
.inv-modal-body { padding: 16px 26px; overflow-y: auto; }
.inv-modal-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 26px 24px;
    border-top: 1px solid #F1F2F4;
}
.inv-modal-foot.end { justify-content: flex-end; }
.inv-modal-foot.split { justify-content: space-between; }

/* search box inside modals */
.inv-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 11px 14px;
    margin-bottom: 14px;
}
.inv-modal-search i { color: #9CA3AF; }
.inv-modal-search input { border: none; outline: none; width: 100%; font-size: 14px; background: transparent; }

/* customer cards (Create invoice) */
.inv-cust-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1.5px solid #ECECEC;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.inv-cust-card:hover { border-color: #C9CFFF; }
.inv-cust-card.selected { border-color: #5263FF; box-shadow: 0 0 0 3px #5263FF22; }
.inv-cust-name { font-size: 16px; font-weight: 700; color: #111827; }
.inv-cust-tax { font-size: 13.5px; color: #6B7280; margin-top: 3px; }
.inv-cust-meta { display: flex; align-items: center; gap: 8px; }
.inv-cust-pill {
    background: #F1F2F4; color: #475569;
    border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.inv-cust-count {
    display: inline-flex; align-items: center; gap: 5px;
    background: #EEF0FF; color: #5263FF;
    border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 700;
}
.inv-cust-check {
    position: absolute; top: -9px; right: -9px;
    width: 26px; height: 26px; border-radius: 50%;
    background: #5263FF; color: #fff;
    display: none; align-items: center; justify-content: center; font-size: 14px;
}
.inv-cust-card.selected .inv-cust-check { display: flex; }

/* generic data table used inside modals */
.inv-dtable { width: 100%; border-collapse: collapse; }
.inv-dtable thead th {
    text-align: left; font-size: 13px; font-weight: 700; color: #475569;
    padding: 12px 14px; border-bottom: 1px solid #EEF0F2;
}
.inv-dtable tbody tr { border-bottom: 1px solid #F2F3F5; }
.inv-dtable tbody tr:hover { background: #F8F9FF; }
.inv-dtable td { padding: 13px 14px; font-size: 14px; color: #1E293B; vertical-align: top; }
.inv-dtable .muted { color: #94A3B8; }
.inv-pre { white-space: pre-line; }

/* segmented sub-tabs inside modals */
.inv-subtabs { display: inline-flex; gap: 4px; background: #F3F4F6; border-radius: 10px; padding: 4px; }
.inv-subtabs button {
    border: none; background: transparent; border-radius: 8px;
    padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: #6B7280; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.inv-subtabs button.active { background: #fff; color: #5263FF; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.inv-select {
    border: 1px solid #E5E7EB; border-radius: 10px; padding: 8px 12px;
    font-size: 13.5px; color: #374151; background: #fff; cursor: pointer;
}

/* detail modal header identity */
.inv-detail-head { display: flex; align-items: center; gap: 14px; }
.inv-detail-icon {
    width: 46px; height: 46px; border-radius: 12px;
    background: #EEF0FF; color: #5263FF;
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.inv-detail-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.inv-total-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: #E9F7EE; color: #2E8B4F; font-weight: 700;
    border-radius: 10px; padding: 8px 14px; font-size: 15px;
}
.inv-wt-badge {
    font-size: 12.5px; font-weight: 600; background: #EEF0FF; color: #5263FF;
    border-radius: 8px; padding: 3px 9px; white-space: nowrap;
}
