/* Dealership Brand Studio - Modern UI/UX */

:root {
    /* Dark Blue Theme Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #1d4ed8;

    /* Dark Theme Grays */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Dark Theme Backgrounds */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;

    /* Dark Theme Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Dark Theme Borders */
    --border-primary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(255, 255, 255, 0.18);
    --border-tooltip: rgba(255, 255, 255, 0.15);

    --bg-tooltip: #1f2937;
    --text-tooltip: #f9fafb;

    /* Shadows for dark theme */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Typography */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Header height */
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ===== HEADER ===== */
.dashboard-header {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    height: var(--header-height);
    margin: 0;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

.brand-logo svg {
    width: 24px;
    height: 24px;
}

.header-brand-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-secondary);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-btn:active {
    transform: scale(0.95);
}

/* ===== MINIMAL SIDEBAR ===== */
.sidebar {
    width: 56px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
    position: relative;
    width: fit-content;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.nav-item:hover .nav-text {
    opacity: 1;
    visibility: visible;
}

.nav-badge {
    position: absolute;
    right: -0.25rem;
    top: -0.25rem;
    background: var(--primary);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
    z-index: 10;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
    position: relative;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 14px;
    height: 14px;
    color: var(--gray-600);
}

.user-info {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.user-profile:hover .user-info {
    opacity: 1;
    visibility: visible;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-300);
    line-height: 1.2;
}

/* Main content adjustment */
.main-wrapper {
    flex: 1;
    margin-left: 56px;
}

.main-content {
    padding: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 0.5rem;
        gap: 0.25rem;
        overflow-x: auto;
    }

    .nav-item-group {
        flex-direction: row;
        gap: 0.25rem;
    }

    .nav-item {
        margin: 0;
        padding: 0.5rem;
        min-width: auto;
    }

    .nav-text,
    .user-info {
        display: none;
    }

    .user-profile {
        display: none;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 1rem;
    }
}

.alerts-container {
    min-height: 0;
    flex: 1;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(230, 65, 83, 0.04) 100%);
    border: 1px solid rgba(196, 30, 58, 0.12);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-user:hover {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12) 0%, rgba(230, 65, 83, 0.08) 100%);
    border-color: rgba(196, 30, 58, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Keep topbar for backward compatibility but point to dashboard-header */
.topbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    margin: 0;
}

.topbar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.topbar-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.topbar-left .subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    justify-content: flex-end;
}

#alertContainer {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1300;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.topbar .user {
    font-size: 0.95rem;
    color: var(--gray-700);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1) 0%, rgba(230, 65, 83, 0.05) 100%);
    border-radius: 24px;
    border: 1px solid rgba(196, 30, 58, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.topbar .user:hover {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.15) 0%, rgba(230, 65, 83, 0.1) 100%);
    border-color: rgba(196, 30, 58, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

/* ====== MODERN SIDEBAR ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
    transform: translateX(0);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.open {
    width: 280px;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow: hidden;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Main Content Adjustment */
.main-wrapper {
    margin-left: 80px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open~.main-wrapper {
    margin-left: 280px;
}

/* Header Adjustment */
.dashboard-header {
    position: fixed;
    top: 0;
    left: 80px;
    right: 0;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open~.main-wrapper .dashboard-header {
    left: 280px;
}

/* Color Palette Generator */
.harmony-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.harmony-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.color-palette {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

.palette-preview {
    display: grid;
    gap: 1rem;
}

.palette-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.color-swatch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.color-hex {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.primary-swatch {
    border-left: 4px solid var(--primary);
}

.secondary-swatch {
    border-left: 4px solid var(--secondary);
}

.accent-swatch {
    border-left: 4px solid var(--accent);
}

.background-swatch {
    border-left: 4px solid var(--bg-primary);
}

.text-swatch {
    border-left: 4px solid var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .color-palette {
        grid-template-columns: 1fr;
        gap: 0.75rem;

        /* Hide labels in collapsed state */
        .nav-label {
            opacity: 0;
            visibility: hidden;
        }

        .sidebar.open .nav-label {
            opacity: 1;
            visibility: visible;
        }

        /* Hide section titles in collapsed state */
        .nav-section-title {
            opacity: 0;
            height: 0;
            margin: 0;
            overflow: hidden;
        }

        .sidebar.open .nav-section-title {
            opacity: 1;
            height: auto;
            margin-bottom: 0.5rem;
        }

        /* Center icons in collapsed state */
        .sidebar:not(.open) .nav-item {
            justify-content: center;
            padding: 0.75rem;
            position: relative;
        }

        .sidebar:not(.open) .nav-item.active::before {
            display: none;
        }

        .sidebar:not(.open) .nav-item:hover {
            transform: none;
        }

        /* Tooltip for collapsed state */
        .sidebar:not(.open) .nav-item::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            margin-left: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: var(--bg-tooltip);
            color: var(--text-tooltip);
            border: 1px solid var(--border-tooltip);
            border-radius: var(--radius-md);
            font-size: 0.875rem;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            z-index: 1001;
            box-shadow: var(--shadow-lg);
            pointer-events: none;
        }

        .sidebar:not(.open) .nav-item:hover::after {
            opacity: 1;
            visibility: visible;
        }

        /* Tooltip arrow */
        .sidebar:not(.open) .nav-item::before {
            content: '';
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            margin-left: -0.5rem;
            width: 0;
            height: 0;
            border-top: 4px solid transparent;
            border-bottom: 4px solid transparent;
            border-right: 4px solid var(--border-tooltip);
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            z-index: 1001;
            pointer-events: none;
        }

        .sidebar:not(.open) .nav-item:hover::before {
            opacity: 1;
            visibility: visible;
        }
    }
}

@media (max-width: 1023px) {
    .sidebar {
        width: 280px;
        /* Always full width on mobile/tablet */
        transform: translateX(-100%);
        /* Hidden by default */
    }

    .sidebar.open {
        transform: translateX(0);
        /* Show when open */
    }

    .main-wrapper {
        margin-left: 0;
        /* No margin on mobile */
    }

    .dashboard-header {
        left: 0;
        /* Header takes full width on mobile */
    }

    /* Show labels on mobile */
    .nav-label {
        opacity: 1;
        visibility: visible;
    }

    /* Hide tooltips on mobile */
    .sidebar .nav-item::before,
    .sidebar .nav-item::after {
        display: none;
    }

    /* Overlay for mobile */
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Dark Theme Adjustments */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item:hover {
    background: var(--bg-hover);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Smooth transitions */
.nav-item,
.nav-label,
.nav-section-title {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.nav-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    width: 100%;
    display: grid;
    gap: 2rem;
}

@media (max-width: 1280px) {
    .container {
        grid-template-columns: 1fr;
    }
}

/* ===== ALERTS ===== */

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-error {
    background: #fecaca;
    color: #7f1d1d;
    border-left-color: var(--danger);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left-color: var(--success);
}

.alert-info {
    background: #dbeafe;
    color: #1e3a8a;
    border-left-color: var(--accent);
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
}

.alert-close.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* ===== LAYOUT ===== */
.main-wrapper {
    padding: 1rem;
    margin-top: var(--header-height);
}

/* ===== MODERN DASHBOARD SECTION ===== */
.dashboard-section {
    width: 100%;
    padding: 0;
    background: var(--bg-primary);
}

/* Quick Actions Section */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.action-card:hover::before {
    opacity: 0.1;
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.action-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.action-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.action-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.action-arrow {
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.action-card:hover .action-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* Recent Activity Section */
.recent-activity {
    margin-bottom: 2rem;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.activity-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.activity-actions {
    display: flex;
    gap: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .action-card {
        padding: 1rem;
        gap: 1rem;
    }

    .action-icon {
        width: 40px;
        height: 40px;
    }

    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ===== MODERN BRANDS SECTION ===== */
.brands-section {
    width: 100%;
    padding: 0;
}

.brands-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.brands-header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
}

.brands-header-content p {
    font-size: 1rem;
    color: var(--gray-600);
    margin: 0;
}

.brands-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-primary);
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.brands-table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.table-wrapper {
    overflow-x: auto;
}

.modern-brands-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.modern-brands-table th {
    background: var(--bg-tertiary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
    white-space: nowrap;
}

.modern-brands-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
    color: var(--text-secondary);
}

.modern-brands-table tbody tr:hover {
    background: var(--bg-hover);
}

.modern-brands-table tbody tr:last-child td {
    border-bottom: none;
}

/* Alert Container */
.alert-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    width: 90%;
    pointer-events: none;
}

.alert {
    position: relative;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    transform: translateX(120%);
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

.alert-success {
    background-color: #10b981;
    color: white;
}

.alert-error {
    background-color: #ef4444;
    color: white;
}

.alert-info {
    background-color: #3b82f6;
    color: white;
}

.alert-warning {
    background-color: #f59e0b;
    color: #1f2937;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Column specific styles */
.col-brand {
    width: 200px;
}

.col-slug {
    width: 150px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.col-domain {
    width: 180px;
}

.col-theme {
    width: 120px;
}

.col-status {
    width: 100px;
}

.col-actions {
    width: 120px;
    text-align: right;
}

/* Brand cell styling */
.brand-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.brand-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.125rem 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Theme color display */
.theme-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 0.375rem;
    border: 1px solid var(--gray-300);
    flex-shrink: 0;
}

.color-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Action buttons */
.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-btn {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.action-btn.edit {
    border-color: var(--accent);
    color: var(--accent);
}

.action-btn.edit:hover {
    background: var(--accent);
    color: white;
}

.action-btn.delete {
    border-color: var(--danger);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: white;
}

/* Empty state */
.empty-state td {
    padding: 0;
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-content svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
}

.empty-content .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .brands-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .brands-header-content h1 {
        font-size: 1.5rem;
    }

    .modern-brands-table {
        font-size: 0.8rem;
    }

    .modern-brands-table th,
    .modern-brands-table td {
        padding: 0.75rem 0.5rem;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .action-btn {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 1rem;
    background: var(--bg-primary);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Section */
#dashboard-section .dashboard-welcome {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    width: 100%;
}

.dashboard-welcome h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.dashboard-welcome>p {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.05) 0%, rgba(230, 65, 83, 0.02) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(196, 30, 58, 0.1);
}

.stat-card svg {
    color: var(--primary);
    flex-shrink: 0;
}

.stat-card>div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* All Previews Grid */
.all-previews {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.all-previews h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.brand-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.brand-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.brand-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.05) 0%, rgba(230, 65, 83, 0.02) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.brand-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.brand-card-slug {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.brand-card-body {
    padding: 1.5rem;
    flex: 1;
}

.brand-card-field {
    margin-bottom: 1rem;
}

.brand-card-field:last-child {
    margin-bottom: 0;
}

.brand-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.brand-card-value {
    font-size: 0.95rem;
    color: var(--gray-700);
}

.brand-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.75rem;
}

.brand-card-action {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--gray-700);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.brand-card-action:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.brand-card-action.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.brand-card-action.danger:hover {
    background: rgba(239, 68, 68, 0.05);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state svg {
    color: var(--gray-300);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state small {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Modern File Upload Areas */
.file-upload-area {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(196, 30, 58, 0.05);
    transform: scale(1.02);
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.file-upload-content svg {
    color: var(--gray-400);
    transition: color 0.3s ease;
}

.file-upload-area:hover .file-upload-content svg {
    color: var(--primary);
}

.file-upload-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.file-upload-subtitle {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin: 0;
}

.file-upload-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.preview-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    object-fit: cover;
}

.remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.remove-file:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* File Info Display */
.file-info-display {
    margin-top: 0.75rem;
    text-align: center;
}

.file-info-display .file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-info-display .file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.file-info-display .file-note {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-style: italic;
}

/* Responsive file upload */
@media (max-width: 768px) {
    .file-upload-area {
        padding: 1.5rem;
        min-height: 120px;
    }

    .file-upload-content svg {
        width: 40px;
        height: 40px;
    }

    .preview-image {
        max-width: 100px;
        max-height: 100px;
    }
}

/* ===== FORM ===== */
.form-section {
    order: 1;
}

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.form-card h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Form Section Blocks */
.form-section-block {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.form-section-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-header p {
    color: var(--gray-200);
    font-size: 0.95rem;
    margin: 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--gray-200);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.form-group small {
    color: var(--gray-200);
    font-size: 0.85rem;
}

/* Keyword Chips Styles */
.keywords-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.keywords-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 32px;
    padding: 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.keywords-chips-container:empty {
    display: none;
}

.keywords-chips-container:empty+input {
    margin-top: 0;
}

.keywords-input-container input {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.keywords-input-container input::placeholder {
    color: var(--text-muted);
}

.keywords-input-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    animation: chipSlideIn 0.2s ease-out;
}

.keyword-chip:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.keyword-text {
    white-space: nowrap;
}

.keyword-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.keyword-remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@keyframes chipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Multi-Step Form Styles */
.form-progress {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-300);
    z-index: 1;
}

.progress-steps.progress-active::before {
    background: linear-gradient(to right, var(--primary) var(--progress-width, 0%), var(--gray-300) var(--progress-width, 0%));
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.progress-step.active .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.1);
}

.progress-step.completed .step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.progress-step .step-title {
    font-size: 0.85rem;
    color: var(--gray-200);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-title {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed .step-title {
    color: var(--success);
}

.progress-bar {
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.5s ease;
    border-radius: 2px;
}

/* Form Steps */
.multi-step-form {
    position: relative;
}

.form-step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.step-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-100);
}

.step-header h2 {
    color: var(--gray-200);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.step-header p {
    color: var(--gray-200);
    font-size: 0.95rem;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-300);
}

.form-navigation .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    width: auto;
    /* Fit content instead of full width */
    white-space: nowrap;
}

.form-navigation .btn-primary {
    background: var(--primary);
    color: white;
}

.form-navigation .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-navigation .btn-secondary:hover {
    background: var(--gray-300);
}

.form-navigation .btn-outline {
    background: transparent;
    color: var(--gray-200);
    border: 1px solid var(--gray-300);
}

.form-navigation .btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Review Summary */
.review-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

.review-summary h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.review-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.review-item strong {
    color: var(--gray-200);
    display: block;
    margin-bottom: 0.25rem;
}

.review-placeholder {
    color: var(--gray-200);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Form Validation Errors */
.form-group input.error,
.form-group textarea.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.error:focus,
.form-group textarea.error:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.char-count {
    color: var(--gray-200);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Auto Input Group */
.auto-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
}

.auto-input-group input {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.auto-path-display {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    align-items: center;
}

.color-picker input[type='color'] {
    width: 100%;
    height: 60px;
    cursor: pointer;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.color-picker input[type='color']:hover {
    border-color: var(--primary);
}

.color-picker input[type='color']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-picker input[type='text'] {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.color-picker input[type='text']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Large Color Picker for Primary Selection */
.color-picker-large {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.color-picker-large input[type='color'] {
    width: 120px;
    height: 120px;
    cursor: pointer;
    border: 3px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.color-picker-large input[type='color']:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-picker-large input[type='color']:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.2);
}

.color-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    border: 3px solid var(--gray-300);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#primaryColorHex {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    max-width: 200px;
}

#primaryColorHex:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Color Palette Display */
.color-palette {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.palette-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.palette-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.palette-row.full-width {
    grid-template-columns: 1fr;
}

.color-swatch {
    position: relative;
    height: 120px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.color-label {
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-hex {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    opacity: 0.9;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(196, 30, 58, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-small {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== PREVIEW SECTION ===== */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    order: 2;
}

@media (max-width: 1280px) {
    .preview-section {
        order: 3;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.preview-card,
.output-card,
.guide-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
}

.preview-header,
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.preview-header h3,
.output-header h3,
.guide-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.preview-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-dot.active {
    background: var(--success);
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--text-primary);
}

/* Brand Preview */
.brand-preview {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 1rem;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--gray-400);
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.preview-placeholder p {
    font-size: 0.95rem;
    margin: 0;
}

/* Brand Preview Content */
.brand-preview-content {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.preview-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.preview-tagline {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin: 0.75rem 0;
}

.preview-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.preview-contact-item {
    color: var(--gray-700);
}

/* Output Container */
.output-container {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    overflow: auto;
    max-height: 400px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--border-primary);
}

.output-container.placeholder-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.placeholder-text {
    color: var(--gray-500);
    text-align: center;
}

.placeholder-text p {
    margin: 0.5rem 0;
    color: var(--gray-600);
}

/* Output Actions */
.output-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.output-actions .btn-small {
    flex: 1;
    justify-content: center;
}

/* Guide Card */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.guide-step p {
    font-size: 0.9rem;
    color: var(--gray-200);
    margin: 0;
    padding-top: 0.25rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        margin-left: 0;
        /* reset for small screens */
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: 200px;
    }

    .sidebar-toggle {
        display: block;
    }

    .brands-list {
        max-height: 150px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .brand-item {
        flex-shrink: 0;
        width: 200px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.875rem 0;
    }

    .header-wrapper {
        padding: 0 1rem;
    }

    .header-content {
        gap: 1rem;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .brand-counter {
        font-size: 0.85rem;
    }

    .main-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .form-card {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .color-picker {
        grid-template-columns: 1fr;
    }

    .color-picker input[type='color'] {
        height: 50px;
    }

    .preview-section {
        grid-template-columns: 1fr;
    }

    .output-container {
        max-height: 300px;
        font-size: 0.75rem;
    }

    .container {
        gap: 1rem;
    }
}

/* ===== BRANDS TABLE ===== */
.brands-list-container {
    margin-top: 3rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.brands-list-container h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.brands-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.brands-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.brands-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.brands-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.2s ease;
}

.brands-table tbody tr:hover {
    background: var(--gray-50);
}

.brands-table td {
    padding: 1rem;
    color: var(--gray-700);
}

.brands-table .brand-name {
    font-weight: 600;
    color: var(--primary);
}

.brands-table .brand-slug {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.theme-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-preview .color-swatch {
    display: inline-block;
    width: 24px !important;
    height: 30px !important;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-300);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.brands-table .color-swatch:hover {
    transform: scale(1.1);
}

.brands-table .actions {
    display: flex;
    gap: 0.5rem;
}

.brands-table .action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.brands-table .btn-edit {
    background: var(--accent);
    color: white;
}

.brands-table .btn-edit:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.brands-table .btn-delete {
    background: var(--danger);
    color: white;
}

.brands-table .btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.brands-table .empty-state {
    text-align: center;
}

.brands-table .empty-state td {
    padding: 2rem;
    color: var(--gray-500);
}

/* Delete confirmation modal */
.delete-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.delete-modal.active {
    display: flex;
}

.delete-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.delete-modal-content h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.delete-modal-content p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.delete-modal-content .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.delete-modal-content .modal-actions .btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.delete-modal-content .btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.delete-modal-content .btn-cancel:hover {
    background: var(--gray-300);
}

.delete-modal-content .btn-confirm-delete {
    background: var(--danger);
    color: white;
}

.delete-modal-content .btn-confirm-delete:hover {
    background: #dc2626;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .brands-list-container {
        padding: 1rem;
    }

    .brands-table {
        font-size: 0.85rem;
    }

    .brands-table th,
    .brands-table td {
        padding: 0.75rem;
    }

    .brands-table .actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .brands-table .action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}