/* Persona Studio - Styles */

:root {
    --bg: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242733;
    --text: #e8e8e8;
    --text-muted: #9ca3af;
    --accent: #6c63ff;
    --accent-hover: #8b87ff;
    --border: #2d3140;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --radius: 8px;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ─── AUTH SCREEN ─── */

.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 30px;
    text-align: center;
}

.auth-container h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

#auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.auth-form {
    display: none;
    text-align: left;
}

.auth-form.active {
    display: block;
}

.auth-form input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
}

.auth-form input:focus,
.auth-form textarea:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ─── APP LAYOUT ─── */

.screen { display: block; }
/* ─── UTILITY CLASSES ─── */
.hidden {
    display: none !important;
}

.screen.hidden { display: none; }

.app-layout {
    display: flex;
    height: 100vh;
}

/* ─── NAVIGATION SIDEBAR ─── */

nav#nav-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
}

.nav-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.nav-brand h1 {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 4px;
}

.welcome-text {
    font-size: 13px;
    color: var(--text-muted);
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.nav-icon {
    font-size: 18px;
}

.nav-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* ─── MAIN CONTENT ─── */

main#content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.app-section {
    min-height: 100%;
}

.app-section.hidden {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 24px;
}

/* ─── CARDS / GRIDS ─── */

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

/* ─── CARD ─── */

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.15);
    transform: translateY(-2px);
}

.card:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.1);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.card-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.card .card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 0;
}

.card .card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(128, 90, 213, 0.1);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.card .card-badge svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex-shrink: 0;
}

.card .card-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-row .card-icon {
    font-size: 20px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.card-title-row h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-asset {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    overflow: hidden;
}

.card-asset .card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

/* ─── Asset Title Styling ─── */

.asset-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    min-height: 28px;
}

.asset-title-line .asset-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.asset-title-line .card-badge {
    flex-shrink: 0;
}

.card-asset {
    transition: box-shadow 0.2s, border-color 0.2s, background 0.4s;
    cursor: pointer;
    border: 1px solid var(--border);
    padding: 16px 20px;
}

.card-asset:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(108, 99, 255, 0.15);
}

.card-asset:hover .asset-title {
    color: var(--accent);
}

/* ─── Newly Created Asset Animation ─── */

@keyframes newAssetPulse {
    0% {
        background: rgba(108, 99, 255, 0.18);
        box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.4);
        border-color: var(--accent);
        transform: scale(1.005);
    }
    40% {
        background: rgba(108, 99, 255, 0.10);
        box-shadow: 0 0 20px 4px rgba(108, 99, 255, 0.15);
        border-color: var(--accent);
        transform: scale(1);
    }
    70% {
        background: rgba(108, 99, 255, 0.04);
        box-shadow: 0 0 10px 2px rgba(108, 99, 255, 0.08);
        border-color: var(--accent);
    }
    100% {
        background: transparent;
        box-shadow: none;
        border-color: var(--border);
        transform: scale(1);
    }
}

.newly-created {
    animation: newAssetPulse 2s ease-out forwards;
}

/* ─── Enhanced Asset Card Styling ─── */

.asset-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

/* Primary row: user title + badge on same line */
.asset-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.asset-card-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.asset-icon-inline {
    font-size: 20px;
    flex-shrink: 0;
}

.asset-user-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-type-badge {
    flex-shrink: 0;
}

/* Gemini title gets its own line with room */
.asset-gemini-title {
    font-size: 14px;
    font-weight: 500;
    font-style: italic;
    color: var(--accent);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-card-body {
    background: var(--bg-tertiary, rgba(108, 99, 255, 0.05));
    border-radius: 8px;
    padding: 10px 14px;
}

.asset-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.asset-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.asset-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.asset-text-sm {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ─── BUTTONS ─── */

.btn-primary {
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 24px;
    background: var(--bg-tertiary);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--accent);
    color: #fff;
}

/* Outline variant — cancel/discard buttons styled like .btn-primary with accent outline */
.btn-outline {
    padding: 10px 24px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    line-height: 1;
    white-space: nowrap;
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-back {
    padding: 10px 24px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    min-height: 40px;
    white-space: nowrap;
}

.btn-back:hover {
    background: var(--bg-tertiary);
    color: var(--text);
    border-color: var(--accent);
}

/* ─── EMPTY STATES ─── */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state h2 {
    margin-bottom: 12px;
    color: var(--text);
}

/* ─── PERSONA DETAIL ─── */

.persona-header {
    margin-bottom: 20px;
}

.persona-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.persona-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.persona-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.detail-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--text-muted);
    font-size: 13px;
    min-width: 120px;
}

/* ─── Q&A SECTION ─── */

.qa-section {
    margin-top: 24px;
}

.qa-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.input-group textarea {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

#conversations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversation-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.conversation-item .question {
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}

.conversation-item .response {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

.conversation-item .timestamp {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 8px;
}

/* ─── CAMPAIGN DETAIL ─── */

.campaign-header {
    margin-bottom: 24px;
}

.campaign-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.campaign-idea {
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 4px;
}

.campaign-target-label {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

/* ─── WORKFLOW STEPS ─── */

.workflow {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.workflow-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.workflow-steps {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    position: relative;
}

.workflow-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    position: relative;
}



.workflow-step:hover {
    border-color: var(--accent);
    background: var(--border);
}

.workflow-step.done {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.workflow-step.current {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
}

.workflow-step .step-check {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.workflow-step .step-name {
    font-weight: 500;
}

.workflow-step .step-indicator {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 4px;
}

.workflow-step.has-content .step-name {
    color: var(--accent);
}

.workflow-step.has-content {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.05);
}

.workflow-step.editing {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
}

.workflow-step.editing .step-check {
    animation: pulse 1.5s infinite;
}

.workflow-content-area.is-clicked-during-edit {
    animation: flash-click 0.6s ease;
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.1);
}

@keyframes flash-click {
    0%   { background: rgba(108, 99, 255, 0.2); border-color: var(--accent); }
    100% { background: var(--bg-secondary); border-color: var(--border); }
}

.workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -12px;
    width: 12px;
    height: 2px;
    background: var(--border);
}

.workflow-content-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 350px;
    max-height: 600px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.workflow-content-area:hover {
    border-color: rgba(108, 99, 255, 0.3);
}

.workflow-content-area.editing {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15), 0 4px 20px rgba(108, 99, 255, 0.15);
}

.workflow-content-area .content-toolbar {
    margin-bottom: 0;
}

/* ─── PREVIEW MODE ─── */
.workflow-preview {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 300px;
}

.preview-content {
    line-height: 1.7;
    font-size: 15px;
    color: var(--text);
}

.preview-content h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.3em;
}

.preview-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.preview-content h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.75em;
    margin-bottom: 0.5em;
}

.preview-content h4,
.preview-content h5,
.preview-content h6 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.preview-content p {
    margin-bottom: 1em;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.preview-content li {
    margin-bottom: 0.5em;
}

.preview-content strong {
    color: var(--accent);
    font-weight: 600;
}

.preview-content em {
    font-style: italic;
    color: var(--text-muted);
}

.preview-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.75em 1em;
    margin: 1em 0;
    background: rgba(108, 99, 255, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

.preview-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid var(--border);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.preview-content code {
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9em;
    color: #e06c75;
}

.preview-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.preview-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.preview-content a:hover {
    text-decoration: underline;
    border-bottom-color: var(--accent);
}

.preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-content th,
.preview-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.preview-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text);
}

.preview-content tr:nth-child(even) {
    background: rgba(108, 99, 255, 0.03);
}

.preview-content tr:hover {
    background: rgba(108, 99, 255, 0.08);
}

.preview-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 1.5em 0;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1em 0;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.preview-content img:hover {
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.2);
}

/* Custom scrollbar for preview */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.preview-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ─── MODE INDICATOR ─── */
.mode-indicator {
    padding: 6px 16px;
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─── CONTENT ACTIONS ─── */
.content-actions {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 2px solid var(--border);
    background: var(--bg-tertiary);
}

.content-actions .btn-edit {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.content-actions .btn-edit:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    transform: translateY(-1px);
}

/* ─── CONTENT TOOLBAR ─── */
.content-toolbar {
    display: flex;
    gap: 6px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.btn-toolbar {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-toolbar:hover {
    background: var(--border);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.1);
}

.btn-toolbar:active {
    transform: scale(0.97);
}

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

.btn-toolbar[data-action="preview"],
.btn-toolbar[data-action="toggle-preview"] {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-toolbar[data-action="preview"]:hover,
.btn-toolbar[data-action="toggle-preview"]:hover {
    background: rgba(108, 99, 255, 0.25);
}

.btn-toolbar[data-action="toggle-preview"].active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-toolbar[data-action="save"] {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-toolbar[data-action="save"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.3);
}

.btn-toolbar[data-action="auto-save"] {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: #10b981;
}

.btn-toolbar[data-action="auto-save"].active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-toolbar[data-action="cancel"] {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-toolbar[data-action="cancel"]:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.toolbar-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    user-select: none;
    margin-left: auto;
    transition: all 0.2s;
}

.toolbar-info.saving {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.1);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.toolbar-separator {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 6px;
    opacity: 0.6;
}

/* ─── ASSET MANAGEMENT VIEW (Step 4) ─── */
.asset-management-view {
    padding: 20px;
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.asset-header h4 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.asset-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.workflow-asset-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.workflow-asset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.15);
}

.asset-status {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* ─── CONTENT VIEWER (Markdown Preview) ─── */
/* ─── SPLIT PANE EDITOR ─── */
/* ─── WYSIWYG EDITOR ─── */
.wysiwyg-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 350px;
}

.wysiwyg-content {
    flex: 1;
    padding: 20px;
    background: var(--bg-secondary);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    overflow-y: auto;
    outline: none;
    min-height: 300px;
    width: 100%;
    box-sizing: border-box;
}

.wysiwyg-content:focus {
    /* no visible focus ring for clean WYSIWYG look */
}

.wysiwyg-content h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.3em;
}

.wysiwyg-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.wysiwyg-content h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.75em;
    margin-bottom: 0.5em;
}

.wysiwyg-content h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.wysiwyg-content h5,
.wysiwyg-content h6 {
    font-size: 1em;
    font-weight: 600;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.wysiwyg-content p {
    margin-bottom: 1em;
}

.wysiwyg-content ul,
.wysiwyg-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.wysiwyg-content li {
    margin-bottom: 0.5em;
}

.wysiwyg-content li input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--accent);
}

.wysiwyg-content strong {
    color: var(--accent);
    font-weight: 600;
}

.wysiwyg-content em {
    font-style: italic;
    color: var(--text-muted);
}

.wysiwyg-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.75em 1em;
    margin: 1em 0;
    background: rgba(108, 99, 255, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

.wysiwyg-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid var(--border);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.wysiwyg-content code {
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9em;
    color: #e06c75;
}

.wysiwyg-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.wysiwyg-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.wysiwyg-content a:hover {
    text-decoration: underline;
    border-bottom-color: var(--accent);
}

.wysiwyg-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.wysiwyg-content th,
.wysiwyg-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.wysiwyg-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text);
}

.wysiwyg-content tr:nth-child(even) {
    background: rgba(108, 99, 255, 0.03);
}

.wysiwyg-content tr:hover {
    background: rgba(108, 99, 255, 0.08);
}

.wysiwyg-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 1.5em 0;
}

.wysiwyg-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1em 0;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.wysiwyg-content img:hover {
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.2);
}

/* Custom scrollbar for WYSIWYG content */
.wysiwyg-content::-webkit-scrollbar {
    width: 8px;
}

.wysiwyg-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.wysiwyg-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.wysiwyg-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Source mode - raw HTML editing */
.wysiwyg-source {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 350px;
}

.wysiwyg-source textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: var(--bg-secondary);
    color: var(--text);
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    border: none;
    outline: none;
    resize: none;
    box-sizing: border-box;
    min-height: 300px;
    overflow-y: auto;
}

.wysiwyg-source textarea::-webkit-scrollbar {
    width: 8px;
}

.wysiwyg-source textarea::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.wysiwyg-source textarea::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.wysiwyg-source textarea::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.content-actions .btn-edit,
.content-actions button {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.content-actions .btn-edit:hover,
.content-actions button:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    transform: translateY(-1px);
}

.content-actions .btn-edit:active,
.content-actions button:active {
    transform: translateY(0);
}

.btn-edit {
    padding: 8px 16px;
    background: rgba(128, 90, 213, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: rgba(128, 90, 213, 0.2);
}

/* ─── LINKED PERSONAS ─── */

.linked-personas {
    margin-bottom: 24px;
}

.linked-personas h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

#linked-personas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.persona-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
}

/* ─── ASSETS ─── */

.campaign-assets {
    overflow: hidden;
}

.campaign-assets h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.asset-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.asset-panel h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

#asset-generated-content {
    line-height: 1.7;
    font-size: 15px;
    color: var(--text);
    display: block;
    min-height: 80px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: auto;
    max-height: 600px;
}

#asset-generated-content h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.3em;
}

#asset-generated-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

#asset-generated-content h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.75em;
    margin-bottom: 0.5em;
}

#asset-generated-content h4,
#asset-generated-content h5,
#asset-generated-content h6 {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

#asset-generated-content p {
    margin-bottom: 1em;
}

#asset-generated-content ul,
#asset-generated-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

#asset-generated-content li {
    margin-bottom: 0.5em;
}

#asset-generated-content strong {
    color: var(--accent);
    font-weight: 600;
}

#asset-generated-content em {
    font-style: italic;
    color: var(--text-muted);
}

#asset-generated-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.75em 1em;
    margin: 1em 0;
    background: rgba(108, 99, 255, 0.08);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

#asset-generated-content pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid var(--border);
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

#asset-generated-content code {
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9em;
    color: #e06c75;
}

#asset-generated-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

#asset-generated-content a {
    color: var(--accent);
    text-decoration: underline;
}

#asset-generated-content a:hover {
    text-decoration: underline;
}

#asset-generated-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

#asset-generated-content th,
#asset-generated-content td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

#asset-generated-content th {
    font-weight: 600;
    background: var(--bg-tertiary);
}

#asset-generated-content tr:nth-child(even) {
    background: rgba(108, 99, 255, 0.03);
}

#asset-generated-content tr:hover {
    background: rgba(108, 99, 255, 0.06);
}

#asset-generated-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 1.5em 0;
}

#asset-generated-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1em 0;
}

#asset-generated-content img:hover {
    opacity: 0.9;
}


.asset-content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.image-display {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 8px;
    overflow: hidden;
}

.image-display img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius);
}

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

.brief-field {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.brief-field strong {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.brief-field ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.brief-field li {
    margin-bottom: 4px;
}

/* ─── MARKDOWN RENDERING ─── */
.asset-panel h2, .asset-panel h3 {
    color: var(--text);
    margin: 16px 0 8px;
}

.asset-panel p {
    margin: 8px 0;
    line-height: 1.6;
}

.asset-panel ul, .asset-panel ol {
    margin: 8px 0 8px 24px;
    padding: 0;
}

.asset-panel li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.asset-panel code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 13px;
}

.asset-panel pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--radius);
    overflow: auto;
    margin: 12px 0;
}

.asset-panel pre code {
    background: none;
    padding: 0;
}

.asset-panel strong {
    font-weight: 600;
}

.asset-panel em {
    font-style: italic;
}

.asset-panel a {
    color: var(--accent);
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.action-buttons button {
    flex: 1;
}

.asset-actions-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

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

.logo-selector label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.logo-selector select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    appearance: auto;
}

.logo-selector select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(104, 129, 203, 0.15);
}

.logo-selector select option {
    padding: 8px;
}

.prompt-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-row textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-row textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(104, 129, 203, 0.15);
}

.prompt-row .action-buttons {
    display: flex;
    gap: 12px;
}

/* ─── MODALS ─── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

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

.modal-header h2 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.form-group select {
    cursor: pointer;
}

#persona-select {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.persona-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}

.persona-checkbox:hover {
    border-color: var(--accent);
}

.persona-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ─── MESSAGES ─── */

.error-msg {
    color: var(--error);
    font-size: 13px;
    margin-top: 12px;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* ─── RESPONSIVE ─── */

/* ─── IMAGE MODAL ─── */
.modal-image {
    width: fit-content;
    min-width: 300px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-secondary);
    padding: 0;
    overflow: auto;
}

.modal-image .modal-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-image .modal-header h2 {
    margin-bottom: 0;
}

.modal-image-body {
    padding: 16px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-image-full {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    flex-shrink: 0;
    display: block;
    border-radius: var(--radius);
    cursor: grab;
}

#modal-image-full:active {
    cursor: grabbing;
}

#modal-image-full:hover {
    opacity: 0.95;
}

/* ─── INLINE EDIT CONTROLS ─── */
.btn-edit {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.btn-edit:hover {
    background: var(--bg-tertiary);
}

.edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--border);
}

.edit-actions .btn-primary {
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.edit-actions .btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    transform: translateY(-1px);
}

.edit-actions .btn-primary:active {
    transform: translateY(0);
}

.edit-actions .btn-secondary {
    padding: 10px 24px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.edit-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: none;
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    nav#nav-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 12px;
    }

    .nav-section {
        flex-direction: row;
    }

    .asset-content-area {
        grid-template-columns: 1fr;
    }
}
/* ─── ASSET DETAIL HEADER ─── */
.asset-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

#asset-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(128, 90, 213, 0.1);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

#asset-type-badge svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.btn-delete-asset-detail {
    background: none;
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: var(--error);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-delete-asset-detail:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--error);
}

/* ─── TOAST NOTIFICATIONS ─── */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.fade-out {
    transform: translateY(0);
    opacity: 0;
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

.toast-warning {
    background: #f59e0b;
}

/* ─── DELETE BUTTONS ─── */
.btn-delete-card {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.5;
    transition: all 0.2s;
    align-self: flex-start;
}

.btn-delete-card:hover {
    opacity: 1;
    background: rgba(244, 67, 54, 0.1);
    transform: scale(1.1);
}

.btn-delete-asset {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.4;
    transition: all 0.2s;
    margin-left: 4px;
    flex-shrink: 0;
}

.btn-delete-asset:hover {
    opacity: 1;
    background: rgba(244, 67, 54, 0.1);
}

/* Card header layout for delete buttons */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-header > div {
    flex: 1;
    min-width: 0;
}

/* ─── DELETE CONFIRMATION MODAL ─── */
.modal-delete .modal-body {
    padding: 20px;
    text-align: center;
}

.modal-delete .modal-body p {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-delete .text-danger {
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
}

.modal-delete .modal-actions {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
}

.btn-danger {
    padding: 10px 24px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── BRAND IDENTITY STYLES ─── */
.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.brand-header h2 {
    font-size: 24px;
    margin: 0;
}

.btn-edit-brand {
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-edit-brand:hover {
    background: var(--accent-hover);
}

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

.brand-detail-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.brand-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.brand-content-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

/* Do's and Don'ts specific styles */
#brand-dos,
.brand-dos {
    background: rgba(76, 175, 80, 0.08);
    border-left: 3px solid rgba(76, 175, 80, 0.5);
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
}

#brand-donts,
.brand-donts {
    background: rgba(244, 67, 54, 0.08);
    border-left: 3px solid rgba(244, 67, 54, 0.5);
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
}

#brand-dos h4,
.brand-dos h4 {
    color: #4CAF50;
}

#brand-donts h4,
.brand-donts h4 {
    color: #F44336;
}

.brand-color-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-color-display .color-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: var(--radius);
}

.brand-color-display .color-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.brand-color-display span {
    font-size: 13px;
    font-family: monospace;
    color: var(--text);
    font-weight: 600;
}

/* ─── COLOR PICKER STYLES ─── */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.color-item input[type="color"] {
    width: 40px;
    height: 36px;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
    background: transparent;
}

.color-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-item input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border);
    border-radius: 4px;
}

.color-item input[type="text"] {
    width: 80px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    text-transform: uppercase;
}

.color-item select.cp-type-select {
    width: 100px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.color-item select.cp-type-select:focus {
    outline: none;
    border-color: var(--accent);
}

.color-item .btn-remove-color {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.color-item .btn-remove-color:hover {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
}

.color-item input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.brand-form {
    max-width: 800px;
}

.brand-form .form-group {
    margin-bottom: 16px;
}

.brand-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.brand-form .form-group input,
.brand-form .form-group textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
}

.brand-form .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.brand-form .form-row {
    display: flex;
    gap: 16px;
}

.brand-form .form-row .form-group {
    flex: 1;
}

.brand-form .form-row .form-group input {
    width: 100%;
}

/* Logo upload styles */
.logo-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.brand-logo-display img {
    max-width: 200px;
    max-height: 80px;
    border-radius: 4px;
    border: 1px solid var(--border);
    padding: 4px;
    background: white;
}

@media (max-width: 600px) {
    .brand-details-grid {
        grid-template-columns: 1fr;
    }
    .brand-form .form-row {
        flex-direction: column;
    }
}

/* Form row helper */
.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group input,
.form-row .form-group textarea {
    width: 100%;
}

/* Brand modal styles */
.modal-brand .modal-body {
    padding: 20px;
}

.modal-brand .brand-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-brand .brand-form-row .form-group {
    flex: 1;
}

.modal-brand .brand-form-row .form-group input,
.modal-brand .brand-form-row .form-group textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
}

.modal-brand .brand-form-row .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-brand .form-group {
    margin-bottom: 0;
}

.modal-brand .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.modal-brand .form-group input,
.modal-brand .form-group textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 14px;
}

.modal-brand .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-brand .logo-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* Brand selector dropdown */
.brand-selector select,
.logo-selector select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}

.brand-selector label,
.logo-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
}

.product-image-upload {
    margin-top: 12px;
}

.product-image-upload label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
}

.product-image-upload button {
    font-size: 12px;
}

#asset-product-image-preview img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid var(--border);
    vertical-align: middle;
}
