/* ==========================================
   TS HOLDINGS (PVT) LTD – ADMIN PANEL
   ========================================== */

:root {
    /* Admin Specific Variables */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 70px;

    /* Reusing Main Theme Variables */
    --primary: #7c4dff;
    --primary-light: #b388ff;
    --primary-dark: #651fff;
    --primary-glow: rgba(124, 77, 255, 0.35);
    --accent: #00e5ff;
    --bg-dark: #0a0e1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2236;
    --bg-surface: #0f1525;
    --glass-bg: rgba(17, 24, 39, 0.65);
    --glass-border: rgba(124, 77, 255, 0.18);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-primary: linear-gradient(135deg, #7c4dff 0%, #00e5ff 100%);
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-md: 0 8px 32px rgba(0, 0, 0, .35);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --ease: cubic-bezier(.4, 0, .2, 1);
    --speed: 0.3s;
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    display: flex;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--speed) var(--ease);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--speed);
    font-weight: 500;
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(124, 77, 255, 0.1);
    color: var(--primary-light);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--glass-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ff5252;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--speed);
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(255, 82, 82, 0.1);
}

/* ---------- MAIN CONTENT ---------- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--speed) var(--ease);
}

/* ---------- TOPBAR ---------- */
.topbar {
    height: var(--topbar-height);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 8px 20px;
    width: 350px;
    gap: 12px;
}

.search-bar i {
    color: var(--text-muted);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-btn {
    position: relative;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff5252;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50px;
    transition: background var(--speed);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- CONTENT AREA ---------- */
.content-area {
    padding: 32px;
    flex: 1;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform var(--speed);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.revenue {
    background: rgba(124, 77, 255, 0.15);
    color: #7c4dff;
}

.stat-icon.orders {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
}

.stat-icon.users {
    background: rgba(255, 171, 0, 0.15);
    color: #ffab00;
}

.stat-icon.growth {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.stat-info .value {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-change {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up {
    color: #00e676;
}

.stat-change.down {
    color: #ff5252;
}

/* Main Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-sm {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--speed);
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Chart Placeholder */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    position: relative;
}

/* Recent Orders Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

tbody td {
    padding: 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.order-id {
    font-weight: 600;
    color: var(--primary-light);
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2a2f3e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
}

.status-pending {
    background: rgba(255, 171, 0, 0.1);
    color: #ffab00;
}

.status-cancelled {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
}

/* Activity Feed */
.activity-item {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}

.activity-item:last-child::before {
    display: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 1;
}

.activity-content p {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.activity-content .time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .logo-text,
    .nav-item span,
    .user-info,
    .sidebar-footer span {
        display: none;
    }

    .main-wrapper {
        margin-left: var(--sidebar-collapsed-width);
    }

    .search-bar {
        width: 40px;
        padding: 10px;
    }

    .search-bar input {
        display: none;
    }
}