/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    /* Premium Color Palette */
    --primary-color: #4F46E5;       /* Indigo 600 */
    --primary-hover: #4338CA;       /* Indigo 700 */
    --secondary-color: #6366F1;     /* Indigo 500 */
    
    --bg-body: #F3F4F6;             /* Light Gray Background */
    --bg-card: #FFFFFF;             /* White Card */
    --bg-sidebar: #FFFFFF;
    
    --text-main: #111827;           /* Almost Black */
    --text-muted: #6B7280;          /* Gray Text */
    --border-color: #E5E7EB;        /* Light Border */
    
    /* Status Colors */
    --success-bg: #D1FAE5;
    --success-text: #065F46;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;

    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transition */
    --transition: all 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Google Font */
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* =========================================
   2. AUTH & INSTALLER LAYOUT (Centered)
   ========================================= */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

.auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decorational Top Bar */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-color);
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

/* =========================================
   3. FORMS & BUTTONS
   ========================================= */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* =========================================
   4. DASHBOARD LAYOUT
   ========================================= */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-menu {
    padding: 20px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    transition: var(--transition);
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.menu-item:hover, .menu-item.active {
    background: #EEF2FF;
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px; /* Sidebar width */
    padding: 30px;
    transition: var(--transition);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 22px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

/* =========================================
   5. DASHBOARD COMPONENTS (Cards, Tables)
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
}

.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px 25px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px 25px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-inactive { background: var(--danger-bg); color: var(--danger-text); }
.badge-pending { background: var(--warning-bg); color: var(--warning-text); }

/* Action Buttons in Table */
.action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    transition: 0.2s;
}
.edit-btn { color: var(--primary-color); }
.delete-btn { color: var(--danger-text); }
.action-btn:hover { transform: scale(1.2); }

/* =========================================
   6. RESPONSIVE DESIGN (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-card {
        overflow-x: auto;
    }
    
    /* Toggle Button for Mobile */
    .menu-toggle {
        display: block; /* Need to add this in HTML later */
        font-size: 24px;
        cursor: pointer;
        margin-right: 15px;
    }
}