:root {
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --secondary: #f97316;
    --bg-dark: #0f1012;
    --panel-bg: rgba(24, 24, 27, 0.85);
    --panel-border: rgba(239, 68, 68, 0.15);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    --success: #10b981;
    --radius-lg: 20px;
    --radius-md: 12px;
    --nav-width: 220px;
    --nav-collapsed: 60px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* ===== BACKGROUND ===== */
.background-effects { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; overflow: hidden; pointer-events: none; }
.glow-orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.25; animation: float 20s infinite alternate; }
.orb-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--primary) 0%, transparent 70%); }
.orb-2 { bottom: -20%; right: 30%; width: 60vw; height: 60vw; background: radial-gradient(circle, var(--secondary) 0%, transparent 70%); animation-delay: -5s; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(5%, 10%) scale(1.1); } }

/* ===== LEFT SIDE NAVIGATION ===== */
.side-nav {
    width: var(--nav-width);
    min-width: var(--nav-width);
    height: 100vh;
    background: #0d0e10;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.side-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.side-nav-brand i {
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.side-nav-brand .nav-label {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.side-nav-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
}

.side-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    width: 100%;
    position: relative;
}
.side-tab i { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.side-tab:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }
.side-tab.active {
    color: white;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.12));
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}
.side-tab.active i { color: var(--primary); }

.side-nav-footer {
    padding: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-credit {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
    padding: 0.4rem 0.5rem 0.2rem;
    letter-spacing: 0.3px;
}
.api-key-side-btn {
    position: relative;
}
.key-status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #ef4444;
    transition: background 0.3s;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.key-status-dot.active { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }

/* API Modal */
.api-modal-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
}
.api-modal-overlay.active { display: flex; }
.api-modal {
    background: var(--panel-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 88vh;
    overflow-y: auto;
    animation: zoomIn 0.3s ease;
}
.api-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.api-modal-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.api-modal-header h3 i { color: var(--secondary); }
.modal-close {
    background: rgba(255,255,255,0.1); border: none; color: var(--text-muted);
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--primary); color: white; }
.api-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.api-hint a { color: var(--primary); text-decoration: underline; }
.api-input-row {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border);
    border-radius: var(--radius-md); padding: 0.5rem;
}
.api-input-row i { color: var(--text-muted); padding-left: 0.5rem; }
.api-input-row input {
    flex: 1; background: transparent; border: none;
    color: var(--text-main); padding: 0.5rem;
    font-family: inherit; font-size: 0.95rem;
}
.api-input-row input:focus { outline: none; }
.save-key-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; border-radius: 8px;
    padding: 0.5rem 1.2rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.save-key-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }
.api-status-msg { font-size: 0.85rem; color: var(--success); margin-top: 0.75rem; display: flex; align-items: center; gap: 0.3rem; }

/* Các mục cấu hình thêm trong modal (engine / model / openai key) */
.api-section {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.api-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.55rem;
}
.api-label i { color: var(--primary); }
.api-hint-sm {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}
.api-hint-sm a { color: var(--primary); text-decoration: underline; }
.api-modal .select-wrapper { width: 100%; }
.api-modal .select-wrapper select {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 0.6rem 2rem 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
}
.api-modal .select-wrapper { position: relative; }
.api-modal .select-wrapper > i {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== MAIN AREA ===== */
.main-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-content {
    display: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
    animation: fadeTabIn 0.3s ease;
}
.tab-content.active { display: flex; }

@keyframes fadeTabIn {
    from { opacity: 0; transform: translateX(6px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== SHARED: FULL LAYOUT (Left controls + Right results) ===== */
.full-layout {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0;
}

.full-left {
    width: 400px;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    border-radius: 0;
    z-index: 5;
}

.full-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
    min-width: 0;
}

.panel-title-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.panel-title-bar > i {
    color: var(--primary);
    font-size: 1.1rem;
}
.panel-title-bar h2 {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.panel-subtitle { font-size: 0.75rem; color: var(--text-muted); }
.panel-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    line-height: 1.5;
}

.panel-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.panel-scrollable::-webkit-scrollbar { width: 5px; }
.panel-scrollable::-webkit-scrollbar-track { background: transparent; }
.panel-scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.logo-avatar {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: white; flex-shrink: 0;
}

/* ===== TAB 1: BANNER (sidebar + main content) ===== */
.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}
.sidebar {
    width: 400px;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    border-radius: 0;
    z-index: 10;
}
.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-title i { color: var(--primary); font-size: 1.1rem; }
.sidebar-title h2 {
    font-size: 1rem; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.scrollable-setup {
    flex: 1; overflow-y: auto; padding: 1.25rem;
}
.scrollable-setup::-webkit-scrollbar { width: 5px; }
.scrollable-setup::-webkit-scrollbar-track { background: transparent; }
.scrollable-setup::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.main-content {
    flex: 1; display: flex; flex-direction: column;
    height: 100%; background: rgba(0,0,0,0.3);
    overflow: hidden; min-width: 0;
}

/* ===== SHARED UI COMPONENTS ===== */
.config-group { margin-bottom: 0.9rem; }
.config-group h2 {
    font-size: 0.88rem; font-weight: 600;
    margin-bottom: 0.4rem; color: var(--text-main);
}

.field-label {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); margin-bottom: 0.4rem;
}
.field-label i { color: var(--primary); font-size: 0.8rem; }
.required { color: var(--primary); }

/* Form inputs */
.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.3s;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: rgba(161,161,170,0.5); }
textarea.form-input { resize: none; min-height: 60px; }

/* Upload Zones */
.upload-zone {
    border: 2px dashed rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
    outline: none;
}
.upload-zone:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(239, 68, 68, 0.04); }
.upload-content { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.upload-content i { font-size: 1.6rem; color: var(--primary); }
.upload-content p { font-size: 0.88rem; }
.file-hint { font-size: 0.75rem; color: var(--text-muted); }

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.preview-item {
    aspect-ratio: 1; border-radius: 8px;
    overflow: hidden; position: relative;
    border: 1px solid var(--panel-border);
    animation: zoomIn 0.3s ease;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-btn {
    position: absolute; top: 3px; right: 3px;
    background: rgba(0,0,0,0.8); color: white; border: none;
    border-radius: 50%; width: 18px; height: 18px;
    font-size: 9px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.remove-btn:hover { background: var(--primary); transform: scale(1.1); }

/* Select/Config */
.row-config { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.config-item { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; min-width: 80px; }
.config-item label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }

.select-wrapper { position: relative; }
.select-wrapper i {
    position: absolute; right: 0.8rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
    font-size: 0.75rem;
}
select {
    width: 100%; appearance: none;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color 0.3s;
}
select:focus { outline: none; border-color: var(--primary); }
select option { background: #18181b; }

/* Prompt/Textarea */
.prompt-container { position: relative; }
textarea {
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.75rem 0.75rem 2.2rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    resize: none;
    transition: all 0.3s ease;
}
textarea:focus { outline: none; border-color: var(--primary); }
.prompt-icon {
    position: absolute; top: 0.85rem; left: 0.8rem;
    color: var(--text-muted); font-size: 0.85rem;
}
textarea:focus + .prompt-icon { color: var(--primary); }

.director-prompt-output {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 100px;
}
.director-prompt-output:focus { outline: none; border-color: var(--primary); }

/* Footer Action */
.action-footer {
    padding: 1rem 1.25rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.primary-btn {
    width: 100%; padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none; border-radius: var(--radius-md);
    color: white; font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
    font-family: inherit;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(50%); }
.compact-btn { padding: 0.7rem; font-size: 0.9rem; }

/* Output Header */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(24, 24, 27, 0.5);
    backdrop-filter: blur(10px);
    z-index: 2;
    flex-shrink: 0;
}
.output-header h2 {
    font-size: 0.95rem; font-weight: 600;
    color: rgba(255,255,255,0.8);
    display: flex; align-items: center; gap: 0.4rem;
}
.output-header h2 i { color: var(--secondary); font-size: 0.85rem; }

.status-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.75rem; border-radius: 20px;
    font-size: 0.78rem; font-weight: 500;
    color: var(--text-muted); white-space: nowrap;
}
.status-badge.processing { background: rgba(239, 68, 68, 0.2); color: #fca5a5; animation: pulse 2s infinite; }
.status-badge.done { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.status-badge.error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.result-count {
    background: rgba(255,255,255,0.08);
    padding: 0.25rem 0.7rem; border-radius: 20px;
    font-size: 0.78rem; color: var(--text-muted);
}

.reset-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 0.3rem;
}
.reset-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* Results Viewer */
.results-viewer {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 1rem;
    display: flex; flex-direction: column;
    gap: 1rem; align-items: stretch; min-width: 0;
}

/* Studio results: 2-column grid */
#studio-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
    align-content: start;
}
#studio-results-grid .empty-state {
    grid-column: 1 / -1;
}
.results-viewer::-webkit-scrollbar { width: 8px; }
.results-viewer::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); }
.results-viewer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex: 1;
    color: rgba(255,255,255,0.15);
    text-align: center;
    padding: 3rem 2rem;
}
.empty-state i { font-size: 3rem; margin-bottom: 0.8rem; }
.empty-state p { font-size: 0.88rem; line-height: 1.5; max-width: 300px; }

/* ===== Results Grid ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%; min-width: 0;
}
@media (max-width: 1400px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }

.result-card {
    width: 100%; position: relative;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    background: #000;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}
.result-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.6); }
.result-card img { width: 100%; height: auto; display: block; object-fit: contain; }

.result-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent 50%);
    opacity: 0; transition: opacity 0.3s ease;
    display: flex; align-items: flex-end;
    padding: 0.8rem; gap: 0.4rem;
}
.result-card:hover .result-overlay { opacity: 1; }

.variation-label {
    background: var(--primary); color: white;
    padding: 2px 8px; border-radius: 14px;
    font-size: 0.75rem; font-weight: bold;
}

.action-btn {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white; width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    font-size: 0.85rem;
}
.action-btn:hover { background: var(--primary); transform: translateY(-2px) scale(1.1); border-color: transparent; }

.result-wrapper {
    display: flex; flex-direction: column; gap: 0.4rem;
    opacity: 0; transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.result-wrapper.visible { opacity: 1; transform: translateY(0); }

/* Card Prompt Editor */
.card-prompt-editor {
    display: flex; gap: 0.4rem;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.4rem;
    align-items: center;
}
.card-prompt-editor input {
    flex: 1; background: transparent; border: none;
    color: var(--text-main); padding: 0.4rem 0.7rem;
    font-family: inherit; font-size: 0.85rem;
}
.card-prompt-editor input:focus { outline: none; }
.card-prompt-editor .edit-btn {
    background: var(--primary); color: white; border: none;
    border-radius: 7px; padding: 0.4rem 0.8rem;
    cursor: pointer; font-weight: 500;
    display: flex; align-items: center; gap: 0.3rem;
    transition: all 0.2s; font-family: inherit; font-size: 0.82rem;
}
.card-prompt-editor .edit-btn:hover { background: var(--primary-hover); }

/* ===== STEP SECTIONS (Director) ===== */
.step-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.step-section:last-child { border-bottom: none; margin-bottom: 0; }
.step-badge {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9rem; font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.step-badge span {
    width: 24px; height: 24px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 800;
    flex-shrink: 0;
}

/* ===== LOGO RESULTS ===== */
.logo-results .logo-idea {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: zoomIn 0.3s ease;
}
.logo-idea h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-idea p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.4rem;
}
.logo-idea strong { color: var(--text-main); }

/* Logo Idea Actions */
.logo-idea-actions {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.logo-gen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
}
.logo-gen-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35); }
.logo-gen-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

.logo-gen-loading {
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logo-gen-result { margin-top: 0.6rem; }
.logo-gen-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--panel-border);
    transition: transform 0.3s, box-shadow 0.3s;
}
.logo-gen-image:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.5); }
.logo-gen-image img { width: 100%; display: block; object-fit: contain; background: #111; }
.logo-gen-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.6rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.logo-gen-image:hover .logo-gen-overlay { opacity: 1; }

/* Ads Idea Controls */
.ads-ideas-viewer { display: flex; flex-direction: column; gap: 0; }
.ads-analysis-card { border-left: 3px solid var(--primary); }
.ads-idea-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.compact-select {
    min-width: 80px;
    max-width: 100px;
}
.compact-select select {
    padding: 0.4rem 1.8rem 0.4rem 0.6rem;
    font-size: 0.8rem;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    appearance: none;
    width: 100%;
}
.compact-select i {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ===== Animations ===== */
@keyframes zoomIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.loader { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 1s linear infinite; display: none; }
.loader.active { display: block; }
.hidden { display: none !important; }

/* Scanning */
.scanning-container {
    width: 100%; max-width: 800px; height: 400px;
    margin: 0 auto;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scan 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.progress-info { text-align: center; z-index: 2; padding: 1.5rem; background: rgba(0,0,0,0.6); border-radius: 12px; backdrop-filter: blur(10px); }
.gen-progress-bar { width: 80%; max-width: 280px; height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 0.8rem auto 0.4rem; overflow: hidden; }
.gen-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 3px; transition: width 0.5s ease; }
.progress-text { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.92); backdrop-filter: blur(20px); }
.lightbox-content {
    position: relative; max-width: 90vw; max-height: 90vh; z-index: 1;
    transform: scale(0.9); transition: transform 0.3s ease;
}
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-content img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.8); }
.lightbox-close {
    position: absolute; top: -12px; right: -12px;
    background: var(--primary); color: white; border: none;
    border-radius: 50%; width: 36px; height: 36px;
    font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}
.lightbox-close:hover { transform: scale(1.1); background: var(--primary-hover); }
.lightbox-download {
    position: absolute; bottom: -18px; left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px; padding: 0.5rem 1.2rem;
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; gap: 0.4rem;
    transition: all 0.2s; font-family: inherit;
}
.lightbox-download:hover { background: var(--primary); border-color: transparent; transform: translateX(-50%) translateY(-2px); }

/* ===== ERROR ===== */
.error-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex: 1; text-align: center;
    padding: 3rem; color: rgba(255,255,255,0.5);
}
.error-state i { font-size: 3rem; margin-bottom: 0.8rem; color: var(--primary); }
.error-state h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--text-main); }
.error-state p { color: var(--text-muted); max-width: 400px; line-height: 1.5; }

.error-toast {
    position: fixed; bottom: 2rem; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(239, 68, 68, 0.95);
    color: white; padding: 0.7rem 1.2rem;
    border-radius: 10px; font-size: 0.88rem;
    font-weight: 500; z-index: 10000;
    opacity: 0; transition: all 0.3s ease;
    display: flex; align-items: center; gap: 0.4rem;
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4);
    backdrop-filter: blur(10px); max-width: 90vw;
}
.error-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Glass panel utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===== GỢI Ý BRIEF TỰ ĐỘNG CHỌN LỌC ===== */
.brief-auto-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.73rem;
    color: var(--secondary);
    margin-bottom: 0.45rem;
    opacity: 0.9;
    line-height: 1.4;
    padding: 0.3rem 0.6rem;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 6px;
}
.brief-auto-hint i {
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* Billboard brief — tự mở rộng khi paste nội dung dài */
#billboard-brief {
    min-height: 100px;
    max-height: 400px;
    resize: vertical;
    transition: height 0.2s ease;
    overflow-y: auto;
}

/* ===== TAB 6: BILLBOARD STYLES ===== */
.billboard-section-card {
    border-left: 3px solid var(--primary);
    transition: border-color 0.3s ease;
}
.billboard-section-card:hover {
    border-left-color: var(--secondary);
}
.billboard-section-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}
.billboard-section-card h3 i {
    font-size: 0.95rem;
    opacity: 0.8;
}
.billboard-section-content {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.billboard-section-content::-webkit-scrollbar {
    width: 5px;
}
.billboard-section-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 5px;
}
.billboard-prompt-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.billboard-variant-actions {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.variant-tag {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(249, 115, 22, 0.2);
}
.billboard-copy-btn {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.7rem !important;
}

/* ===== ACCORDION STYLES ===== */
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.1rem 0;
    border-radius: 8px;
    transition: background 0.2s ease;
    user-select: none;
}
.accordion-header:hover {
    background: rgba(255,255,255,0.03);
}
.accordion-header h3 {
    margin: 0;
}
.accordion-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.accordion-arrow.open {
    transform: rotate(180deg);
}
.accordion-body {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding-top: 0.5rem;
}
.accordion-body.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

/* ===== ACTION BAR ===== */
.billboard-action-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    padding: 0.6rem 0.7rem;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}
.bb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.bb-action-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}
.bb-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.bb-gen-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-weight: 600;
}
.bb-gen-btn:hover {
    filter: brightness(1.1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
}

/* Variant card — điều khiển dạng lưới ngang */
.bb-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.billboard-variant-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.65rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.bb-variant-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ===== GALLERY KẾT QUẢ CHUNG — mọi ảnh cạnh nhau trong 1 khung ===== */
.bb-gallery-card {
    border-left: 3px solid var(--secondary);
}
.bb-gallery-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}
.bb-gallery-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
}
.bb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-top: 0.75rem;
}
/* Khi ẩn panel trái → khung rộng hơn → 3 ảnh mỗi hàng cho cân đối (6 ô = 2 hàng đều) */
#billboard-layout.panel-collapsed .bb-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}
/* Màn hình hẹp → 1 cột */
@media (max-width: 900px) {
    .bb-gallery-grid,
    #billboard-layout.panel-collapsed .bb-gallery-grid {
        grid-template-columns: 1fr;
    }
}
.bb-gallery-grid:empty {
    display: none;
}
.bb-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.55rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}
.bb-tile-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
}
.bb-tile-body .logo-gen-image {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #0a0a0a;
    transition: transform 0.25s, box-shadow 0.25s;
}
.bb-tile-body .logo-gen-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}
.bb-tile-body .logo-gen-image img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
}
.bb-tile-err {
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 0.5rem;
}
.bb-tile .logo-gen-loading {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== BILLBOARD COMPACT RESULT IMAGES ===== */
.bb-result-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.bb-result-compact .logo-gen-image {
    max-height: 180px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.bb-result-compact .logo-gen-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}
.bb-result-compact .logo-gen-image img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}
/* Ô chỉnh sửa prompt dưới ảnh billboard */
.bb-edit-bar {
    display: flex;
    gap: 0.4rem;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.35rem;
    align-items: center;
}
.bb-edit-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.35rem 0.6rem;
    font-family: inherit;
    font-size: 0.8rem;
}
.bb-edit-bar input:focus { outline: none; }
.bb-edit-bar input::placeholder { color: rgba(161,161,170,0.4); }
.bb-edit-bar .bb-edit-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.78rem;
    white-space: nowrap;
}
.bb-edit-bar .bb-edit-btn:hover { background: var(--primary-hover); }
.bb-edit-bar .bb-edit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== PANEL TOGGLE BUTTON ===== */
#billboard-layout,
#palm-layout,
#biz-layout,
#hair-layout,
#outfit-layout,
#sticker-layout,
#other-layout {
    position: relative;
}
.panel-toggle-btn {
    position: absolute;
    left: 380px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 28px;
    height: 56px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0 10px 10px 0;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.3);
}
.panel-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 2px 0 20px rgba(239, 68, 68, 0.2);
}
.panel-toggle-btn i {
    transition: transform 0.3s ease;
}

/* Trạng thái thu gọn panel trái */
#billboard-layout.panel-collapsed #billboard-left-panel,
#palm-layout.panel-collapsed #palm-left-panel,
#biz-layout.panel-collapsed #biz-left-panel,
#hair-layout.panel-collapsed #hair-left-panel,
#outfit-layout.panel-collapsed #outfit-left-panel,
#sticker-layout.panel-collapsed #sticker-left-panel,
#other-layout.panel-collapsed #other-left-panel {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    opacity: 0;
}
#billboard-layout.panel-collapsed .panel-toggle-btn,
#palm-layout.panel-collapsed .panel-toggle-btn,
#biz-layout.panel-collapsed .panel-toggle-btn,
#hair-layout.panel-collapsed .panel-toggle-btn,
#outfit-layout.panel-collapsed .panel-toggle-btn,
#sticker-layout.panel-collapsed .panel-toggle-btn,
#other-layout.panel-collapsed .panel-toggle-btn {
    left: 0;
    border-radius: 0 10px 10px 0;
}
#billboard-layout.panel-collapsed .panel-toggle-btn i,
#palm-layout.panel-collapsed .panel-toggle-btn i,
#biz-layout.panel-collapsed .panel-toggle-btn i,
#hair-layout.panel-collapsed .panel-toggle-btn i,
#outfit-layout.panel-collapsed .panel-toggle-btn i,
#sticker-layout.panel-collapsed .panel-toggle-btn i,
#other-layout.panel-collapsed .panel-toggle-btn i {
    transform: rotate(180deg);
}
#billboard-left-panel,
#palm-left-panel,
#biz-left-panel,
#hair-left-panel,
#outfit-left-panel,
#sticker-left-panel,
#other-left-panel {
    transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease, opacity 0.25s ease, border 0.3s ease;
}

/* ===== CHIP CHỌN BỐI CẢNH (Ảnh Trang Phục) ===== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}
.chip {
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.selected {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.mini-link-btn {
    margin-top: 0.55rem;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
}
.mini-link-btn:hover { color: var(--primary); text-decoration: underline; }
/* Nhãn mức độ phù hợp của kiểu tóc */
.hair-tier {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.12rem 0.5rem;
    border-radius: 20px;
    width: fit-content;
}
.hair-tier-best { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.hair-tier-good { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }
.hair-tier-ok { background: rgba(148,163,184,0.15); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.3); }

/* ===== ẢNH DOANH NHÂN ===== */
.secondary-btn {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.7rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
}
.secondary-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}
.secondary-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.biz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    align-content: start;
}
.biz-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}
.biz-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
}
.biz-card-body .logo-gen-image {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #0a0a0a;
}
.biz-card-body .logo-gen-image img {
    width: 100%;
    display: block;
    object-fit: cover;
}
.biz-card-body .logo-gen-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
#biz-layout.panel-collapsed .biz-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ===== PHÂN TÍCH CHỈ TAY ===== */
.palm-h {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-size: 1.05rem;
    margin: 1rem 0 0.6rem;
}
.palm-h:first-child { margin-top: 0; }
.palm-result-card, .palm-img-card {
    border-left: 3px solid var(--secondary);
}
.palm-analysis {
    line-height: 1.7;
    font-size: 0.92rem;
    color: var(--text-main);
}
.palm-analysis p {
    margin: 0 0 0.55rem;
    text-align: justify;
    text-justify: inter-word;
}
.palm-analysis p:last-child { margin-bottom: 0; }
.palm-analysis h3, .palm-analysis h4, .palm-analysis h5 {
    color: var(--primary);
    margin: 1rem 0 0.45rem;
    line-height: 1.4;
}
.palm-analysis h3:first-child,
.palm-analysis h4:first-child { margin-top: 0; }
.palm-analysis h3 { font-size: 1.02rem; }
.palm-analysis h4 { font-size: 0.95rem; }
.palm-analysis h5 { font-size: 0.9rem; }
.palm-analysis strong { color: var(--secondary); }
.palm-img-body .logo-gen-image {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #0a0a0a;
    max-width: 480px;
    margin: 0 auto;
}
.palm-img-body .logo-gen-image img {
    width: 100%;
    display: block;
    object-fit: contain;
}
.palm-img-body .logo-gen-loading {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
/* Side-nav ALWAYS visible as vertical sidebar */
@media (max-width: 1200px) {
    .side-nav { width: var(--nav-collapsed); min-width: var(--nav-collapsed); }
    .nav-label { display: none; }
    .side-tab { justify-content: center; padding: 0.75rem 0.5rem; }
    .side-tab i { width: auto; font-size: 1.1rem; }
    .side-nav-brand { justify-content: center; padding: 1rem 0.5rem; }
    .key-status-dot { right: 5px; }
    .full-left, .sidebar { width: 320px; min-width: 280px; }
}
@media (max-width: 900px) {
    .full-left, .sidebar { width: 280px; min-width: 240px; }
}
@media (max-width: 700px) {
    .full-layout, .app-layout { flex-direction: column; }
    .full-left, .sidebar { width: 100%; min-width: unset; height: auto; max-height: 45vh; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .full-right, .main-content { flex: 1; min-height: 300px; }
}


/* ===== LOGIN OVERLAY ===== */
.login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(14px);
    padding: 1.5rem;
}
.login-overlay.active { display: flex; }
.login-box {
    width: 100%;
    max-width: 380px;
    padding: 2.2rem 2rem;
    border-radius: 18px;
    text-align: center;
    animation: zoomIn 0.3s ease;
}
.login-brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0.4rem 0 1.4rem; }
.login-field {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.2rem 0.7rem;
    margin-bottom: 0.7rem;
}
.login-field i { color: var(--text-muted); }
.login-field input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-main); font-family: inherit; font-size: 0.92rem; padding: 0.7rem 0.3rem;
}
.login-error { color: var(--primary); font-size: 0.82rem; min-height: 1.1em; margin: 0.2rem 0 0.6rem; }
.login-submit {
    width: 100%; padding: 0.8rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none; border-radius: 10px; color: #fff; font-weight: 700; font-size: 0.95rem;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.login-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(239,68,68,0.4); }
.login-submit:disabled { opacity: 0.7; cursor: wait; }

/* ===== SETTING TAB ===== */
.setting-wrap {
    height: 100%; overflow-y: auto; padding: 1.5rem;
    max-width: 760px; margin: 0 auto; width: 100%;
}
.setting-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.2rem;
}
.setting-header h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 0.55rem; }
.setting-header h2 i { color: var(--secondary); }
.setting-user {
    font-size: 0.82rem; color: var(--text-muted);
    background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border);
    padding: 0.3rem 0.7rem; border-radius: 20px;
}
.setting-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.1rem;
}
.setting-card h3 {
    font-size: 1rem; margin-bottom: 0.9rem;
    display: flex; align-items: center; gap: 0.5rem; color: var(--primary);
}
.setting-label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.setting-label a { color: var(--secondary); }
.setting-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.setting-input {
    flex: 1; min-width: 160px;
    background: rgba(0,0,0,0.28); border: 1px solid var(--panel-border);
    border-radius: 8px; color: var(--text-main); padding: 0.6rem 0.8rem;
    font-family: inherit; font-size: 0.88rem;
}
.setting-input.full { width: 100%; flex: none; }
.setting-input:focus { outline: none; border-color: var(--primary); }
.setting-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; border: none; border-radius: 8px; padding: 0.6rem 1rem;
    font-weight: 600; font-family: inherit; font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
}
.setting-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.setting-btn.danger { background: rgba(255,255,255,0.06); border: 1px solid var(--panel-border); margin-top: 0.9rem; }
.setting-btn.danger:hover { background: rgba(239,68,68,0.15); color: var(--primary); }
.setting-msg { font-size: 0.82rem; color: var(--success); min-height: 1em; margin: 0.5rem 0 0; }
.setting-status-row { display: flex; gap: 1.2rem; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.9rem; flex-wrap: wrap; }
.setting-status-row b { color: var(--text-main); font-weight: 600; }
.users-list { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; }
.user-row {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; padding: 0.5rem 0.8rem; font-size: 0.88rem;
}
.user-row em { color: var(--text-muted); font-size: 0.75rem; margin-left: 0.3rem; }
.user-del {
    background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3);
    color: var(--primary); border-radius: 6px; padding: 0.3rem 0.55rem; cursor: pointer; transition: all 0.2s;
}
.user-del:hover { background: var(--primary); color: #fff; }
.setting-wrap .select-wrapper { position: relative; width: 100%; }
.setting-wrap .select-wrapper select {
    width: 100%; background: rgba(0,0,0,0.28); border: 1px solid var(--panel-border);
    border-radius: 8px; color: var(--text-main); padding: 0.6rem 2rem 0.6rem 0.8rem;
    font-family: inherit; font-size: 0.88rem; cursor: pointer; appearance: none;
}
.setting-wrap .select-wrapper > i {
    position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--text-muted); font-size: 0.75rem;
}
