* {
    box-sizing: border-box;
}

:root {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-glow: rgba(129, 140, 248, 0.2);
    --bg-main: #0b0f1a;
    --card-bg: #141b2d;
    --card-hover: #1c253d;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(20, 27, 45, 0.8);
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -1px rgb(0 0 0 / 0.3);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    background-image: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

.premium-nav {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
}

.nav-links a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--primary);
    background: var(--primary-glow);
}

.main-container {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.btn-premium {
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-premium:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary-premium {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary-premium:hover {
    background: rgba(255, 255, 255, 0.1);
}

.glass-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-main);
    width: 100%;
    display: block;
    transition: all 0.2s;
    font-size: 0.95rem;
}

/* Fix for Chrome autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #141b2d inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

.badge-premium {
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-success { background: rgba(74, 222, 128, 0.1); color: var(--success); }
.badge-warning { background: rgba(251, 191, 36, 0.1); color: var(--warning); }
.badge-danger { background: rgba(248, 113, 113, 0.1); color: var(--danger); }

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

.premium-table th {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.premium-table tr {
    background: transparent;
    transition: all 0.2s;
}

.premium-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #080b14;
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-link i {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

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

.sidebar-link:hover i {
    transform: translateX(2px);
}

.sidebar-link.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(129, 140, 248, 0.1);
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Page Layout Shift */
.has-sidebar {
    margin-left: 280px;
}

/* Sales Gold Theme */
.card-gold {
    background: linear-gradient(135deg, #141b2d 0%, #1c253d 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
    position: relative;
    overflow: hidden;
}

.card-gold::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Badges */
.badge-premium {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-success { background: rgba(74, 222, 128, 0.1); color: #4ade80; border-color: rgba(74, 222, 128, 0.2); }
.badge-warning { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border-color: rgba(251, 191, 36, 0.2); }
.badge-danger { background: rgba(248, 113, 113, 0.1); color: #f87171; border-color: rgba(248, 113, 113, 0.2); }
.badge-primary { background: rgba(129, 140, 248, 0.1); color: #a5b4fc; border-color: rgba(129, 140, 248, 0.2); }

.text-gold {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.badge-gold {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Alerts */
.alert-premium {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.alert-premium.success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
}

.alert-premium.danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}

/* Modern Slider / Detail Panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 600px;
    max-width: 90vw;
    background: #0d121f;
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.detail-panel.active {
    transform: translateX(0);
}

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

.detail-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1999;
}

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

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.animate-fade-in {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.login-box {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

.btn-premium.pulse:hover {
    animation: pulse 1.5s infinite;
}

/* Side Panel / Slider */
.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 550px;
    max-width: 90vw;
    height: 100%;
    background: #ffffff;
    /* Solid color to prevent transparency issues */
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 1001;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    transform: translateX(100%);
    visibility: hidden;
    padding: 2.5rem;
    overflow-y: auto;
}

.side-panel.active {
    transform: translateX(0);
    visibility: visible;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.side-panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-panel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.close-panel:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

.qr-container {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    display: inline-block;
    margin: 1.5rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.qr-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

.info-group {
    margin-bottom: 1.5rem;
}

.info-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.info-value {
    color: var(--text-main);
    font-weight: 500;
    word-break: break-all;
}