/* BakedInAki - Admin Dashboard Styles */

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

:root {
    --primary-yellow: #FFD700;
    --primary-green: #32CD32;
    --dark-green: #228B22;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

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

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--text-dark);
    color: white;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #555;
    margin-bottom: 1.5rem;
}

.admin-logo h2 {
    font-size: 1.5rem;
}

.admin-logo .baked {
    color: var(--primary-yellow);
}

.admin-logo .in {
    color: var(--primary-green);
}

.admin-logo .aki {
    color: var(--primary-yellow);
}

.admin-logo small {
    color: #888;
    font-size: 0.8rem;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 0.5rem;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #ccc;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary-yellow);
}

.admin-nav .nav-icon {
    font-size: 1.2rem;
}

.logout-btn {
    margin-top: 2rem;
    width: 100%;
    padding: 0.75rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

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

.admin-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-card.orders .stat-value {
    color: var(--primary-green);
}

.stat-card.pending .stat-value {
    color: #ffc107;
}

.stat-card.revenue .stat-value {
    color: var(--primary-green);
}

/* Tables */
.admin-card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr:hover {
    background: #f9f9f9;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

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

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons */
.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    margin-right: 0.5rem;
}

.btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-view:hover {
    background: #bbdefb;
}

.btn-edit {
    background: #fff3e0;
    color: #f57c00;
}

.btn-edit:hover {
    background: #ffe0b2;
}

.btn-delete {
    background: #ffebee;
    color: #d32f2f;
}

.btn-delete:hover {
    background: #ffcdd2;
}

.btn-add {
    background: var(--primary-green);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add:hover {
    background: var(--dark-green);
}

/* Order Details Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Order Detail Sections */
.order-detail-section {
    margin-bottom: 1.5rem;
}

.order-detail-section h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    color: var(--text-light);
}

.detail-value {
    font-weight: 500;
}

.order-items-list {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

/* Status Update */
.status-update {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.status-btn:hover {
    border-color: var(--primary-green);
}

.status-btn.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #FFA500 100%);
}

.login-box {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-logo .baked {
    color: var(--primary-yellow);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.login-logo .in {
    color: var(--primary-green);
}

.login-logo .aki {
    color: var(--primary-yellow);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.login-box h2 {
    margin-bottom: 2rem;
    color: var(--text-light);
    font-weight: normal;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: var(--dark-green);
}

.login-error {
    color: #dc3545;
    margin-top: 1rem;
    display: none;
}

.back-link {
    margin-top: 1.5rem;
    display: block;
    color: var(--text-light);
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary-green);
}

/* Product Form */
.product-form {
    display: grid;
    gap: 1rem;
}

.product-form .form-group {
    margin-bottom: 0;
}

.product-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-form input,
.product-form select,
.product-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.product-form input:focus,
.product-form select:focus,
.product-form textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Filter & Search */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 250px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-container {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
