/* Admin Panel Styles */

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.btn-block {
    width: 100%;
    padding: 14px;
}

.login-error {
    color: #e53935;
    font-size: 13px;
    text-align: center;
    margin-top: 15px;
    min-height: 20px;
}

.login-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-light);
}

.login-info p {
    margin-bottom: 5px;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--secondary-color);
}

.nav-icon {
    font-size: 18px;
}

.nav-badge {
    margin-left: auto;
    background: var(--secondary-color);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    background: var(--bg-color);
    min-height: 100vh;
}

.admin-header {
    background: var(--white);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header h1 {
    font-size: 24px;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.admin-content {
    padding: 30px;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card h3 {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Data Tables */
.data-table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h2 {
    font-size: 18px;
    color: var(--text-color);
}

.table-filters {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--white);
}

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

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

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

.data-table td {
    font-size: 14px;
    color: var(--text-color);
}

.data-table tr:hover {
    background: #fafafa;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-confirmed {
    background: #e3f2fd;
    color: #1565c0;
}

.status-preparing {
    background: #fff8e1;
    color: #f57f17;
}

.status-delivering {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.action-btn:last-child {
    margin-right: 0;
}

.action-btn-view {
    background: #e3f2fd;
    color: #1565c0;
}

.action-btn-edit {
    background: #fff8e1;
    color: #f57f17;
}

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

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

.action-btn:hover {
    opacity: 0.8;
}

/* Order Detail */
.order-detail {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-info h3 {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.order-info p {
    font-size: 13px;
    color: var(--text-light);
}

.order-status-actions {
    display: flex;
    gap: 10px;
}

.order-section {
    margin-bottom: 20px;
}

.order-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.order-items {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    font-weight: 500;
}

.order-item-details {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid var(--primary-color);
}

.order-total span:last-child {
    color: var(--primary-color);
}

/* Forms */
.admin-form {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    max-width: 600px;
}

.admin-form h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload:hover {
    border-color: var(--primary-color);
}

.image-upload input {
    display: none;
}

.image-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 10px;
}

/* Print Styles */
.print-template {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-template,
    .print-template * {
        visibility: visible;
    }

    .print-template {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        padding: 10px;
    }

    .print-header {
        text-align: center;
        border-bottom: 1px dashed #000;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .print-header h1 {
        font-size: 16px;
        margin: 0;
    }

    .print-order-info {
        margin-bottom: 10px;
    }

    .print-items {
        border-top: 1px dashed #000;
        border-bottom: 1px dashed #000;
        padding: 10px 0;
        margin: 10px 0;
    }

    .print-item {
        margin-bottom: 8px;
    }

    .print-total {
        font-size: 14px;
        font-weight: bold;
        text-align: right;
    }

    .print-footer {
        text-align: center;
        font-size: 10px;
        margin-top: 15px;
        padding-top: 10px;
        border-top: 1px dashed #000;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* Settings Page */
.settings-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

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

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

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

    .data-table {
        display: block;
        overflow-x: auto;
    }
}
