﻿/* ═══════════════════════════════════════════════════════
   Payment Out — Corecent navy nav theme (smart)
   Aligns with header-corecent + Daily Expenses / JV pages
   ═══════════════════════════════════════════════════════ */

.pout-wrap {
    --pout-ink: #0f172a;
    --pout-muted: #64748b;
    --pout-line: #e2e8f0;
    --pout-bg: #eef2f7;
    --pout-navy: #1a3a5c;
    --pout-navy-2: #24507a;
    --pout-blue: #1565c0;
    --pout-accent: #f97316;
    --pout-menu: #bbdefb;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    background: var(--pout-bg);
    font-size: 10px;
    color: var(--pout-ink);
}

/* ── Top bar (nav title theme) ── */
.pout-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0f2740 0%, var(--pout-navy) 48%, var(--pout-navy-2) 100%);
    color: #fff;
    padding: 7px 12px;
    box-shadow: 0 2px 10px rgba(15, 39, 64, .28);
    position: relative;
    z-index: 2;
}
.pout-topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pout-topbar-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    font-size: 13px;
}
.pout-topbar-title { display: block; font-size: 13px; font-weight: 800; line-height: 1.15; }
.pout-topbar-sub { display: block; font-size: 9px; opacity: .72; margin-top: 1px; }
.pout-top-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pout-count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: rgba(187, 222, 251, .22); border: 1px solid rgba(187, 222, 251, .45);
    border-radius: 999px; font-size: 9px; font-weight: 800; color: #e3f2fd;
}
.pout-create-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; padding: 0 10px; border-radius: 5px;
    font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer;
    background: var(--pout-accent); color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: 0 2px 6px rgba(249, 115, 22, .35);
}
.pout-create-btn:hover { background: #ea580c; color: #fff; }
.pout-ghost-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; padding: 0 9px; border-radius: 5px;
    font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer;
    background: rgba(255,255,255,.1); color: #fff;
    border: 1px solid rgba(255,255,255,.28);
}
.pout-ghost-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

/* ── Body ── */
.pout-body {
    flex: 1 1 auto;
    padding: 6px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin: 0;
}

/* ── KPI strip ── */
.pout-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}
.pout-stat {
    display: flex; align-items: center; gap: 6px;
    background: #fff; border-radius: 6px; padding: 4px 8px;
    border: 1px solid var(--pout-line);
    box-shadow: 0 1px 2px rgba(15, 39, 64, .04);
}
.pout-stat-icon {
    width: 24px; height: 24px; border-radius: 6px;
    display: grid; place-items: center; font-size: 11px; flex-shrink: 0;
}
.pout-stat-icon--orange { background: #fff7ed; color: #c2410c; }
.pout-stat-icon--green { background: #ecfdf5; color: #15803d; }
.pout-stat-icon--indigo { background: #eef2ff; color: #4338ca; }
.pout-stat-icon--blue { background: #e3f2fd; color: #1565c0; }
.pout-stat-label {
    display: block; font-size: 8px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--pout-muted);
}
.pout-stat-val {
    display: block; font-size: 13px; font-weight: 800;
    color: var(--pout-ink); font-variant-numeric: tabular-nums; line-height: 1.15;
}

/* ── Layout: period nav + main ── */
.pout-layout {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
    gap: 7px;
    align-items: stretch;
    min-height: 0;
    flex: 1 1 auto;
}
@media (max-width: 900px) {
    .pout-layout { grid-template-columns: 1fr; }
}

.pout-period {
    background: #fff;
    border: 1px solid var(--pout-line);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 210px);
    overflow: hidden;
}
.pout-period-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px; border-bottom: 1px solid var(--pout-line);
    background: linear-gradient(180deg, #e3f2fd 0%, #f8fafc 100%);
    flex-shrink: 0;
}
.pout-period-h strong { font-size: 10px; font-weight: 800; color: var(--pout-navy); }
.pout-period-h span { font-size: 9px; font-weight: 700; color: var(--pout-muted); }
.pout-period-list { flex: 1; overflow: auto; min-height: 0; }
.pout-period-item {
    width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f1f5f9;
    background: #fff; padding: 7px 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.pout-period-item:hover { background: #e3f2fd; }
.pout-period-item.on {
    background: #e8f1fb;
    box-shadow: inset 3px 0 0 var(--pout-navy);
}
.pout-period-label { font-size: 10px; font-weight: 700; color: var(--pout-ink); }
.pout-period-item.on .pout-period-label { color: var(--pout-navy); }
.pout-period-count {
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #f1f5f9; color: var(--pout-muted);
    font-size: 9px; font-weight: 800; display: inline-grid; place-items: center;
}
.pout-period-item.on .pout-period-count { background: var(--pout-navy); color: #fff; }

.pout-main {
    display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 0;
}

/* ── Filter bar ── */
.pout-filter-bar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--pout-line); border-radius: 7px;
    padding: 6px 8px;
}
.pout-status-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.pout-tab {
    border: 1px solid var(--pout-line); background: #f8fafc; color: var(--pout-muted);
    font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 999px; cursor: pointer;
}
.pout-tab.active { background: var(--pout-navy); border-color: var(--pout-navy); color: #fff; }
.pout-tab:hover:not(.active) { background: #e3f2fd; border-color: #90caf9; color: var(--pout-navy); }

.pout-filter-field { position: relative; flex: 1; min-width: 130px; }
.pout-filter-field--search { flex: 2; min-width: 160px; }
.pout-filter-field--party { flex: 1.2; min-width: 150px; }
.pout-filter-icon {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 10px; pointer-events: none; z-index: 1;
}
.pout-filter-input {
    width: 100%; height: 26px; border: 1px solid var(--pout-line); border-radius: 5px;
    padding: 0 8px 0 26px; font-size: 10px;
    background: #f8fafc; color: var(--pout-ink); box-sizing: border-box;
}
.pout-filter-input:focus {
    outline: none; border-color: #90caf9; background: #fff;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, .12);
}
.pout-search-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; padding: 0 12px; border: none; border-radius: 5px;
    background: var(--pout-navy); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer;
    white-space: nowrap;
}
.pout-search-btn:hover { background: var(--pout-navy-2); }
.pout-search-btn:disabled { opacity: .55; cursor: wait; }

/* ── Table card ── */
.pout-table-card {
    background: #fff; border: 1px solid var(--pout-line); border-radius: 7px;
    overflow: hidden; flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
}
.pout-loading, .pout-empty {
    text-align: center; padding: 20px 12px; color: var(--pout-muted); font-size: 11px;
}
.pout-empty i { color: #cbd5e1; display: block; margin-bottom: 6px; font-size: 22px; }
.pout-empty-title { font-size: 12px; font-weight: 800; color: var(--pout-ink); }
.pout-empty-sub { font-size: 10px; max-width: 360px; margin: 4px auto 0; }

.pout-table-wrap { overflow: auto; flex: 1 1 auto; min-height: 0; }
.pout-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.pout-table thead {
    background: var(--pout-navy);
    position: sticky; top: 0; z-index: 1;
}
.pout-table th {
    padding: 6px 8px; font-size: 8px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: #bbdefb; text-align: left;
}
.pout-table td {
    padding: 3px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
    height: 28px;
}
.pout-row:hover { background: #f0f7ff; }
.pout-row:last-child td { border-bottom: none; }

.pout-pay-no { font-weight: 800; color: var(--pout-navy); }
.pout-supplier { font-weight: 600; color: #334155; }
.pout-date { color: var(--pout-muted); white-space: nowrap; }
.pout-amt { font-weight: 800; color: var(--pout-ink); font-variant-numeric: tabular-nums; }
.pout-narration {
    display: block; font-size: 9px; color: #94a3b8; max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pout-badge {
    display: inline-flex; align-items: center; padding: 1px 7px;
    border-radius: 999px; font-size: 8px; font-weight: 800; text-transform: uppercase;
}
.pout-badge--paid { background: #dcfce7; color: #166534; }
.pout-badge--other { background: #e0e7ff; color: #3730a3; }
.pout-badge--partial { background: #fef3c7; color: #92400e; }

.pout-actions { display: inline-flex; gap: 3px; }
.pout-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 5px; border: 1px solid transparent;
    background: transparent; color: var(--pout-muted); cursor: pointer;
    text-decoration: none; font-size: 11px;
}
.pout-action-btn:hover { background: #e3f2fd; color: var(--pout-navy); border-color: #90caf9; }
.pout-action-btn--view:hover { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.pout-action-btn--del:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.pout-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px; border-top: 1px solid var(--pout-line);
    background: #f0f7ff; flex-wrap: wrap; gap: 6px; flex-shrink: 0;
}
.pout-page-info { font-size: 9px; color: var(--pout-muted); font-weight: 600; }
.pout-page-btns { display: inline-flex; gap: 2px; }
.pout-page-btn {
    min-width: 22px; height: 22px; border: 1px solid var(--pout-line); background: #fff;
    border-radius: 4px; font-size: 9px; font-weight: 700; cursor: pointer; color: #475569;
}
.pout-page-btn:hover:not(:disabled) { background: #e3f2fd; border-color: #90caf9; color: var(--pout-navy); }
.pout-page-btn--active { background: var(--pout-navy); border-color: var(--pout-navy); color: #fff; }
.pout-page-btn:disabled { opacity: .4; cursor: default; }

.pout-spinner {
    width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: var(--pout-navy);
    border-radius: 50%; animation: poutspin .7s linear infinite; display: inline-block;
}
@keyframes poutspin { to { transform: rotate(360deg); } }

@media (max-width: 992px) {
    .pout-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .pout-stats { grid-template-columns: 1fr; }
    .pout-period { max-height: 160px; }
}

/* ── Add / edit voucher ── */
.pout-voucher {
    background: #fff;
    border: 1px solid var(--pout-line);
    border-radius: 8px;
    padding: 10px 10px 8px;
    box-shadow: 0 1px 2px rgba(15, 39, 64, .05);
}
.pout-supplier-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}
.pout-float--supplier { flex: 1 1 auto; min-width: 0; }
.pout-bal-chip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 120px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid var(--pout-line);
}
.pout-bal-chip span {
    font-size: 8px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--pout-muted);
}
.pout-bal-chip strong { font-size: 11px; color: var(--pout-navy); font-variant-numeric: tabular-nums; }
.pout-bal-chip.pout-supplier-bal--zero { background: #fffbeb; border-color: #fde68a; }
.pout-bal-chip.pout-supplier-bal--zero strong { color: #92400e; }
.pout-bal-chip.pout-supplier-bal--advance { background: #ecfdf5; border-color: #a7f3d0; }
.pout-bal-chip.pout-supplier-bal--advance strong { color: #166534; }

.pout-voucher-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(120px, .7fr) minmax(140px, .8fr) minmax(120px, .7fr);
    gap: 8px 8px;
    align-items: start;
}
.pout-amt { min-width: 0; }
.pout-float--span2,
.pout-float-col.pout-float--span2 { grid-column: 1 / 3; }
.pout-float--notes { grid-column: 3 / -1; }
.pout-float--payee { grid-column: 2 / -1; }
.pout-float--amount .pout-float-input { min-width: 52px; }
.pout-req { color: #dc2626; font-weight: 800; }

.pout-float {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid #c5d0dc;
    border-radius: 6px;
    background: #fff;
}
.pout-float:focus-within {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, .1);
}
.pout-float--error { border-color: #dc2626; }
.pout-float > label {
    position: absolute;
    left: 8px;
    top: 0;
    transform: translateY(-50%);
    margin: 0;
    padding: 0 4px;
    background: #fff;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}
.pout-float:focus-within > label { color: #1565c0; }
.pout-float-ccy {
    flex-shrink: 0;
    margin-right: 6px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}
.pout-float-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 32px;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #1565c0;
    padding: 6px 0 2px !important;
    font-variant-numeric: tabular-nums;
}
.pout-float-input::placeholder {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    font-weight: 600;
}
.pout-float-select {
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer;
}
.pout-float-area {
    height: 32px;
    min-height: 32px;
    resize: none;
    font-weight: 500 !important;
    padding-top: 8px !important;
}
.pout-float--supplier .form-select,
.pout-float--supplier input {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    min-height: 32px;
    height: 32px;
    font-size: 12px !important;
    font-weight: 600;
    color: #0f172a;
    padding-left: 2px;
}
.pout-float .rz-datepicker,
.pout-float .rz-calendar {
    width: 100%;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.pout-float .rz-inputtext,
.pout-float .rz-datepicker-input,
.pout-float .pout-float-rz {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100%;
    height: 32px;
    font-size: 12px !important;
    font-weight: 600;
    color: #0f172a !important;
}
.pout-float--voucher { gap: 6px; padding-left: 6px; }
.pout-float--voucher .rz-button { flex-shrink: 0; height: 22px !important; font-size: 9px !important; }

.pout-amt-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    margin: 0 0 0 4px;
    flex-shrink: 0;
}
.pout-chip {
    height: 20px;
    padding: 0 5px;
    border: 1px solid #86efac;
    background: #fff;
    color: #15803d;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}
.pout-chip:hover { background: #f0fdf4; }
.pout-chip--muted { border-color: #cbd5e1; color: #64748b; }
.pout-chip--muted:hover { background: #f8fafc; }

.pout-field-error {
    margin: 2px 0 0;
    font-size: 9px;
    font-weight: 700;
    color: #dc2626;
}
.pout-advance-hint { margin: 2px 0 0; font-size: 9px; color: #166534; font-weight: 600; }

.pout-table-head-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 8px; border-bottom: 1px solid var(--pout-line); background: #fff;
}
.pout-section-label { font-size: 10px; font-weight: 800; color: var(--pout-navy); }
.pout-inv-count {
    font-size: 9px; font-weight: 800; color: var(--pout-navy);
    background: #e3f2fd; border-radius: 999px; padding: 2px 8px;
}
.pout-td-inv { font-weight: 800; color: var(--pout-navy); }
.pout-td-pay { min-width: 148px; width: 148px; }
.pout-pay-grp {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    min-width: 132px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.pout-pay-grp .input-group-text {
    display: flex;
    align-items: center;
    padding: 0 7px;
    font-size: 10px;
    font-weight: 800;
    background: #1a3a5c;
    color: #fff !important;
    border: 0;
}
.pout-pay-input {
    flex: 1 1 auto;
    min-width: 80px !important;
    width: 100% !important;
    height: 28px !important;
    min-height: 28px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    text-align: right;
    padding: 2px 8px !important;
    font-variant-numeric: tabular-nums;
}
.pout-amt-due { display: block; font-size: 9px; color: #c2410c; }
.pout-overdue { color: #dc2626; font-weight: 700; }
.pout-row--selected { background: #e8f1fb !important; }
.pout-inv-cards { display: none; }
.pout-summary-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 10px; background: #f0f7ff; border-top: 1px solid var(--pout-line);
}
.pout-summary-label { font-size: 10px; font-weight: 700; }
.pout-summary-val { font-size: 13px; font-weight: 800; color: var(--pout-navy); }

.pout-add-footer {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    padding: 7px 12px;
    background: #fff;
    border-top: 1px solid var(--pout-line);
    box-shadow: 0 -4px 12px rgba(15, 39, 64, .06);
}
.pout-ghost-btn--dark {
    background: #fff; color: var(--pout-navy); border: 1px solid var(--pout-line);
}
.pout-ghost-btn--dark:hover { background: #e3f2fd; color: var(--pout-navy); }

@media (max-width: 900px) {
    .pout-voucher-grid { grid-template-columns: 1fr 1fr; }
    .pout-float--span2, .pout-float-col.pout-float--span2,
    .pout-float--notes, .pout-float--payee { grid-column: 1 / -1; }
    .pout-supplier-row { flex-direction: column; }
    .pout-table-wrap { display: none; }
    .pout-inv-cards { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
    .pout-inv-card {
        border: 1px solid var(--pout-line); border-radius: 6px; padding: 8px; background: #fff;
    }
    .pout-inv-card--selected { background: #e8f1fb; }
    .pout-inv-card-header, .pout-inv-card-footer {
        display: flex; justify-content: space-between; align-items: center; gap: 8px;
    }
    .pout-inv-card-body { margin: 6px 0; font-size: 10px; color: var(--pout-muted); }
}
