/**
 * Admin Design System - Apostle Takim Ministries
 * Premium glassmorphism dashboard styling
 */

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
    /* Primary Colors - LIGHT THEME */
    --admin-bg-dark: #f8fafc;
    --admin-bg-darker: #f1f5f9;
    --admin-bg-card: rgba(255, 255, 255, 0.9);
    --admin-bg-card-hover: rgba(255, 255, 255, 1);

    /* Accent Colors */
    --admin-purple: #7c3aed;
    --admin-purple-light: #a78bfa;
    --admin-purple-glow: rgba(124, 58, 237, 0.4);
    --admin-gold: #f59e0b;
    --admin-gold-light: #fbbf24;
    --admin-gold-glow: rgba(245, 158, 11, 0.3);

    /* Status Colors */
    --admin-success: #22c55e;
    --admin-success-light: #4ade80;
    --admin-danger: #ef4444;
    --admin-danger-light: #f87171;
    --admin-warning: #f59e0b;
    --admin-info: #3b82f6;

    /* Text Colors */
    --admin-text: #1e293b;
    --admin-text-secondary: #334155;
    --admin-text-muted: #64748b;
    --admin-text-dark: #0f172a;

    /* Border & Shadow */
    --admin-border: rgba(100, 116, 139, 0.2);
    --admin-border-light: rgba(0, 0, 0, 0.05);
    --admin-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --admin-shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --admin-shadow-glow: 0 0 20px var(--admin-purple-glow);

    /* Glassmorphism */
    --admin-glass-bg: rgba(255, 255, 255, 0.8);
    --admin-glass-blur: blur(12px);
    --admin-glass-border: 1px solid rgba(0, 0, 0, 0.08);

    /* Spacing */
    --admin-spacing-xs: 0.25rem;
    --admin-spacing-sm: 0.5rem;
    --admin-spacing-md: 1rem;
    --admin-spacing-lg: 1.5rem;
    --admin-spacing-xl: 2rem;

    /* Border Radius */
    --admin-radius-sm: 0.375rem;
    --admin-radius-md: 0.75rem;
    --admin-radius-lg: 1rem;
    --admin-radius-xl: 1.5rem;

    /* Transitions */
    --admin-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --admin-transition-fast: all 0.15s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
.admin-dashboard {
    background: linear-gradient(
        135deg,
        var(--admin-bg-dark) 0%,
        var(--admin-bg-darker) 100%
    );
    min-height: 100vh;
    color: var(--admin-text);
}

.admin-dashboard .page-content {
    background: transparent;
}

.admin-dashboard .container-xxl,
.admin-dashboard .container-fluid {
    padding: var(--admin-spacing-lg);
}

/* ============================================
   GLASSMORPHISM CARDS
   ============================================ */
.glass-card {
    background: var(--admin-glass-bg);
    backdrop-filter: var(--admin-glass-blur);
    -webkit-backdrop-filter: var(--admin-glass-blur);
    border: var(--admin-glass-border);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow);
    transition: var(--admin-transition);
}

.glass-card:hover {
    background: var(--admin-bg-card-hover);
    box-shadow: var(--admin-shadow-lg);
    transform: translateY(-2px);
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--admin-border);
    padding: var(--admin-spacing-lg);
}

.glass-card .card-body {
    padding: var(--admin-spacing-lg);
}

.glass-card .card-title {
    color: var(--admin-text);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================
   METRIC CARDS
   ============================================ */
.metric-card {
    background: var(--admin-glass-bg);
    backdrop-filter: var(--admin-glass-blur);
    -webkit-backdrop-filter: var(--admin-glass-blur);
    border: var(--admin-glass-border);
    border-radius: var(--admin-radius-lg);
    padding: var(--admin-spacing-lg);
    position: relative;
    overflow: hidden;
    transition: var(--admin-transition);
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--admin-purple) 0%,
        var(--admin-gold) 100%
    );
    opacity: 0;
    transition: var(--admin-transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--admin-shadow-glow);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--admin-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--admin-spacing-md);
}

.metric-card .metric-icon.purple {
    background: linear-gradient(
        135deg,
        var(--admin-purple) 0%,
        var(--admin-purple-light) 100%
    );
    box-shadow: 0 4px 12px var(--admin-purple-glow);
}

.metric-card .metric-icon.gold {
    background: linear-gradient(
        135deg,
        var(--admin-gold) 0%,
        var(--admin-gold-light) 100%
    );
    box-shadow: 0 4px 12px var(--admin-gold-glow);
}

.metric-card .metric-icon.success {
    background: linear-gradient(
        135deg,
        var(--admin-success) 0%,
        var(--admin-success-light) 100%
    );
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.metric-card .metric-icon.info {
    background: linear-gradient(135deg, var(--admin-info) 0%, #60a5fa 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.metric-card .metric-label {
    color: var(--admin-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--admin-spacing-xs);
}

.metric-card .metric-value {
    color: var(--admin-text);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--admin-spacing-sm);
}

.metric-card .metric-change {
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-card .metric-change.positive {
    color: var(--admin-success);
}

.metric-card .metric-change.negative {
    color: var(--admin-danger);
}

/* ============================================
   STATUS BADGES
   ============================================ */
.admin-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.admin-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success-light);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.admin-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--admin-gold-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.admin-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.admin-badge.purple {
    background: rgba(124, 58, 237, 0.15);
    color: var(--admin-purple-light);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ============================================
   TABLES
   ============================================ */
.admin-table {
    color: var(--admin-text);
    margin-bottom: 0;
}

.admin-table thead th {
    background: rgba(15, 23, 42, 0.5);
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--admin-spacing-md);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: var(--admin-spacing-md);
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
    color: var(--admin-text-secondary);
}

.admin-table tbody tr {
    transition: var(--admin-transition-fast);
}

.admin-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.05);
}

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

/* ============================================
   CHARTS CONTAINER
   ============================================ */
.chart-container {
    position: relative;
    padding: var(--admin-spacing-md);
}

.chart-title {
    color: var(--admin-text);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--admin-spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--admin-spacing-sm);
}

.chart-title i {
    color: var(--admin-purple-light);
}

/* ============================================
   BUTTONS
   ============================================ */
.admin-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--admin-radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--admin-transition);
    border: none;
    cursor: pointer;
}

.admin-btn-primary {
    background: linear-gradient(135deg, var(--admin-purple) 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 2px 8px var(--admin-purple-glow);
}

.admin-btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, var(--admin-purple) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--admin-purple-glow);
}

.admin-btn-secondary {
    background: var(--admin-glass-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.admin-btn-secondary:hover {
    background: var(--admin-bg-card-hover);
    border-color: var(--admin-purple);
}

.admin-btn-gold {
    background: linear-gradient(135deg, var(--admin-gold) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px var(--admin-gold-glow);
}

.admin-btn-gold:hover {
    background: linear-gradient(
        135deg,
        var(--admin-gold-light) 0%,
        var(--admin-gold) 100%
    );
}

/* ============================================
   SIDEBAR OVERRIDE - PREMIUM DESIGN
   ============================================ */

/* Sidebar Container */
.startbar {
    background: #ffffff !important;
    border-right: 1px solid rgba(100, 116, 139, 0.15) !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04) !important;
}

/* Brand/Logo Section */
.startbar .brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    margin-bottom: 0.5rem;
}

.startbar .brand .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.startbar .brand .logo-lg {
    height: 36px !important;
    width: auto;
}

/* Menu Labels (Section Headers) */
.startbar .menu-label {
    padding: 1.25rem 1.5rem 0.5rem 1.5rem !important;
    margin-top: 0.5rem !important;
}

.startbar .menu-label span {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: #64748b !important;
}

.startbar .menu-label .label-border {
    display: none !important;
}

/* Nav Items Container */
.startbar .navbar-nav {
    padding: 0 0.5rem;
}

/* Individual Nav Items */
.startbar .nav-item {
    margin-bottom: 2px;
}

/* Nav Links */
/* Nav Links */
.startbar .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    margin: 0 0.5rem !important;
    border-radius: 0.625rem !important;
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    border-left: 3px solid transparent !important;
}

.startbar .nav-link .menu-icon {
    font-size: 1.25rem !important;
    width: 24px !important;
    margin-right: 0.875rem !important;
    color: #64748b !important;
    transition: color 0.2s ease !important;
}

/* Hover State */
.startbar .nav-link:hover {
    background: rgba(59, 130, 246, 0.06) !important;
    color: #1e293b !important;
}

.startbar .nav-link:hover .menu-icon {
    color: #3b82f6 !important;
}

/* Active State - Blue accent bar on left */
.startbar .nav-link.active {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #3b82f6 !important;
    border-left-color: #3b82f6 !important;
    font-weight: 600 !important;
}

.startbar .nav-link.active .menu-icon {
    color: #3b82f6 !important;
}

/* Submenu Chevron */
.startbar .nav-link[data-bs-toggle="collapse"]::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    margin-left: auto;
    transition: transform 0.2s ease;
}

.startbar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
    transform: rotate(45deg);
}

/* Submenu Container */
.startbar .collapse .nav {
    margin-left: 2.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(100, 116, 139, 0.15);
}

/* Submenu Items */
.startbar .collapse .nav-link {
    padding: 0.5rem 0.75rem !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    border-left: none !important;
    border-radius: 0.375rem !important;
}

.startbar .collapse .nav-link:hover {
    background: rgba(59, 130, 246, 0.06) !important;
    color: #3b82f6 !important;
}

.startbar .collapse .nav-link.active {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

/* Scrollbar Styling */
.startbar .simplebar-scrollbar::before {
    background: rgba(100, 116, 139, 0.3) !important;
    border-radius: 10px !important;
}

/* Mobile Overlay */
.startbar-overlay {
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px);
}

/* Icon Alignment Fix */
.startbar .nav-link span:not(.menu-icon) {
    flex: 1;
}

/* ============================================
   NAVBAR OVERRIDE (DARK THEME)
   ============================================ */
.admin-dashboard .topbar {
    background: var(--admin-glass-bg) !important;
    backdrop-filter: var(--admin-glass-blur);
    border-bottom: 1px solid var(--admin-border);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--admin-spacing-lg);
}

.section-title {
    color: var(--admin-text);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--admin-spacing-sm);
}

.section-title i {
    color: var(--admin-purple-light);
}

/* ============================================
   PRODUCT ITEM (LIST)
   ============================================ */
.product-list-item {
    display: flex;
    align-items: center;
    gap: var(--admin-spacing-md);
    padding: var(--admin-spacing-md);
    border-radius: var(--admin-radius-md);
    transition: var(--admin-transition-fast);
}

.product-list-item:hover {
    background: rgba(124, 58, 237, 0.05);
}

.product-list-item .product-image {
    width: 48px;
    height: 48px;
    border-radius: var(--admin-radius-sm);
    object-fit: cover;
    border: 1px solid var(--admin-border);
}

.product-list-item .product-info {
    flex: 1;
    min-width: 0;
}

.product-list-item .product-name {
    color: var(--admin-text);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-list-item .product-meta {
    color: var(--admin-text-muted);
    font-size: 0.75rem;
}

.product-list-item .product-sales {
    color: var(--admin-gold);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gold {
    color: var(--admin-gold) !important;
}

.text-purple {
    color: var(--admin-purple-light) !important;
}

.text-muted-admin {
    color: var(--admin-text-muted) !important;
}

.bg-glass {
    background: var(--admin-glass-bg);
    backdrop-filter: var(--admin-glass-blur);
}

.glow-purple {
    box-shadow: var(--admin-shadow-glow);
}

.glow-gold {
    box-shadow: 0 0 20px var(--admin-gold-glow);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .metric-card .metric-value {
        font-size: 1.5rem;
    }

    .admin-dashboard .container-xxl,
    .admin-dashboard .container-fluid {
        padding: var(--admin-spacing-md);
    }
}

@media (max-width: 767.98px) {
    .metric-card {
        padding: var(--admin-spacing-md);
    }

    .metric-card .metric-value {
        font-size: 1.25rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--admin-spacing-sm);
    }
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 5px var(--admin-purple-glow);
    }
    50% {
        box-shadow: 0 0 20px var(--admin-purple-glow);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   PREMIUM DATA TABLE SYSTEM
   Stripe/Linear/Vercel inspired design
   ============================================ */

/* Summary Cards Row */
.summary-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--admin-purple) 0%,
        var(--admin-gold) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -8px rgba(124, 58, 237, 0.15);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.summary-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.summary-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.summary-card__trend.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.summary-card__trend.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.summary-card__trend i {
    font-size: 0.875rem;
}

.summary-card__icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.summary-card__icon.purple {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

.summary-card__icon.gold {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.summary-card__icon.green {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
}

.summary-card__icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

/* Table Container */
.premium-table-container {
    background: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Table Toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    background: rgba(248, 250, 252, 0.6);
    flex-wrap: wrap;
}

.table-toolbar__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Search Input */
.table-search {
    position: relative;
    min-width: 400px;
}

.table-search__input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.2s ease;
}

.table-search__input::placeholder {
    color: #94a3b8;
}

.table-search__input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.table-search__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

/* Filter Buttons */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.04);
}

.filter-btn.active {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
}

.filter-btn__badge {
    background: #7c3aed;
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
}

/* Export Button */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.export-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.export-btn i {
    font-size: 1rem;
}

/* Premium Table */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Table Header */
.premium-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.premium-table thead th {
    padding: 0.875rem 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

.premium-table thead th:first-child {
    padding-left: 1.5rem;
}

.premium-table thead th:last-child {
    padding-right: 1.5rem;
}

/* Sortable Headers */
.premium-table .sortable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.premium-table .sortable:hover {
    color: #7c3aed;
}

.premium-table .sortable::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #cbd5e1;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.premium-table .sortable.asc::after {
    border-top: none;
    border-bottom: 5px solid #7c3aed;
    opacity: 1;
}

.premium-table .sortable.desc::after {
    border-top: 5px solid #7c3aed;
    opacity: 1;
}

/* Table Body */
.premium-table tbody tr {
    transition: all 0.15s ease;
}

.premium-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.03);
}

.premium-table tbody tr.selected {
    background: rgba(124, 58, 237, 0.06);
}

.premium-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.08);
    font-size: 0.875rem;
    color: #334155;
    vertical-align: middle;
}

.premium-table tbody td:first-child {
    padding-left: 1.5rem;
}

.premium-table tbody td:last-child {
    padding-right: 1.5rem;
}

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

/* Row Checkbox */
.row-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    transition: all 0.15s ease;
}

.row-checkbox:checked {
    background: #7c3aed;
    border-color: #7c3aed;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.row-checkbox:hover {
    border-color: #7c3aed;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pill.paid,
.status-pill.completed,
.status-pill.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}
.status-pill.paid::before,
.status-pill.completed::before,
.status-pill.success::before {
    background: #22c55e;
}

.status-pill.pending,
.status-pill.processing {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}
.status-pill.pending::before,
.status-pill.processing::before {
    background: #f59e0b;
}

.status-pill.shipped,
.status-pill.dispatched {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.status-pill.shipped::before,
.status-pill.dispatched::before {
    background: #3b82f6;
}

.status-pill.failed,
.status-pill.cancelled,
.status-pill.refunded {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
.status-pill.failed::before,
.status-pill.cancelled::before,
.status-pill.refunded::before {
    background: #ef4444;
}

.status-pill.downloaded,
.status-pill.digital {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}
.status-pill.downloaded::before,
.status-pill.digital::before {
    background: #7c3aed;
}

.status-pill.draft,
.status-pill.inactive {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}
.status-pill.draft::before,
.status-pill.inactive::before {
    background: #94a3b8;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #475569; /* slate-600 */
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
}

.quick-action-btn i {
    color: inherit !important;
}

.quick-action-btn.view { color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.quick-action-btn.edit { color: #22c55e; border-color: rgba(34, 197, 94, 0.3); }
.quick-action-btn.delete { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.quick-action-btn.download { color: #8b5cf6; border-color: rgba(139, 92, 246, 0.3); }

.quick-action-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.5);
}

.quick-action-btn.view:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.5);
}

.quick-action-btn.edit:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.5);
}

.quick-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.5);
}

.quick-action-btn.download:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
}

.bulk-actions-bar.visible {
    display: flex;
}

.bulk-actions-bar__count {
    font-weight: 600;
    font-size: 0.875rem;
}

.bulk-actions-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Table Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
    background: rgba(248, 250, 252, 0.4);
}

.table-pagination__info {
    font-size: 0.8125rem;
    color: #64748b;
}

.table-pagination__controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.5rem;
    background: white;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #7c3aed;
    color: #7c3aed;
}

.pagination-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filters Panel */
.filters-panel {
    display: none;
    padding: 1rem 1.5rem;
    background: rgba(248, 250, 252, 0.8);
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-panel.visible {
    display: flex;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 160px;
}

.filter-group__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.filter-group__select {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-group__select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-picker input {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #334155;
    background: white;
    min-width: 130px;
}

.date-range-picker input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* User Avatar Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-cell__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(124, 58, 237, 0.2);
}

.user-cell__avatar.placeholder {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-cell__info {
    display: flex;
    flex-direction: column;
}

.user-cell__name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.user-cell__email {
    font-size: 0.75rem;
    color: #64748b;
}

/* Order ID Cell */
.order-id {
    font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #7c3aed;
}

/* Amount Cell */
.amount-cell {
    font-weight: 600;
    color: #0f172a;
}

.amount-cell.positive {
    color: #16a34a;
}

.amount-cell.negative {
    color: #dc2626;
}

/* Empty State */
.table-empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.table-empty-state__icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.table-empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.table-empty-state__description {
    font-size: 0.875rem;
    color: #94a3b8;
    max-width: 360px;
    margin: 0 auto;
}

/* Loading State */
.table-loading {
    padding: 4rem 2rem;
    text-align: center;
}

.table-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: #7c3aed;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Table */
@media (max-width: 991.98px) {
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        min-width: 100%;
    }

    .table-toolbar__right {
        justify-content: flex-end;
    }

    .summary-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .premium-table-container {
        border-radius: 0;
        margin: 0 -1rem;
    }

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

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

    .table-pagination {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Column Visibility Toggle */
.column-toggle {
    position: relative;
}

.column-toggle__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: 0.75rem;
    padding: 0.75rem;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    display: none;
}

.column-toggle__dropdown.visible {
    display: block;
}

.column-toggle__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #475569;
    transition: background 0.15s ease;
}

.column-toggle__item:hover {
    background: rgba(124, 58, 237, 0.05);
}

/* Keyboard Shortcut Hints */
.keyboard-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.375rem;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 0.5rem;
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
}
