/* ==========================================================================
   ToolSphare Business & Everyday Workflow Tools — Unified Stylesheet
   Covers Customer Credit Ledger, Shared Expense Settlement, Receipt Bookkeeper,
   Stock Expiry Tracker, Payment Reconciler, and Household Bill Calendar.
   ========================================================================== */

:root {
    --biz-bg-card: rgba(15, 23, 42, 0.85);
    --biz-bg-elevated: rgba(30, 41, 59, 0.7);
    --biz-bg-glass: rgba(15, 23, 42, 0.55);
    --biz-border: rgba(148, 163, 184, 0.16);
    --biz-border-hover: rgba(59, 130, 246, 0.45);
    --biz-primary: #3b82f6;
    --biz-primary-hover: #2563eb;
    --biz-primary-glow: rgba(59, 130, 246, 0.35);
    --biz-success: #10b981;
    --biz-success-glow: rgba(16, 185, 129, 0.25);
    --biz-warning: #f59e0b;
    --biz-danger: #ef4444;
    --biz-danger-glow: rgba(239, 68, 68, 0.25);
    --biz-purple: #8b5cf6;
    --biz-cyan: #06b6d4;
    --biz-text-main: #f8fafc;
    --biz-text-muted: #94a3b8;
    --biz-text-dim: #64748b;
    --biz-radius-lg: 16px;
    --biz-radius-md: 10px;
    --biz-radius-sm: 6px;
    --biz-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
}

.biz-suite-tool {
    max-width: 1140px;
    margin: 0 auto;
    color: var(--biz-text-main);
    font-family: inherit;
}

/* Trust Header Badges */
.biz-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.biz-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #93c5fd;
    letter-spacing: 0.01em;
}
.biz-trust-pill.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}
.biz-trust-pill.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

/* Country Selector Toolbar */
.biz-country-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: var(--biz-bg-card);
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--biz-shadow);
}
.biz-country-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.biz-country-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--biz-text-muted);
}
.biz-country-select {
    padding: 0.45rem 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--biz-radius-sm);
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}
.biz-country-select:focus {
    border-color: var(--biz-primary);
    box-shadow: 0 0 0 2px var(--biz-primary-glow);
}
.biz-sample-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--biz-radius-sm);
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.biz-sample-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
    color: #fff;
    transform: translateY(-1px);
}

/* KPI Summary Cards */
.biz-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.biz-kpi-card {
    padding: 1.15rem 1.25rem;
    background: var(--biz-bg-card);
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius-md);
    box-shadow: var(--biz-shadow);
    transition: border-color 0.2s ease;
}
.biz-kpi-card:hover {
    border-color: var(--biz-border-hover);
}
.biz-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--biz-text-muted);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.biz-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
}
.biz-kpi-card.green .biz-kpi-value { color: #34d399; }
.biz-kpi-card.red .biz-kpi-value { color: #f87171; }
.biz-kpi-card.amber .biz-kpi-value { color: #fbbf24; }
.biz-kpi-card.blue .biz-kpi-value { color: #60a5fa; }
.biz-kpi-sub {
    font-size: 0.75rem;
    color: var(--biz-text-dim);
    margin-top: 0.25rem;
}

/* Main Workspace Card */
.biz-panel {
    background: var(--biz-bg-card);
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius-lg);
    box-shadow: var(--biz-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.biz-panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--biz-border);
    margin-bottom: 1.25rem;
}
.biz-panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.biz-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Buttons */
.biz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--biz-radius-sm);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
}
.biz-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--biz-primary-glow);
}
.biz-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--biz-primary-glow);
}
.biz-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--biz-success-glow);
}
.biz-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}
.biz-btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}
.biz-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}
.biz-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.biz-btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
}

/* Forms & Inputs */
.biz-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.biz-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.biz-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--biz-text-muted);
}
.biz-input, .biz-select, .biz-textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--biz-radius-sm);
    color: #f8fafc;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.biz-input:focus, .biz-select:focus, .biz-textarea:focus {
    border-color: var(--biz-primary);
    box-shadow: 0 0 0 2px var(--biz-primary-glow);
    background: rgba(15, 23, 42, 0.9);
}

/* Tables */
.biz-table-wrapper {
    overflow-x: auto;
    border-radius: var(--biz-radius-md);
    border: 1px solid var(--biz-border);
    margin-bottom: 1.25rem;
    background: rgba(15, 23, 42, 0.4);
}
.biz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
    white-space: nowrap;
}
.biz-table th {
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--biz-border);
}
.biz-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}
.biz-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.45);
}
.biz-table td.num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Status Badges */
.biz-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.biz-badge.green {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}
.biz-badge.red {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.biz-badge.amber {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}
.biz-badge.blue {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}
.biz-badge.purple {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
}

/* Empty State */
.biz-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--biz-text-dim);
}
.biz-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.45;
}
.biz-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Tab Navigation */
.biz-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--biz-border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}
.biz-tab {
    padding: 0.65rem 1.15rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--biz-text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.biz-tab:hover {
    color: #f8fafc;
}
.biz-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Modals */
.biz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.biz-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.biz-modal {
    background: #0f172a;
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.biz-modal-overlay.active .biz-modal {
    transform: scale(1);
}
.biz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--biz-border);
    margin-bottom: 1.25rem;
}
.biz-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}
.biz-modal-close {
    background: transparent;
    border: none;
    color: var(--biz-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.biz-modal-close:hover {
    color: #ffffff;
}

/* Printable / PDF Window Formatting */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .biz-trust-row, .biz-country-bar, .biz-panel-actions, .biz-sample-btn, .biz-btn {
        display: none !important;
    }
    .biz-panel, .biz-kpi-card {
        background: transparent !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        color: #000000 !important;
    }
    .biz-table th {
        background: #f1f5f9 !important;
        color: #000000 !important;
    }
    .biz-table td {
        color: #000000 !important;
    }
}
