:root {
    --primary: #0B8F3C;
    --primary-light: #34C759;
    --primary-dark: #076d2e;
    --bg-main: #f8fafc;
    --bg-sidebar: #1a1a1a;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-premium: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
    color: var(--text-main);
    min-height: 100vh;
}

@media (min-width: 1024px) {
    body {
        height: 100vh;
        overflow: hidden;
    }
}

h1, h2, h3, .brand {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

@media (min-width: 1024px) {
    .app-container {
        height: 100vh;
    }
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 24px 32px 24px;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(11, 143, 60, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.sub-brand {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.nav-item.active {
    background-color: var(--primary);
    color: var(--text-white);
}

.sidebar-footer {
    padding: 24px 12px 0 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-info .status {
    font-size: 0.7rem;
    color: var(--primary-light);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .main-content {
        height: 100vh;
        overflow: hidden;
    }
}

.top-bar {
    height: 80px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* UI Elements */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(11, 143, 60, 0.2);
}

.btn:active {
    transform: scale(0.96);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

/* Form Styling */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(11, 143, 60, 0.1), 0 4px 12px rgba(11, 143, 60, 0.05);
    transform: translateY(-1px);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.mode-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.mode-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.mode-option.active {
    border-color: var(--primary);
    background-color: rgba(11, 143, 60, 0.05);
}

.mode-option h4 {
    margin-bottom: 4px;
    color: var(--text-main);
}

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

/* Tabs Styling */
.tabs-container {
    margin-top: 32px;
}

.tabs-header {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 4px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-link.active {
    color: var(--primary);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.22s var(--ease-premium);
}

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

/* Output Area */
.output-box {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
    min-height: 300px;
}

.copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

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

/* Loader */
/* Improved Step Progress Indicator */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 48px;
    position: relative;
    padding: 0 40px;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step-item {
    width: 42px;
    height: 42px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 2;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.step-item.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(11, 143, 60, 0.2);
}

.step-item.completed {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

.step-item.completed::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary);
    z-index: -1;
}

.step-label {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.step-item.active .step-label {
    color: var(--primary);
    font-weight: 700;
}

/* App Type Grid */
.app-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.app-type-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.app-type-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.app-type-card:active {
    transform: scale(0.98);
}

.app-type-card.active {
    border-color: var(--primary);
    background-color: rgba(11, 143, 60, 0.05);
}

.app-type-card i {
    width: 24px;
    height: 24px;
    color: inherit;
    transition: var(--transition);
}

.type-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    transition: var(--transition);
}

/* Type Specific Colors */
.type-crm { --type-color: #0B8F3C; --type-bg: rgba(11, 143, 60, 0.12); }
.type-web-app { --type-color: #2563EB; --type-bg: rgba(37, 99, 235, 0.12); }
.type-marketplace { --type-color: #F97316; --type-bg: rgba(249, 115, 22, 0.12); }
.type-inventory { --type-color: #7C3AED; --type-bg: rgba(124, 58, 237, 0.12); }
.type-landing-page { --type-color: #06B6D4; --type-bg: rgba(6, 182, 212, 0.12); }
.type-membership { --type-color: #EC4899; --type-bg: rgba(236, 72, 153, 0.12); }
.type-event { --type-color: #F59E0B; --type-bg: rgba(245, 158, 11, 0.12); }
.type-prompt-builder { --type-color: #10B981; --type-bg: rgba(16, 185, 129, 0.12); }
.type-website-bisnis { --type-color: #6366F1; --type-bg: rgba(99, 102, 241, 0.12); }
.type-dashboard-admin { --type-color: #1F2937; --type-bg: rgba(31, 41, 55, 0.08); }
.type-internal-tools { --type-color: #64748B; --type-bg: rgba(100, 116, 139, 0.10); }
.type-custom { --type-color: #9CA3AF; --type-bg: rgba(156, 163, 175, 0.10); }

.app-type-card .type-icon-wrapper {
    background-color: var(--type-bg);
    color: var(--type-color);
}

.app-type-card:hover .type-icon-wrapper {
    background-color: var(--type-bg);
    filter: brightness(0.9);
}

.app-type-card:hover i {
    transform: scale(1.1);
}

.app-type-card.active {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.app-type-card.active .type-icon-wrapper {
    background-color: var(--type-color);
    color: white;
}

.app-type-card.active h4 {
    color: var(--primary);
    font-weight: 700;
}

.app-type-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
    line-height: 1.4;
}

.label-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-header label {
    margin-bottom: 0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.btn-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.color-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.color-card.active {
    border-color: var(--primary);
    background-color: rgba(11, 143, 60, 0.05);
    box-shadow: 0 0 0 1px var(--primary);
}

.color-swatch {
    height: 40px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
}

.color-swatch-primary {
    flex: 2;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.color-swatch-secondary {
    flex: 1;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.color-card span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.custom-color-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

#custom-color-picker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s var(--ease-premium);
}

.chip:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
    transform: scale(1.03);
}

.chip:active {
    transform: scale(0.96);
}

.chip.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Premium Field Cards */
.field-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    transition: var(--transition);
    position: relative;
}

.field-card:focus-within {
    transform: scale(1.01);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Floating Labels */
.floating-group {
    position: relative;
}

.floating-group label {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
    pointer-events: none;
    z-index: 1;
}

.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label,
.floating-group textarea:focus ~ label,
.floating-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background-color: white;
    padding: 0 6px;
}

/* Premium Preview */
.live-preview {
    background: rgba(11, 143, 60, 0.03);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-top: 32px;
    font-size: 0.9rem;
}

.live-preview h5 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.microcopy {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
    font-style: italic;
}

.autofill-notice {
    background-color: rgba(37, 99, 235, 0.05);
    border: 1px dashed #2563EB;
    color: #2563EB;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeInDown 0.3s var(--ease-premium);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Overlay Styling */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo-icon {
    margin: 0 auto 16px auto;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #0f172a;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Badge Styles */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-owner {
    background-color: rgba(11, 143, 60, 0.15);
    color: #0B8F3C;
}

.badge-admin {
    background-color: rgba(37, 99, 235, 0.15);
    color: #2563EB;
}

/* Access Code Input */
.access-code-input {
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    font-size: 1.1rem !important;
    font-weight: 600;
    font-family: 'Outfit', monospace;
}

/* Code Management Table */
.code-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.85rem;
}

.code-table th,
.code-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.code-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-table tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

.code-value {
    font-family: 'Outfit', monospace;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--primary);
}

.code-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.code-badge-active {
    background-color: rgba(11, 143, 60, 0.12);
    color: #0B8F3C;
}

.code-badge-used {
    background-color: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.code-badge-expired {
    background-color: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.code-copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.code-copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.generate-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 24px;
}

.generate-form .form-group {
    margin-bottom: 0;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(11, 143, 60, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.history-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.history-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.history-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.sidebar .nav-item {
    animation: slideIn 0.4s ease-out forwards;
    opacity: 0;
}

.sidebar .nav-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar .nav-item:nth-child(2) { animation-delay: 0.2s; }
.sidebar .nav-item:nth-child(3) { animation-delay: 0.3s; }
.sidebar .nav-item:nth-child(4) { animation-delay: 0.4s; }

.card {
    animation: fadeInUp 0.4s var(--ease-premium);
    transition: var(--transition);
}

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

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 12px;
    }
    
    .sidebar-header {
        padding-bottom: 12px;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
        gap: 8px;
    }
    
    .nav-item {
        margin-bottom: 0;
        white-space: nowrap;
    }
    
    .sidebar-footer, .user-profile {
        display: none;
    }
    
    .top-bar {
        padding: 0 16px;
    }
    
    .content-area {
        padding: 16px;
    }
}
/* ========================================== */
/* RESPONSIVE STYLES                          */
/* ========================================== */

/* Desktop Header Adjustments */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* Base Layout Adjustments */
.app-container {
    position: relative;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

/* Tablet & Mobile ( < 1024px ) */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        box-shadow: 20px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.active + .sidebar-overlay {
        display: block;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-bar {
        padding: 0 16px;
    }

    .content-area {
        padding: 20px 16px;
    }

    .top-actions {
        display: none; /* Hide non-essential badges on small screens */
    }
}

/* Tablet ( 640px - 1024px ) */
@media (min-width: 640px) and (max-width: 1024px) {
    .history-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile ( < 640px ) */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .top-bar h1 {
        font-size: 1.2rem;
    }

    .history-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 20px 16px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        height: 44px;
    }

    .mode-selector {
        flex-direction: column;
    }

    /* Table to Card List in Settings */
    .code-table thead {
        display: none;
    }

    .code-table, .code-table tbody, .code-table tr, .code-table td {
        display: block;
        width: 100%;
    }

    .code-table tr {
        margin-bottom: 16px;
        background: #f8fafc;
        border-radius: var(--radius-md);
        padding: 16px;
        border: 1px solid var(--border-color);
    }

    .code-table td {
        text-align: right;
        padding: 8px 0;
        position: relative;
        padding-left: 50%;
        border: none !important;
    }

    .code-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
    }

    .code-table td:last-child {
        display: flex;
        gap: 8px;
        padding-left: 0;
        justify-content: center;
        margin-top: 12px;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 16px;
    }

    .code-table td:last-child::before {
        display: none;
    }

    .generate-form {
        flex-direction: column;
    }
}

/* Helper Class for Table Labels */
.mobile-label {
    display: none;
}

@media (max-width: 640px) {
    .mobile-label {
        display: block;
    }
}
