/* ═══════════════════════════════════════════════
   TECHNITURE — Admin Panel Theme
   Blue-Purple Gradient · Zoho-inspired
   ═══════════════════════════════════════════════ */

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

:root {
    --admin-bg: #f5f7fa;
    --admin-sidebar: #1a237e;
    --admin-sidebar-2: #283593;
    --admin-card: #ffffff;
    --admin-primary: #5e35b1;
    --admin-primary-light: #7e57c2;
    --admin-accent: #2962ff;
    --admin-border: #e2e8f0;
    --admin-border-d: #cbd5e1;
    --admin-text: #1e293b;
    --admin-muted: #64748b;
    --admin-lavender: #ede7f6;
    --sidebar-width: 260px;
    --topbar-h: 64px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
    --gradient-primary: linear-gradient(135deg, #1a237e, #5e35b1);
    --gradient-secondary: linear-gradient(135deg, #5e35b1, #7e57c2);
}

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

body, .admin-body {
    font-family: var(--font-body);
    background: var(--admin-bg);
    color: var(--admin-text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* ── LAYOUT ──────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────── */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--admin-sidebar);
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
}

    .admin-sidebar.collapsed {
        width: 70px;
    }

        .admin-sidebar.collapsed .nav-label,
        .admin-sidebar.collapsed .sidebar-brand span,
        .admin-sidebar.collapsed .nav-item span {
            display: none;
        }

.sidebar-brand {
    height: var(--topbar-h);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    background: rgba(0,0,0,0.2);
}

    .sidebar-brand i {
        font-size: 1.5rem;
        color: white;
        flex-shrink: 0;
        width: 30px;
        text-align: center;
    }

    .sidebar-brand span {
        font-family: var(--font-display);
        font-size: 1.2rem;
        font-weight: 800;
        color: white;
        white-space: nowrap;
    }

    .sidebar-brand b {
        background: linear-gradient(135deg, #b39ddb, white);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
    }

.nav-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 16px 8px 6px;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

    .nav-item i {
        font-size: 1.1rem;
        flex-shrink: 0;
        width: 22px;
        text-align: center;
    }

    .nav-item:hover {
        background: rgba(255,255,255,0.1);
        color: white;
        transform: translateX(4px);
    }

    .nav-item.active {
        background: var(--gradient-secondary);
        color: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    .nav-item.text-danger {
        color: #ffb3b3 !important;
    }

        .nav-item.text-danger:hover {
            background: rgba(239, 154, 154, 0.2);
            color: white !important;
        }

/* ── TOPBAR ──────────────────────────────────── */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--admin-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.sidebar-toggle {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    background: transparent;
    color: var(--admin-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .sidebar-toggle:hover {
        border-color: var(--admin-primary);
        color: var(--admin-primary);
        background: var(--admin-lavender);
    }

.admin-user-btn {
    background: var(--admin-lavender);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--admin-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .admin-user-btn:hover {
        border-color: var(--admin-primary);
        background: white;
    }

/* ── CONTENT ─────────────────────────────────── */
.admin-content {
    padding: 28px;
    flex: 1;
}

/* ── PAGE HEADER ─────────────────────────────── */
.page-header {
    margin-bottom: 28px;
}

    .page-header h1 {
        font-family: var(--font-display);
        font-size: 2rem;
        font-weight: 800;
        color: var(--admin-text);
        margin: 0;
        letter-spacing: -0.02em;
    }

    .page-header p {
        color: var(--admin-muted);
        font-size: 0.9rem;
        margin: 4px 0 0;
    }

.breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.breadcrumb-item a {
    color: var(--admin-primary);
}

.breadcrumb-item.active {
    color: var(--admin-muted);
}

/* ── STAT CARDS ──────────────────────────────── */
.stat-card {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

    .stat-card::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--gradient-primary);
    }

.stat-revenue::after {
    background: linear-gradient(90deg, #1a237e, #5e35b1);
}

.stat-orders::after {
    background: linear-gradient(90deg, #5e35b1, #7e57c2);
}

.stat-products::after {
    background: linear-gradient(90deg, #7e57c2, #b39ddb);
}

.stat-customers::after {
    background: linear-gradient(90deg, #283593, #5e35b1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.stat-revenue .stat-icon {
    background: #ede7f6;
    color: #5e35b1;
}

.stat-orders .stat-icon {
    background: #e8eaf6;
    color: #1a237e;
}

.stat-products .stat-icon {
    background: #f3e5f5;
    color: #7e57c2;
}

.stat-customers .stat-icon {
    background: #e1f5fe;
    color: #2962ff;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--admin-text);
    line-height: 1;
    margin-bottom: 6px;
}

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

/* ── ADMIN CARD ──────────────────────────────── */
.admin-card {
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

    .admin-card:hover {
        box-shadow: var(--shadow-lg);
    }

.admin-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--admin-text);
    background: #fafafa;
}

/* ── TABLES ──────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

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

    .admin-table th {
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--admin-muted);
        padding: 14px 20px;
        border-bottom: 1px solid var(--admin-border);
        white-space: nowrap;
        text-align: left;
    }

    .admin-table td {
        padding: 16px 20px;
        border-bottom: 1px solid var(--admin-border);
        vertical-align: middle;
        font-size: 0.85rem;
    }

    .admin-table tr:last-child td {
        border-bottom: none;
    }

    .admin-table tbody tr {
        transition: all 0.2s ease;
    }

        .admin-table tbody tr:hover {
            background: var(--admin-lavender);
        }

/* ── STATUS BADGES ───────────────────────────── */
.badge-status {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: var(--font-body);
    border: 1px solid transparent;
}

.status-pending {
    background: #fff8e1;
    color: #b26a00;
    border-color: #ffe082;
}

.status-confirmed {
    background: #e8eaf6;
    color: #1a237e;
    border-color: #9fa8da;
}

.status-processing {
    background: #ede7f6;
    color: #5e35b1;
    border-color: #b39ddb;
}

.status-shipped {
    background: #e1f5fe;
    color: #0277bd;
    border-color: #81d4fa;
}

.status-delivered {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

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

.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

.status-unpaid {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}

/* ── FORMS (admin) ───────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: white;
    color: var(--admin-text);
    transition: all 0.2s ease;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--admin-primary);
        box-shadow: 0 0 0 3px rgba(94, 53, 177, 0.1);
        outline: none;
    }

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-muted);
    margin-bottom: 6px;
}

/* ── BUTTONS (admin) ─────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-accent {
    background: var(--gradient-primary);
    color: white !important;
    box-shadow: var(--shadow);
}

    .btn-accent:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }

.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
}

.btn-outline-primary {
    border: 1px solid var(--admin-primary) !important;
    color: var(--admin-primary) !important;
    background: transparent !important;
}

    .btn-outline-primary:hover {
        background: var(--gradient-primary) !important;
        color: white !important;
    }

/* ── STOCK BARS ──────────────────────────────── */
.stock-bar-wrap {
    background: var(--admin-border);
    border-radius: 50px;
    height: 6px;
    width: 100%;
}

.stock-bar {
    height: 6px;
    border-radius: 50px;
    transition: width 0.4s ease;
}

    .stock-bar.high {
        background: linear-gradient(90deg, #00c853, #69f0ae);
    }

    .stock-bar.medium {
        background: linear-gradient(90deg, #ffb300, #ffe082);
    }

    .stock-bar.low-bar {
        background: linear-gradient(90deg, #f44336, #ff8a80);
    }

/* ── CHART ───────────────────────────────────── */
.chart-wrap {
    position: relative;
    height: 280px;
}

/* ── IMAGE UPLOAD ────────────────────────────── */
.img-upload-area {
    border: 2px dashed var(--admin-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

    .img-upload-area:hover {
        border-color: var(--admin-primary);
        background: var(--admin-lavender);
    }

.img-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-top: 16px;
    display: none;
}

/* ── ALERTS ──────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    border: none;
    border-left: 4px solid;
    font-size: 0.85rem;
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.alert-success {
    background: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
}

.alert-danger {
    background: #ffebee;
    border-color: #c62828;
    color: #b71c1c;
}

.alert-info {
    background: #e1f5fe;
    border-color: #0288d1;
    color: #01579b;
}

.alert-warning {
    background: #fff8e1;
    border-color: #ff8f00;
    color: #b26a00;
}

/* ── INVOICE ─────────────────────────────────── */
.invoice-container {
    background: white;
    max-width: 900px;
    margin: 0 auto;
    padding: 48px;
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.invoice-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

    .invoice-logo span {
        background: var(--gradient-secondary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.invoice-gold-bar {
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin: 24px 0;
}

@media print {
    .admin-sidebar, .admin-topbar, .no-print {
        display: none !important;
    }

    .admin-content {
        padding: 0 !important;
    }

    .invoice-container {
        border: none;
        box-shadow: none;
    }
}

/* Badge b2b/b2c */
.badge-b2b {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
}

.badge-b2c {
    background: var(--admin-lavender);
    color: var(--admin-primary);
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
}

/* Custom scrollbar for admin */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--admin-border);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--admin-primary);
    }
