/* Dull Studio Platform - Styles */

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

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --surface-3: #222222;
    --border: #2a2a2a;
    --border-light: #333;
    --text: #f0f0f0;
    --muted: #777;
    --accent: #c43e2a;
    --accent-dim: rgba(196, 62, 42, 0.15);
    --green: #2ea043;
    --green-dim: rgba(46, 160, 67, 0.15);
    --amber: #d29922;
    --amber-dim: rgba(210, 153, 34, 0.15);
    --blue: #388bfd;
    --blue-dim: rgba(56, 139, 253, 0.15);
    --purple: #8b5cf6;
    --purple-dim: rgba(139, 92, 246, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ========== PIN GATE ========== */
.pin-gate {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 24px;
}

.pin-gate.hidden { display: none; }

.pin-gate .pin-logo { height: 24px; opacity: 0.7; margin-bottom: 8px; }

.pin-gate h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: -0.2px;
}

.pin-gate .pin-input-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pin-gate input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    color: var(--text);
    font-size: 18px;
    font-family: inherit;
    letter-spacing: 4px;
    text-align: center;
    width: 200px;
    outline: none;
}

.pin-gate input:focus { border-color: var(--accent); }

.pin-gate .pin-error {
    color: var(--accent);
    font-size: 13px;
    height: 18px;
}

.pin-gate .pin-submit {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.pin-gate .pin-submit:hover { opacity: 0.9; }

/* ========== APP SHELL ========== */
.app { display: none; }
.app.visible { display: block; }

/* ========== HEADER ========== */
.header {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(20px);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo { height: 20px; width: auto; opacity: 0.9; }

.header-divider { width: 1px; height: 20px; background: var(--border); }

.header h1 {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.2px;
    color: var(--muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* View toggle */
.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-toggle button {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
    transition: all 0.15s;
}

.view-toggle button:hover { color: var(--text); }

.view-toggle button.active {
    background: var(--surface-2);
    color: var(--text);
}

.action-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.action-badge .badge-count {
    font-size: 12px;
    font-weight: 700;
}

.action-badge.review {
    background: var(--amber-dim);
    color: var(--amber);
}

.action-badge.send {
    background: var(--green-dim);
    color: var(--green);
}

.action-badge.followup {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ========== PIPELINE VIEW ========== */
.pipeline-view { display: none; }
.pipeline-view.active { display: block; }

.pipeline-container { padding: 24px 32px; }

/* Pipeline controls */
.pipeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.pipeline-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    width: 300px;
    outline: none;
}

.pipeline-search:focus { border-color: var(--accent); }
.pipeline-search::placeholder { color: #555; }

.pipeline-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}

.pipeline-stats .stat-value {
    color: var(--text);
    font-weight: 600;
}

/* Weekly stats */
.weekly-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 14px;
}

.weekly-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    font-weight: 600;
}

.weekly-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.weekly-stat-value {
    color: var(--text);
    font-weight: 700;
}

.weekly-divider {
    width: 1px;
    height: 12px;
    background: var(--border);
}

.change-up {
    color: var(--green);
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
}

.change-down {
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
}

.change-neutral {
    color: var(--muted);
    font-size: 10px;
    margin-left: 2px;
}

/* Kanban board (desktop) */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

.kanban-column {
    min-width: 260px;
    max-width: 300px;
    flex: 1;
    flex-shrink: 0;
}

.kanban-column-header {
    padding: 10px 14px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.kanban-column-header h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}

.kanban-column-header .col-count {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-cards {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Pipeline card */
.pipeline-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, opacity 0.15s, transform 0.15s;
}

.pipeline-card:hover {
    border-color: var(--border-light);
    background: var(--surface-3);
}

/* Drag and drop */
.pipeline-card[draggable="true"] {
    cursor: grab;
}

.pipeline-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    cursor: grabbing;
}

.kanban-column.drag-over {
    background: var(--surface);
    border: 1px dashed var(--accent);
    border-radius: var(--radius-lg);
}

.kanban-drop-zone {
    padding: 24px 12px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin: 4px;
}

/* Approve for Spec button */
/* In-production indicator */
.pipeline-card.in-production {
    border-color: var(--blue);
    border-style: solid;
}

.production-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.production-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    animation: pulse 1.5s infinite;
}

.production-label {
    font-size: 9px;
    color: var(--blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    animation: pulse 1.5s infinite;
}

.production-state {
    text-align: center;
    padding: 60px 32px;
    color: var(--muted);
}

.production-state h2 {
    font-size: 18px;
    color: var(--text);
    margin: 16px 0 8px;
}

.production-state p {
    font-size: 13px;
    line-height: 1.6;
}

.production-dot-lg {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    animation: pulse 1.5s infinite;
    margin: 0 auto;
}

/* Lemlist badge */
.lemlist-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--blue-dim);
    color: var(--blue);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 100px;
}

.pipeline-card {
    position: relative;
}

.approve-spec-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 8px 0 4px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.approve-spec-btn:hover {
    opacity: 0.9;
}

.approve-spec-btn-modal {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.approve-spec-btn-modal:hover {
    opacity: 0.9;
}

.send-to-production-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.send-to-production-btn:hover {
    opacity: 0.9;
}

/* Add Brand button */
.add-brand-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
    margin-left: auto;
}

.add-brand-btn:hover { opacity: 0.9; }

/* Add Brand modal form */
#add-brand-modal .form-group {
    margin-bottom: 16px;
}

#add-brand-modal .form-group label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
}

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

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

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

#add-brand-modal .form-group select {
    cursor: pointer;
}

/* Follow-up due card highlighting */
.pipeline-card.follow-up-due {
    border-color: var(--amber);
    background: var(--amber-dim);
}

.pipeline-card.follow-up-due .card-name {
    color: var(--amber);
}

/* Modal sections */
.modal-section-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.modal-section-header:first-child {
    margin-top: 0;
}

.modal-info-block {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    border-left: 3px solid var(--border);
}

.modal-info-block strong {
    color: var(--text);
}

.field-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

.field-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.field-with-action label {
    margin-bottom: 0 !important;
}

.copy-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

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

.spec-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

.spec-link:hover { text-decoration: underline; }

.email-textarea {
    min-height: 160px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif !important;
}

/* Input with visit button */
.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-btn input {
    flex: 1;
}

.visit-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

.visit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Cross-link button */
.cross-link-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.15s;
}

.cross-link-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Revision awaiting banner */
.revision-banner {
    padding: 10px 16px;
    background: var(--amber-dim);
    color: var(--amber);
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid rgba(210, 153, 34, 0.2);
}

.revision-banner-icon {
    margin-right: 6px;
}

.concept-card.awaiting-revision {
    opacity: 0.7;
}

.concept-card.awaiting-revision .image-row,
.concept-card.awaiting-revision .concept-footer {
    pointer-events: none;
    opacity: 0.5;
}

/* Date inputs */
input[type="date"] {
    cursor: pointer;
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
    padding: 4px;
}

.modal-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

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

.modal-save {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.modal-save:hover { opacity: 0.9; }

.pipeline-card .card-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pipeline-card .card-category {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.pipeline-card .card-product {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.pipeline-card .card-contact {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.pipeline-card .card-contact strong {
    color: var(--text);
    font-weight: 500;
}

.pipeline-card .card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.pipeline-card .card-link {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
}

.pipeline-card .card-link:hover { text-decoration: underline; }

.pipeline-card .card-date {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.pipeline-card .card-followup {
    font-size: 11px;
    color: var(--amber);
    margin-top: 6px;
    font-weight: 500;
}

/* Status dropdown on cards */
.status-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    min-height: 28px;
}

.status-select:focus { border-color: var(--accent); }

/* Collapsed section for DQ/NI */
.pipeline-collapsed-section {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.collapsed-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.collapsed-toggle:hover { color: var(--text); }

.collapsed-toggle .chevron {
    transition: transform 0.2s;
    font-size: 10px;
}

.collapsed-toggle .chevron.collapsed { transform: rotate(-90deg); }

.collapsed-brands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin-top: 8px;
    overflow: hidden;
    transition: max-height 0.3s;
}

.collapsed-brands.collapsed {
    max-height: 0;
    margin-top: 0;
}

.collapsed-brands .pipeline-card { opacity: 0.5; }
.collapsed-brands .pipeline-card:hover { opacity: 0.8; }

/* ========== BRAND DETAIL MODAL ========== */
.brand-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.brand-modal-overlay.visible { display: flex; }

.brand-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.brand-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.brand-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand-modal-header .modal-category {
    font-size: 13px;
    color: var(--muted);
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
}

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

.brand-modal-body { padding: 24px; }

.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

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

.modal-field input:focus,
.modal-field textarea:focus,
.modal-field select:focus {
    border-color: var(--accent);
}

.modal-field textarea { min-height: 80px; resize: vertical; }

.modal-field .field-value {
    font-size: 14px;
    color: var(--text);
    padding: 4px 0;
}

.modal-field .field-value a {
    color: var(--accent);
    text-decoration: none;
}

.modal-field .field-value a:hover { text-decoration: underline; }

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

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

.btn-primary {
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
    padding: 10px 24px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

.btn-secondary:hover { border-color: var(--border-light); }

.btn-danger {
    padding: 10px 24px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

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

/* ========== REVIEW VIEW ========== */
.review-view { display: none; }
.review-view.active { display: flex; min-height: calc(100vh - 57px); }

/* Review sidebar */
.review-sidebar {
    width: 260px;
    border-right: 1px solid var(--border);
    padding: 16px 0;
    flex-shrink: 0;
    position: sticky;
    top: 57px;
    height: calc(100vh - 57px);
    overflow-y: auto;
}

.review-sidebar h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 8px 20px;
    margin-bottom: 4px;
}

.brand-item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    min-height: 44px;
}

.brand-item:hover { background: var(--surface); }

.brand-item.active {
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
}

.brand-item .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand-item .status-dot.pending { background: var(--muted); }
.brand-item .status-dot.reviewing { background: var(--amber); }
.brand-item .status-dot.approved { background: var(--green); }
.brand-item .status-dot.generating { background: var(--blue); animation: pulse 1.5s infinite; }

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

.brand-item .progress { font-size: 11px; color: var(--muted); }

.sidebar-section { margin-bottom: 8px; }

.sidebar-section.archived {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 8px;
}

.archive-toggle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 8px 20px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archive-toggle:hover { color: var(--text); }

.archive-toggle .chevron { transition: transform 0.2s; }
.archive-toggle .chevron.collapsed { transform: rotate(-90deg); }

.archived-brands { overflow: hidden; transition: max-height 0.3s; }
.archived-brands.collapsed { max-height: 0; }

.brand-item.archived-item { opacity: 0.5; }
.brand-item.archived-item:hover { opacity: 0.8; }

/* Review main */
.review-main {
    flex: 1;
    padding: 32px;
    max-width: 1100px;
    padding-bottom: 100px;
}

.brand-header { margin-bottom: 32px; }

.brand-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand-header .product {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}

.brand-header .intel-summary {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.brand-header .intel-summary strong { color: var(--text); }
.brand-header .intel-summary a { color: var(--accent); text-decoration: none; }
.brand-header .intel-summary a:hover { text-decoration: underline; }

/* Concept cards */
.concept-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    overflow: hidden;
}

.concept-card.approved { border-color: var(--green); }
.concept-card.needs-revision { border-color: var(--amber); }

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

.concept-header .left h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.concept-header .left .format {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.concept-header .headline {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
    max-width: 300px;
    text-align: right;
}

.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending { background: rgba(119,119,119,0.2); color: var(--muted); }
.status-badge.approved { background: var(--green-dim); color: var(--green); }
.status-badge.revision { background: var(--amber-dim); color: var(--amber); }

/* Image comparison */
.image-row { display: flex; gap: 0; }

.image-option {
    flex: 1;
    padding: 20px;
    border-right: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}

.image-option:last-child { border-right: none; }
.image-option:hover { background: var(--surface-2); }
.image-option.selected { background: var(--green-dim); }

.image-option img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.image-option .label {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
}

.image-option .select-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    font-family: inherit;
}

.image-option .select-btn:hover { border-color: var(--green); color: var(--green); }
.image-option.selected .select-btn { background: var(--green); border-color: var(--green); color: white; }

/* Feedback area */
.concept-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.feedback-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feedback-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    outline: none;
}

.feedback-input:focus { border-color: var(--accent); }
.feedback-input::placeholder { color: #555; }

.approve-btn {
    padding: 10px 20px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    min-height: 44px;
}

.approve-btn:hover { opacity: 0.9; }
.approve-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.approve-btn.undo {
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
}

.submit-feedback-btn {
    padding: 10px 20px;
    background: var(--amber);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    min-height: 44px;
}

.revision-type-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    min-height: 44px;
}

.revision-type-select:focus { border-color: var(--accent); }

.revision-type-hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

/* Prompt toggle */
.prompt-toggle { padding: 0 24px 16px; }
.prompt-toggle summary { font-size: 12px; color: var(--muted); cursor: pointer; }

.prompt-toggle pre {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
}

/* Revision history */
.revision-history { padding: 0 24px 16px; }

.revision-block {
    background: var(--amber-dim);
    border: 1px solid rgba(210,153,34,0.2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.revision-block h4 {
    font-size: 12px;
    color: var(--amber);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revision-block .feedback-text {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 4px;
    border-left: 3px solid var(--amber);
}

.revision-block .prev-images {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.revision-block .prev-images img {
    height: 120px;
    width: auto;
    border-radius: 4px;
    opacity: 0.6;
}

.revision-block .prev-images .label {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    margin-top: 4px;
}

/* Deploy bar */
.deploy-bar {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    padding: 16px 32px;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.deploy-bar .info { font-size: 14px; color: var(--muted); }
.deploy-bar .info strong { color: var(--text); }

.deploy-btn {
    padding: 12px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    min-height: 44px;
}

.deploy-btn:hover { opacity: 0.9; }
.deploy-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Global feedback area */
.global-feedback-area { margin-top: 12px; }

.global-feedback-area textarea {
    min-height: 80px;
    width: 100%;
    display: block;
}

.global-feedback-area button { margin-top: 8px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 100px 32px;
    color: var(--muted);
}

.empty-state h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}

/* Mobile brand nav (review view) */
.mobile-brand-nav { display: none; }

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    right: 32px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text);
    z-index: 300;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    pointer-events: none;
}

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

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--accent); }

/* Loading spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--muted);
    font-size: 14px;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pipeline vertical list on mobile */
.pipeline-list { display: none; }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body { overflow-x: hidden; max-width: 100vw; }
    .app { overflow-x: hidden; }

    /* Header */
    .header { padding: 12px 16px; }
    .header-left { gap: 10px; }
    .header-logo { height: 16px; }
    .header-divider { height: 16px; }
    .header h1 { font-size: 12px; }
    .header h1 { display: none; }
    .header-divider { display: none; }
    .action-badges { gap: 4px; }
    .action-badge { padding: 3px 8px; font-size: 10px; }
    .action-badge .badge-count { font-size: 11px; }
    .header-right { gap: 12px; }
    .view-toggle button { padding: 8px 12px; font-size: 12px; }

    /* Pipeline */
    .pipeline-container { padding: 16px; }
    .pipeline-controls { flex-wrap: wrap; gap: 8px; }
    .pipeline-search { width: 100%; order: 1; }
    .weekly-stats { order: 2; flex: 1; gap: 10px; font-size: 11px; }
    .add-brand-btn { order: 3; margin-left: 0; }
    .pipeline-stats { order: 4; width: 100%; }

    /* Hide kanban, show list */
    .kanban-board { display: none !important; }
    .pipeline-list { display: block !important; }

    .pipeline-list-section {
        margin-bottom: 16px;
    }

    .pipeline-list-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius) var(--radius) 0 0;
        cursor: pointer;
    }

    .pipeline-list-header h3 {
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--muted);
    }

    .pipeline-list-header .col-count {
        font-size: 11px;
        color: var(--muted);
        background: var(--surface-2);
        padding: 2px 8px;
        border-radius: 10px;
    }

    .pipeline-list-cards {
        border: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .pipeline-card {
        padding: 16px;
    }

    .pipeline-card .card-name { font-size: 15px; }

    .collapsed-brands {
        grid-template-columns: 1fr;
    }

    /* Brand modal */
    .brand-modal-overlay { padding: 0; align-items: flex-end; overflow-x: hidden; }
    .brand-modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
        overflow-x: hidden;
    }
    .brand-modal-header { padding: 20px 16px; }
    .brand-modal-body { padding: 16px; overflow-x: hidden; }
    .brand-modal-body input, .brand-modal-body textarea, .brand-modal-body select {
        max-width: 100%;
        width: 100% !important;
    }
    .brand-modal-body .input-with-btn { flex-wrap: nowrap; }
    .brand-modal-body .input-with-btn input { min-width: 0; }
    .modal-row { grid-template-columns: 1fr; }
    .modal-actions { padding: 12px 16px; flex-direction: column; }
    .modal-actions button { width: 100%; }

    /* Review view */
    .review-view.active { flex-direction: column; }
    .review-sidebar { display: none; }

    .mobile-brand-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 49px;
        z-index: 99;
    }

    .mobile-nav-btn {
        background: var(--surface-2);
        border: 1px solid var(--border);
        color: var(--text);
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-btn:active { background: var(--border); }
    .mobile-nav-btn:disabled { opacity: 0.2; }

    .mobile-nav-info {
        text-align: center;
        flex: 1;
        padding: 0 8px;
    }

    .mobile-nav-info .brand-name { font-size: 15px; font-weight: 600; }
    .mobile-nav-info .brand-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

    /* Review main */
    .review-main { padding: 16px; padding-bottom: 100px; }
    .brand-header { margin-bottom: 20px; }
    .brand-header h2 { font-size: 18px; }
    .brand-header .product { font-size: 13px; margin-bottom: 8px; }
    .brand-header .intel-summary { font-size: 12px; padding: 12px; }

    .concept-card { margin-bottom: 20px; border-radius: var(--radius); }
    .concept-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
        padding: 14px 16px;
    }
    .concept-header .left h3 { font-size: 14px; }
    .concept-header .headline { text-align: left; max-width: none; font-size: 12px; }

    .image-row { flex-direction: column; }
    .image-option { border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
    .image-option:last-child { border-bottom: none; }
    .image-option .select-btn { padding: 12px; font-size: 14px; }

    .concept-footer { padding: 12px 16px; }
    .feedback-row { flex-direction: column; gap: 8px; width: 100%; }
    .feedback-input { min-height: 50px; font-size: 14px; width: 100% !important; }
    .revision-type-select { font-size: 14px; width: 100%; }
    .approve-btn { padding: 12px; font-size: 14px; width: 100%; }
    .submit-feedback-btn { padding: 12px; font-size: 14px; width: 100%; }

    .prompt-toggle { padding: 0 16px 12px; }
    .prompt-toggle summary { font-size: 11px; }
    .prompt-toggle pre { font-size: 10px; }

    .revision-history { padding: 0 16px 12px; }
    .revision-block { padding: 12px; }
    .revision-block .prev-images img { height: 80px; }

    .deploy-bar {
        left: 0;
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 16px;
    }
    .deploy-bar .info { font-size: 13px; }
    .deploy-btn { width: 100%; padding: 14px; font-size: 15px; }

    .global-feedback-area textarea { min-height: 60px !important; font-size: 14px; }

    .toast { right: 16px; left: 16px; bottom: 90px; text-align: center; }
}
