/* =====================================================
   KRISHNA NATURALS - PROFESSIONAL ADMIN PANEL CSS
   Modern Sidebar-Based Dashboard Design
   ===================================================== */

/* Admin Variables */
:root {
    --admin-sidebar-width: 260px;
    --admin-sidebar-collapsed: 70px;
    --admin-header-height: 65px;
    --admin-bg: #f0f2f5;
    --admin-sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    --admin-card-bg: #ffffff;
    --admin-text: #333;
    --admin-text-muted: #6c757d;
    --admin-accent: #D4AF37;
    --admin-accent-light: #f5ecd3;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-info: #3b82f6;
    --admin-border: #e5e7eb;
    --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Admin Body */
.admin-body {
    background: var(--admin-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: row !important;
}

/* =====================================================
   SIDEBAR NAVIGATION
   ===================================================== */
.admin-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--admin-sidebar-width);
    height: 100vh;
    background: var(--admin-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease;
    overflow-x: hidden;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

/* Admin Logo */
.admin-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
}

.admin-logo img {
    height: 45px;
    filter: brightness(0) invert(1);
}

.admin-badge {
    background: var(--admin-accent);
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Admin Menu */
.admin-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    display: flex;
    /* Enforce flex */
    flex-direction: column;
    /* Force vertical stacking */
    gap: 4px;
    /* Space between items */
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 180px);
    width: 100%;
    /* Ensure full width */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.admin-menu li {
    width: 100%;
    /* Force list items to take full width */
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    /* Prevent text wrapping */
    width: 100%;
    /* Ensure link takes full width of li */
    box-sizing: border-box;
    /* Include padding in width */
}

.admin-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-menu a.active {
    background: rgba(212, 175, 55, 0.2);
    color: var(--admin-accent);
    font-weight: 600;
}

.admin-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--admin-accent);
    border-radius: 0 4px 4px 0;
}

/* Menu Categories */
.menu-category {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 16px 8px;
}

/* Admin Actions */
.admin-actions {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
}

.admin-actions .btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.admin-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
.admin-main {
    margin-left: var(--admin-sidebar-width);
    flex: 1;
    padding: 25px;
    min-height: 100vh;
    background: var(--admin-bg);
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px 25px;
    background: var(--admin-card-bg);
    border-radius: 16px;
    box-shadow: var(--admin-shadow);
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0;
}

.admin-header p {
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    margin: 5px 0 0;
}

/* =====================================================
   STATS CARDS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--admin-card-bg);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--admin-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--admin-shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--admin-text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    font-weight: 500;
}

/* =====================================================
   LIVE VISITORS CARD
   ===================================================== */
.live-visitors-card {
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 16px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.live-indicator {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.live-count {
    font-size: 2rem;
    font-weight: 800;
}

.live-label {
    font-weight: 600;
    margin-right: auto;
}

.live-visitors-card small {
    opacity: 0.8;
    font-size: 0.8rem;
}

/* =====================================================
   QUICK STATS
   ===================================================== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quick-stat {
    background: var(--admin-card-bg);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--admin-shadow);
}

.quick-label {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

.quick-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--admin-text);
}

.quick-value.success {
    color: var(--admin-success);
}

.quick-value.warning {
    color: var(--admin-warning);
}

.quick-value.danger {
    color: var(--admin-danger);
}

/* =====================================================
   ADMIN SECTIONS
   ===================================================== */
.admin-section {
    background: var(--admin-card-bg);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--admin-shadow);
}

.admin-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--admin-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =====================================================
   ADMIN TABLE
   ===================================================== */
.admin-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    border-bottom: 2px solid var(--admin-border);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.9rem;
    color: var(--admin-text);
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.processing {
    background: #e0e7ff;
    color: #3730a3;
}

.status-badge.shipped {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.delivered {
    background: #a7f3d0;
    color: #047857;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.status-badge.paid {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* =====================================================
   FILTERS
   ===================================================== */
.order-filters,
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--admin-card-bg);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--admin-text-muted);
}

.filter-group select,
.filter-group input {
    padding: 10px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 150px;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--admin-accent);
}

/* =====================================================
   RECENT ORDERS TABLE
   ===================================================== */
.recent-orders-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--admin-border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    font-weight: 700;
    color: var(--admin-text);
}

.order-customer {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

.order-amount {
    font-weight: 700;
    color: var(--admin-text);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.admin-section .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   FORMS
   ===================================================== */
.admin-form .form-group {
    margin-bottom: 20px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--admin-text);
    font-size: 0.9rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* =====================================================
   MODALS
   ===================================================== */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.admin-modal.active {
    display: flex;
}

.modal-content {
    background: var(--admin-card-bg);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--admin-shadow-lg);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--admin-text-muted);
    padding: 5px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* Tablet - Keep sidebar full width but smaller */
@media (max-width: 1024px) {
    .admin-nav {
        width: 220px;
    }

    .admin-logo img {
        height: 35px;
    }

    .admin-menu a {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .admin-main {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .admin-nav {
        transform: translateX(-100%);
        width: var(--admin-sidebar-width);
    }

    .admin-nav.mobile-open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 15px;
        padding-top: 70px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    /* Hamburger Button for Mobile */
    .admin-hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        background: linear-gradient(135deg, #1a1a2e, #16213e);
        border: none;
        border-radius: 10px;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        gap: 5px;
    }

    .admin-hamburger span {
        display: block;
        width: 22px;
        height: 2.5px;
        background: #D4AF37;
        border-radius: 2px;
        transition: all 0.3s;
    }

    .admin-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .admin-hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .admin-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Mobile Overlay */
    .admin-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
    }

    .admin-overlay.active {
        display: block;
    }
}

/* Hide hamburger on desktop */
.admin-hamburger {
    display: none;
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--admin-text-muted);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--admin-text);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--admin-text-muted);
}