:root {
    --primary: #a855f7;
    --primary-light: #c084fc;
    --primary-dark: #7c3aed;
    --accent: #ec4899;
    --accent-light: #f472b6;
    --surface: #0f0f1a;
    --surface-elevated: #1a1a2e;
    --surface-glass: rgba(30, 30, 50, 0.7);
    --border-glass: rgba(168, 85, 247, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a0a2e 50%, #0f1a2e 100%);
    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Global ---- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(168, 85, 247, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(236, 72, 153, 0.04) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-2%, -2%);
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ---- Typography ---- */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Navbar Glass ---- */
.navbar-glass {
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.75rem 0;
    transition: var(--transition);
}

.navbar-glass.scrolled {
    background: rgba(15, 15, 26, 0.95);
    box-shadow: var(--shadow-glow);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding-top: 76px;
}

/* ---- Cards Glass ---- */
.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    transition: var(--transition);
}

.card-glass:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.card-stat {
    overflow: hidden;
    position: relative;
}

.card-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-stat:hover::after {
    opacity: 1;
}

/* ---- Stat Icons ---- */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ---- Auth Container ---- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.auth-card {
    border-radius: 24px !important;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.auth-icon-wrap {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
    }
}

/* ---- Input Glass ---- */
.input-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition);
}

.input-glass:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}

.form-floating>label {
    color: var(--text-secondary) !important;
}

/* ---- Buttons ---- */
.btn-primary-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary-gradient:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.35);
}

.btn-primary-gradient:hover::before {
    left: 100%;
}

.btn-primary-gradient:active {
    transform: translateY(0);
}

/* ---- Tables ---- */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(168, 85, 247, 0.05);
    --bs-table-border-color: rgba(255, 255, 255, 0.05);
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

/* ---- Status Badges ---- */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 8px;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ---- Service Card ---- */
.service-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
    cursor: pointer;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.3);
}

.service-selected {
    background: rgba(168, 85, 247, 0.1) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.cursor-pointer {
    cursor: pointer;
}

/* ---- Slot Buttons ---- */
.slot-btn {
    min-width: 70px;
    transition: var(--transition);
}

.slot-btn.active {
    background: var(--gradient-primary) !important;
    border-color: var(--primary) !important;
}

/* ---- Toast Custom ---- */
.toast-custom {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* ---- Footer ---- */
.footer-glass {
    background: rgba(15, 15, 26, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-glass);
}

/* ---- Animations ---- */
.animate-fade-in {
    animation: fadeIn 0.5s ease-out both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* ---- Nav Items ---- */
.nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-link-custom:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link-custom.active {
    color: var(--primary-light) !important;
    background: rgba(168, 85, 247, 0.1);
}

/* ---- Form Switch Custom ---- */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }

    .card-body {
        padding: 1rem;
    }

    .table th,
    .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ---- Modal Dark ---- */
.modal-content {
    border-radius: var(--radius) !important;
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* ---- Alert styles ---- */
.alert {
    border-radius: var(--radius-sm);
}

/* ---- Loading Skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}