/* 🔥 GLOBAL RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f6f6;
    background: linear-gradient(135deg, #f8f6f6, #eaeaea);
    color: #333;
}

/* CONTAINER */
.container {
    width: 90%;
    max-width: 1000px;
    margin: auto;
    padding-bottom: 50px;
}

/* HEADER */
.admin-header {
    background: white;
    padding: 20px 5%;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    background: #ec5b13;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.btn:hover {
    background: #d14b0e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #555;
}

.btn-secondary:hover {
    background: #333;
}

/* CARD */
.card-box {
    background: white;
    padding: 25px;
    margin-top: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th, table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

table th {
    background: #fdfdfd;
    font-weight: 600;
}

table tr:hover {
    background-color: #fcfcfc;
}

table img {
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* FORM */
input, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    transition: border 0.3s;
}

input:focus, select:focus {
    border-color: #ec5b13;
    outline: none;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

/* STAT BOX */
.stat-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 5px solid #ec5b13;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box h3 {
    font-size: 32px;
    margin-bottom: 5px;
    color: #ec5b13;
}

canvas {
    margin-top: 20px;
}

/* LOGIN PAGE */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: white;
    padding: 40px 30px;
    width: 100%;
    max-width: 350px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
}

.login-card h2 {
    margin-bottom: 25px;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ================= MOBILE & RESPONSIVE FIXES ================= */
@media (max-width: 768px) {
    /* Stats Grid Fix */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Header Fix */
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .admin-header h2 {
        font-size: 22px;
    }

    /* Table Scroll Fix */
    .card-box {
        padding: 15px;
        overflow-x: auto; /* Adds horizontal scroll to prevent overflow */
    }
    
    table {
        min-width: 600px; /* Ensures the table doesn't squish too much */
    }

    /* Action Buttons Stacking Fix for Dashboards & Forms */
    .card-box > .btn, 
    .card-box > div > .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    
    /* Keep Table Action Buttons Inline */
    td .btn {
        display: inline-block;
        width: auto;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    /* Bahut choti screen (purane phones) ke liye */
    .stats-grid {
        grid-template-columns: 1fr;
    }
}