/* =========================================
   1. GLOBAL & RESET STYLES
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    display: flex;
    overflow-x: hidden;
}

/* =========================================
   2. ADMIN SIDEBAR & LAYOUT STYLES
========================================= */
.admin-sidebar, .staff-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.admin-sidebar h2, .staff-sidebar h2 {
    text-align: center;
    padding: 20px 0;
    background: #1a252f;
    margin-bottom: 10px;
    font-size: 20px;
    color: #008080;
}

.admin-sidebar ul, .staff-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar ul li, .staff-sidebar ul li {
    border-bottom: 1px solid #34495e;
}

.admin-sidebar ul li a, .staff-sidebar ul li a {
    display: block;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    font-size: 15px;
    transition: 0.2s;
}

.admin-sidebar ul li a:hover, 
.admin-sidebar ul li a.active,
.staff-sidebar ul li a:hover, 
.staff-sidebar ul li a.active {
    background-color: #008080;
    padding-left: 25px;
}

/* Main Content & Navbar */
.main-content, .staff-main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    background-color: #f4f7f6;
    transition: all 0.3s ease;
}

.top-navbar, .staff-top-navbar {
    background: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.menu-toggle, .toggle-menu-btn {
    font-size: 20px;
    cursor: pointer;
    background: #008080;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    display: none;
}

.admin-profile, .staff-profile-info {
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

/* =========================================
   3. SHARED CONTAINERS & CARDS
========================================= */
.dashboard-content, .admin-container, .admin-tickets-container, .form-container { 
    max-width: 1200px; 
    margin: 20px auto; 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

.dashboard-content h2, .admin-container h2, .admin-tickets-container h2 { 
    color: #333; 
    margin-top: 0; 
    border-bottom: 2px solid #008080; 
    padding-bottom: 10px; 
}

.stats-grid, .staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card, .staff-stat-card, .staff-welcome-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border-left: 5px solid #008080;
}

/* =========================================
   4. TABLES & RESPONSIVE WRAPPER
========================================= */
.table-responsive, .table-card {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
    background: #fff;
    border-radius: 8px;
}

.admin-table, .tickets-table, .item-table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 750px; 
}

.admin-table th, .admin-table td, 
.tickets-table th, .tickets-table td, 
.item-table th, .item-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
    font-size: 14px;
}

.admin-table th, .tickets-table th, .item-table th { 
    background-color: #008080; 
    color: white; 
    white-space: nowrap; 
}

.admin-table tr:hover, .tickets-table tr:hover, .item-table tr:hover { 
    background-color: #f1f1f1; 
}

/* =========================================
   5. BUTTONS, BADGES & FORMS
========================================= */
.btn-sm, .action-btn, .submit-btn, .btn-filter {
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
    background-color: #008080;
}
.btn-sm:hover, .action-btn:hover, .submit-btn:hover, .btn-filter:hover { opacity: 0.9; background-color: #006666; }

.btn-danger, .btn-delete { background-color: #e74c3c; }
.btn-danger:hover, .btn-delete:hover { background-color: #c0392b; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #333; }
.form-group input, .form-group select, .search-input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; }

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    text-transform: capitalize;
}
.admin-badge, .badge-admin, .status-approved { background: #d4edda; color: #155724; }
.user-badge, .badge-editor { background: #e2e3e5; color: #383d41; }
.badge-manager { background: #f39c12; color: white; }
.status-pending { background: #fff3cd; color: #856404; }
.status-blocked, .badge-rejected { background: #f8d7da; color: #721c24; }

/* =========================================
   6. MODAL STYLES
========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 12px; right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}
.modal-close:hover { color: #000; }

/* =========================================
   7. MOBILE RESPONSIVE MEDIA QUERY
========================================= */
@media (max-width: 768px) {
    .admin-sidebar, .staff-sidebar {
        left: -250px;
    }
    .admin-sidebar.active, .staff-sidebar.active {
        left: 0;
    }
    .main-content, .staff-main-content {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle, .toggle-menu-btn {
        display: block;
    }
    .dashboard-content, .admin-container {
        margin: 10px;
        padding: 15px;
    }
}

/* =========================================
   8. FILTER BUTTONS ENHANCEMENTS
========================================= */
.filter-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 2px;
}

.btn-filter {
    background-color: #e2e3e5;
    color: #333;
    margin: 5px;
}

.btn-filter.active {
    background-color: #008080;
    color: white;
}

.btn-filter .badge {
    background: rgba(0, 0, 0, 0.1);
    color: inherit;
    margin-left: 5px;
}

/* =========================================
   9. TABLE STATUS BADGES
========================================= */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.status-badge.status-approved { background-color: #d4edda; color: #155724; }
.status-badge.status-pending { background-color: #fff3cd; color: #856404; }
.status-badge.status-blocked { background-color: #f8d7da; color: #721c24; }

/* =========================================
   10. VIEW BUTTON & STATUS UPDATE FORM
========================================= */
.view-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    font-weight: bold;
}

.view-btn:hover { background-color: #2980b9; }

.status-update-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-update-form select {
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
/* =========================================
   12. TICKET STATUS BADGES
========================================= */
/* Common properties for all ticket statuses */
.status-Open, 
.status-In-Progress, 
.status-Resolved, 
.status-Closed {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

/* Specific colors for each status */
.status-Open { 
    background-color: #cce5ff; /* Light Blue */
    color: #004085; 
}

.status-In-Progress { 
    background-color: #fff3cd; /* Yellow / Orange */
    color: #856404; 
}

.status-Resolved { 
    background-color: #d4edda; /* Light Green */
    color: #155724; 
}

.status-Closed { 
    background-color: #e2e3e5; /* Gray */
    color: #383d41; 
}


/* Update Button Styles */
.status-update-form button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px; /* Changed to 4px to match other buttons */
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.3s;
}

.status-update-form button:hover {
    background-color: #e67e22; /* Darker orange on hover */
}

/* =========================================
   11. PAGINATION STYLES
========================================= */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #555;
}

.pagination a {
    padding: 8px 15px;
    background-color: #008080;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.pagination a:hover {
    background-color: #006666;
}

.pagination a.disabled {
    background-color: #cccccc;
    color: #888888;
    pointer-events: none;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .pagination {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
/* =========================================
   18. STAFF / ADMIN LOGIN PAGE STYLES
========================================= */

/* Overriding default body flex behavior to center the login box */
.staff-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #2c3e50; /* Match sidebar theme background */
    margin: 0;
    width: 100%;
}

/* The white login card */
.staff-login-box {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 35px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.staff-login-box h2 {
    text-align: center;
    color: #008080; /* Theme primary color */
    margin-bottom: 25px;
    font-size: 24px;
    border-bottom: 2px solid #f4f7f6;
    padding-bottom: 10px;
}

/* Making the submit button full-width specifically for the login form */
.staff-login-box .submit-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
    margin-top: 15px;
    border-radius: 6px;
}
