/* Admin Panel Styles */
:root {
    --primary-color: #F7931E;
    --secondary-color: #2E7D32;
    --accent-color: #FF8C00;
    --dark-bg: #0D0D0D;
    --light-bg: #f4f1ea;
    --dark-text: #2C2C2C;
    --border-radius: 8px;
    --sidebar-width: 250px;
    --font-display: 'Luckiest Guy', cursive;
    --font-body: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--dark-text);
}

h1, h2, .sidebar-header h2, .login-box h2 {
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(247,147,30,0.15), transparent 60%), var(--dark-bg);
}

.login-box {
    background: #161616;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(247,147,30,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    width: 90%;
    max-width: 380px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.login-box .form-group label {
    color: #ddd;
}

.login-box .form-group input {
    background-color: var(--dark-bg);
    color: #f5f0e6;
    border-color: #3a3a3a;
}

.login-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.2em;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    border-right: 3px solid var(--primary-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.3rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu .menu-link {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-menu .menu-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--accent-color);
    padding-left: 2rem;
}

.sidebar-menu .menu-link.active {
    background-color: rgba(255,255,255,0.2);
    border-left-color: var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Admin Header */
.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logout-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: var(--secondary-color);
}

/* Page Content */
.page-content {
    display: none;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.page-content.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: var(--secondary-color);
    font-size: 1.8rem;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.recent-orders {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.recent-orders h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

thead {
    background-color: var(--secondary-color);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background-color: var(--light-bg);
}

/* Status Badge */
.status {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
}

.status.delivered {
    background-color: #d4edda;
    color: #155724;
}

.status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status.processing {
    background-color: #cce5ff;
    color: #004085;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(255,107,53,0.3);
}

.item-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
}

/* Settings */
.settings-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.settings-form {
    max-width: 800px;
}

.settings-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* Filters */
.filters {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

.filters select {
    padding: 0.7rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 70px;
    }

    .sidebar-header h2 {
        font-size: 1rem;
    }

    .sidebar-menu .menu-link {
        padding: 1rem 0.5rem;
        text-align: center;
        font-size: 0.8rem;
    }

    .sidebar-menu .menu-link:hover,
    .sidebar-menu .menu-link.active {
        padding-left: 0.5rem;
    }

    .menu-toggle {
        display: block;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.7rem;
    }

    .header-right {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .admin-header {
        padding: 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem;
    }
}
