/*
 * Panel eCartelera – Design System Refresh
 * Modernised UI with reusable tokens and components.
 */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Archivo:wght@300;400;500;600;700;800;900&display=swap');

/* -------------------------------------------------------------------------- */
/* Theme Tokens                                                                */
/* -------------------------------------------------------------------------- */
:root,
html.theme-dark,
html.theme-dark body {
    --surface-0: #040404;
    --surface-1: #0b0b0d;
    --surface-2: rgba(22, 22, 24, 0.92);
    --surface-3: rgba(32, 32, 36, 0.78);
    --surface-border: #DDD;
    --surface-border-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);

    --text-primary: #f5f5f5;
    --text-secondary: rgba(229, 229, 229, 0.7);
    --text-muted: rgba(229, 229, 229, 0.55);
    --text-inverse: #050505;

    --accent-primary: #9ee800;
    --accent-primary-strong: #b4ff1a;
    --accent-surface: rgba(158, 232, 0, 0.12);
    --accent-shadow: rgba(158, 232, 0, 0.3);

    --success-surface: rgba(111, 207, 151, 0.16);
    --success-strong: #4caf6d;
    --info-surface: rgba(100, 181, 246, 0.18);
    --info-strong: #64b5f6;
    --danger-base: #ff5151;
    --danger-surface: rgba(255, 81, 81, 0.18);

    --gradient-app: radial-gradient(circle at 0% 0%, rgba(158, 232, 0, 0.06), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(100, 181, 246, 0.06), transparent 55%),
        #050505;

    --scrollbar-track: #151515;
    --scrollbar-thumb: #303030;
    --scrollbar-thumb-hover: #9ee800;

    /* Legacy aliases */
    --bg-primary: var(--surface-0);
    --bg-secondary: var(--surface-2);
    --bg-tertiary: var(--surface-3);
    --bg-input: rgba(18, 18, 20, 0.75);
    --bg-input-focus: rgba(28, 28, 32, 0.95);
    --bg-navbar: rgba(10, 10, 12, 0.92);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-table-stripe: rgba(255, 255, 255, 0.04);

    --border-primary: var(--surface-border);
    --border-secondary: rgba(255, 255, 255, 0.12);
    --border-input: rgba(255, 255, 255, 0.16);

    --gradient-accent: linear-gradient(135deg, #9ee800 0%, #fafd0b 100%);
    --gradient-accent-hover: linear-gradient(135deg, #b4ff1a 0%, #fbfd3d 100%);
}

html.theme-light,
html.theme-light body {
    --surface-0: #f2f4f8;
    --surface-1: #ffffff;
    --surface-2: rgba(255, 255, 255, 0.92);
    --surface-3: rgba(245, 247, 250, 0.92);
    --surface-border: #DDD;
    --surface-border-strong: rgba(17, 24, 39, 0.14);
    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.18);

    --text-primary: #101828;
    --text-secondary: rgba(16, 24, 40, 0.75);
    --text-muted: rgba(16, 24, 40, 0.55);
    --text-inverse: #ffffff;

    --accent-primary: #759e0b;
    --accent-primary-strong: #8bb20d;
    --accent-surface: rgba(117, 158, 11, 0.12);
    --accent-shadow: rgba(117, 158, 11, 0.24);

    --success-surface: rgba(56, 142, 60, 0.12);
    --success-strong: #2e7d32;
    --info-surface: rgba(33, 150, 243, 0.12);
    --info-strong: #1976d2;
    --danger-base: #c0392b;
    --danger-surface: rgba(192, 57, 43, 0.14);

    --gradient-app: radial-gradient(circle at 0% 0%, rgba(117, 158, 11, 0.12), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(33, 150, 243, 0.12), transparent 65%),
        #f5f5f5;

    --scrollbar-track: #d7dce5;
    --scrollbar-thumb: #b8c2cc;
    --scrollbar-thumb-hover: #759e0b;

    --bg-primary: var(--surface-0);
    --bg-secondary: var(--surface-1);
    --bg-tertiary: var(--surface-3);
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;
    --bg-navbar: rgba(255, 255, 255, 0.92);
    --bg-hover: rgba(117, 158, 11, 0.1);
    --bg-table-stripe: rgba(117, 158, 11, 0.05);

    --border-primary: var(--surface-border);
    --border-secondary: rgba(99, 112, 126, 0.2);
    --border-input: rgba(99, 112, 126, 0.2);

    --gradient-accent: linear-gradient(135deg, #759e0b 0%, #639010 100%);
    --gradient-accent-hover: linear-gradient(135deg, #8bb20d 0%, #759e0b 100%);
}

:root {
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 999px;
    --nav-height: 68px;
    --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Bebas Neue', 'Impact', sans-serif;
    --font-base: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Base Styles                                                                 */
/* -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background: var(--gradient-app);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(158, 232, 0, 0.02) 2px,
            rgba(158, 232, 0, 0.02) 4px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

.layout-shell {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.app-main {
    flex: 1;
    padding: 48px 0 64px;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.stack-md {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stack-lg {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--accent-primary-strong);
}

p {
    color: var(--text-secondary);
}

hr {
    border: none;
    border-top: 1px solid var(--surface-border);
    margin: 24px 0;
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Surface & Card Tokens                                                       */
/* -------------------------------------------------------------------------- */
.surface {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 32px;
    position: relative;
}

.surface--muted {
    background: var(--surface-3);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.cards-grid > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.cards-grid > *:nth-child(1) { animation-delay: 0.1s; }
.cards-grid > *:nth-child(2) { animation-delay: 0.2s; }
.cards-grid > *:nth-child(3) { animation-delay: 0.3s; }
.cards-grid > *:nth-child(4) { animation-delay: 0.4s; }

/* -------------------------------------------------------------------------- */
/* Navigation                                                                  */
/* -------------------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-navbar);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: var(--nav-height);
}

.nav-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2rem;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(158, 232, 0, 0.4);
}

.nav-brand__tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--surface-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}

.nav-link:hover,
.nav-link:focus-visible {
    background: var(--accent-surface);
    color: var(--accent-primary-strong);
    transform: translateY(-1px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--surface-border);
    background: var(--surface-3);
    cursor: pointer;
    transition: border var(--transition-base), transform var(--transition-base);
}

.nav-user:hover,
.nav-user:focus-within {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.nav-user__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-surface);
    color: var(--accent-primary-strong);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.nav-user__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-user__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-user__role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-user__chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.nav-user__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 220px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-user:hover .nav-user__menu,
.nav-user:focus-within .nav-user__menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-user__menu a {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background var(--transition-base), color var(--transition-base);
}

.nav-user__menu a:hover,
.nav-user__menu a:focus-visible {
    background: var(--accent-surface);
    color: var(--accent-primary-strong);
}

/* Emulation Mode Styles */
.nav-user--emulating {
    background: var(--danger-surface) !important;
    border: 1px solid var(--danger-base) !important;
    animation: pulse-emulation 2s infinite;
}

.nav-user--emulating:hover,
.nav-user--emulating:focus-within {
    background: var(--danger-surface) !important;
    border-color: var(--danger-base) !important;
}

.nav-user--emulating .nav-user__avatar {
    background: var(--danger-base) !important;
    color: white !important;
}

.nav-user__menu-header {
    padding: 0.75rem 1rem 0.5rem;
    background: var(--danger-surface);
    border-bottom: 1px solid var(--danger-base);
    margin: -0.5rem -0.5rem 0.5rem;
}

.nav-user__menu-divider {
    height: 1px;
    background: var(--surface-border);
    margin: 0.5rem 0;
}

.menu-item-danger {
    color: var(--danger-base) !important;
    font-weight: 600 !important;
}

.menu-item-danger:hover,
.menu-item-danger:focus-visible {
    background: var(--danger-surface) !important;
    color: var(--danger-base) !important;
}

@keyframes pulse-emulation {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 81, 81, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 81, 81, 0);
    }
}

.emulation-badge {
    color: var(--danger-base);
    font-weight: 600;
}

.emulation-icon {
    margin-right: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/* Alerts                                                                      */
/* -------------------------------------------------------------------------- */
.alert {
    position: relative;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    background: var(--surface-3);
    color: var(--text-primary);
}

.alert + .alert {
    margin-top: 16px;
}

.alert-banner {
    border-left: 4px solid var(--accent-primary);
}

.alert-success {
    background: var(--success-surface);
    border-color: rgba(76, 175, 109, 0.35);
    color: var(--success-strong);
}

.alert-error {
    background: var(--danger-surface);
    border-color: rgba(255, 81, 81, 0.35);
    color: var(--danger-base);
}

.alert-info {
    background: var(--info-surface);
    border-color: rgba(100, 181, 246, 0.35);
    color: var(--info-strong);
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                     */
/* -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), border var(--transition-base);
    color: inherit;
    background: transparent;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--text-inverse);
    box-shadow:
        0 12px 30px var(--accent-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: transparent;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    background: var(--gradient-accent-hover);
    box-shadow:
        0 16px 40px var(--accent-shadow),
        0 0 30px var(--accent-primary),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: var(--surface-3);
    border-color: var(--surface-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary-strong);
}

.btn-ghost {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary-strong);
    background: var(--accent-surface);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5151 0%, #ff884d 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(255, 81, 81, 0.35);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff6666 0%, #ffa36d 100%);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    gap: 8px;
}

.btn-icon__symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-border-strong);
    color: inherit;
    font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                       */
/* -------------------------------------------------------------------------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label,
.form-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea,
.filters input,
.filters select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-shadow);
    background: var(--bg-input-focus);
}

.form-group small,
.form-helper {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.form-group .error,
.error.field-error {
    font-size: 0.82rem;
    color: var(--danger-base);
    font-weight: 600;
}

.form-footer {
    margin-top: 8px;
    text-align: center;
}

.form-footer a {
    font-weight: 500;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.form-actions .btn:not(.btn-block) {
    min-width: 160px;
}

.form-surface {
    max-width: 720px;
}

/* Toggle */
.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-3);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-pill);
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--gradient-accent);
    border-color: transparent;
    box-shadow: 0 0 10px var(--accent-shadow);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
    background: white;
}

.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.toggle-switch:hover .toggle-slider {
    border-color: var(--accent-primary);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------- */
/* Auth                                                                        */
/* -------------------------------------------------------------------------- */
.auth-container {
    min-height: calc(100vh - var(--nav-height, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: min(420px, 100%);
    text-align: left;
    position: relative;
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.auth-subtitle {
    margin-top: 8px;
    margin-bottom: 16px;
}

.divider {
    position: relative;
    text-align: center;
    margin: 16px 0;
}

.divider span {
    display: inline-block;
    padding: 0 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--surface-2);
    position: relative;
    z-index: 1;
}

.divider:before {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    background: var(--surface-border);
    transform: translateY(-50%);
}

/* -------------------------------------------------------------------------- */
/* Page Headers                                                                */
/* -------------------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 0.95;
    text-shadow:
        0 0 20px rgba(158, 232, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.4);
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--gradient-accent);
    box-shadow: 0 0 16px var(--accent-primary);
}

.page-subtitle {
    margin-top: 20px;
    max-width: 52ch;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* Dashboard                                                                   */
/* -------------------------------------------------------------------------- */
.dashboard-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 32px;
    background: linear-gradient(135deg, rgba(158, 232, 0, 0.05) 0%, transparent 100%),
                var(--surface-2);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, var(--accent-primary) 0%, transparent 50%) 1;
    overflow: hidden;
    transition: all var(--transition-base);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--accent-primary) 0px,
        var(--accent-primary) 20px,
        transparent 20px,
        transparent 40px
    );
    opacity: 0.4;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(158, 232, 0, 0.2);
    border-color: var(--accent-primary);
}

.dashboard-card:hover::before {
    opacity: 0.8;
    animation: film-strip-slide 1.5s linear infinite;
}

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

@keyframes film-strip-slide {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}

.dashboard-card h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    line-height: 1;
}

.dashboard-card p {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

.dashboard-card .btn {
    margin-top: 24px;
}

/* Company Media Section */
.company-media {
    margin-top: 3rem;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header__content h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    margin: 0 0 0.5rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.section-header__content p {
    color: var(--text-secondary);
    margin: 0;
}

.section-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.section-stat {
    background: linear-gradient(135deg, rgba(158, 232, 0, 0.08) 0%, var(--surface-2) 100%);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(158, 232, 0, 0.3);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(158, 232, 0, 0.1);
    transition: all var(--transition-base);
}

.section-stat:hover {
    border-color: var(--accent-primary);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(158, 232, 0, 0.2);
    transform: translateY(-2px);
}

.section-stat strong {
    font-family: var(--font-display);
    color: var(--accent-primary);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(158, 232, 0, 0.5);
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.media-grid .media-card {
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.media-grid .media-card:nth-child(1) { animation-delay: 0.05s; }
.media-grid .media-card:nth-child(2) { animation-delay: 0.1s; }
.media-grid .media-card:nth-child(3) { animation-delay: 0.15s; }
.media-grid .media-card:nth-child(4) { animation-delay: 0.2s; }
.media-grid .media-card:nth-child(5) { animation-delay: 0.25s; }
.media-grid .media-card:nth-child(6) { animation-delay: 0.3s; }
.media-grid .media-card:nth-child(7) { animation-delay: 0.35s; }
.media-grid .media-card:nth-child(8) { animation-delay: 0.4s; }
.media-grid .media-card:nth-child(9) { animation-delay: 0.45s; }
.media-grid .media-card:nth-child(10) { animation-delay: 0.5s; }

.media-card__poster {
    position: relative;
    padding-top: 150%;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px rgba(158, 232, 0, 0.1);
    transition: all var(--transition-base);
}

.media-card:hover .media-card__poster {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(158, 232, 0, 0.3),
        inset 0 0 0 2px var(--accent-primary);
}

.media-card__poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 1;
}

.media-card:hover .media-card__poster::before {
    opacity: 1;
}

.media-card__poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:hover .media-card__poster img {
    transform: scale(1.1);
}

.media-card__type {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(158, 232, 0, 0.4);
    z-index: 2;
    font-family: var(--font-base);
}

.media-card__info {
    margin-top: 0.75rem;
}

.media-card__info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color var(--transition-base);
}

.media-card:hover .media-card__info h3 {
    color: var(--accent-primary);
}

.media-card__info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.empty-state {
    padding: 3rem;
    text-align: center;
}

.empty-state__title {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
    color: var(--text-secondary);
}

.empty-state__text {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Filters & Toolbars                                                          */
/* -------------------------------------------------------------------------- */
.filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filters__form {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.filters__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------- */
/* Tables                                                                      */
/* -------------------------------------------------------------------------- */
.table-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    background: var(--surface-2);
}

.table-card.surface {
    padding: 0;
}

.table-scroll {
    overflow-x: auto;
    padding: 8px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table thead th {
    text-align: left;
    padding: 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--surface-border);
}

.data-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--surface-border);
    color: var(--text-secondary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
    background: var(--bg-table-stripe);
}

.data-table--interactive tbody tr:hover {
    background: var(--accent-surface);
    color: var(--text-primary);
}

.data-table .current-session {
    border-left: 3px solid var(--accent-primary);
}

.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-summary {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Badges                                                                      */
/* -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-status {
    background: var(--surface-3);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}

.badge-active {
    background: var(--accent-surface);
    color: var(--accent-primary-strong);
}

.badge-suspended {
    background: rgba(255, 196, 0, 0.18);
    color: #fbbf24;
}

.badge-inactive {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5f5;
}

.badge-role-superadmin {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
}

.badge-role-admin {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.badge-role-user {
    background: rgba(45, 212, 191, 0.18);
    color: #5eead4;
}

/* -------------------------------------------------------------------------- */
/* Profile                                                                     */
/* -------------------------------------------------------------------------- */
.profile-container {
    display: grid;
    gap: 24px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-section h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.profile-section h3 {
    font-size: 1.1rem;
    margin-top: 16px;
}

.passkeys-list {
    margin-top: 12px;
}

.passkeys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.passkey-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    background: var(--surface-3);
    transition: transform var(--transition-base), border var(--transition-base);
}

.passkey-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
}

.passkey-icon {
    font-size: 32px;
}

.passkey-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.passkey-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.user-info strong {
    color: var(--text-primary);
}

.btn-delete-passkey {
    padding: 6px 12px;
    background: var(--danger-surface);
    color: var(--danger-base);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-base), color var(--transition-base);
}

.btn-delete-passkey:hover {
    background: var(--danger-base);
    color: #fff;
}

/* Theme selector */
.theme-selector {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.theme-option {
    position: relative;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    background: var(--surface-3);
    display: grid;
    place-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.theme-option:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.theme-option.active {
    border-color: var(--accent-primary);
    background: var(--accent-surface);
    box-shadow: var(--shadow-md);
}

.theme-option input {
    display: none;
}

.theme-option-icon {
    font-size: 1.8rem;
}

.theme-option-label {
    font-weight: 600;
    color: var(--text-primary);
}

.theme-option-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Sessions                                                                    */
/* -------------------------------------------------------------------------- */
.sessions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* -------------------------------------------------------------------------- */
/* Error Pages                                                                 */
/* -------------------------------------------------------------------------- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 5rem;
    color: var(--accent-primary);
}

.error-page p {
    max-width: 520px;
    margin: 0 auto;
}

/* -------------------------------------------------------------------------- */
/* Utilities                                                                   */
/* -------------------------------------------------------------------------- */
.badge + .badge {
    margin-left: 8px;
}

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

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}

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

/* Text selection */
::selection {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

::-moz-selection {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                  */
/* -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .profile-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 18px;
    }

    .nav-links {
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .navbar-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links {
        justify-content: center;
    }

    .nav-user__menu {
        right: 50%;
        transform: translate(50%, -6px);
    }

    .nav-user:hover .nav-user__menu,
    .nav-user:focus-within .nav-user__menu {
        transform: translate(50%, 0);
    }

    .surface {
        padding: 24px;
    }

    .filters__form {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-block,
    .form-actions .btn {
        width: 100%;
    }

    .data-table {
        min-width: 100%;
    }

    .auth-card {
        padding: 24px;
    }

    .auth-card h1 {
        font-size: 1.75rem;
    }

    .passkeys-grid {
        grid-template-columns: 1fr;
    }

    /* Products section responsive */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

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

    .product-select-group,
    .search-group {
        max-width: 100%;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
    }

    .radio-option {
        padding: 12px;
    }

    .checkbox-label {
        padding: 10px;
    }

    /* Media grid responsive */
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-stats {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 540px) {
    .page-title {
        font-size: 2.5rem;
    }

    .section-header__content h2 {
        font-size: 2rem;
    }

    .dashboard-card h3 {
        font-size: 1.8rem;
    }

    .nav-brand__tag {
        display: none;
    }

    .nav-user__meta {
        display: none;
    }

    .nav-user {
        padding: 6px;
    }
}

/* ========================================================================== */
/* Company Branding Components                                               */
/* ========================================================================== */

/* Form Section Dividers */
.form-divider {
    border: 0;
    border-top: 1px solid var(--surface-border);
    margin: 2rem 0;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Logo Upload Container */
.logo-upload-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.logo-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--surface-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.logo-placeholder svg {
    margin-bottom: 0.5rem;
}

.logo-upload-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.logo-upload-container.drag-over .logo-preview {
    border-color: var(--accent-primary);
    background: var(--accent-surface);
}

/* Gradient Pickers */
.gradients-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.gradient-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gradient-picker label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.gradient-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 2px solid var(--surface-border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-preview::after {
    content: '✎';
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gradient-preview:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.gradient-preview:hover::after {
    opacity: 1;
}

/* Font Selector */
.font-selector-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.font-type-toggle {
    display: flex;
    gap: 2rem;
}

.radio-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-inline input[type="radio"] {
    cursor: pointer;
}

.font-option {
    padding: 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--surface-2);
}

.font-select {
    width: 100%;
    margin-bottom: 1rem;
}

.font-preview {
    padding: 1.5rem;
    background: var(--surface-0);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

.font-preview p {
    margin: 0.5rem 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.font-file-info {
    padding: 1rem;
    background: var(--success-surface);
    border-radius: 6px;
    margin-top: 1rem;
}

.font-file-info p {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: var(--surface-1);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--surface-border);
}

.modal-content.modal-lg {
    max-width: 900px;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--surface-3);
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--surface-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Logo Editor */
.logo-editor {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 2rem;
}

.logo-editor-canvas {
    border: 2px solid var(--surface-border);
    border-radius: 12px;
    overflow: hidden;
    background: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface-2) 0% 50%) 50% / 20px 20px;
}

.logo-editor-canvas canvas {
    display: block;
    cursor: move;
}

.logo-editor-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px var(--accent-surface);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px var(--accent-surface);
}

.control-group span {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.875rem;
}

/* Gradient Editor */
.gradient-editor {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gradient-preview-large {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    border: 2px solid var(--surface-border);
    box-shadow: var(--shadow-md);
}

.gradient-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gradient-controls select,
.gradient-controls input[type="color"],
.gradient-controls input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-primary);
    font-size: 1rem;
}

#solidColorControls input[type="color"] {
    height: 60px;
    cursor: pointer;
}

#colorStops {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-stop {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

.color-stop input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-stop input[type="number"] {
    width: 80px;
    padding: 0.5rem;
}

.color-stop span {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-icon {
    background: var(--danger-surface);
    color: var(--danger-base);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--danger-base);
    color: white;
}

.gradient-css-output {
    margin-top: 1rem;
}

.gradient-css-output label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gradient-css-output textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--surface-0);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    resize: vertical;
}

/* Select2 Dark Theme Override */
.select2-container--default .select2-selection--single {
    background-color: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    height: 42px;
    padding: 6px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 28px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-dropdown {
    background-color: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.select2-container--default .select2-results__option {
    background-color: var(--surface-2);
    color: var(--text-primary);
    padding: 8px 12px;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: var(--accent-surface);
    color: var(--accent-primary);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--surface-3);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-upload-container {
        flex-direction: column;
    }

    .logo-editor {
        grid-template-columns: 1fr;
    }

    .logo-editor-canvas canvas {
        width: 100%;
        height: auto;
    }

    .gradients-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
        margin: 1rem;
    }
}

/* Form help text */
.form-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ========================================================================== */
/* Stats Grid                                                                */
/* ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 24px;
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

/* ========================================================================== */
/* Enhanced Badge Variants                                                   */
/* ========================================================================== */

.badge-success {
    background: var(--success-surface);
    color: var(--success-strong);
    border: 1px solid rgba(76, 175, 109, 0.25);
}

.badge-danger {
    background: var(--danger-surface);
    color: var(--danger-base);
    border: 1px solid rgba(255, 81, 81, 0.25);
}

.badge-info {
    background: var(--info-surface);
    color: var(--info-strong);
    border: 1px solid rgba(100, 181, 246, 0.25);
}

.badge-warning {
    background: rgba(255, 196, 0, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(255, 196, 0, 0.25);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* ========================================================================== */
/* Radio Groups & Checkbox Styling                                          */
/* ========================================================================== */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--surface-2);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.radio-option:hover {
    background: var(--accent-surface);
    border-color: var(--accent-primary);
}

.radio-option input[type="radio"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.radio-option input[type="radio"]:checked + div {
    color: var(--text-primary);
}

.radio-option div {
    flex: 1;
}

.radio-option strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.radio-option small {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    background: var(--surface-2);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.checkbox-label:hover {
    background: var(--accent-surface);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label span {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================================================== */
/* Alert Variants                                                            */
/* ========================================================================== */

.alert-warning {
    background: rgba(255, 196, 0, 0.18);
    border-color: rgba(255, 196, 0, 0.35);
    color: #fbbf24;
}

.alert-warning strong {
    display: block;
    margin-bottom: 8px;
}

.alert-warning p {
    color: inherit;
    margin: 0;
}

.alert-info strong {
    display: block;
    margin-bottom: 8px;
    color: var(--info-strong);
}

.alert-info p {
    color: var(--text-secondary);
    margin: 0;
}

.alert-info .badge {
    margin-left: 12px;
}

/* ========================================================================== */
/* Text Utilities                                                            */
/* ========================================================================== */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================================================== */
/* Inline Forms                                                              */
/* ========================================================================== */

.inline-form {
    display: inline;
}

/* ========================================================================== */
/* Page Header Actions                                                       */
/* ========================================================================== */

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

/* ========================================================================== */
/* Product-Specific Styles                                                  */
/* ========================================================================== */

.product-select-group {
    flex: 1;
    max-width: 500px;
}

.search-group {
    max-width: 500px;
}

.product-info-alert {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-info-alert > div {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.entity-website {
    font-size: 0.85rem;
}

.entity-website a {
    color: var(--info-strong);
    text-decoration: none;
    transition: color var(--transition-base);
}

.entity-website a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* ========================================================================== */
/* Loading Overlay                                                           */
/* ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay > div {
    background: var(--surface-2);
    padding: 24px 48px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ========================================================================== */
/* New Entity Button (Create/Add Actions)                                    */
/* ========================================================================== */

.btn-new-entity {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--accent-shadow), 0 0 0 0 var(--accent-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-new-entity::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn-new-entity:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-shadow), 0 0 0 0 var(--accent-primary);
}

.btn-new-entity:hover::before {
    opacity: 1;
}

.btn-new-entity:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--accent-shadow);
}

.btn-new-entity svg {
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-new-entity:hover svg {
    transform: rotate(90deg);
}

/* Pulse animation for emphasis (optional, can be added with JS) */
@keyframes pulse-new-entity {
    0%, 100% {
        box-shadow: 0 2px 8px var(--accent-shadow), 0 0 0 0 var(--accent-primary);
    }
    50% {
        box-shadow: 0 2px 8px var(--accent-shadow), 0 0 0 8px rgba(188, 255, 0, 0);
    }
}

.btn-new-entity.pulse {
    animation: pulse-new-entity 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-new-entity {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-new-entity svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================================================== */
/* Advanced Gradient Builder                                                 */
/* ========================================================================== */

.modal-gradient {
    max-width: 800px;
}

.gradient-builder {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Big Preview */
.gradient-preview-big {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-md);
    background: linear-gradient(90deg, #ffffff 0%, #000000 100%);
}

/* Gradient Slider Bar */
.gradient-slider-container {
    padding: 0.5rem 0;
}

.gradient-slider-bar {
    position: relative;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    cursor: crosshair;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gradient-slider-track {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #ffffff 0%, #000000 100%);
}

.gradient-stops-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.slider-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    cursor: grab;
    pointer-events: all;
    transition: transform 0.15s ease;
}

.slider-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.slider-marker.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Color Stops List */
.color-stops-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

.color-stop-row {
    display: grid;
    grid-template-columns: auto 28px 90px 1fr 95px 32px;
    gap: 0.625rem;
    align-items: center;
    padding: 0.625rem;
    background: var(--surface-1);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    transition: all 0.2s ease;
}

.color-stop-row:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-stop-row.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.color-stop-row.highlighted {
    animation: highlight-pulse 0.6s ease;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 2px 16px var(--accent-shadow);
    }
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: var(--text-primary);
}

.color-preview-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
}

.color-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--surface-border);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-preview:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 6px var(--accent-shadow);
}

.color-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    visibility: hidden;
}

.color-picker {
    width: 36px;
    height: 28px;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.hex-input {
    width: 90px;
    padding: 0.4rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    text-transform: uppercase;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-primary);
}

.hex-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.opacity-control,
.position-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.opacity-control label,
.position-control label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.opacity-slider {
    flex: 1;
    min-width: 0;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    outline: none;
    -webkit-appearance: none;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.opacity-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.opacity-value {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: right;
}

.position-input {
    width: 50px;
    padding: 0.25rem 0.375rem;
    font-size: 0.8125rem;
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text-primary);
    text-align: center;
}

.position-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.position-control span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-delete-stop {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-surface);
    color: var(--danger-base);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-stop:hover:not(:disabled) {
    background: var(--danger-base);
    color: white;
}

.btn-delete-stop:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Controls Row */
.gradient-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.gradient-type-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--surface-2);
    padding: 4px;
    border-radius: 8px;
}

.gradient-type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gradient-type-btn:hover {
    background: var(--surface-3);
    color: var(--text-primary);
}

.gradient-type-btn.active {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* Angle Control */
.gradient-angle-control {
    padding: 1rem;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

.gradient-angle-control label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.angle-control-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.angle-control-wrapper input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    outline: none;
    -webkit-appearance: none;
}

.angle-control-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.angle-control-wrapper input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.angle-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 50px;
    text-align: right;
}

/* CSS Output */
.gradient-css-output {
    padding: 1rem;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--surface-border);
}

.gradient-css-output label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.css-output-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.css-output-wrapper code {
    flex: 1;
    display: block;
    padding: 0.75rem 1rem;
    background: var(--surface-0);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: nowrap;
}

.btn-copy {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--accent-surface);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-gradient {
        max-width: 100%;
        margin: 1rem;
    }

    .gradient-preview-big {
        height: 200px;
    }

    .color-stop-row {
        grid-template-columns: auto 28px 36px 90px 1fr auto;
        gap: 0.5rem;
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .position-control {
        display: none;
    }

    .opacity-control label,
    .position-control label {
        display: none;
    }

    .gradient-controls-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .gradient-type-toggle {
        width: 100%;
        justify-content: center;
    }
}
