/* ==========================================================================
   MobileVault Wholesaler PWA - Design System & UI/UX Styling
   Refined Card Margins, Inner Paddings, Fluid Typography & Spacing
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-card-hover: #1c263f;
    --bg-input: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #38bdf8;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent & Status Colors */
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.35);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #06b6d4;
    --online-badge: #38bdf8;
    --cash-badge: #34d399;

    /* Spacing & Radii */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    /* Shadows & Effects */
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(21, 29, 48, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Global Reset & Base Setup
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Page Views System (SPA Switching)
   -------------------------------------------------------------------------- */
.page-view {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 18px 16px 100px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fadeIn 0.2s ease-in-out;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.subpage-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.subpage-header h2 {
    font-size: 1.2rem;
}

.back-btn {
    background: rgba(255, 255, 255, 0.08);
    border: var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.back-btn:active {
    background: var(--primary);
}

.subpage-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --------------------------------------------------------------------------
   1. PIN Security Lock Screen
   -------------------------------------------------------------------------- */
.page-view.pin-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: 100%;
    margin: 0;
    padding: 32px 20px;
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-main) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    overflow-y: auto;
    box-sizing: border-box;
}

.pin-card {
    width: 100%;
    max-width: 380px;
    margin: auto;
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pin-brand .brand-icon {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.pin-brand h2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pin-brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pin-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pin-prompt span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pin-dots {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.pin-dots .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: var(--transition-fast);
}

.pin-dots .dot.filled {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    transform: scale(1.15);
}

.pin-error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 20px;
}

.pin-error-shake {
    animation: shake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.key-btn {
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: var(--border-color);
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.key-btn:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.95);
}

.key-action {
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.03);
}

.pin-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   2. Main Layout & Header
   -------------------------------------------------------------------------- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.pwa-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   3. Metrics Grid
   -------------------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.metric-card {
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.card-stock::before { background: var(--primary); }
.card-repair::before { background: var(--warning); }
.card-payable::before { background: var(--danger); }
.card-receivable::before { background: var(--success); }

.metric-card:active {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.metric-icon {
    font-size: 1.6rem;
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.metric-info h3 {
    font-size: 1.25rem;
    margin-top: 3px;
}

/* --------------------------------------------------------------------------
   4. Action Dock
   -------------------------------------------------------------------------- */
.action-dock {
    display: flex;
    flex-direction: column;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-hero {
    width: 100%;
    padding: 18px;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: var(--border-color);
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

.btn:active {
    transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   5. Search & Filters
   -------------------------------------------------------------------------- */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: var(--border-color);
    color: var(--text-primary);
    padding: 14px 40px 14px 46px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.clear-search {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    white-space: nowrap;
    background: var(--bg-card);
    border: var(--border-color);
    color: var(--text-secondary);
    padding: 9px 16px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.chip-alert.active {
    background: var(--danger);
    border-color: var(--danger);
}

/* --------------------------------------------------------------------------
   6. Inventory Stock Cards List
   -------------------------------------------------------------------------- */
.inventory-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
}

.results-badge {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.device-card {
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.device-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pill-stock { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-repair { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-sold { background: rgba(56, 189, 248, 0.12); color: var(--online-badge); border: 1px solid rgba(56, 189, 248, 0.3); }

.imei-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.imei-badge {
    font-family: monospace;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.party-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.84rem;
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.party-item {
    display: flex;
    flex-direction: column;
}

.party-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.party-val {
    font-weight: 600;
}

.financial-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.financial-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
}

.text-danger { color: var(--danger); font-weight: 700; }
.text-success { color: var(--success); font-weight: 700; }

.progress-bar-bg {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    border-radius: var(--radius-full);
}

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}

.card-btn {
    flex: 1;
    padding: 11px 10px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.empty-state {
    text-align: center;
    padding: 42px 24px;
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   7. Form Cards & Inputs
   -------------------------------------------------------------------------- */
.page-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-card {
    background: var(--bg-card);
    border: var(--border-color);
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-card);
}

.form-card-title {
    font-size: 1.05rem;
    color: var(--primary);
    border-bottom: var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 480px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

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

.form-group label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background: var(--bg-input);
    border: var(--border-color);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    width: 100%;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-input);
    padding: 5px;
    border-radius: var(--radius-sm);
    gap: 6px;
}

.segment {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.segment input {
    display: none;
}

.segment:has(input:checked) {
    background: var(--primary);
    color: #fff;
}

.live-balance-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-top: 4px;
}

.balance-danger { background: var(--danger-bg); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.balance-success { background: var(--success-bg); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }

.selected-device-summary {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 16px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.page-form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   8. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 380px;
}

.toast {
    background: #1e293b;
    color: #fff;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    animation: slideUp 0.25s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   9. Responsive Breakpoints (Mobile, Tablet, Desktop)
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
    .page-view {
        max-width: 840px;
        padding: 24px 24px 120px 24px;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .page-form-actions {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 14px;
    }

    .card-top {
        align-items: center;
    }

    .detail-deal-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
}

@media (min-width: 1024px) {
    .page-view {
        max-width: 960px;
    }

    .app-header {
        padding: 18px 24px;
    }

    .metric-card {
        padding: 20px;
    }

    .metric-info h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .app-header {
        padding: 10px 12px;
        gap: 6px;
    }

    .app-logo {
        font-size: 1.05rem;
    }

    .pwa-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .header-right {
        gap: 4px;
    }

    .header-right .btn-sm {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .page-view {
        padding: 12px 10px;
    }

    .pin-card {
        padding: 22px 16px;
    }

    .key-btn {
        height: 52px;
        font-size: 1.2rem;
    }

    .party-info-row {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-btn {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   10. Whole History & Date Range Filter Styling
   -------------------------------------------------------------------------- */
.date-filter-box {
    background: rgba(15, 23, 42, 0.6);
    border: var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.date-filter-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.active-date-tag {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.12);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.date-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.custom-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.custom-date-inputs input[type="date"] {
    background: var(--bg-input);
    border: var(--border-color);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.history-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.hmetric-card {
    background: var(--bg-card);
    border: var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hmetric-highlight {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
}

.hmetric-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.hmetric-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-card {
    background: var(--bg-card);
    border: var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    border-left: 4px solid var(--primary);
}

.timeline-card-purchase { border-left-color: var(--primary); }
.timeline-card-sale { border-left-color: var(--accent); }
.timeline-card-supplier_payment { border-left-color: var(--danger); }
.timeline-card-buyer_payment { border-left-color: var(--success); }
.timeline-card-repair_send { border-left-color: var(--warning); }

.timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-title {
    font-size: 0.96rem;
    font-weight: 700;
}

.timeline-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.timeline-amount {
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}


