/* ==========================================================================
   BOMBO RADYO ERP - GLOBAL STYLESHEET
   ========================================================================== */

:root {
    /* Brand Colors */
    --bombo-red: #d32f2f;
    --bombo-red-dark: #b71c1c;
    --bombo-red-bright: #cc0000;
    
    /* System Colors */
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --success: #2E7D32;
    --success-light: #e8f5e9;
    --warning: #F57C00;
    --warning-light: #fff3e0;
    --purple: #8E24AA;
    
    /* Neutrals */
    --bg-light: #e0e0e0;
    --bg-card: #f9f9f9;
    --text-dark: #333;
    --text-muted: #555;
    --border-color: #ccc;
    --border-light: #eee;
}

/* =========================================
   1. BASE & TYPOGRAPHY
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background: var(--bg-light); 
    margin: 0; 
    padding: 20px; 
    color: var(--text-dark); 
    font-size: 14px;
}

/* Special Body for Login/Offline screens */
body.auth-screen {
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 0;
}

/* =========================================
   2. LAYOUT & WRAPPERS
   ========================================= */
.wrapper { 
    max-width: 1400px; 
    margin: 0 auto; 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    border: 1px solid var(--border-color);
}

.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 3px solid var(--bombo-red); 
    padding-bottom: 15px; 
    margin-bottom: 25px; 
    flex-wrap: wrap; 
    gap: 15px;
}

.page-header h1 { 
    color: var(--bombo-red); 
    margin: 0; 
    font-size: 24px; 
    font-weight: 900; 
    text-transform: uppercase; 
}

.toolbar { 
    display: flex; 
    justify-content: space-between; 
    background: #f4f4f4; 
    padding: 15px; 
    border: 1px solid var(--border-color); 
    border-radius: 6px;
    margin-bottom: 20px; 
    align-items: center; 
    gap: 15px; 
    flex-wrap: wrap; 
}

/* =========================================
   3. COMPONENTS (BUTTONS & BADGES)
   ========================================= */
.btn { 
    padding: 10px 15px; 
    text-decoration: none; 
    font-size: 12px; 
    font-weight: bold; 
    border-radius: 4px; 
    border: none; 
    cursor: pointer; 
    display: inline-block; 
    text-align: center;
    transition: 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: white; }
.btn-submit { background: var(--success); color: white; width: 100%; padding: 12px; font-size: 14px; }
.btn-danger { background: var(--bombo-red); color: white; }
.btn-dark { background: #555; color: white; }

.badge { 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-size: 10px; 
    font-weight: bold; 
    color: white; 
    text-transform: uppercase; 
    white-space: nowrap; 
}
.badge-pending { background: var(--warning-light); color: #e65100; border: 1px solid #ffcc80; }
.badge-approved, .badge-won { background: var(--success-light); color: var(--success); border: 1px solid #a5d6a7; }
.badge-lost, .badge-bad { background: #ffebee; color: var(--bombo-red); border: 1px solid #ffcdd2; }
.badge-active { background: #e3f2fd; color: var(--primary); border: 1px solid #90caf9; }

/* =========================================
   4. FORMS & INPUTS
   ========================================= */
.form-group { margin-bottom: 15px; }
.form-group label { 
    display: block; 
    font-size: 12px; 
    font-weight: bold; 
    margin-bottom: 5px; 
    color: var(--text-muted); 
    text-transform: uppercase;
}
.form-control, .form-group input, .form-group select, .form-group textarea { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #aaa; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 13px; 
    font-family: inherit;
    transition: border 0.3s;
}
.form-control:focus, .form-group input:focus, .form-group select:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 5px rgba(25, 118, 210, 0.2); 
}

/* Alerts */
.alert { padding: 15px; border-radius: 4px; margin-bottom: 20px; font-size: 13px; font-weight: bold; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* =========================================
   5. TABLES
   ========================================= */
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { 
    background: #f4f4f4; 
    color: var(--text-muted); 
    font-weight: bold; 
    text-transform: uppercase; 
    font-size: 11px; 
}
tr:hover td { background: var(--bg-card); }

/* =========================================
   6. MODALS
   ========================================= */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.6); 
    overflow: hidden; 
}
.modal-content { 
    background: #fff; 
    margin: 5% auto; 
    padding: 25px; 
    width: 90%; 
    max-width: 600px; 
    border-radius: 6px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    position: relative; 
    max-height: 90vh; 
    overflow-y: auto;
}
.close { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; position: absolute; top: 15px; right: 20px; }
.close:hover { color: var(--bombo-red); }

/* =========================================
   7. DASHBOARD CARDS & GRIDS
   ========================================= */
.analytics-grid, .kpi-grid, .stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 15px; 
    margin-bottom: 20px; 
}
.stat-card, .kpi-card { 
    background: #fff; 
    border: 1px solid var(--border-light); 
    border-radius: 6px; 
    padding: 20px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--border-color);
}
.stat-card h3, .kpi-card h3 { 
    margin: 0 0 5px 0; 
    font-size: 11px; 
    text-transform: uppercase; 
    color: var(--text-muted); 
}
.stat-card .amount, .kpi-card .amount { margin: 0; font-size: 26px; font-weight: 900; color: var(--text-dark); }

/* Progress Bars */
.progress-container { width: 100%; margin-top: 15px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 10px; font-weight: bold; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.progress-bg { background: rgba(0,0,0,0.1); height: 8px; border-radius: 4px; overflow: hidden; width: 100%; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease-in-out; background: var(--primary); }

/* =========================================
   8. PRINT MEDIA QUERIES
   ========================================= */
@media print { 
    .no-print { display: none !important; } 
    body, .wrapper { background: #fff; padding: 0; margin: 0; box-shadow: none; border: none; max-width: 100%; }
    table { width: 100%; }
    th { color: #000; background: #f4f4f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    td { border: 1px solid #ccc; }
    .stat-card, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}