:root {
    /* Colors - Deep Space Theme */
    --primary-bg: #030712;
    --primary-bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #020617 60%);

    /* Glassmorphism Surface Tokens */
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.08);
    /* Subtle border */
    --card-inner-glow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    /* Top highlight */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --card-backdrop: blur(16px) saturate(180%);

    /* Accents - Electric Violet & Neon Pink */
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --accent-glow: rgba(124, 58, 237, 0.4);
    --accent-text-gradient: linear-gradient(to right, #ffffff 10%, #d8b4fe 100%);

    /* Status Colors - Vibrant & Clear */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;

    /* Typography */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Form Elements */
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-border: rgba(139, 92, 246, 0.5);
    --input-focus-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);

    /* Layout & Spacing */
    --sidebar-width: 280px;
    --header-height: 80px;
    --border-radius: 20px;
    --border-radius-sm: 12px;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Animation Defaults */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
}

body {
    font-family: var(--font-body);
    background: var(--primary-bg);
    background-image: var(--primary-bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Animated Glassmorphism Blobs */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.1;
    animation: blobFloat 20s ease-in-out infinite, blobColor 15s ease-in-out infinite alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    top: -20%;
    right: -10%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    animation-delay: 0s;
    opacity: 0.1;
}

.blob-2 {
    width: 500px;
    height: 500px;
    bottom: -15%;
    left: -10%;
    background: linear-gradient(135deg, #6366f1, var(--accent-primary));
    animation-delay: -5s;
    animation-duration: 25s, 18s;
    opacity: 0.1;
}

.blob-3 {
    width: 400px;
    height: 400px;
    top: 40%;
    left: 50%;
    background: linear-gradient(135deg, var(--accent-secondary), #f472b6);
    animation-delay: -10s;
    animation-duration: 22s, 12s;
    opacity: 0.1;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95) rotate(-5deg);
    }

    75% {
        transform: translate(40px, 30px) scale(1.02) rotate(3deg);
    }
}

@keyframes blobColor {
    0% {
        filter: blur(80px) hue-rotate(0deg);
    }

    50% {
        filter: blur(90px) hue-rotate(20deg);
    }

    100% {
        filter: blur(80px) hue-rotate(-20deg);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-main);
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 16px;
    /* Floating sidebar */
    top: 16px;
    bottom: 16px;
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.7);
    /* Slightly more opaque for readability */
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--card-shadow);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%), rgba(15, 23, 42, 0.85);
}

.sidebar-header {
    padding: 32px 24px 24px;
    text-align: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.3));
    letter-spacing: -0.03em;
}

.nav-menu {
    list-style: none;
    padding: 0 12px;
    flex: 1;
    overflow-y: auto;
    margin-top: 12px;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-menu a.active {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-gradient);
    border-radius: 99px;
}

.nav-menu .icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--card-border);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.user-info {
    margin-bottom: 16px;
}

.user-name {
    display: block;
    font-weight: 700;
    font-family: var(--font-heading);
}

.user-tokens {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    animation: fadeIn 0.4s ease-out;
    position: relative;
    z-index: 2;
}

.main-full {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    position: relative;
    z-index: 2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content>* {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Cards */
/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow), var(--card-inner-glow);
    border-radius: var(--border-radius);
    padding: 32px;
    margin-bottom: 32px;
    transition: transform 0.3s var(--bounce), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.3), var(--card-inner-glow);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Shine effect on card hover */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.03) 55%, transparent 60%);
    transition: all 0.7s;
    pointer-events: none;
}

.card:hover::after {
    left: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 600;
    background: var(--accent-text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Dropdowns */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    z-index: 100;
    min-width: 180px;
    margin-top: 8px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Elements */
/* Elements - Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border: 1px solid transparent;
    border-radius: 99px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s var(--bounce), box-shadow 0.2s ease, background 0.2s;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--accent-gradient);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background-position: 100% 50%;
    /* Gradient Shift */
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    border-color: transparent;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
    box-shadow: var(--input-focus-shadow), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Enhanced Select Styling */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.form-select option {
    background: #1e293b;
    color: var(--text-main);
    padding: 12px;
}

/* Date Input Styling */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(220deg);
}

/* File Input Styling */
input[type="file"] {
    width: 100%;
    padding: 14px 20px;
    background: var(--input-bg);
    border: 1px dashed var(--input-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

input[type="file"]:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent-primary);
}

input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--input-focus);
}

input[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 99px;
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Compact File Input (for toolbars) */
.file-input-compact {
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
    width: auto !important;
    max-width: 200px;
    display: inline-block;
}

.file-input-compact::file-selector-button {
    padding: 4px 10px !important;
    margin-right: 8px !important;
    font-size: 0.75rem !important;
}

.form-textarea {
    min-height: 150px;
    font-family: var(--font-mono);
}

/* Tables - Premium Glass */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.table th {
    text-align: left;
    padding: 16px 24px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.table td {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
    vertical-align: middle;
}

.table td:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    border-left: 1px solid rgba(255, 255, 255, 0.03);
}

.table td:last-child {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.table tbody tr {
    transition: transform 0.2s ease;
}

.table tbody tr:hover {
    transform: scale(1.005);
    z-index: 10;
    position: relative;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Badges */
/* Badges - Vibrant & Glowing */
.badge {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.badge::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background: currentColor;
    z-index: 0;
}

.badge-draft,
.badge-stopped {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-ready {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.15);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
}

.badge-scheduled {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.15);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.2);
}

.badge-queued {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.15);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}

.badge-sending {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
    animation: pulse-glow 2s infinite;
}

.badge-completed {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

.badge-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.2);
}

.badge-paused {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

.badge-preparing {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.2);
    animation: pulse-glow 1.5s infinite;
}

.badge-stopping {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.2);
    animation: pulse-glow 1.5s infinite;
}


@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 15px currentColor;
    }
}

/* Progress Bars */
/* Progress Bars - Neon Glow */
.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 20px var(--accent-glow);
    position: relative;
}

/* Shimmer effect for progress bar */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Sending Progress (Compact) */
.sending-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 99px;
    border: 1px solid var(--card-border);
}

.sending-progress .progress-bar {
    width: 60px;
    height: 6px;
    flex-shrink: 0;
}

.sending-progress .progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
}


/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.5;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.5;
    filter: grayscale(0.5);
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Wizard */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 99px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--card-border);
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 99px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.wizard-step.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.wizard-step.completed {
    color: var(--success);
}

.wizard-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.wizard-step.active .wizard-step-number {
    background: rgba(255, 255, 255, 0.2);
}

/* Tag Legend */
.tag-legend {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

}

.tag-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    font-size: 0.85rem;

    cursor: pointer;
    transition: var(--transition);
}

.tag-item:hover {
    background: var(--accent-glow);
    color: white;
    border-color: var(--accent-primary);
}

/* Health Indicator (extends .live-indicator) */
.health-indicator {
    margin-top: 12px;
    font-size: 0.8rem;
}

.health-indicator.healthy {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.health-indicator.healthy::before {
    background: var(--success);
    animation: live-pulse 2s infinite;
}

.health-indicator.degraded {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
}

.health-indicator.degraded::before {
    background: var(--warning);
    animation: none;
}

.health-indicator.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.health-indicator.error::before {
    background: var(--error);
    animation: none;
}

/* CodeMirror Override */
.CodeMirror {
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid var(--input-border);
}

.CodeMirror-focused {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--input-focus);
}

/* Responsive */
/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.live-indicator::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.7);
}

.live-indicator.active {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.live-indicator.active::before {
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: live-pulse 2s infinite;
}

.live-indicator.error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.live-indicator.error::before {
    background: var(--error);
    animation: none;
}

@keyframes live-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(139, 92, 246, 0.05);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    padding-top: 24px;
}

/* Responsive */

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
    display: none;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    right: 0;
    top: 24px;
    width: 24px;
    height: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 101;
    transform: translateX(100%);
}

.sidebar-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle .toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: 80px;
}

/* Hide text elements completely in collapsed state */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .health-indicator {
    display: none;
}

/* Hide nav text - only show icons */
.sidebar.collapsed .nav-menu a {
    justify-content: center;
    padding: 14px;
    gap: 0;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-menu a span:not(.icon) {
    display: none;
}

/* Center the icon */
.sidebar.collapsed .nav-menu .icon {
    margin: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 16px;
}

.sidebar.collapsed .logo {
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
}

/* Hide footer completely and let menu take full height */
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .nav-menu {
    flex: 1;
    padding-bottom: 20px;
}

.sidebar.collapsed .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* Transition for smooth collapse */
.sidebar,
.sidebar .logo-text,
.sidebar .health-indicator,
.sidebar .user-name,
.sidebar .user-tokens,
.sidebar .logout-btn,
.sidebar .nav-menu a span:not(.icon) {
    transition: all 0.3s ease;
}

/* Only apply collapsed margin on desktop, not mobile */
@media (min-width: 769px) {
    body.sidebar-collapsed .main-content {
        margin-left: 80px;
    }
}

/* Tablet - Collapsed sidebar by default */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-header h1 .logo-text,
    .user-name,
    .user-tokens,
    .logout-btn {
        display: none;
    }

    .nav-menu a span:not(.icon) {
        display: none;
    }

    .nav-menu a {
        justify-content: center;
        padding: 16px;
    }

    .main-content {
        margin-left: 80px;
    }
}

/* Mobile - Hamburger menu */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: static;
        width: 40px;
        height: 40px;
        margin-right: 12px;
        flex-shrink: 0;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        width: 280px;
        border-radius: 0;
        transition: left 0.3s ease;
        z-index: 100;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar.open~.sidebar-overlay {
        display: block;
    }

    .sidebar-header h1,
    .sidebar-footer,
    .user-name,
    .user-tokens,
    .logout-btn {
        display: block;
    }

    .nav-menu a span:not(.icon),
    .nav-text {
        display: inline;
    }

    .nav-menu a {
        justify-content: flex-start;
        padding: 14px 20px;
        gap: 14px;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .page-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }

    .page-title {
        font-size: 1.4rem;
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .wizard-steps {
        flex-wrap: wrap;
        padding: 4px;
    }

    .wizard-step {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .wizard-step span:not(.wizard-step-number) {
        display: none;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Diff View Styles */
#ai-diff-container {
    height: 400px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--card-border);
}

.merge-view-container .CodeMirror {
    height: 100% !important;
}

.CodeMirror-merge,
.CodeMirror-merge .CodeMirror {
    height: 400px !important;
}

.CodeMirror-merge-2pane .CodeMirror-merge-pane {
    width: 47%;
}

.CodeMirror-merge-2pane .CodeMirror-merge-gap {
    width: 6%;
}

.ai-refinement-changes {
    margin-bottom: 20px;
}

.ai-refinement-changes ul {
    list-style: none;
    padding: 0;
}

.ai-refinement-changes li {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-refinement-changes li::before {
    content: '✨';
}

/* Fullscreen Modal Override */
.modal.modal-fullscreen {
    max-width: none;
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    margin: 0;
}

.modal-fullscreen .modal-body {
    padding: 20px;
    height: calc(100vh - 160px);
    /* Adjust based on header/footer */
}

.modal-fullscreen #ai-diff-container {
    height: 100% !important;
}

.modal-fullscreen .CodeMirror-merge,
.modal-fullscreen .CodeMirror-merge .CodeMirror {
    height: 100% !important;
}

/* Unified Diff Visuals */
#ai-diff-container {
    background: #0f172a;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 24px;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
    border-radius: var(--border-radius-sm);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#ai-diff-container del {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    text-decoration: line-through;
    padding: 2px 4px;
    border-radius: 4px;
}

#ai-diff-container ins {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Inline Diff Styles */
.cm-diff-added {
    background-color: rgba(16, 185, 129, 0.2) !important;
    border-bottom: 2px solid var(--success);
    color: #fff !important;
}

.cm-diff-deleted {
    background-color: rgba(239, 68, 68, 0.2) !important;
    text-decoration: line-through;
    color: var(--text-muted) !important;
    opacity: 0.7;
}

/* CodeMirror Theme Refinement */
.CodeMirror {
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
}

.CodeMirror-gutters {
    background: rgba(0, 0, 0, 0.2) !important;
    border-right: 1px solid var(--card-border) !important;
}

.CodeMirror-linenr {
    color: var(--text-dim) !important;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--accent-primary) !important;
}

.cm-s-material-darker .cm-tag {
    color: var(--accent-secondary) !important;
}

.cm-s-material-darker .cm-attribute {
    color: var(--accent-primary) !important;
}

.cm-s-material-darker .cm-string {
    color: var(--success) !important;
}

.cm-s-material-darker .cm-comment {
    color: var(--text-dim) !important;
}

.cm-s-material-darker .cm-keyword {
    color: var(--accent-primary) !important;
}

/* Scrollbar for CodeMirror */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
}

/* Unified Diff CodeMirror Styling */
#ai-diff-container .CodeMirror {
    height: 100% !important;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
}

#ai-diff-container .CodeMirror-gutters {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--card-border);
}

/* Diff line highlights */
.cm-negative {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

.cm-positive {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

/* Make line numbers subtle */
#ai-diff-container .CodeMirror-linenumber {
    color: var(--text-dim);
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:hover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--input-focus);
}

input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

input[type="checkbox"]:indeterminate {
    background: rgba(139, 92, 246, 0.3);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:indeterminate::after {
    content: '−';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

/* Order Quick Cards */
.order-quick-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.order-quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.order-card-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.order-card-content {
    flex: 1;
}

.order-card-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.order-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.order-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 99px;
    background: var(--warning);
    color: #000;
    text-transform: uppercase;
}

.order-quick-card.pending {
    border-left: 3px solid var(--warning);
}

.order-quick-card.pending:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.order-quick-card.today {
    border-left: 3px solid var(--accent-primary);
}

.order-quick-card.revenue {
    border-left: 3px solid var(--success);
}

.order-quick-card.revenue:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.order-quick-card.packages {
    border-left: 3px solid var(--accent-secondary);
}

.order-quick-card.packages:hover {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--accent-secondary);
}