/* ==========================================================================
   ADMIN PANEL STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-active: #3b82f6;
    --admin-bg: #f8fafc;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #1e293b;
    --admin-muted: #64748b;
    --admin-primary: #1e293b;
    --admin-accent: #3b82f6;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
}

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

body.admin-body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.sidebar-logo span { color: #38bdf8; }

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    padding: 10px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--admin-sidebar-text);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--admin-sidebar-active);
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main Content Area */
.admin-main {
    flex-grow: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-topbar-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--admin-text);
}

.admin-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-content {
    padding: 32px;
    flex-grow: 1;
}

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

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--admin-text);
    margin-top: 4px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--admin-muted);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; }

/* Admin Cards & Tables */
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--admin-text);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 700;
    color: var(--admin-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--admin-border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dbeafe; color: #1e40af; }
.badge-processing { background: #e0e7ff; color: #3730a3; }
.badge-shipped { background: #fef9c3; color: #854d0e; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Admin Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
}

.admin-btn-primary { background: #1e293b; color: #ffffff; }
.admin-btn-primary:hover { background: #0f172a; }
.admin-btn-accent { background: #3b82f6; color: #ffffff; }
.admin-btn-accent:hover { background: #2563eb; }
.admin-btn-danger { background: #fee2e2; color: #ef4444; }
.admin-btn-danger:hover { background: #ef4444; color: #ffffff; }
.admin-btn-outline { background: transparent; border: 1px solid var(--admin-border); color: var(--admin-text); }
.admin-btn-outline:hover { background: #f1f5f9; }

/* Forms */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--admin-text);
}

.admin-input, .admin-select, .admin-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--admin-text);
    background: #ffffff;
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Timeline Log Manager */
.tracking-log-card {
    background: #f8fafc;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 80px; }
    .admin-sidebar .sidebar-logo span, .admin-sidebar .sidebar-link span, .admin-sidebar .nav-section-title { display: none; }
    .admin-main { margin-left: 80px; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
}
