html, body {
    height: 100%;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url('../images/Logo.svg');
    mask: url('../images/Logo.svg');
    mask-position: center;
    mask-repeat: no-repeat;
    width: 180px;
    height: 24px;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* =========================================================
   HỘ KINH DOANH MINH TRÂN - MODERN EXECUTIVE UI SYSTEM
   ========================================================= */

.hokd-order-actionbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.hokd-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
    gap: 12px;
    margin: 4px 0 10px 0;
}

.hokd-kpi-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hokd-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.hokd-kpi-card.accent-blue   { border-left-color: #2563eb; }
.hokd-kpi-card.accent-teal   { border-left-color: #0d9488; }
.hokd-kpi-card.accent-indigo { border-left-color: #4f46e5; }
.hokd-kpi-card.accent-purple { border-left-color: #7c3aed; }
.hokd-kpi-card.accent-orange { border-left-color: #ea580c; }
.hokd-kpi-card.accent-green  { border-left-color: #16a34a; background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%); }
.hokd-kpi-card.accent-red    { border-left-color: #dc2626; background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%); }

.hokd-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.hokd-kpi-value {
    font-size: 1.32rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.hokd-kpi-value .unit {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.hokd-kpi-sub {
    font-size: 0.78rem;
    color: #475569;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.text-green  { color: #15803d !important; }
.text-red    { color: #dc2626 !important; }
.text-orange { color: #c2410c !important; }
.muted       { color: #64748b !important; }
.bold        { font-weight: 700 !important; }

.hokd-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warn    { background: #ffedd5; color: #9a3412; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

/* Partner Info Strip inside Order View */
.hokd-partner-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    padding: 8px 14px;
    margin-bottom: 10px;
    font-size: 0.83rem;
    color: #1e293b;
}

.hokd-partner-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Expense Payment Voucher Banner (Phiếu chi) */
.hokd-voucher-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #cbd5e1;
    border-left: 5px solid #1e3a8a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.hokd-voucher-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 260px;
}

.hokd-voucher-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hokd-voucher-type {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.hokd-voucher-type.is-order {
    background: #dbeafe;
    color: #1e3a8a;
}

.hokd-voucher-type.is-general {
    background: #fef3c7;
    color: #92400e;
}

.hokd-voucher-reason {
    font-size: 0.92rem;
    color: #0f172a;
}

.hokd-voucher-sep {
    color: #94a3b8;
    margin: 0 4px;
}

.hokd-voucher-words {
    font-size: 0.86rem;
    color: #15803d;
    font-weight: 600;
}

.hokd-voucher-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.hokd-voucher-amount-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #64748b;
}

.hokd-voucher-amount {
    font-size: 1.65rem;
    font-weight: 800;
    color: #b91c1c;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.hokd-voucher-amount .unit {
    font-size: 0.95rem;
    color: #64748b;
}

.hokd-voucher-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Unit Business Info Live Preview Card */
.hokd-unit-preview-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 4px solid #1e3a8a;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.hokd-unit-preview-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e40af;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.hokd-unit-preview-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.hokd-unit-preview-name {
    font-size: 1.18rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.hokd-unit-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 4px;
}

.hokd-unit-preview-addr {
    font-size: 0.85rem;
    color: #475569;
}

.hokd-unit-preview-banks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.83rem;
}

.hokd-bank-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dashboard & 3-Slip Preview */
.hokd-dashboard, .hokd-preview-container {
    padding: 6px 4px 24px 4px;
}

.hokd-dash-topbar, .hokd-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hokd-dash-heading {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e3a8a;
}

.hokd-dash-subtitle {
    font-size: 0.84rem;
    color: #64748b;
    margin-top: 2px;
}

.hokd-preview-title {
    font-size: 0.95rem;
    color: #1e293b;
}

.hokd-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.hokd-preset-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hokd-pill {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.hokd-pill:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.hokd-pill.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
}

.hokd-filter-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.83rem;
    font-weight: 600;
    color: #475569;
}

.hokd-input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.84rem;
    background: #ffffff;
    color: #0f172a;
}

.hokd-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.justify-center { justify-content: center; }

.hokd-btn {
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 7px 13px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.hokd-btn:hover { opacity: 0.92; }
.hokd-btn:active { transform: scale(0.99); }

.hokd-btn-xs {
    border: none;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
}

.btn-primary { background: #1d4ed8; color: #ffffff; }
.btn-indigo  { background: #4338ca; color: #ffffff; }
.btn-emerald { background: #15803d; color: #ffffff; }
.btn-orange  { background: #c2410c; color: #ffffff; }
.btn-outline { background: #ffffff; color: #1e293b; border-color: #cbd5e1; }
.btn-outline:hover { background: #f1f5f9; }

.hokd-two-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 16px;
}

.mt-16 { margin-top: 16px; }

.hokd-sheet-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.hokd-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.hokd-sheet-header h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: #1e3a8a;
}

.hokd-sheet-sub {
    font-size: 0.78rem;
    color: #64748b;
}

.hokd-table-wrap {
    overflow-x: auto;
}

.hokd-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}

.hokd-excel-table thead th {
    background: #1e3a8a;
    color: #ffffff;
    font-weight: 700;
    padding: 8px 10px;
    border: 1px solid #334155;
    text-align: left;
    white-space: nowrap;
}

.hokd-excel-table thead th.col-highlight-hdr {
    background: #15803d;
}

.hokd-excel-table tbody td {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.hokd-excel-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.hokd-excel-table tbody tr:hover {
    background: #eff6ff;
}

.hokd-excel-table td.col-highlight {
    background: #f0fdf4;
    color: #14532d;
}

.hokd-excel-table tfoot td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
}

.hokd-excel-table .num    { text-align: right !important; }
.hokd-excel-table .center { text-align: center !important; }
.hokd-excel-table .right  { text-align: right !important; }

.hokd-excel-table tr.row-total td {
    background: #eff6ff;
    font-weight: 800;
    color: #1e3a8a;
}

.hokd-excel-table tr.row-sub td {
    background: #ffffff;
    font-weight: 600;
}

.hokd-excel-table tr.row-grand-amber td {
    background: #fef9c3;
    font-weight: 800;
    font-size: 0.92rem;
    color: #854d0e;
}

.hokd-excel-table tr.row-grand-green td {
    background: #dcfce7;
    font-weight: 800;
    font-size: 0.92rem;
    color: #14532d;
}

.hokd-excel-table tr.row-surplus td {
    background: #fff7ed;
    font-weight: 800;
    color: #c2410c;
}

.hokd-link {
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

.hokd-link:hover {
    text-decoration: underline;
}

/* Visual Daily Bars */
.hokd-chart-bars {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hokd-bar-row {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 12px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.hokd-bar-date {
    font-weight: 700;
    font-size: 0.84rem;
    color: #334155;
}

.hokd-bar-tracks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hokd-bar-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
}

.bar-tag {
    width: 34px;
    color: #64748b;
    font-weight: 600;
}

.bar-fill {
    height: 10px;
    border-radius: 5px;
    min-width: 4px;
}

.bg-blue  { background: #3b82f6; }
.bg-teal  { background: #0d9488; }
.bg-green { background: #16a34a; }

.bar-num {
    font-variant-numeric: tabular-nums;
    color: #1e293b;
}

/* =========================================================
   PARTNER DEBT STATEMENT (BẢNG SAO KÊ & ĐỐI CHIẾU CÔNG NỢ)
   ========================================================= */
.hokd-statement-controls {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.hokd-statement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.hokd-period-row {
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.hokd-options-row {
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    justify-content: flex-start;
    gap: 24px;
}

.hokd-ctrl-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hokd-ctrl-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.hokd-select-partner {
    min-width: 320px;
    font-weight: 700;
    border-color: #93c5fd;
    background: #f8fafc;
}

.hokd-check-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.83rem;
    color: #334155;
    cursor: pointer;
}

.hokd-statement-paper {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-top: 5px solid #1e3a8a;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
}

.hokd-paper-action-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 9px;
    padding: 10px 14px;
    margin-bottom: 18px;
}

.hokd-paper-action-strip.is-bottom {
    margin-bottom: 0;
    margin-top: 18px;
}

.hokd-paper-action-hint {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e3a8a;
}

.hokd-statement-paper .hokd-excel-table {
    font-size: 0.8rem;
}

.hokd-statement-paper .hokd-excel-table thead th,
.hokd-statement-paper .hokd-excel-table tbody td,
.hokd-statement-paper .hokd-excel-table tfoot td {
    padding: 6px 7px;
}

.hokd-paper-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.hokd-paper-seller, .hokd-paper-buyer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px 16px;
}

.hokd-paper-buyer {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.hokd-paper-tag {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.hokd-paper-org {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.hokd-paper-line {
    font-size: 0.83rem;
    color: #334155;
    line-height: 1.45;
}

.hokd-paper-title-block {
    text-align: center;
    margin: 18px 0 16px 0;
}

.hokd-paper-title-block h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: 0.02em;
}

.hokd-paper-period {
    font-size: 0.86rem;
    color: #475569;
    margin-top: 4px;
}

.hokd-balance-summary-box {
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 16px;
}

.hokd-bal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.hokd-bal-item:nth-child(even) {
    background: #f8fafc;
}

.hokd-bal-item.is-closing {
    background: #fef9c3;
    color: #1e3a8a;
    font-size: 0.96rem;
    font-weight: 800;
    border-bottom: none;
}

.hokd-paper-section-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.hokd-paper-grand-box {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-left: 5px solid #ca8a04;
    border-radius: 9px;
    padding: 14px 18px;
}

.hokd-grand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #1e3a8a;
}

.hokd-grand-number {
    font-size: 1.38rem;
    color: #b91c1c;
    font-variant-numeric: tabular-nums;
}

.hokd-grand-words {
    font-size: 0.88rem;
    color: #334155;
    margin-top: 4px;
    font-weight: 600;
}

.hokd-paper-surplus-note {
    margin-top: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: #9a3412;
}

.hokd-paper-bank-box {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.55;
}

.hokd-paper-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 26px;
    padding-bottom: 12px;
    text-align: center;
}

.hokd-paper-signatures .sig-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
}

.hokd-paper-signatures .sig-sub {
    font-size: 0.8rem;
    font-style: italic;
    color: #64748b;
    margin-bottom: 48px;
}

.hokd-paper-signatures .sig-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}
