/* ── Reset ───────────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
    --bg:         #F4F4F6;
    --surface:    #FFFFFF;
    --border:     #E4E4E7;
    --border-2:   #EDEDEF;
    --text:       #18181B;
    --text-2:     #6B7280;
    --text-3:     #9CA3AF;
    --accent:     #2563EB;
    --accent-h:   #1D4ED8;
    --green:      #16A34A;
    --green-h:    #15803D;
    --amber:      #D97706;
    --red:        #DC2626;
    --red-h:      #B91C1C;
    --radius-sm:  4px;
    --radius:     6px;
    --radius-lg:  8px;
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
    --shadow:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* ── Global ──────────────────────────────────────────────────────────────── */
body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.container {
    padding: 0 48px 48px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
    background: #111117;
    color: white;
    padding: 16px 48px;
    margin: 0 -48px 20px;
    border-bottom: 1px solid #1e1e26;
}

header h1 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

header p {
    color: #71717A;
    font-size: 12px;
}

/* ── Nav Tabs ────────────────────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.nav-tab {
    padding: 9px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Sora', sans-serif;
    color: var(--text-2);
    transition: color 0.12s, border-color 0.12s;
    white-space: nowrap;
}

.nav-tab:hover { color: var(--text); }

.nav-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content         { display: none; }
.tab-content.active  { display: block; padding-top: 24px; }

#dashboard.tab-content.active { padding-top: 0; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    letter-spacing: -0.01em;
}

.card h3 {
    font-size: 11px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Card subtitle paragraph — description lines under h2 */
.card > p {
    font-size: 13px;
    color: var(--text-2);
    margin-top: -8px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    padding: 0 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: background 0.12s, opacity 0.12s, border-color 0.12s;
    letter-spacing: 0.01em;
    height: 32px;
    white-space: nowrap;
}

.btn-primary        { background: var(--accent); color: white; }
.btn-primary:hover  { background: var(--accent-h); }

.btn-success        { background: var(--green); color: white; }
.btn-success:hover  { background: var(--green-h); }

.btn-secondary      { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--text); border-color: #C4C4C8; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

thead { background: #F9F9FA; }

th {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-2);
    font-size: 13px;
}

tr:hover { background: #FAFAFB; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-draft        { background: #F4F4F6; color: #6B7280; }
.badge-overdue      { background: #FEE2E2; color: #991B1B; font-weight: 700; }
.badge-submitted    { background: #DBEAFE; color: #1E40AF; }
.badge-in-progress  { background: #FEF3C7; color: #92400E; }
.badge-completed    { background: #DCFCE7; color: #166534; }
.badge-cancelled    { background: #FEE2E2; color: #991B1B; }
.badge-confirmed    { background: #DBEAFE; color: #1E40AF; }
.badge-inv-sent     { background: #FEF3C7; color: #92400E; }
.badge-inv-paid     { background: #DCFCE7; color: #166534; }

.pay-row-paid td    { background: #F0FDF4 !important; }
.pay-row-sent td    { background: #FEFCE8 !important; }
.pay-row-overdue td { background: #FFF1F2 !important; }

/* ── Workflow ─────────────────────────────────────────────────────────────── */
.workflow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.workflow-step {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}

.workflow-step.active    { background: #EFF6FF; border-left-color: var(--accent); }
.workflow-step.completed { background: #F0FDF4; border-left-color: var(--green); }

.workflow-arrow { font-size: 20px; color: var(--border); }

/* ── Item Row ─────────────────────────────────────────────────────────────── */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 60px;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.remove-btn {
    padding: 0 12px;
    height: 32px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    transition: background 0.12s;
}
.remove-btn:hover { background: var(--red-h); }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.success-message {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-left: 3px solid var(--green);
    color: #166534;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 12px;
    display: none;
}

.info-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid #52525B;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
}
.info-box h4  { color: var(--text); margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.info-box ul  { margin-left: 18px; color: var(--text-2); font-size: 13px; }
.info-box ul li { margin: 4px 0; }

/* ── Inline table inputs ──────────────────────────────────────────────────── */
.tbl-input {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    width: 100%;
    background: var(--surface);
}
.tbl-input:focus { outline: none; border-color: var(--accent); }

#new-orders-table td { padding: 8px; vertical-align: middle; }


/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.filter-bar .form-group   { margin-bottom: 0; min-width: 150px; }
.filter-bar .btn-secondary { align-self: flex-end; }

/* Normalize date/number inputs in filter bars to match the design system */
.filter-bar input[type="date"],
.filter-bar input[type="number"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.filter-bar input[type="date"]:focus,
.filter-bar input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Inline inputs inside flex rows (shipping-method, etc.) */
.form-group-inline {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    background: var(--surface);
}
.form-group-inline:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

/* ── Table scroll wrapper ────────────────────────────────────────────────── */
.table-scroll-wrap {
    overflow-y: scroll;
    overflow-x: auto;
    max-height: 400px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ── XL Table (forecast/payment views) ───────────────────────────────────── */
.xl-table {
    border-collapse: collapse;
    font-size: 13px;
    width: 100%;
    margin-top: 0;
    table-layout: auto;
}

.xl-table thead { background: #F9F9FA; }

.xl-table th {
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #F3F5F8;
}

.xl-table td {
    padding: 6px 8px;
    border: 1px solid var(--border-2);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xl-table tr:nth-child(even) td { background: #FAFAFA; }
.xl-table tr:hover td           { background: #F0F4FF; }

.xl-input {
    width: 100%;
    padding: 3px 5px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: 'Sora', sans-serif;
}
.xl-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--surface);
}
.xl-input[readonly] { color: var(--text-2); }

.xl-table tr.week-current td { background: #D1FAE5 !important; }
.xl-table tr.week-next td    { background: #FEF9C3 !important; }
.xl-table tr.clickable       { cursor: pointer; }
.xl-table tr.selected td     { background: #DBEAFE !important; }
.xl-table tr.selected.week-current td,
.xl-table tr.selected.week-next td   { background: #DBEAFE !important; }

/* ── Doc Step Cards ──────────────────────────────────────────────────────── */
.doc-checklist {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.doc-step-card {
    flex: 1;
    min-width: 160px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s;
}
.doc-step-card.step-done    { border-left-color: var(--green); background: #F0FDF4; }
.doc-step-card.step-na      { border-left-color: var(--border); background: var(--bg); opacity: 0.6; }
.doc-step-card.step-pending { border-left-color: var(--border); }

.doc-step-card .step-num    { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.doc-step-card .step-title  { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.doc-step-card .step-status { font-size: 12px; font-weight: 600; }
.doc-step-card.step-done    .step-status { color: var(--green); }
.doc-step-card.step-na      .step-status { color: var(--text-2); }
.doc-step-card.step-pending .step-status { color: var(--text-3); }
.doc-step-card .step-detail { font-size: 11px; color: var(--text-2); margin-top: 3px; word-break: break-all; }

/* ── Kanban Board (base) ─────────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    align-items: flex-start;
}

.kanban-col {
    flex: 1 1 0;
    min-width: 210px;
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.kanban-col-body {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    min-height: 80px;
    max-height: 520px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 13px;
}

.kanban-card-customer { font-weight: 600; color: var(--text); font-size: 13px; margin-bottom: 6px; }
.kanban-card-table    { width: 100%; border-collapse: collapse; font-size: 12px; }
.kanban-card-table .kc-label { color: var(--text-3); padding: 2px 6px 2px 0; white-space: nowrap; width: 50%; }
.kanban-card-table .kc-value { color: var(--text); font-weight: 600; padding: 2px 0; }
.kanban-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 20px 8px; }

.kanban-count {
    background: rgba(0,0,0,0.06);
    border-radius: var(--radius-sm);
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
}

.kanban-col-forecast    .kanban-col-header { background: var(--bg);     color: var(--text-2); border-top: 2px solid #9CA3AF; }
.kanban-col-confirmed   .kanban-col-header { background: #EFF6FF; color: #1D4ED8;    border-top: 2px solid #2563EB; }
.kanban-col-inv-pending .kanban-col-header { background: #FFFBEB; color: #92400E;    border-top: 2px solid #D97706; }
.kanban-col-inv-sent    .kanban-col-header { background: #F0FDF4; color: #166534;    border-top: 2px solid #16A34A; }

/* ── Dashboard: Sleek Functional Redesign ────────────────────────────────── */

#dashboard {
    --db-bg:          #F4F4F6;
    --db-surface:     #FFFFFF;
    --db-border:      #E4E4E7;
    --db-border-soft: #EBEBED;
    --db-text:        #18181B;
    --db-text-2:      #6B7280;
    --db-text-3:      #9CA3AF;
    --db-forecast:    #6B7280;
    --db-confirmed:   #2563EB;
    --db-inv-pending: #D97706;
    --db-inv-sent:    #16A34A;
    background: var(--db-bg);
    padding: 28px 0 44px;
}

/* ── Weekly Shipping Summary ── */
#db-weekly-summary {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.db-ws-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--db-border-soft);
    gap: 16px;
    flex-wrap: wrap;
}

.db-ws-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Segmented timeframe toggle */
.db-ws-timeframe {
    display: flex;
    border: 1px solid var(--db-border);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.db-ws-tf-btn {
    padding: 0 12px;
    height: 28px;
    border: none;
    background: var(--db-surface);
    color: var(--db-text-2);
    font-size: 12px;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.db-ws-tf-btn + .db-ws-tf-btn { border-left: 1px solid var(--db-border); }
.db-ws-tf-btn.active           { background: var(--db-confirmed); color: #fff; font-weight: 600; }
.db-ws-tf-btn:not(.active):hover { background: var(--db-bg); color: var(--db-text); }

.db-ws-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-ws-nav button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--db-border);
    border-radius: 6px;
    background: var(--db-surface);
    color: var(--db-text-2);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    padding: 0;
}
.db-ws-nav button:hover:not(:disabled) { background: var(--db-bg); border-color: #C4C4C8; color: var(--db-text); }
.db-ws-nav button:disabled { opacity: 0.3; cursor: default; }

#db-ws-today {
    display: none;
    width: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 0 9px;
    letter-spacing: 0.01em;
    color: var(--db-confirmed) !important;
    border-color: var(--db-confirmed) !important;
}

.db-ws-week-label { text-align: center; min-width: 110px; }

.db-ws-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--db-text);
    line-height: 1.2;
}

.db-ws-range {
    font-size: 11px;
    color: var(--db-text-3);
    margin-top: 2px;
}

.db-ws-total {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.db-ws-total-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--db-text);
    letter-spacing: -0.03em;
    line-height: 1;
}

.db-ws-total-label {
    font-size: 12px;
    color: var(--db-text-3);
    font-weight: 400;
}

/* Two-column body: order list left, calendar right */
.db-ws-body-split {
    display: flex;
    min-height: 0;
}
.db-ws-body-split .db-ws-rows {
    flex: 2;
    min-width: 0;
    border-right: 1px solid var(--db-border-soft);
}
.db-ws-cal-panel {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Mini calendar */
.db-cal-month-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--db-text-2);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
.db-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.db-cal-dow {
    font-size: 10px;
    font-weight: 600;
    color: var(--db-text-3);
    text-align: center;
    padding-bottom: 4px;
}
.db-cal-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--db-text-2);
    border-radius: 5px;
    cursor: default;
    line-height: 1;
}
.db-cal-empty { visibility: hidden; }
.db-cal-in-range {
    background: color-mix(in srgb, var(--db-confirmed) 12%, transparent);
    color: var(--db-text);
}
.db-cal-today {
    background: var(--db-confirmed);
    color: #fff !important;
    font-weight: 700;
    border-radius: 5px;
}
.db-cal-has-order { font-weight: 600; color: var(--db-text); }
.db-cal-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--db-confirmed);
    flex-shrink: 0;
}
.db-cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.db-cal-dots { display: flex; gap: 2px; justify-content: center; }
.db-cal-today .db-cal-dot { opacity: 0.85; }

.db-ws-rows {
    display: flex;
    flex-direction: column;
}

.db-ws-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--db-border-soft);
    font-size: 13px;
    transition: background 0.1s;
}
.db-ws-row:last-child { border-bottom: none; }
.db-ws-row:hover { background: var(--db-bg); }
.db-ws-row-clickable { cursor: pointer; }
.db-ws-row-clickable:hover { background: color-mix(in srgb, var(--db-confirmed) 8%, var(--db-bg)); }

.db-ws-customer {
    flex: 1;
    font-weight: 600;
    color: var(--db-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-ws-dest {
    font-weight: 400;
    color: var(--db-text-3);
}

.db-ws-am {
    font-size: 12px;
    color: var(--db-text-2);
    white-space: nowrap;
    min-width: 72px;
}

.db-ws-date {
    font-size: 12px;
    color: var(--db-text-3);
    white-space: nowrap;
    min-width: 76px;
}

.db-ws-part {
    font-size: 12px;
    color: var(--db-text-2);
    font-family: 'Sora', monospace;
    white-space: nowrap;
}

.db-ws-qty {
    font-weight: 600;
    color: var(--db-confirmed);
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.db-ws-empty {
    padding: 16px 20px;
    font-size: 12px;
    color: var(--db-text-3);
}

/* ── Yearly summary grid ───────────────────────────────────────────────────── */
.db-yr-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--db-border-soft);
    cursor: pointer;
    transition: background 0.1s;
}
.db-yr-row:last-child { border-bottom: none; }
.db-yr-row:hover { background: color-mix(in srgb, var(--db-confirmed) 8%, var(--db-bg)); }
.db-yr-row-current .db-yr-month { color: var(--db-confirmed); font-weight: 700; }

.db-yr-month {
    width: 84px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--db-text);
}

.db-yr-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--db-border-soft);
    border-radius: 3px;
    overflow: hidden;
}

.db-yr-bar {
    display: block;
    height: 100%;
    background: var(--db-confirmed);
    border-radius: 3px;
    transition: width 0.35s ease;
}

.db-yr-count {
    width: 72px;
    font-size: 11px;
    color: var(--db-text-3);
    text-align: right;
    flex-shrink: 0;
}

.db-yr-qty {
    width: 80px;
    font-size: 12px;
    font-weight: 600;
    color: var(--db-confirmed);
    text-align: right;
    flex-shrink: 0;
}

.db-yr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
    padding: 8px 20px 4px;
}
.db-yr-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--db-text-2);
    font-weight: 500;
}
.db-yr-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Header ── */
#dashboard .db-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

#dashboard .db-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--db-text);
    letter-spacing: -0.01em;
    line-height: 1;
    margin-bottom: 3px;
}

#dashboard .db-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: var(--db-text-3);
}

/* ── Filters ── */
#dashboard .db-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

#dashboard .db-filters select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--db-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239CA3AF'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid var(--db-border);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    color: var(--db-text-2);
    cursor: pointer;
    outline: none;
    min-width: 148px;
    height: 32px;
    transition: border-color 0.12s, color 0.12s;
}

#dashboard .db-filters select:hover  { border-color: #C4C4C8; color: var(--db-text); }
#dashboard .db-filters select:focus  { border-color: var(--db-confirmed); color: var(--db-text); }

#dashboard .db-filters button {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 6px;
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--db-text-2);
    cursor: pointer;
    padding: 0 12px;
    height: 32px;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
    white-space: nowrap;
}
#dashboard .db-filters button:hover { border-color: #C4C4C8; color: var(--db-text); background: #FAFAFA; }

/* ── Kanban board ── */
#dashboard .kanban-board {
    gap: 0;
    border: 1px solid var(--db-border);
    border-radius: 8px;
    background: var(--db-surface);
    overflow: hidden;
    padding-bottom: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

#dashboard .kanban-col {
    flex: 1 1 0;
    min-width: 185px;
    border-right: 1px solid var(--db-border);
}
#dashboard .kanban-col:last-child { border-right: none; }

/* Column headers */
#dashboard .kanban-col-header {
    background: var(--db-surface) !important;
    border-top: none !important;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--db-border-soft);
}

#dashboard .kanban-col-header > span:first-child {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--db-text);
    text-transform: none;
}

#dashboard .kanban-count {
    background: none !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
}

#dashboard .kanban-col-forecast    .kanban-count { color: var(--db-forecast);    background: #F4F4F6 !important; }
#dashboard .kanban-col-confirmed   .kanban-count { color: var(--db-confirmed);   background: #EFF6FF !important; }
#dashboard .kanban-col-inv-pending .kanban-count { color: var(--db-inv-pending); background: #FFFBEB !important; }
#dashboard .kanban-col-inv-sent    .kanban-count { color: var(--db-inv-sent);    background: #F0FDF4 !important; }

/* Column bodies */
#dashboard .kanban-col-body {
    background: var(--db-bg) !important;
    border: none !important;
    padding: 10px;
    gap: 6px;
    max-height: 480px;
}

/* Cards */
#dashboard .kanban-card {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    animation: db-card-in 0.2s ease both;
    animation-delay: calc(var(--card-i, 0) * 30ms);
    transition: border-color 0.12s, box-shadow 0.12s;
}

#dashboard .kanban-card:hover {
    border-color: #C4C4C8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

@keyframes db-card-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#dashboard .kanban-card-customer { font-size: 12px; font-weight: 600; color: var(--db-text); margin-bottom: 7px; }

#dashboard .kanban-card-table .kc-label {
    font-size: 11px;
    font-weight: 400;
    color: var(--db-text-3);
    padding: 1px 8px 1px 0;
    text-transform: none;
    letter-spacing: 0;
}

#dashboard .kanban-card-table .kc-value {
    font-size: 11px;
    font-weight: 500;
    color: var(--db-text);
    padding: 1px 0;
}

#dashboard .kanban-empty {
    font-size: 12px;
    color: var(--db-text-3);
    text-align: center;
    padding: 24px 8px;
}

/* ── Info bar ── */
#dashboard .db-info {
    margin-top: 16px;
    font-size: 11px;
    font-weight: 400;
    color: var(--db-text-3);
    line-height: 1.6;
}

/* ─── Payments Due This Month (dashboard) ─────────────────────── */
.db-payments-due-section {
    background: var(--db-card-bg, #fff);
    border: 1px solid var(--db-border, #e8edf3);
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 20px;
}
.db-payments-due-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.db-payments-due-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--db-text-1, #0f172a);
    letter-spacing: -0.01em;
}
.db-payments-due-month {
    font-size: 12px;
    color: var(--db-text-3, #8a9ab5);
    font-weight: 500;
}
.db-pd-empty {
    font-size: 13px;
    color: var(--db-text-3, #8a9ab5);
    padding: 8px 0;
}
.db-pd-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--db-border, #e8edf3);
}
.db-pd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.db-pd-table thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #5e7188;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--db-border, #e8edf3);
    white-space: nowrap;
}
.db-pd-table tbody td {
    padding: 7px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    white-space: nowrap;
}
.db-pd-table tbody tr:last-child td { border-bottom: none; }
.db-pd-customer-row td {
    background: #f8fafc !important;
    font-weight: 700;
    font-size: 12px;
    color: #374151;
    padding: 6px 12px;
    border-top: 1px solid #e2e8f0;
}
.db-pd-customer-row:first-child td { border-top: none; }
.db-pd-row td               { background: #fff; }
.db-pd-row-overdue td       { background: #fff8f8 !important; }
.db-pd-row-paid td          { background: #f0fdf4 !important; color: #64748b !important; }
.db-pd-paid-badge           { display: inline-block; font-size: 10px; font-weight: 600;
                              background: #dcfce7; color: #16a34a; border-radius: 4px;
                              padding: 1px 5px; margin-left: 5px; vertical-align: middle; }
.db-pd-indent               { padding-left: 24px !important; color: #64748b !important; }
.db-pd-tiles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.db-pd-tile {
    position: relative;
    border-radius: 8px;
    padding: 10px 40px 10px 16px;
    min-width: 150px;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
    user-select: none;
}
.db-pd-tile:hover  { filter: brightness(0.97); box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.db-pd-tile-overdue { background: #fff1f2; border: 1px solid #fca5a5; }
.db-pd-tile-due     { background: #fefce8; border: 1px solid #fde68a; }
.db-pd-tile-total   { background: #eff6ff; border: 1px solid #bfdbfe; }
.db-pd-tile-future  { background: #f0fdf4; border: 1px solid #bbf7d0; }

/* Upcoming months pane (inside expandable section) */
.db-pd-upcoming-body { display: flex; min-height: 80px; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.db-pd-month-list { width: 190px; flex-shrink: 0; border-right: 1px solid #e2e8f0; }
.db-pd-month-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 0.12s; }
.db-pd-month-item:last-child { border-bottom: none; }
.db-pd-month-item:hover { background: #f1f5f9; }
.db-pd-month-item.db-pd-month-selected { background: #f0fdf4; border-left: 3px solid #22c55e; padding-left: 11px; }
.db-pd-month-name { display: block; font-size: 13px; font-weight: 600; color: #1e293b; }
.db-pd-month-meta { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.db-pd-month-item.db-pd-month-selected .db-pd-month-name { color: #166534; }
.db-pd-future-panel { flex: 1; padding: 12px 16px; min-width: 0; overflow-x: auto; }
.db-pd-tile-label   { font-size: 11px; font-weight: 600; margin-bottom: 2px; }
.db-pd-tile-amount  { font-size: 17px; font-weight: 700; line-height: 1.1; }
.db-pd-tile-count   { font-size: 11px; margin-top: 2px; opacity: 0.7; }
.db-pd-tile-overdue .db-pd-tile-label,
.db-pd-tile-overdue .db-pd-tile-amount,
.db-pd-tile-overdue .db-pd-tile-count  { color: #991b1b; }
.db-pd-tile-due .db-pd-tile-label,
.db-pd-tile-due .db-pd-tile-amount,
.db-pd-tile-due .db-pd-tile-count      { color: #92400e; }
.db-pd-tile-total .db-pd-tile-label,
.db-pd-tile-total .db-pd-tile-amount,
.db-pd-tile-total .db-pd-tile-count    { color: #1d4ed8; }
.db-pd-tile-future .db-pd-tile-label,
.db-pd-tile-future .db-pd-tile-amount,
.db-pd-tile-future .db-pd-tile-count   { color: #166534; } /* reserved */
.db-pd-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 16px;
    transition: transform 0.2s;
    opacity: 0.5;
}
.db-pd-tile-open .db-pd-chevron { transform: translateY(-50%) rotate(90deg); opacity: 1; }
.db-pd-tile-open.db-pd-tile-overdue { border-color: #f87171; box-shadow: 0 0 0 2px #fee2e2; }
.db-pd-tile-open.db-pd-tile-due     { border-color: #fbbf24; box-shadow: 0 0 0 2px #fef9c3; }
.db-pd-tile-open.db-pd-tile-total   { border-color: #93c5fd; box-shadow: 0 0 0 2px #dbeafe; }
.db-pd-tile-open.db-pd-tile-future  { border-color: #4ade80; box-shadow: 0 0 0 2px #dcfce7; }
.db-pd-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    padding-left: 2px;
}
.db-pd-section-label-overdue { color: #991b1b; }

/* Days-remaining pill */
.db-days-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.db-days-overdue { background: #fee2e2; color: #991b1b; }
.db-days-today   { background: #fef9c3; color: #854d0e; }
.db-days-urgent  { background: #ffedd5; color: #9a3412; }
.db-days-ok      { background: #eff6ff; color: #1d4ed8; }

/* ── Customer Information master-detail ──────────────────────────────────── */
.ci-master-detail {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.ci-list-panel {
    width: 200px;
    flex-shrink: 0;
}
.ci-list-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.ci-name-list {
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;
}
.ci-name-list li {
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-2);
    color: var(--text);
    transition: background 0.12s;
}
.ci-name-list li:last-child  { border-bottom: none; }
.ci-name-list li:hover       { background: var(--bg); }
.ci-name-list li.ci-selected { background: #EFF6FF; font-weight: 600; color: var(--accent); }

.ci-detail-panel { flex: 1; min-width: 0; }
.ci-detail-panel .form-grid { margin-bottom: 16px; }

.ci-field-group { display: flex; flex-direction: column; gap: 12px; }

.ci-field-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 12px;
}
.ci-field-row label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    text-align: right;
}
.ci-field-row input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.ci-field-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.ci-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* ── Order Processing Sidebar ─────────────────────────────────────────────── */
.ow-layout {
    display: flex;
    gap: 0;
    min-height: 260px;
}
/* ── Order summary (frozen header) ───────────────────────────────────────── */
.ow-order-summary {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.ow-order-summary-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}
.ow-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 6px;
}
.ow-info-item {
    padding: 6px 9px 7px;
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 5px;
    min-width: 0;
}
.ow-info-item.ow-info-editable {
    background: #fff;
    border-color: #cbd5e1;
}
.ow-info-item.ow-info-editable:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px #eff6ff;
}
.ow-info-label {
    font-size: 9.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 3px;
    white-space: nowrap;
}
.ow-info-val {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 18px;
}
.ow-info-val-input {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    outline: none;
    min-height: 18px;
}
.ow-info-val-select {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    outline: none;
    cursor: pointer;
    min-height: 18px;
    -webkit-appearance: auto;
}

.ow-sidebar {
    width: 180px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 4px 0 16px;
}
.ow-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s, color 0.1s;
    user-select: none;
}
.ow-nav-item:hover {
    background: #f8fafc;
    color: var(--text);
}
.ow-nav-item.ow-nav-active {
    border-left-color: var(--accent);
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}
.ow-nav-item::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}
.ow-nav-item[data-section="order-details"]::before { display: none; }
.ow-nav-item.tl-done::before    { background: #22c55e; }
.ow-nav-item.tl-urgent::before  { background: #ef4444; }
.ow-nav-item.tl-warning::before { background: #f59e0b; }
.ow-nav-item.tl-pending::before { background: #94a3b8; }
.ow-nav-item.tl-inactive::before{ background: #e2e8f0; }
.ow-content {
    flex: 1;
    padding: 0 0 0 28px;
    min-width: 0;
}
.ow-section {
    padding: 4px 0;
}
.ow-section-header {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* ── Email distribution row (CI/PO and Invoice sections) ─────────────────── */
.ow-email-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.ow-email-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.ow-email-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}
.ow-email-chip {
    display: inline-block;
    font-size: 12px;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 2px 10px;
}
.ow-email-copy-btn {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ow-email-copy-btn:hover { background: #e2e8f0; }
.ow-email-btn {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.ow-email-btn:hover { background: #1d4ed8; }

/* ── Order Timeline ───────────────────────────────────────────────────────── */
.order-timeline {
    display: flex;
    align-items: flex-start;
    margin: 0 0 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 68px;
}
.tl-node {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}
.tl-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.tl-line {
    flex: 1;
    height: 2px;
    min-width: 16px;
    margin-top: 18px;
    align-self: flex-start;
    background: #e2e8f0;
}
/* Done — green */
.tl-done .tl-node  { background: #16a34a; color: #fff; }
.tl-done .tl-label { color: #16a34a; }
.tl-line.tl-done   { background: #16a34a; }
/* Urgent — red */
.tl-urgent .tl-node  { background: #fee2e2; color: #dc2626; border: 2px solid #fca5a5; }
.tl-urgent .tl-label { color: #dc2626; }
/* Pending — grey */
.tl-pending .tl-node  { background: #f1f5f9; color: #94a3b8; border: 2px solid #e2e8f0; }
.tl-pending .tl-label { color: #94a3b8; }
/* Warning — yellow (invoiced, before payment deadline) */
.tl-warning .tl-node  { background: #fefce8; color: #b45309; border: 2px solid #fde047; }
.tl-warning .tl-label { color: #b45309; }
/* Inactive — grey regardless of urgency (payment not yet applicable) */
.tl-inactive .tl-node  { background: #f8fafc; color: #cbd5e1; border: 2px solid #e2e8f0; }
.tl-inactive .tl-label { color: #cbd5e1; }
/* Clickable steps — pointer cursor + brightness on hover (filter avoids overflow clipping) */
.tl-clickable          { cursor: pointer; }
.tl-clickable .tl-node { transition: filter 0.15s; }
.tl-clickable:hover .tl-node { filter: brightness(0.82); }

/* ── Packing list drag-and-drop upload ────────────────────────────────────── */
.pl-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 12px;
    color: #64748b;
    user-select: none;
}
.pl-dropzone:hover, .pl-dropzone-active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #2563eb;
}
.pl-dropzone-loading {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #3b82f6;
    pointer-events: none;
}
.pl-dropzone-loading .pl-dropzone-text::after {
    content: " Parsing…";
}
.pl-dropzone-icon {
    color: inherit;
    opacity: 0.7;
}
.pl-dropzone-text {
    font-size: 13px;
    font-weight: 500;
}
.pl-dropzone-sub {
    font-size: 11px;
    opacity: 0.7;
}

.pl-upload-result {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.pl-result-file {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 12px;
}
.pl-result-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pl-result-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.pl-result-label {
    font-size: 11px;
    color: #94a3b8;
    min-width: 110px;
    flex-shrink: 0;
}
.pl-result-value {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.pl-result-missing {
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}
.pl-result-error {
    font-size: 12px;
    color: #dc2626;
}
.pl-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

/* ─── Open Invoices ───────────────────────────────────────────── */
.oi-customer-list-box {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
}
.oi-list-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
    user-select: none;
}
.oi-list-row:last-child { border-bottom: none; }
.oi-list-row:hover      { background: #f8fafc; }
.oi-list-row.selected   { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.oi-list-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2490ef;
    flex-shrink: 0;
    cursor: pointer;
}
.oi-selected-display {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    min-height: 80px;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
}
.oi-empty-hint  { color: #94a3b8; font-size: 13px; font-style: italic; }
.oi-selected-tag {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.oi-report-card { margin-top: 0; }
.oi-group-header td {
    background: #f1f5f9 !important;
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    padding: 8px 12px;
    letter-spacing: 0.01em;
}
.oi-group-overdue td {
    background: #fee2e2 !important;
    font-weight: 700;
    font-size: 13px;
    color: #991b1b;
    padding: 8px 12px;
}
.oi-total-tile {
    border-radius: 8px;
    padding: 10px 18px;
    min-width: 150px;
}
.oi-tile-overdue { background: #fff1f2; border: 1px solid #fca5a5; }
.oi-tile-due     { background: #fefce8; border: 1px solid #fde68a; }
.oi-tile-total   { background: #eff6ff; border: 1px solid #bfdbfe; }
.oi-tile-label  { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.oi-tile-amount { font-size: 18px; font-weight: 700; }
.oi-tile-overdue .oi-tile-label,  .oi-tile-overdue .oi-tile-amount  { color: #991b1b; }
.oi-tile-due     .oi-tile-label,  .oi-tile-due     .oi-tile-amount  { color: #92400e; }
.oi-tile-total   .oi-tile-label,  .oi-tile-total   .oi-tile-amount  { color: #1d4ed8; }
