/* ============================================
   Apex Crypto Trading - Premium Theme System
   ============================================ */

/* --- CSS Variables (Dark Theme - Default) --- */
:root,
[data-theme="dark"] {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --bg-input: #0f1623;
    --bg-sidebar: #0d1320;
    --bg-nav: #111827;
    --bg-modal: #1a2332;
    --bg-table-hover: rgba(99, 102, 241, 0.05);

    --border-primary: rgba(255, 255, 255, 0.06);
    --border-secondary: rgba(255, 255, 255, 0.1);
    --border-focus: #6366f1;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #e2e8f0;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-primary-glow: rgba(99, 102, 241, 0.3);
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.1);
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.1);
    --accent-red-glow: rgba(239, 68, 68, 0.3);
    --accent-amber: #f59e0b;
    --accent-amber-bg: rgba(245, 158, 11, 0.1);
    --accent-blue: #3b82f6;
    --accent-blue-bg: rgba(59, 130, 246, 0.1);
    --accent-cyan: #06b6d4;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-red: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-card: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(139, 92, 246, 0.05) 100%
    );
    --gradient-balance: linear-gradient(
        135deg,
        #1e293b 0%,
        #0f172a 50%,
        #1e1b4b 100%
    );

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Light Theme --- */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-nav: #ffffff;
    --bg-modal: #ffffff;
    --bg-table-hover: rgba(99, 102, 241, 0.04);

    --border-primary: rgba(0, 0, 0, 0.06);
    --border-secondary: rgba(0, 0, 0, 0.1);

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
    --shadow-card:
        0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);

    --gradient-balance: linear-gradient(
        135deg,
        #eef2ff 0%,
        #e0e7ff 50%,
        #ede9fe 100%
    );
}

/* --- Global Reset & Base --- */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition:
        background var(--transition-base),
        color var(--transition-base);
    line-height: 1.6;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-green {
    color: var(--accent-green) !important;
}
.text-red {
    color: var(--accent-red) !important;
}
.text-amber {
    color: var(--accent-amber) !important;
}
.text-blue {
    color: var(--accent-blue) !important;
}
.text-muted-custom {
    color: var(--text-muted) !important;
}
.text-secondary-custom {
    color: var(--text-secondary) !important;
}

/* --- Cards --- */
.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: visible;
}
.card-premium:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-lg);
}
.card-premium .card-body {
    padding: 20px;
}
.card-premium .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-primary);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-heading);
}

/* Glass card effect */
.card-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    opacity: 0;
    transition: opacity var(--transition-base);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card:hover::before {
    opacity: 1;
}
.stat-card.stat-primary::before {
    background: var(--gradient-primary);
}
.stat-card.stat-green::before {
    background: var(--gradient-green);
}
.stat-card.stat-red::before {
    background: var(--gradient-red);
}
.stat-card.stat-amber::before {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.stat-card.stat-blue::before {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform var(--transition-spring);
}
.stat-card:hover .stat-icon {
    transform: scale(1.1);
}
.stat-icon.icon-primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}
.stat-icon.icon-green {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}
.stat-icon.icon-red {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}
.stat-icon.icon-amber {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
}
.stat-icon.icon-blue {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

/* --- Buttons --- */
.btn-premium {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
.btn-premium::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.btn-premium:hover::after {
    opacity: 1;
}

.btn-primary-glow {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}
.btn-primary-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-primary-glow);
    color: #fff;
}

.btn-green-glow {
    background: var(--gradient-green);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}
.btn-green-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-green-glow);
    color: #fff;
}

.btn-red-glow {
    background: var(--gradient-red);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-red-glow);
}
.btn-red-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}
.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* --- Form Controls --- */
.form-control-premium,
.form-select-premium {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}
.form-control-premium:focus,
.form-select-premium:focus {
    background: var(--bg-input);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    outline: none;
}
.form-control-premium::placeholder {
    color: var(--text-muted);
}
.form-label-premium {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* --- Tables --- */
.card-premium .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}
.table-premium {
    color: var(--text-primary);
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-striped-color: var(--text-primary);
    --bs-table-active-bg: var(--bg-table-hover);
    --bs-table-active-color: var(--text-primary);
    --bs-table-hover-bg: var(--bg-table-hover);
    --bs-table-hover-color: var(--text-primary);
}
.table-premium thead th {
    background: var(--bg-input);
    border-bottom: 2px solid var(--border-primary);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 7px 6px;
    white-space: nowrap;
}
.table-premium tbody td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
    font-size: 0.74rem;
    background: transparent !important;
    white-space: nowrap;
}
.table-premium tbody tr {
    transition: background var(--transition-fast);
    background-color: transparent !important;
}
.table-premium tbody tr:hover {
    background: var(--bg-table-hover) !important;
}
/* Compact buttons & selects inside tables */
.table-premium .btn-sm {
    padding: 4px 10px;
    font-size: 0.72rem;
}
.table-premium .form-select-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: 75px;
}
.table-premium .avatar-circle-sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

/* --- Badges --- */
.badge-premium {
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}
.badge-danger {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}
.badge-warning {
    background: var(--accent-amber-bg);
    color: var(--accent-amber);
}
.badge-primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
}
.badge-info {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

/* --- Icon Rail (Mobile sidebar strip) --- */
.icon-rail {
    display: none; /* hidden on desktop, shown on mobile via media query */
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-primary);
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow: hidden;
}
.icon-rail-top {
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--border-primary);
    width: 100%;
    display: flex;
    justify-content: center;
}
.icon-rail-logo {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}
.icon-rail-links {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.icon-rail-links::-webkit-scrollbar { width: 0; }
.icon-rail-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: all var(--transition-base);
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}
.icon-rail-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.icon-rail-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}
.icon-rail-bottom {
    padding: 8px 0 12px;
    border-top: 1px solid var(--border-primary);
    width: 100%;
    display: flex;
    justify-content: center;
}

/* --- Sidebar (Admin) --- */
.sidebar-premium {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-primary);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1002;
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border-primary);
}
.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-base);
    margin-bottom: 2px;
}
.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}
.sidebar-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}
.sidebar-link.active i {
    color: var(--accent-primary);
}
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-primary);
}
.main-content-admin {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* --- Bottom Nav (User) --- */
.bottom-nav-premium {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    border-top: 1px solid var(--border-primary);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.bottom-nav-item {
    color: var(--text-muted);
    text-decoration: none;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 6px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all var(--transition-base);
    position: relative;
}
.bottom-nav-item i {
    font-size: 1.15rem;
    transition: transform var(--transition-spring);
}
.bottom-nav-item.active {
    color: var(--accent-primary);
}
.bottom-nav-item.active i {
    transform: scale(1.15);
}
.bottom-nav-item.active::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

/* --- Top Bar (User) --- */
.top-bar-premium {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Notifications --- */
.notification-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
}

.notification-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.notification-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-red);
    border-radius: 50%;
    border: 1.5px solid var(--bg-input);
}

.notification-link:hover .notification-dot {
    border-color: var(--bg-card-hover);
}

.blink {
    animation: blinker 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blinker {
    50% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

/* --- Theme Toggle --- */
.theme-toggle {
    width: 44px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
    position: relative;
    cursor: pointer;
    transition: all var(--transition-base);
}
.theme-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    transition: transform var(--transition-spring);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .theme-toggle::after {
    transform: translateX(20px);
    background: var(--accent-amber);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}
@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-primary-glow);
    }
    50% {
        box-shadow:
            0 0 20px var(--accent-primary-glow),
            0 0 40px rgba(99, 102, 241, 0.1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}
.animate-fade-up {
    animation: fadeInUp 0.5s ease forwards;
}
.animate-slide-left {
    animation: slideInLeft 0.4s ease forwards;
}
.animate-slide-right {
    animation: slideInRight 0.4s ease forwards;
}
.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}
.animate-float {
    animation: float 3s ease-in-out infinite;
}
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}
.stagger-children > *:nth-child(1) {
    animation-delay: 0.05s;
}
.stagger-children > *:nth-child(2) {
    animation-delay: 0.1s;
}
.stagger-children > *:nth-child(3) {
    animation-delay: 0.15s;
}
.stagger-children > *:nth-child(4) {
    animation-delay: 0.2s;
}
.stagger-children > *:nth-child(5) {
    animation-delay: 0.25s;
}
.stagger-children > *:nth-child(6) {
    animation-delay: 0.3s;
}
.stagger-children > *:nth-child(7) {
    animation-delay: 0.35s;
}
.stagger-children > *:nth-child(8) {
    animation-delay: 0.4s;
}

/* --- Balance Card --- */
.balance-card-premium {
    background: var(--gradient-balance);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.balance-card-premium::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(
        circle,
        rgba(99, 102, 241, 0.15) 0%,
        transparent 70%
    );
    border-radius: 50%;
}

/* --- Alerts --- */
.alert-premium {
    border-radius: var(--radius-md);
    border: 1px solid;
    padding: 14px 18px;
    font-size: 0.875rem;
    animation: slideInRight 0.3s ease;
}
.alert-premium.alert-success {
    background: var(--accent-green-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}
.alert-premium.alert-danger {
    background: var(--accent-red-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* --- Pagination --- */
.pagination {
    gap: 4px;
}
.pagination .page-link {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm) !important;
    padding: 8px 14px;
    font-size: 0.85rem;
    transition: all var(--transition-base);
}
.pagination .page-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* --- Modal --- */
.modal-premium .modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}
.modal-premium .modal-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 20px 24px;
}
.modal-premium .modal-body {
    padding: 24px;
}

/* --- Coin card (Home) --- */
.coin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-base);
    cursor: pointer;
}
.coin-card:hover {
    border-color: var(--border-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* --- Responsive --- */

/* ── Mobile: up to 768px ── */
@media (max-width: 768px) {
    /* Icon Rail visible on mobile */
    .icon-rail {
        display: flex;
    }

    /* Sidebar hidden by default, slides over icon rail */
    .sidebar-premium {
        transform: translateX(-100%);
    }
    .sidebar-premium.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Hide old hamburger toggle - icon rail replaces it */
    .mobile-toggle {
        display: none !important;
    }

    /* Main content offset for icon rail */
    .main-content-admin {
        margin-left: 52px;
        padding: 16px 10px 16px 10px;
    }

    /* Typography */
    h4 { font-size: 1.05rem; }
    h5 { font-size: 0.95rem; }
    h6 { font-size: 0.85rem; }
    p { font-size: 0.82rem; }

    /* Cards */
    .card-premium .card-body {
        padding: 12px;
    }
    .card-premium .card-header {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* Stat cards */
    .stat-card {
        padding: 12px 10px;
    }
    .stat-card h4 {
        font-size: 0.9rem;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .table-premium thead th,
    .table-premium tbody td {
        padding: 7px 5px;
        font-size: 0.68rem;
    }
    .table-premium .btn-sm {
        padding: 3px 7px;
        font-size: 0.65rem;
    }
    .table-premium .form-select-sm {
        padding: 3px 6px;
        font-size: 0.68rem;
        min-width: 65px;
    }
    .table-premium .avatar-circle-sm {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    /* Buttons */
    .btn-premium {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
    .btn-group-sm > .btn {
        font-size: 0.65rem !important;
        padding: 3px 6px;
    }

    /* Forms */
    .form-control-premium,
    .form-select-premium {
        padding: 9px 10px;
        font-size: 0.82rem;
    }
    .form-label-premium {
        font-size: 0.72rem;
    }

    /* Avatars */
    .avatar-circle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .avatar-circle-sm {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    /* Badges */
    .badge-premium {
        padding: 3px 7px;
        font-size: 0.65rem;
    }

    /* Modal */
    .modal-dialog {
        margin: 8px;
    }
    .modal-premium .modal-body {
        padding: 14px;
    }
    .modal-content .modal-body {
        padding: 14px;
    }
    .modal-header {
        padding: 12px 14px;
    }
    .modal-footer {
        padding: 10px 14px;
    }

    /* Pagination */
    .pagination .page-link {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* Empty state */
    .empty-state {
        padding: 32px 16px;
    }
    .empty-state i {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    .empty-state p {
        font-size: 0.82rem;
    }

    /* Alerts */
    .alert-premium {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    /* Balance card (user home) */
    .balance-card-premium {
        padding: 16px;
    }
    .balance-card-premium h2 {
        font-size: 1.4rem;
    }
    .balance-card-premium h3 {
        font-size: 1rem;
    }

    /* Settings pages */
    .settings-card-wrap {
        max-width: 100%;
    }
    .settings-hero {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }
    .settings-hero-title {
        font-size: 1.1rem !important;
    }
    .settings-form-card {
        padding: 1.2rem;
    }
    .settings-field-group {
        padding: 1rem;
    }
    .settings-save-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }

    /* User top bar */
    .top-bar-premium {
        padding: 10px 14px;
    }
    .top-bar-premium h6 {
        font-size: 0.88rem;
    }
    .notification-link {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    .notification-link span {
        display: none;
    }

    /* User bottom nav */
    .bottom-nav-item {
        font-size: 0.6rem;
        padding: 5px 10px;
    }
    .bottom-nav-item i {
        font-size: 1rem;
    }

    /* User container */
    .user-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Floating support buttons */
    .floating-support {
        bottom: 80px !important;
        right: 12px !important;
    }
    .floating-support .btn-support {
        width: 42px !important;
        height: 42px !important;
        font-size: 20px !important;
    }

    /* Select2 */
    .select2-container {
        font-size: 0.82rem;
    }
}

/* ── Tablet: 769px to 1024px ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content-admin {
        padding: 24px;
    }
    .sidebar-premium {
        width: 220px;
    }
    .main-content-admin {
        margin-left: 220px;
    }
    .sidebar-link {
        font-size: 0.8rem;
        padding: 9px 12px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-card h4 {
        font-size: 1rem;
    }
}

/* ── Desktop: hide mobile toggle ── */
@media (min-width: 769px) {
    .mobile-toggle {
        display: none !important;
    }
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
    background: transparent !important;
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.4;
    display: inline-block;
}
.empty-state p {
    margin-bottom: 0;
    font-weight: 500;
    font-size: 0.95rem;
}

/* --- Pill Tabs --- */
.nav-pills-premium .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-base);
    border: 1px solid transparent;
}
.nav-pills-premium .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.nav-pills-premium .nav-link.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-primary-glow);
}

/* --- Loading skeleton --- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* --- Misc --- */
.divider {
    border-top: 1px solid var(--border-primary);
    margin: 16px 0;
}
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    color: #fff;
}
.avatar-circle-sm {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}

/* Hover lift effect */
.hover-lift {
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base);
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* --- Price change indicator --- */
.price-up {
    color: var(--accent-green);
}
.price-up::before {
    content: "▲ ";
    font-size: 0.7em;
}
.price-down {
    color: var(--accent-red);
}
.price-down::before {
    content: "▼ ";
    font-size: 0.7em;
}

/* High Priority Dark Mode Table Overrides */
[data-theme="dark"] .table-premium,
[data-theme="dark"] .table-premium thead,
[data-theme="dark"] .table-premium tbody,
[data-theme="dark"] .table-premium tr,
[data-theme="dark"] .table-premium td,
[data-theme="dark"] .table-premium th {
    background-color: transparent !important;
    background: transparent !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .empty-state {
    background-color: transparent !important;
    background: transparent !important;
}
