/* ==========================================================================
   SJM LABS ENTERPRISE PORTAL - MASTER STYLESHEET
   Version: 4.5.2
   Author: SJM Internal Systems
   Description: Global styles for Sales & Operations Dashboard
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & THEME CONFIGURATION
   -------------------------------------------------------------------------- */
:root {
    /* -- BRAND IDENTITY COLORS -- */
    /* Primary Purple: Used for Headers, Active States, Main Buttons */
    --primary: #64003C;       
    
    /* Accent Magenta: Used for 'Upsell' highlights, Alerts, CTAs */
    --accent: #78003C;        
    
    /* Corporate Navy: Used for Backgrounds, Footer, Deep text */
    --navy: #0F2C5C;          
    
    /* Trust Blue: Used for Links, Info badges, Secondary buttons */
    --blue: #2A4D9B;          
    
    /* Neutral Grey: Used for Borders, De-emphasized text */
    --grey: #B1BCC3;          
    
    /* -- UI COLORS -- */
    --bg-body: #f4f6f9;       /* Light Blue-Grey Background */
    --bg-card: #ffffff;       /* Pure White Card Background */
    --text-main: #333333;     /* Dark Grey Text (easier on eyes than black) */
    --text-muted: #777777;    /* Meta data text */
    --border-light: #e1e4e8;  /* Subtle dividers */
    
    /* -- STATUS INDICATORS -- */
    --success: #28a745;       /* Sales Wins, Online Status */
    --warning: #ffc107;       /* Pending Actions */
    --danger: #dc3545;        /* Critical Alerts, Downtime */
    --info: #17a2b8;          /* General Info */

    /* -- SPACING & LAYOUT -- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --container-width: 1200px;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--navy);
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
    text-decoration: underline;
}

p { margin-bottom: 1rem; }

/* --------------------------------------------------------------------------
   3. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    flex: 1; /* Pushes footer down */
}

/* Grid System Helper */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* Spacing Helpers */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.p-20 { padding: 20px; }

/* --------------------------------------------------------------------------
   4. NAVIGATION BAR (Global)
   -------------------------------------------------------------------------- */
.navbar {
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-brand:hover { color: #f0f0f0; text-decoration: none; }

.navbar-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-link.active {
    color: white;
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

/* User Profile in Nav */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
    padding: 5px 15px;
    border-radius: 20px;
}
.user-avatar {
    width: 25px;
    height: 25px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   5. COMPONENT: CARDS
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--navy);
}

/* Card Variations */
.card-highlight {
    border-top: 4px solid var(--primary);
}
.card-alert {
    border-left: 4px solid var(--accent);
    background-color: #fff9fc;
}

/* --------------------------------------------------------------------------
   6. COMPONENT: BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(100, 0, 60, 0.3);
}
.btn-primary:hover { background-color: #4a002c; color: white; }

.btn-secondary {
    background-color: var(--blue);
    color: white;
}
.btn-secondary:hover { background-color: #1a3a80; color: white; }

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background-color: var(--primary); color: white; }

.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.2rem; }
.btn-block { display: block; width: 100%; }

/* --------------------------------------------------------------------------
   7. COMPONENT: FORMS & INPUTS
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 15px; }

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--navy);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--grey);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(100, 0, 60, 0.1);
}

/* Search Box Specifics */
.search-wrapper {
    position: relative;
    max-width: 100%;
}
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}
.search-input-lg {
    padding-left: 45px;
    border-radius: 50px;
    border: 2px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   8. COMPONENT: TABLES
   -------------------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: white;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background-color: #f8f9fa;
    color: var(--navy);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: #f1f1f1;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* --------------------------------------------------------------------------
   9. COMPONENT: BADGES & ALERTS
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary { background-color: var(--primary); color: white; }
.badge-success { background-color: var(--success); color: white; }
.badge-warning { background-color: var(--warning); color: #212529; }
.badge-danger { background-color: var(--danger); color: white; }
.badge-info { background-color: var(--info); color: white; }

.alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* --------------------------------------------------------------------------
   10. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--navy);
    color: var(--grey);
    padding: 40px 0 20px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand h4 { color: white; margin-bottom: 10px; }
.footer-links a { display: block; color: var(--grey); margin-bottom: 5px; }
.footer-links a:hover { color: white; }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   11. UTILITIES & ANIMATIONS
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

.hidden { display: none !important; }

/* Animation: Fade In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* --------------------------------------------------------------------------
   12. RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .container { max-width: 960px; }
}

@media (max-width: 768px) {
    .navbar-menu { display: none; /* Hide standard menu on mobile */ }
    /* You would typically add a hamburger menu toggle here */
    
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .card { padding: 15px; }
    .container { padding: 0 15px; }
}

@media (print) {
    .navbar, .site-footer, .btn { display: none; }
    body { background: white; color: black; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}