@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* --- UPDATED THEME COLORS (White, Blue, Red) --- */
    --primary: #2563EB;       /* Royal Blue (Logo Left Side) */
    --primary-glow: rgba(37, 99, 235, 0.2);
    --primary-dark: #1D4ED8;
    
    /* Backgrounds - Light Theme */
    --bg-body: #F3F4F6;       /* Light Gray Background */
    --bg-panel: #FFFFFF;      /* White Panels */
    --bg-input: #FFFFFF;      /* White Input Boxes */
    --border: #E5E7EB;        /* Light Gray Border */
    
    /* Text Colors */
    --text-main: #1F2937;     /* Dark Gray Text (Main Color) */
    --text-secondary: #6B7280;/* Gray Secondary Text */
    
    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;        /* Red (Matches Logo Right Side) */
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main) !important; /* Force Dark Text */
    height: 100vh; 
    overflow: hidden; 
    font-size: 14px; 
}

/* --- FIX: Force Dark Text on Generic Elements --- */
p, h1, h2, h3, h4, h5, h6, span, div, td, th, a {
    color: inherit; /* Inherit from body (which is forced dark) */
}

/* --- APP LAYOUT --- */
.app-container { display: flex; height: 100vh; width: 100%; }

/* --- SIDEBAR --- */
.sidebar { 
    width: 250px; 
    background: var(--bg-panel); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    padding: 20px 15px; 
    flex-shrink: 0; 
    z-index: 20; 
    color: var(--text-main); /* Ensure sidebar text is dark */
}

.brand { 
    height: 60px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 30px; 
    border-bottom: 1px solid var(--border); 
}

.brand img { height: 55px; width: auto; object-fit: contain; }

.menu-label { 
    font-size: 11px; 
    text-transform: uppercase; 
    color: var(--text-secondary) !important; /* Keep this gray */
    font-weight: 700; 
    margin-bottom: 10px; 
    margin-top: 20px; 
    padding-left: 10px; 
}

.nav-link { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px 12px; 
    color: var(--text-secondary) !important; /* Default gray */
    text-decoration: none; 
    border-radius: 6px; 
    margin-bottom: 4px; 
    transition: 0.2s; 
    font-weight: 500; 
}

.nav-link:hover { 
    background: #EFF6FF; /* Very Light Blue Hover */
    color: var(--primary) !important; /* Blue text on hover */
}

.nav-link.active { 
    background: var(--primary); 
    color: #ffffff !important; /* Force White text on Active */
    font-weight: 600; 
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.nav-link i { width: 18px; text-align: center; }

/* --- MAIN CONTENT --- */
.main-content { flex: 1; display: flex; flex-direction: column; background: var(--bg-body); overflow: hidden; }

/* --- HEADER --- */
.top-bar { 
    height: 64px; 
    background: var(--bg-panel); 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 30px; 
    flex-shrink: 0; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.page-title h2 { font-size: 18px; font-weight: 600; color: var(--text-main) !important; }
.page-title span { font-size: 12px; color: var(--text-secondary) !important; display: block; margin-top: 2px; }

.search-box { position: relative; width: 300px; }
.search-box input { 
    width: 100%; 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    padding: 8px 12px 8px 35px; 
    border-radius: 6px; 
    color: var(--text-main) !important; /* Dark text in search */
    font-size: 13px; 
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-size: 12px; }

/* --- USER PROFILE & DROPDOWN --- */
.user-actions { display: flex; align-items: center; gap: 20px; position: relative; }
.icon-btn { background: none; border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; }
.icon-btn:hover { color: var(--primary); }

.user-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.user-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    /* Avatar Gradient: Blue to Red to match logo */
    background: linear-gradient(135deg, var(--primary), var(--danger)); 
    color: #fff !important; /* Force White */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 12px; 
    border: 2px solid #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

.user-meta { text-align: right; }
.user-meta .name { display: block; font-size: 13px; font-weight: 600; color: var(--text-main) !important; }
.user-meta .role { display: block; font-size: 11px; color: var(--text-secondary) !important; }

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    width: 180px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    display: none;
    z-index: 100;
    overflow: hidden;
}
.dropdown-menu.show { display: block; animation: fadeIn 0.2s ease; }
.dropdown-item { padding: 12px 15px; display: block; color: var(--text-main) !important; text-decoration: none; font-size: 13px; transition: 0.2s; border-bottom: 1px solid rgba(0,0,0,0.05); }
.dropdown-item:hover { background: #EFF6FF; color: var(--primary) !important; }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item i { margin-right: 8px; width: 16px; text-align: center; color: var(--text-secondary); }
.dropdown-item:hover i { color: var(--primary) !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* --- DASHBOARD CONTENT --- */
.content-scroll { flex: 1; overflow-y: auto; padding: 30px; color: var(--text-main); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }

.stat-card { 
    background: var(--bg-panel); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}

.stat-info h3 { font-size: 12px; color: var(--text-secondary) !important; text-transform: uppercase; margin-bottom: 5px; }
.stat-info .value { font-size: 24px; font-weight: 700; color: var(--text-main) !important; }

.stat-icon { 
    width: 40px; 
    height: 40px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
    background: #EFF6FF; 
    color: var(--primary) !important; 
}

.card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.card-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #F9FAFB; color: var(--text-main); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { 
    background: #F9FAFB; 
    text-align: left; 
    padding: 12px 20px; 
    font-size: 11px; 
    text-transform: uppercase; 
    color: var(--text-secondary) !important; 
    font-weight: 600; 
}
.data-table td { padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text-main) !important; font-size: 13px; }

.status-pill { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-Open { background: #DBEAFE; color: #2563EB !important; } 
.status-Closed { background: #D1FAE5; color: #059669 !important; }

/* --- INPUT FIELDS --- */
input, select, textarea, .login-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main) !important; /* Force Dark Text */
    transition: all 0.3s;
    font-weight: 500;
}

input:focus, select:focus, textarea:focus, .login-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    outline: none;
}

/* --- BUTTON STYLING --- */
.btn, .login-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%);
    color: #ffffff !important; /* Force White Text */
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px 24px;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:hover, .login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #3B82F6 0%, var(--primary) 100%);
    color: #ffffff !important;
}

/* Small Button */
.btn-sm {
    background: #fff;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
    font-size: 12px;
    padding: 6px 14px;
    box-shadow: none;
    text-decoration: none; 
    display: inline-block; 
    cursor: pointer;
}

.btn-sm:hover {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

/* Danger Button (Red) */
.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #EF4444);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
    color: white !important;
}

/* --- LOGIN PAGE --- */
.login-wrapper { 
    display: flex; justify-content: center; align-items: center; height: 100vh; 
    background: linear-gradient(135deg, #F3F4F6 0%, #EFF6FF 100%);
}

.login-card { 
    width: 400px; 
    background: var(--bg-panel); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 40px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.05); 
    text-align: center;
    border-top: 4px solid var(--primary); 
    border-bottom: 4px solid var(--danger); 
    color: var(--text-main);
}

.login-card img { height: 50px; margin-bottom: 25px; object-fit: contain; }
.login-card h2 { margin-bottom: 5px; color: var(--text-main) !important; }
.login-card p { margin-bottom: 30px; color: var(--text-secondary) !important; font-size: 13px; }
.login-input-group { margin-bottom: 20px; text-align: left; }
.login-input-group label { display: block; font-size: 12px; color: var(--text-secondary) !important; margin-bottom: 8px; font-weight: 600; }
.login-input { width: 100%; padding: 12px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-main) !important; border-radius: 6px; outline: none; }
.login-input:focus { border-color: var(--primary); }
.login-btn { width: 100%; padding: 12px; background: var(--primary); color: #fff !important; border: none; font-weight: 700; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.login-btn:hover { background: var(--primary-dark); }