/* ================================
   PROFESSIONAL UI SYSTEM v2.0
   MNC-Level Design Tokens & Styles
   ================================ */

/* ================================
   DESIGN TOKENS
   ================================ */
:root {
    /* Brand Colors - Premium Orange Palette */
    --primary-50: #FFF7ED;
    --primary-100: #FFEDD5;
    --primary-200: #FED7AA;
    --primary-300: #FDBA74;
    --primary-400: #FB923C;
    --primary-500: #F97316;
    --primary-600: #EA580C;
    --primary-700: #C2410C;
    --primary-800: #9A3412;
    --primary-900: #7C2D12;

    /* Keep backward compatibility */
    --primary-color: #FF8C42;
    --primary-hover: #F97316;
    --primary-light: rgba(255, 140, 66, 0.08);
    --primary-glow: rgba(255, 140, 66, 0.25);

    /* Neutral Colors - Enhanced */
    --gray-50: #FAFAF9;
    --gray-100: #F5F5F4;
    --gray-200: #E7E5E4;
    --gray-300: #D6D3D1;
    --gray-400: #A8A29E;
    --gray-500: #78716C;
    --gray-600: #57534E;
    --gray-700: #44403C;
    --gray-800: #292524;
    --gray-900: #1C1917;

    /* Keep backward compatibility */
    --text-dark: #1C1917;
    --text-medium: #57534E;
    --text-light: #78716C;
    --bg-white: #FFFFFF;
    --bg-cream: #FAFAF9;
    --bg-light: #F5F5F4;
    --border-color: #E7E5E4;

    /* Semantic Colors - Enhanced */
    --success: #059669;
    --success-light: rgba(5, 150, 105, 0.1);
    --error: #DC2626;
    --error-light: rgba(220, 38, 38, 0.1);
    --warning: #D97706;
    --warning-light: rgba(217, 119, 6, 0.1);
    --info: #0284C7;
    --info-light: rgba(2, 132, 199, 0.1);

    /* Premium Shadows - Layered */
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.05);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.08), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.08), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(28, 25, 23, 0.08), 0 8px 10px -6px rgba(28, 25, 23, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(28, 25, 23, 0.2);
    --shadow-primary: 0 10px 30px -5px rgba(255, 140, 66, 0.3);
    --shadow-primary-lg: 0 20px 40px -10px rgba(255, 140, 66, 0.35);

    /* Focus Ring */
    --focus-ring: 0 0 0 3px rgba(255, 140, 66, 0.25);
    --focus-ring-inset: inset 0 0 0 2px rgba(255, 140, 66, 0.5);

    /* Border Radius System */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Spacing System */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-fixed: 30;
    --z-overlay: 40;
    --z-modal: 50;
    --z-popover: 60;
    --z-tooltip: 70;
}

/* ================================
   GLOBAL STYLES
   ================================ */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Better focus states */
*:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Selection color */
::selection {
    background: rgba(255, 140, 66, 0.2);
    color: var(--text-dark);
}

/* ================================
   PROFESSIONAL HEADER
   ================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-3) var(--space-5);
    transition: var(--transition-base);
}

.app-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-dark);
}

/* Premium Menu Button */
.menu-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-base);
    color: var(--text-dark);
    font-size: 0;
}

.menu-btn:hover {
    background: var(--primary-light);
    border-color: rgba(255, 140, 66, 0.3);
    transform: translateY(-1px);
}

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

/* Credits Badge - Premium */
.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-white) 100%);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-700);
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
}

.credits-badge:hover {
    box-shadow: var(--shadow-sm);
}

.credits-badge .icon {
    color: var(--primary-500);
}

/* ================================
   PREMIUM CARDS
   ================================ */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 140, 66, 0.3) 50%, transparent 100%);
    opacity: 0;
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

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

.card-compact {
    padding: var(--space-4);
}

/* Card as link */
a.card {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Premium card variant */
.card-premium {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--primary-50) 100%);
    border-color: var(--primary-200);
}

/* ================================
   PROFESSIONAL BUTTONS
   ================================ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: var(--transition-base);
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Button - Premium */
.btn-primary {
    width: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid var(--primary-600);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--primary-400) 0%, var(--primary-color) 100%);
    box-shadow: var(--shadow-primary-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Shimmer effect on primary buttons */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    transition: left 0.6s ease;
}

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

/* Secondary Button */
.btn-secondary {
    width: 100%;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

/* Outline Button */
.btn-outline {
    width: 100%;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--text-medium);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Icon only button */
.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-lg);
}

/* Button sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 16px;
    border-radius: var(--radius-xl);
}

/* Loading state */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

.btn-secondary.btn-loading::before,
.btn-outline.btn-loading::before,
.btn-ghost.btn-loading::before {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
}

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

/* ================================
   FORM ELEMENTS
   ================================ */
.input-group {
    margin-bottom: var(--space-5);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-2);
    letter-spacing: -0.1px;
}

input[type="text"],
input[type="email"],
input[type="tel"]:not(.otp-input),
input[type="password"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-dark);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    box-shadow: var(--shadow-xs);
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--gray-300);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--bg-light);
    color: var(--text-light);
    cursor: not-allowed;
}

/* OTP Inputs */
.otp-inputs {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.otp-input {
    width: 52px;
    height: 56px;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    box-shadow: var(--shadow-xs);
    color: var(--text-dark);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.otp-input:not(:placeholder-shown) {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

/* ================================
   SLIDE MENU - PREMIUM
   ================================ */
.slide-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--bg-white);
    z-index: var(--z-modal);
    transition: left var(--transition-slow);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
}

.slide-menu.active {
    left: 0;
}

.menu-header {
    padding: var(--space-6);
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg-white) 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.menu-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 20px;
    color: var(--text-medium);
    cursor: pointer;
    transition: var(--transition-base);
}

.menu-close:hover {
    background: var(--error-light);
    color: var(--error);
    border-color: rgba(220, 38, 38, 0.3);
}

.menu-user-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.menu-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
}

.menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-user-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 var(--space-1) 0;
}

.menu-user-details p {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0;
}

.menu-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3) 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    margin: var(--space-1) var(--space-3);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - var(--space-6));
    font-family: var(--font-sans);
}

.menu-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.menu-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-medium);
    transition: var(--transition-base);
}

.menu-item:hover .menu-item-icon {
    color: var(--primary-color);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-3) var(--space-5);
}

.menu-item.logout {
    color: var(--error);
}

.menu-item.logout:hover {
    background: var(--error-light);
}

.menu-item.logout .menu-item-icon {
    color: var(--error);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ================================
   DASHBOARD STYLES
   ================================ */
.dash-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-6);
}

.dash-header {
    margin-bottom: var(--space-6);
}

.dash-greeting {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 var(--space-1) 0;
    letter-spacing: -0.5px;
}

.dash-tagline {
    font-size: 15px;
    color: var(--text-medium);
    margin: 0;
}

/* Hero CTA */
.cta-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-2xl);
    color: white;
    text-decoration: none;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-primary-lg);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.cta-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    opacity: 0;
    transition: var(--transition-base);
}

.cta-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 50px -12px rgba(255, 140, 66, 0.4);
}

.cta-hero:hover::before {
    opacity: 1;
}

.cta-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.cta-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.cta-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.2);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
}

/* Stats Grid */
.stats-section {
    margin-bottom: var(--space-6);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    text-align: center;
    transition: var(--transition-base);
}

.stat-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-medium);
    margin-top: var(--space-1);
}

.credits-highlight {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-white) 100%);
    border-color: var(--primary-200);
}

.credits-highlight .stat-value {
    color: var(--primary-600);
}

/* Content Layout */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-6);
}

@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
}

.main-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.view-all-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Renders Grid */
.renders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.render-card {
    display: block;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

.render-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.render-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--bg-light);
}

.render-info {
    padding: var(--space-3);
}

.render-type {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.render-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

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

.skeleton-render {
    aspect-ratio: 3/4;
}

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

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

/* Action Cards (Sidebar) */
.action-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
    margin-bottom: var(--space-3);
}

@media (max-width: 768px) {
    .action-card {
        margin-bottom: 0;
        flex-direction: column;
        text-align: center;
        padding: var(--space-5);
    }

    .action-arrow {
        display: none;
    }
}

.action-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    font-size: 22px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.action-content {
    flex: 1;
    min-width: 0;
}

.action-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.action-subtitle {
    font-size: 13px;
    color: var(--text-medium);
    margin-top: 2px;
}

.action-arrow {
    font-size: 18px;
    color: var(--gray-400);
    transition: var(--transition-base);
}

.action-card:hover .action-arrow {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-2);
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: var(--space-5);
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */
.toast {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    max-width: 360px;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    z-index: var(--z-tooltip);
    animation: toast-in 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

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

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ================================
   UPLOAD AREAS
   ================================ */
.upload-area {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    overflow: hidden;
}

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

.upload-area.has-file {
    border-style: solid;
    border-color: var(--primary-color);
}

.upload-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    color: var(--text-light);
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
    background: var(--bg-white);
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-medium);
}

/* Change button on uploaded image */
.change-btn {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-4);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.change-btn:hover {
    background: var(--primary-color);
}

/* ================================
   MODALS
   ================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-base);
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-6);
    box-shadow: var(--shadow-2xl);
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

/* ================================
   LOADING OVERLAY
   ================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-6);
}

.loading-overlay.active {
    display: flex;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    color: white;
}

.loading-top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.stage-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    font-size: 28px;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.stage-copy {
    text-align: left;
}

.stage-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-1);
}

.stage-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.stage-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.stage-chip {
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 140, 66, 0.2);
    color: var(--primary-300);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.stage-dots {
    display: flex;
    gap: var(--space-2);
}

.stage-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: dot-pulse 1.4s ease-in-out infinite;
}

.stage-dots span:nth-child(1) {
    animation-delay: 0s;
}

.stage-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.stage-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Progress bar */
.loading-bar-background {
    width: 280px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    padding: 4px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-400) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.white-bars-container {
    position: absolute;
    display: flex;
    gap: 16px;
    height: 100%;
    animation: bars-move 1s linear infinite;
}

.white-bar {
    width: 8px;
    height: 200%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    transform: rotate(25deg);
}

@keyframes bars-move {
    from {
        transform: translateX(-40px);
    }

    to {
        transform: translateX(0);
    }
}

/* ================================
   RESPONSIVE ADJUSTMENTS
   ================================ */
@media (max-width: 640px) {
    .dash-wrap {
        padding: var(--space-4);
    }

    .dash-greeting {
        font-size: 20px;
    }

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

    .stat-card {
        padding: var(--space-4);
    }

    .stat-value {
        font-size: 24px;
    }

    .cta-hero {
        padding: var(--space-5);
    }

    .cta-title {
        font-size: 16px;
    }

    .toast {
        left: var(--space-3);
        right: var(--space-3);
        max-width: none;
    }

    .modal-content {
        padding: var(--space-5);
        margin: var(--space-4);
    }

    .otp-input {
        width: 44px;
        height: 50px;
        font-size: 20px;
    }
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.4s ease-out;
}

.animate-slide-in-right {
    animation: slide-in-right 0.4s ease-out;
}