/* Admin CSS extracted from admin.html */
:root {
    --primary: #FF5500;
    --dark: #121417;
    --dark-light: #1e2126;
    --text-grey: #a0a0a0;
    --success: #00c851;
    --danger: #ff4444;
    --warning: #ffbb33;
    --info: #33b5e5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #f4f6f9;
    display: flex;
    height: 100vh;
    color: #333;
}

.pin-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.pin-input {
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #444;
    background: #222;
    color: white;
    margin-top: 20px;
    width: 250px;
    outline: none;
    letter-spacing: 5px;
}

.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.brand {
    padding: 25px;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 1px solid #2a2e35;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
}

.nav-links {
    flex: 1;
    overflow-y: auto;
    padding-top: 20px;
}

.nav-header {
    font-size: 11px;
    text-transform: uppercase;
    color: #555;
    padding: 10px 25px;
    font-weight: 700;
    margin-top: 10px;
}

.nav-item {
    padding: 12px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #bbb;
    transition: 0.2s;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll on body */
    padding: 25px;
    background: #edf0f5;
    width: 100%;
    min-width: 0;
    /* CRITICAL: Allows flex item to shrink below content width */
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 15px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 20px;
    border: 1px solid #eef0f5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 4px solid transparent;
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

/* Helper Buttons */
.action-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 11px;
    font-weight: 600;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap;
    margin-bottom: 2px;
}

.action-btn:hover {
    opacity: 0.9;
}

.btn-orange {
    background: var(--primary);
}

.btn-green {
    background: var(--success);
}

.btn-red {
    background: var(--danger);
}

.btn-blue {
    background: var(--info);
}

.btn-dark {
    background: #333;
}

.btn-success {
    background: var(--success);
}

/* --- BADGES --- */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-active {
    background: #e3f2fd;
    color: #0d47a1;
}

/* --- FORMS --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    font-size: 13px;
    background: #fff;
    color: #333;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.1);
}

textarea.input-field {
    resize: vertical;
}

/* --- TABLES --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 15px;
    background: #f8f9fb;
    color: #666;
    font-weight: 600;
    border-bottom: 2px solid #eee;
    text-transform: uppercase;
    font-size: 11px;
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    vertical-align: middle;
}

tr:hover td {
    background: #fafafa;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* --- MOBILE RESPONSIVE --- */
.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
    margin-right: 15px;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.overlay.active {
    display: block;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .main-content {
        padding: 15px;
        /* Reduced padding */
        width: 100%;
    }

    .panel {
        padding: 15px;
        overflow: hidden;
        /* Prevent overflow */
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .header-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }

    .header-bar>* {
        width: 100%;
    }

    .header-bar form {
        display: flex;
        gap: 10px;
    }

    .header-bar form input {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 20px;
    }

    /* Ensure table scroll works */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        display: block;
        border: 1px solid #eee;
    }
}