/* Sophie Dashboard — Clean, minimal styles */

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --muted: #6c757d;
    --border: #dee2e6;
    --primary: #0d6efd;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e2e8f0;
    --radius: 8px;
}

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

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

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header { padding: 0 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h1 { font-size: 1.5rem; font-weight: 700; }
.sidebar-header .subtitle { font-size: 0.8rem; opacity: 0.6; margin-top: 0.25rem; }

.nav-links { padding: 1rem 0; flex: 1; }
.nav-links .nav-item {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.nav-links .nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-links .nav-item.active { background: rgba(255,255,255,0.12); font-weight: 600; }

/* Collapsible nav sections */
.nav-section { }
.nav-section summary {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    user-select: none;
}
.nav-section[open] summary { color: rgba(255,255,255,0.6); }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::marker { display: none; content: ''; }
.nav-section summary::before { content: '\25B8  '; }
.nav-section[open] > summary::before { content: '\25BE  '; }

.sidebar-footer { padding: 1rem 1.5rem; font-size: 0.75rem; opacity: 0.5; }
.sidebar-footer a { color: var(--sidebar-text); }

/* Main content */
.content { margin-left: 220px; flex: 1; padding: 2rem; max-width: 1200px; }
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.5rem; font-weight: 600; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-card.highlight { border-color: var(--success); background: #f0fdf4; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.data-table th { background: var(--bg); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: #f8f9fa; }
.data-table.compact td { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg);
    color: var(--text);
}
.badge-agency_enquiry { background: #dbeafe; color: #1e40af; }
.badge-axopar { background: #fef3c7; color: #92400e; }
.badge-coral { background: #d1fae5; color: #065f46; }
.badge-membership { background: #ede9fe; color: #5b21b6; }
.badge-spam { background: #fee2e2; color: #991b1b; }
.badge-sub { background: #f0f9ff; color: #0369a1; }
.badge-high, .badge-critical { background: #fee2e2; color: #991b1b; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #d1fae5; color: #065f46; }
.badge-tier-premium { background: #fef3c7; color: #92400e; }
.badge-tier-high { background: #dbeafe; color: #1e40af; }
.badge-tier-standard { background: var(--bg); color: var(--muted); }
.badge-tier-low { background: #f3f4f6; color: #6b7280; }
.badge-calendar { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.boat-warnings { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }
.badge-warning { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 0.65rem; }
.badge-warning-field { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 0.65rem; }

/* Status */
.status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-new { background: #dbeafe; color: #1e40af; }
.status-acknowledged { background: #e0e7ff; color: #3730a3; }
.status-quoted { background: #fef3c7; color: #92400e; }
.status-following_up { background: #fed7aa; color: #9a3412; }
.status-booked { background: #d1fae5; color: #065f46; }
.status-lost { background: #fee2e2; color: #991b1b; }
.status-closed { background: #f3f4f6; color: #6b7280; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-active { background: #dbeafe; color: #1e40af; }
.status-waiting_customer { background: #fed7aa; color: #9a3412; }

/* Section */
.section { margin-bottom: 2rem; }
.section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: var(--bg); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-approve { background: var(--success); color: white; border-color: var(--success); }
.btn-approve:hover { background: #157347; }
.btn-reject { background: var(--danger); color: white; border-color: var(--danger); }
.btn-reject:hover { background: #bb2d3b; }
.btn-won { background: #1e40af; color: white; border-color: #1e40af; font-weight: 600; }
.btn-won:hover { background: #1e3a8a; color: white; }

/* Detail views */
.detail-card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.detail-body { margin-bottom: 1.5rem; }
.email-body { white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; background: var(--bg); padding: 1rem; border-radius: var(--radius); line-height: 1.5; }

/* Conversation */
.conversation { margin: 1.5rem 0; }
.message { margin-bottom: 1rem; padding: 1rem; border-radius: var(--radius); }
.message-customer { background: #f0f9ff; border-left: 3px solid var(--primary); }
.message-sophie { background: #f0fdf4; border-left: 3px solid var(--success); }
.message-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.85rem; }
.message-body { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }

/* Filters */
.filters { margin-bottom: 1.5rem; display: flex; gap: 0.75rem; align-items: center; }
.filters select, .filters input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--surface);
}

/* Boat grid */
.boat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.boat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.boat-image { height: 160px; background: var(--bg) center/cover no-repeat; }
.boat-image.placeholder { background-color: #e2e8f0; }
.boat-info { padding: 1rem; }
.boat-info h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.boat-meta { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.boat-details { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.boat-details p { margin-bottom: 0.15rem; }
.boat-features { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.75rem; }
.feature-tag { font-size: 0.7rem; padding: 0.1rem 0.4rem; background: var(--bg); border-radius: 4px; color: var(--muted); }

/* Reports */
.reports-list { display: flex; flex-direction: column; gap: 1rem; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.report-stats { display: flex; gap: 2rem; }
.report-stat { text-align: center; }
.report-stat .stat-value { font-size: 1.25rem; font-weight: 700; display: block; }
.report-stat .stat-label { font-size: 0.75rem; color: var(--muted); }
.report-detail { margin-top: 1rem; }

/* Suggestions */
.suggestions-list { display: flex; flex-direction: column; gap: 1rem; }
.suggestion-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.suggestion-high, .suggestion-critical { border-left: 3px solid var(--danger); }
.suggestion-medium { border-left: 3px solid var(--warning); }
.suggestion-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.suggestion-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.suggestion-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.suggestion-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }
.draft-content { white-space: pre-wrap; font-size: 0.85rem; background: var(--bg); padding: 1rem; margin-top: 0.5rem; border-radius: var(--radius); }
.impact { margin-top: 0.5rem; font-size: 0.85rem; color: var(--success); font-style: italic; }

/* Questions */
.questions-list { display: flex; flex-direction: column; gap: 1rem; }
.question-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.question-card.question-high { border-left: 3px solid var(--danger); }
.question-card.question-normal { border-left: 3px solid var(--primary); }
.question-card.question-low { border-left: 3px solid var(--border); }
.question-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.question-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.question-context { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.75rem; font-style: italic; }
.question-answer-form textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; font-family: inherit; resize: vertical; }
.question-answer-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15); }
.question-actions { margin-top: 0.75rem; display: flex; justify-content: space-between; align-items: center; }
.question-buttons { display: flex; gap: 0.5rem; }
.checkbox-label { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.question-answer { margin-top: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius); font-size: 0.9rem; line-height: 1.5; }
.question-answer p { margin: 0.25rem 0; }
.badge-qcat-pricing { background: #fef3c7; color: #92400e; }
.badge-qcat-availability { background: #dbeafe; color: #1e40af; }
.badge-qcat-policy { background: #fee2e2; color: #991b1b; }
.badge-qcat-boat_info { background: #d1fae5; color: #065f46; }
.badge-qcat-general { background: var(--bg); color: var(--muted); }
.badge-kb { background: #d1fae5; color: #065f46; font-size: 0.7rem; margin-left: 0.5rem; }
.status-dismissed { background: #f3f4f6; color: #6b7280; }

/* Utilities */
.muted { color: var(--muted); font-size: 0.85rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem; }
details summary { cursor: pointer; font-size: 0.85rem; color: var(--primary); margin-top: 0.5rem; }
.quotes-section { margin-top: 1.5rem; }
.quote-card { background: var(--bg); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }

/* Edit forms */
.edit-form { max-width: 900px; }
.form-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.form-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; font-family: inherit; background: var(--surface);
}
.form-group textarea { resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}
.form-group small { display: block; margin-top: 0.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.4rem; margin-top: 0.3rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; cursor: pointer; padding: 0.35rem 0.5rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.checkbox-label:hover { background: var(--hover); }
.checkbox-label input[type="checkbox"] { margin: 0; }
.tag-vibe { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }
.image-preview { max-width: 200px; max-height: 120px; margin-top: 0.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.boat-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* Knowledge base */
.knowledge-list { display: flex; flex-direction: column; gap: 0.5rem; }
.knowledge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color 0.15s;
}
.knowledge-card:hover { border-color: var(--primary); }
.knowledge-card-header { display: flex; justify-content: space-between; align-items: center; }
.knowledge-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.knowledge-card h3 a { color: var(--text); text-decoration: none; }
.knowledge-card h3 a:hover { color: var(--primary); }
.knowledge-draft { opacity: 0.75; border-left: 3px solid #f59e0b; }
.knowledge-card-preview { font-size: 0.82rem; color: var(--muted); line-height: 1.4; margin-top: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Knowledge base filter tabs */
.kb-filter-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.kb-filter-tab {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.kb-filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.kb-filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.badge-kb-quoting { background: #fef3c7; color: #92400e; }
.badge-kb-policies { background: #fee2e2; color: #991b1b; }
.badge-kb-locations { background: #d1fae5; color: #065f46; }
.badge-kb-operations { background: #dbeafe; color: #1e40af; }
.badge-kb-brand { background: #ede9fe; color: #5b21b6; }
.badge-kb-general { background: var(--bg); color: var(--muted); }
.badge-scope-agency { background: #dbeafe; color: #1e40af; }
.badge-scope-own_boats { background: #fef3c7; color: #92400e; }
.badge-scope-all { background: #f3f4f6; color: #6b7280; }
.badge-draft { background: #fef3c7; color: #92400e; font-weight: 600; }
.kb-status-tab {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.kb-status-tab:hover { border-color: #92400e; color: #92400e; }
.kb-status-tab.active { background: #92400e; color: white; border-color: #92400e; }
.kb-scope-tab {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.kb-scope-tab:hover { border-color: #92400e; color: #92400e; }
.kb-scope-tab.active { background: #92400e; color: white; border-color: #92400e; }

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    line-height: 1.5;
}
.chat-msg-user {
    align-self: flex-end;
    background: #dbeafe;
    border-bottom-right-radius: 2px;
}
.chat-msg-sophie {
    align-self: flex-start;
    background: #f0fdf4;
    border-bottom-left-radius: 2px;
}
.chat-msg-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.chat-msg-body {
    font-size: 0.9rem;
    word-wrap: break-word;
}
.chat-msg-body ul { margin: 0.25rem 0 0.25rem 1.25rem; }
.chat-msg-body li { margin-bottom: 0.15rem; }
.chat-msg-body code { background: rgba(0,0,0,0.06); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.85em; }
.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background: var(--bg);
}
.chat-input-row {
    display: flex;
    gap: 0.75rem;
}
.chat-input-row input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
}
.chat-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}
.btn-send {
    padding: 0.65rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-send:hover { background: #0b5ed7; }
.btn-send:disabled { background: var(--muted); cursor: not-allowed; }

/* Thinking dots */
.chat-thinking {
    display: flex;
    gap: 0.3rem;
    padding: 0.25rem 0;
}
.chat-thinking .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    animation: thinking 1.4s infinite ease-in-out both;
}
.chat-thinking .dot:nth-child(1) { animation-delay: -0.32s; }
.chat-thinking .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes thinking {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Pricing page */
.pricing-page .form-section { max-width: 900px; }
.pricing-page textarea#rate-sheet-text {
    width: 100%; max-width: 900px; font-family: monospace; font-size: 13px;
    padding: 12px; border: 1px solid #ddd; border-radius: 6px; resize: vertical;
}
.season-block {
    background: #f8fafe; border-radius: 8px; padding: 12px 16px 4px; margin-bottom: 12px;
    border-left: 3px solid #1e40af;
}
.tier-row, .dynamic-row { align-items: center; gap: 8px; margin-bottom: 4px; }
.tier-row input, .dynamic-row input { font-size: 14px; padding: 6px 8px; }
.btn-remove {
    background: none; border: none; color: #e74c3c; font-size: 20px; cursor: pointer;
    padding: 2px 8px; border-radius: 4px; line-height: 1;
}
.btn-remove:hover { background: #fde8e8; }
.btn-small {
    font-size: 13px; padding: 4px 12px; background: #eee; border: 1px solid #ddd;
    border-radius: 4px; cursor: pointer; color: #333;
}
.btn-small:hover { background: #ddd; }
.advanced-section { border: 1px solid #e0e0e0; border-radius: 8px; padding: 0; }
.advanced-section summary {
    padding: 12px 16px; cursor: pointer; user-select: none;
    list-style: none; display: flex; align-items: center; gap: 8px;
}
.advanced-section summary::before { content: '▸'; font-size: 14px; color: #666; }
.advanced-section[open] summary::before { content: '▾'; }
.advanced-section summary h3 { margin: 0; font-size: 15px; }
.advanced-section > div, .advanced-section > :not(summary) { padding: 0 16px 16px; }
.tier-header { padding: 0; margin-top: 8px; }
.col-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.col-headers { margin-bottom: 2px; }
.month-selector { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.month-chip {
    display: inline-block; padding: 4px 12px; border-radius: 16px;
    font-size: 0.8rem; font-weight: 500; cursor: pointer; user-select: none;
    background: var(--bg); border: 1px solid var(--border); color: var(--muted);
    transition: all 0.15s;
}
.month-chip:hover { border-color: var(--primary); color: var(--primary); }
.month-chip.active { background: #dbeafe; border-color: #1e40af; color: #1e40af; }
.day-selector { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.day-chip {
    display: inline-block; padding: 3px 10px; border-radius: 14px;
    font-size: 0.78rem; font-weight: 500; cursor: pointer; user-select: none;
    background: var(--bg); border: 1px solid var(--border); color: var(--muted);
    transition: all 0.15s;
}
.day-chip:hover { border-color: var(--primary); color: var(--primary); }
.day-chip.active { background: #d1fae5; border-color: #059669; color: #065f46; }
.tier-row { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.tier-row-top { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tier-field { display: flex; flex-direction: column; gap: 4px; }
.tier-field-narrow { min-width: 100px; max-width: 140px; }
.tier-field input { padding: 6px 8px; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.tier-inline-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.inline-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.labelled-row { align-items: flex-end; }

/* Pricing summary on edit page */
.pricing-summary-block { margin-bottom: 12px; }
.pricing-mini-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 0.85rem; }
.pricing-mini-table th {
    text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--border);
}
.pricing-mini-table td { padding: 4px 8px; border-bottom: 1px solid #f0f0f0; }
.pricing-summary-fees { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pricing-fee-item { display: flex; gap: 8px; font-size: 0.88rem; align-items: baseline; }
.pricing-fee-label { font-weight: 600; min-width: 120px; flex-shrink: 0; font-size: 0.82rem; color: var(--muted); }

/* Analytics */
.analytics-section { margin-bottom: 2rem; }
.analytics-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.analytics-section h4 { font-size: 0.95rem; font-weight: 600; margin: 1.25rem 0 0.75rem; }
.analytics-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.analytics-period-selector { display: flex; gap: 0.5rem; }
.analytics-dateby-toggle { display: flex; align-items: center; gap: 0.5rem; }
.analytics-dateby-toggle .toggle-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.btn-active { background: var(--primary); color: white; border-color: var(--primary); }
.stat-card.bookeo { border-color: var(--info); background: #f0f9ff; }
.stat-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }
.revenue-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.day-heatmap { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.day-bar { display: flex; align-items: center; gap: 0.5rem; }
.day-label { width: 2.5rem; font-size: 0.8rem; font-weight: 500; color: var(--muted); text-align: right; }
.day-fill { background: var(--info); color: white; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; min-width: 1.5rem; text-align: center; }

/* Chart containers */
.chart-container { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; max-height: 350px; }
.chart-container canvas { max-height: 300px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.date-range-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.lead-time-avg { display: inline-block; margin-left: 1rem; font-size: 0.9rem; color: var(--muted); font-weight: 400; }

/* Occupancy heatmap grid */
.occupancy-heatmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
.occupancy-cell { border-radius: var(--radius); padding: 0.75rem 0.5rem; text-align: center; color: white; min-height: 70px; display: flex; flex-direction: column; justify-content: center; }
.occupancy-month { font-size: 0.75rem; font-weight: 600; opacity: 0.9; }
.occupancy-pct { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.occupancy-detail { font-size: 0.65rem; opacity: 0.8; }

/* Growth opportunity card */
.growth-opportunity-card { background: #f0fdf4; border: 2px solid var(--success); border-radius: var(--radius); padding: 1.5rem; }
.growth-opportunity-card h3 { color: var(--success); font-size: 1.1rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #bbf7d0; }
.growth-headline { font-size: 0.95rem; margin-bottom: 0.5rem; }
.growth-estimate { font-size: 1rem; color: var(--success); font-weight: 500; }

/* Conversations */
.conversations-list { display: flex; flex-direction: column; gap: 0.75rem; }
.conversation-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.conversation-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.conversation-card-escalated { border-left: 3px solid var(--warning); }
.conversation-card-unread { border-left: 3px solid var(--primary); }
.conversation-card-escalated.conversation-card-unread { border-left: 3px solid var(--warning); }
.conversation-card-awaiting { background: #fffbeb; }

.unread-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}
.awaiting-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #fed7aa;
    color: #9a3412;
    white-space: nowrap;
}

.btn-dismiss {
    background: none;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius);
    line-height: 1;
}
.btn-dismiss:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.conversation-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; gap: 0.5rem; }
.conversation-card-title { flex: 1; min-width: 0; }
.conversation-card-badges { display: flex; gap: 0.4rem; flex-shrink: 0; }
.conversation-card-preview { font-size: 0.85rem; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-card-footer { display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.75rem; }

/* Escalation badges */
.escalation-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.escalation-needs-help { background: #fef3c7; color: #92400e; }
.escalation-ready-to-book { background: #fee2e2; color: #991b1b; }
.escalation-needs-takeover { background: #ede9fe; color: #5b21b6; }
.badge-escalation-nav { background: var(--danger); color: white; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 10px; margin-left: 0.25rem; }

/* Customer mood badges */
.mood-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}
.mood-frustrated { background: #fee2e2; color: #991b1b; }
.mood-urgent { background: #fef3c7; color: #92400e; }
.mood-positive { background: #d1fae5; color: #065f46; }

/* Conversation detail layout */
.conversation-detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; }
.conversation-main { min-width: 0; }
.conversation-sidebar { position: sticky; top: 2rem; align-self: start; }

/* Escalation card (in detail view) */
.escalation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.escalation-card-needs_help { border-left: 4px solid #f59e0b; background: #fffbeb; }
.escalation-card-ready_to_book { border-left: 4px solid var(--danger); background: #fef2f2; }
.escalation-card-needs_takeover { border-left: 4px solid #8b5cf6; background: #f5f3ff; }
.escalation-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.escalation-reason { font-size: 0.95rem; line-height: 1.5; }

/* Conversation actions (help/takeover forms) */
.conversation-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.action-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.action-form h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.action-form textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; font-family: inherit; resize: vertical; }
.action-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15); }
.action-form .form-group { margin-bottom: 0.75rem; }
.action-form button { margin-top: 0.5rem; }

/* Conversation thread */
.conversation-thread { display: flex; flex-direction: column; gap: 0.75rem; }
.message-team { background: #f5f3ff; border-left: 3px solid #8b5cf6; }

/* Customer info in sidebar */
.customer-info p { margin-bottom: 0.15rem; }

/* Escalation history */
.escalation-history-item { padding: 0.75rem; background: var(--bg); border-radius: var(--radius); margin-bottom: 0.5rem; }
.escalation-history-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.25rem; }

/* Conversation summary card */
.summary-card { background: #f0f4ff; border: 1px solid #c9d6f0; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.summary-card h4 { margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--primary); }
.summary-card ul { margin: 0; padding-left: 1.25rem; }
.summary-card li { font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.25rem; }
.summary-card.loading { opacity: 0.6; }

/* Draft reply cards */
.draft-reply-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.5rem; cursor: pointer; transition: border-color 0.15s; }
.draft-reply-card:hover { border-color: var(--primary); }
.draft-reply-card p { font-size: 0.85rem; margin-bottom: 0.5rem; white-space: pre-wrap; line-height: 1.5; }

/* Status waiting_owner */
.status-waiting_owner { background: #fef3c7; color: #92400e; }

/* Performance Dashboard */
.sophie-score-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}
.sophie-score-card.score-green { border-color: var(--success); background: #f0fdf4; }
.sophie-score-card.score-amber { border-color: var(--warning); background: #fffbeb; }
.sophie-score-card.score-red { border-color: var(--danger); background: #fef2f2; }
.sophie-score-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}
.sophie-score-card.score-green .sophie-score-value { color: var(--success); }
.sophie-score-card.score-amber .sophie-score-value { color: #b45309; }
.sophie-score-card.score-red .sophie-score-value { color: var(--danger); }
.sophie-score-label { font-size: 1rem; font-weight: 600; color: var(--muted); }
.sophie-score-breakdown { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; font-size: 0.82rem; color: var(--muted); }
.sophie-score-breakdown span { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.sophie-score-breakdown strong { font-size: 1rem; color: var(--text); }

/* Feedback buttons */
.feedback-section { margin-top: 1rem; }
.feedback-section h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.feedback-btn-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.feedback-btn:hover { border-color: var(--primary); color: var(--primary); }
.feedback-btn-up { border-color: #86efac; color: #065f46; }
.feedback-btn-up:hover { background: #d1fae5; border-color: var(--success); }
.feedback-btn-down { border-color: #fca5a5; color: #991b1b; }
.feedback-btn-down:hover { background: #fee2e2; border-color: var(--danger); }
.feedback-btn-good { border-color: #86efac; }
.feedback-btn-good:hover { background: #d1fae5; }
.feedback-btn-wrong { border-color: #fca5a5; }
.feedback-btn-wrong:hover { background: #fee2e2; }
.feedback-confirmed { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.7rem; font-size: 0.78rem; color: var(--success); font-weight: 500; }
.coach-btn { background: var(--bg); }
.coach-btn:hover { background: #e2e8f0; border-color: var(--muted); }

/* Boat pick rating (inline in quotes) */
.boat-pick-actions { display: inline-flex; gap: 0.25rem; margin-left: 0.5rem; }
.boat-pick-btn {
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}
.boat-pick-btn:hover { border-color: var(--primary); }
.boat-pick-btn-good:hover { background: #d1fae5; border-color: var(--success); }
.boat-pick-btn-wrong:hover { background: #fee2e2; border-color: var(--danger); }

/* Weekly Review */
.review-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
}
.review-nav-btn {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}
.review-nav-btn:hover { text-decoration: underline; }
.review-week-label { font-size: 1.05rem; font-weight: 700; }
.review-cards { display: flex; flex-direction: column; gap: 1rem; }

/* Review card v2 */
.review-card-v2 {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.review-card-v2:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.review-card-escalated { border-left: 3px solid var(--warning); }
.review-card-rated.review-card-rated-good { border-left: 3px solid var(--success); }
.review-card-rated.review-card-rated-could_improve { border-left: 3px solid var(--warning); }
.review-card-rated.review-card-rated-poor { border-left: 3px solid var(--danger); }

.review-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.review-card-identity { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.review-card-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}
.review-card-name:hover { color: var(--primary); }

.review-card-subject {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
    font-style: italic;
}

/* Context tags */
.review-card-context { margin-bottom: 0.6rem; }
.review-context-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.context-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
}

/* Customer message preview */
.review-card-preview {
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
}
.preview-text {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Recommendations + outcome row */
.review-card-recs-outcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.review-recs { font-size: 0.83rem; }
.review-recs-label { color: var(--muted); font-weight: 500; margin-right: 0.3rem; }
.rec-boat {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #eef2ff;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #3730a3;
    margin-right: 0.2rem;
}
.rec-boat-hit { background: #d1fae5; color: #065f46; font-weight: 600; }

.review-outcome { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.outcome-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
}
.outcome-booked { background: #d1fae5; color: #065f46; }
.outcome-lost { background: #fee2e2; color: #991b1b; }
.outcome-progress { background: #eef2ff; color: #3730a3; }
.outcome-commission { font-size: 0.82rem; font-weight: 600; color: var(--success); }

/* Footer: rating + conversation link */
.review-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    gap: 1rem;
    flex-wrap: wrap;
}
.review-rating-area { flex: 1; }
.review-rating-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.review-rate-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-right: 0.2rem; }
.review-rating-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.review-rating-btn:hover { border-color: var(--primary); background: var(--bg); }
.review-rating-btn-good:hover { border-color: var(--success); background: #d1fae5; color: #065f46; }
.review-rating-btn-improve:hover { border-color: var(--warning); background: #fef3c7; color: #92400e; }
.review-rating-btn-poor:hover { border-color: var(--danger); background: #fee2e2; color: #991b1b; }
.review-note-input {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-family: inherit;
}
.review-note-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15); }
.review-rated { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.review-rated-good { background: #d1fae5; color: #065f46; }
.review-rated-could_improve { background: #fef3c7; color: #92400e; }
.review-rated-poor { background: #fee2e2; color: #991b1b; }
.review-view-link {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.review-view-link:hover { text-decoration: underline; }
.review-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.review-empty p { margin-bottom: 0.5rem; }
.review-empty a { color: var(--primary); }

/* Training Arena */
.training-stats { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.training-stats .stat-card { flex: 1; }
.training-start { text-align: center; margin: 2rem 0; }
.btn-training {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-training:hover { background: #0b5ed7; }
.training-scenario-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.scenario-header { margin-bottom: 1rem; }
.scenario-header h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.scenario-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.scenario-detail { font-size: 0.85rem; }
.scenario-detail .detail-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.training-pick-form { margin-top: 1rem; }
.training-pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius); }
.training-pick-row select, .training-pick-row input { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; font-family: inherit; }
.training-pick-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3rem; }
.training-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.training-result-header { text-align: center; margin-bottom: 1.5rem; }
.training-agreement { font-size: 2rem; font-weight: 800; }
.training-agreement.match-high { color: var(--success); }
.training-agreement.match-mid { color: var(--warning); }
.training-agreement.match-low { color: var(--danger); }
.training-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.training-col h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.training-pick-item { padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.training-pick-item:last-child { border-bottom: none; }
.badge-match { background: #d1fae5; color: #065f46; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px; margin-left: 0.4rem; }

/* Training Arena — Review Cards */
.training-review-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.training-review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.training-review-header h4 { margin: 0; font-size: 1rem; }
.training-review-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}
.training-review-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.reason-tag {
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}
.training-rating-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.training-rating-options label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s;
}
.training-rating-options label:hover { background: var(--bg); }
.training-rating-options input[type="radio"] { margin: 0; }
.training-note-row { margin-top: 0.4rem; }
.training-note-row input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
}
.training-suggest-row { margin-top: 0.4rem; }
.training-suggest-row select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: inherit;
}
.badge-role-best_match { background: #d1fae5; color: #065f46; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px; }
.badge-role-upgrade { background: #ede9fe; color: #5b21b6; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px; }
.badge-role-value { background: #fef3c7; color: #92400e; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 4px; }

/* Training Arena — Result Cards */
.training-result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.rating-good_pick { color: var(--success); font-weight: 600; }
.rating-ok_not_ideal { color: var(--warning); font-weight: 600; }
.rating-wrong_boat { color: var(--danger); font-weight: 600; }

/* Calendar */
.calendar-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; align-items: center; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.fc .fc-event { border-radius: 4px; padding: 3px 6px; margin-bottom: 2px; border: none; cursor: pointer; }
.fc .fc-toolbar-title { font-size: 1.2rem; font-weight: 600; }
.fc .fc-button { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
.fc .fc-event-cancelled { text-decoration: line-through; opacity: 0.6; }
.fc .fc-daygrid-day { min-height: 80px; }
.cal-event-inner { line-height: 1.3; overflow: hidden; }
.cal-event-time { font-size: 0.7rem; font-weight: 700; opacity: 0.9; white-space: nowrap; }
.cal-event-detail { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event-boat { font-weight: 700; }
.cal-event-customer { font-weight: 400; opacity: 0.9; }
.cal-event-pax { font-weight: 400; opacity: 0.7; font-size: 0.7rem; }

/* Staff Portal */
.staff-body { display: block; background: var(--bg); }
.staff-topbar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.staff-topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}
.staff-brand { font-size: 1.1rem; font-weight: 700; }
.staff-nav-links { display: flex; gap: 0.25rem; }
.staff-nav-link {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.staff-nav-link:hover { background: rgba(255,255,255,0.1); }
.staff-nav-link.active { background: rgba(255,255,255,0.15); font-weight: 600; }
.staff-nav-logout { opacity: 0.6; }
.staff-nav-logout:hover { opacity: 1; }
.staff-content { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

/* Staff shift cards (no pay) */
.shift-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.shift-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.shift-card.shift-today { border-color: var(--primary); border-left: 3px solid var(--primary); }
.shift-card.shift-past { opacity: 0.5; }
.shift-card-date { font-weight: 700; min-width: 100px; }
.shift-card-time { font-size: 0.95rem; color: var(--text); }
.shift-card-hours { font-size: 0.85rem; color: var(--muted); }
.shift-card-notes { font-size: 0.82rem; color: var(--muted); font-style: italic; }

/* Owner Roster */
.roster-week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
}
.roster-week-title { font-size: 1.05rem; font-weight: 700; text-align: center; }
.roster-days { display: flex; flex-direction: column; gap: 0.75rem; }
.roster-day-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.roster-day-card.roster-day-today { border-color: var(--primary); border-left: 3px solid var(--primary); }
.roster-day-card.roster-day-past { opacity: 0.6; }
.roster-day-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.roster-day-label { font-weight: 700; font-size: 1rem; }
.roster-shift-info { margin-top: 0.25rem; }
.roster-shift-time { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.roster-shift-hours { font-size: 0.85rem; color: var(--muted); }
.roster-shift-pay { font-size: 0.95rem; font-weight: 600; color: var(--success); margin-top: 0.25rem; }
.roster-shift-notes { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-top: 0.25rem; }
.roster-shift-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.roster-no-shift { margin-top: 0.25rem; }
.roster-add-btn { color: var(--primary); border-color: var(--primary); border-style: dashed; }
.roster-add-btn:hover { background: #f0f7ff; }
.roster-unavailable { margin-bottom: 0.5rem; }
.roster-unavail-block {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

/* Availability grid */
.avail-grid-wrapper { overflow-x: auto; }
.avail-grid { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); }
.avail-grid th { font-size: 0.7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 0.5rem 0.25rem; text-align: center; }
.avail-date-header { text-align: left !important; padding-left: 0.75rem !important; min-width: 110px; }
.avail-date-cell { padding: 0.4rem 0.75rem; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.avail-hour-cell { padding: 0.25rem; text-align: center; }
.avail-hour {
    display: block;
    width: 100%;
    min-width: 40px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--surface);
}
.avail-hour:hover { border-color: var(--primary); }
.avail-hour.unavailable { background: #fee2e2; border-color: #fca5a5; }
.avail-row-today .avail-date-cell { font-weight: 700; color: var(--primary); }

/* All Day button */
.avail-allday-header { text-align: center; min-width: 60px; }
.avail-allday-cell { padding: 0.25rem; text-align: center; }
.avail-allday-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    white-space: nowrap;
}
.avail-allday-btn:hover { border-color: var(--danger); color: var(--danger); }
.avail-allday-btn.active { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* Monthly calendar overview */
.avail-calendar-overview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.avail-month-grid { max-width: 320px; }
.avail-month-label { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.35rem; margin-top: 0.75rem; }
.avail-month-label:first-child { margin-top: 0; }
.avail-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.15rem;
}
.avail-month-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.avail-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 4px;
    color: var(--text);
    background: var(--bg);
}
.avail-cal-empty { background: transparent; }
.avail-cal-partial { background: #fef3c7; color: #92400e; }
.avail-cal-full { background: #fee2e2; color: #991b1b; font-weight: 700; }
.avail-cal-today { outline: 2px solid var(--primary); outline-offset: -1px; }
.avail-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--muted);
    align-items: center;
}
.avail-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}
.avail-legend-clear { background: var(--bg); border: 1px solid var(--border); }
.avail-legend-partial { background: #fef3c7; }
.avail-legend-full { background: #fee2e2; }

/* Mobile header + hamburger (hidden on desktop) */
.mobile-header { display: none; }
.nav-overlay { display: none; }

/* Responsive */
@media (max-width: 768px) {
    /* Mobile header bar */
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        background: var(--sidebar-bg);
        color: var(--sidebar-text);
        padding: 0 1rem;
        z-index: 1001;
    }
    .mobile-title { font-size: 1.1rem; font-weight: 700; }

    /* Hamburger button */
    .hamburger {
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--sidebar-text);
        border-radius: 1px;
        transition: transform 0.2s, opacity 0.2s;
    }
    body.nav-open .hamburger span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
    body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
    body.nav-open .hamburger span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

    /* Sidebar as slide-out drawer */
    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
        height: auto;
        overflow-y: auto;
    }
    body.nav-open .sidebar { transform: translateX(0); }

    /* Overlay behind sidebar */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: 50px;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
    body.nav-open .nav-overlay { display: block; }

    /* Main content */
    .content {
        margin-left: 0;
        margin-top: 50px;
        padding: 1rem;
        max-width: 100%;
    }
    .page-header h2 { font-size: 1.2rem; }

    /* Grids → single column or tighter */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .stat-card { padding: 0.75rem; }
    .stat-value { font-size: 1.3rem; }
    .boat-grid { grid-template-columns: 1fr; }
    .revenue-split { grid-template-columns: 1fr; }
    .chart-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .training-comparison { grid-template-columns: 1fr; }
    .training-pick-row { grid-template-columns: 1fr; }
    .conversation-detail-layout { grid-template-columns: 1fr; }
    .conversation-sidebar { position: static; }

    /* Tables → horizontal scroll */
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table th, .data-table td { white-space: nowrap; padding: 0.5rem 0.75rem; font-size: 0.8rem; }

    /* Filters → wrap on mobile */
    .filters { flex-wrap: wrap; }
    .analytics-controls { flex-direction: column; align-items: flex-start; }
    .analytics-period-selector { flex-wrap: wrap; }

    /* Calendar mobile — custom toolbar */
    .cal-mobile-toolbar {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        margin-bottom: 1rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.75rem;
    }
    .cal-mobile-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }
    .cal-mob-btn {
        padding: 0.5rem 1rem;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: var(--surface);
        color: var(--text);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .cal-mob-btn:active { background: var(--bg); }
    .cal-mob-arrow { padding: 0.5rem 0.85rem; font-size: 1rem; font-weight: 700; }
    .cal-mob-today { background: var(--primary); color: white; border-color: var(--primary); }
    .cal-mob-today:active { background: #0b5ed7; }
    .cal-mobile-title {
        text-align: center;
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text);
    }
    .cal-mobile-views {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
    }
    .cal-mob-view { padding: 0.4rem 1.25rem; }
    .cal-mob-view.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    /* Hide FullCalendar's own toolbar on mobile */
    .fc .fc-header-toolbar { display: none !important; }

    /* Calendar list view mobile */
    .fc .fc-list { border: none; }
    .fc .fc-list-event td { padding: 0.6rem 0.75rem; font-size: 0.85rem; }
    .fc .fc-list-day-cushion { padding: 0.5rem 0.75rem; font-size: 0.82rem; font-weight: 600; }
    .cal-list-event { font-size: 0.85rem; line-height: 1.4; }
    .cal-list-event .cal-event-boat { font-weight: 700; }
    .cal-list-event .cal-event-customer { color: var(--text); }
    .cal-list-event .cal-event-pax { color: var(--muted); font-size: 0.8rem; }

    /* Calendar month on mobile */
    .fc .fc-daygrid-day { min-height: 50px; }
    .cal-event-time { font-size: 0.6rem; }
    .cal-event-detail { font-size: 0.65rem; }
    .calendar-legend { font-size: 0.7rem; gap: 0.5rem; }

    /* Chat */
    .chat-container { height: calc(100vh - 170px); }
    .chat-msg { max-width: 95%; }

    /* Cards + sections */
    .detail-card { padding: 1rem; }
    .form-section { padding: 1rem; }
    .report-stats { flex-wrap: wrap; gap: 1rem; }
    .sophie-score-breakdown { flex-wrap: wrap; gap: 1rem; }
    .review-card-recs-outcome { flex-direction: column; }

    /* Weekly review nav */
    .review-nav { flex-wrap: wrap; gap: 0.5rem; text-align: center; }
    .review-week-label { width: 100%; order: -1; }

    /* Staff portal mobile */
    .staff-topbar-inner { flex-direction: column; height: auto; padding: 0.5rem 0; gap: 0.25rem; }
    .staff-nav-links { gap: 0.1rem; }
    .staff-nav-link { font-size: 0.78rem; padding: 0.35rem 0.5rem; }

    /* Shift cards mobile */
    .shift-card { flex-direction: column; align-items: flex-start; gap: 0.25rem; }

    /* Roster mobile */
    .roster-week-nav { flex-wrap: wrap; gap: 0.5rem; text-align: center; }
    .roster-week-title { width: 100%; order: -1; }

    /* Availability grid mobile */
    .avail-hour { min-width: 32px; height: 28px; }
    .avail-grid th { font-size: 0.6rem; }
    .avail-date-cell { font-size: 0.75rem; }
}

/* Invoice status badges */
.status-draft { background: #f3f4f6; color: #6b7280; }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-tc_signed { background: #e0e7ff; color: #3730a3; }
.status-deposit_paid { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #f3f4f6; color: #6b7280; }

/* Invoice line items table */
.line-items-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.line-items-table th { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 0.5rem 0.75rem; border-bottom: 2px solid var(--border); text-align: left; }
.line-items-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.line-items-table .line-total-row td { border-top: 2px solid var(--border); font-weight: 600; }
.line-items-table input { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; font-family: inherit; }
.line-items-table input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15); }

/* Invoice event log */
.event-log { display: flex; flex-direction: column; gap: 0.35rem; }
.event-log-item { font-size: 0.82rem; color: var(--muted); padding: 0.25rem 0; }
.event-log-item strong { color: var(--text); font-weight: 600; }

/* Quick-add buttons (invoice form) */
.quick-add-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.quick-add-btn { padding: 0.3rem 0.65rem; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 0.78rem; cursor: pointer; transition: all 0.15s; }
.quick-add-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; }

/* Invoice summary totals */
.invoice-totals { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; font-size: 0.9rem; }
.invoice-totals .total-row { display: flex; gap: 1.5rem; }
.invoice-totals .total-label { color: var(--muted); min-width: 120px; text-align: right; }
.invoice-totals .total-value { font-weight: 600; min-width: 100px; text-align: right; }
.invoice-totals .total-row.grand-total { font-size: 1.1rem; border-top: 2px solid var(--border); padding-top: 0.5rem; margin-top: 0.25rem; }

/* Timeline (contacts) */
.timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-item {
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
}
.timeline-item-enquiry { border-left-color: var(--primary); }
.timeline-item-booking { border-left-color: var(--success); }
.timeline-item-bookeo  { border-left-color: #8b5cf6; }
.timeline-item-quote   { border-left-color: var(--warning); }
.timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.timeline-badge {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    padding: 0.15rem 0.5rem; border-radius: 3px;
}
.timeline-badge-enquiry { background: #dbeafe; color: #1e40af; }
.timeline-badge-booking { background: #d1fae5; color: #065f46; }
.timeline-badge-bookeo  { background: #ede9fe; color: #5b21b6; }
.timeline-badge-quote   { background: #fef3c7; color: #92400e; }
.timeline-item-invoice { border-left-color: #1e40af; }
.timeline-badge-invoice { background: #dbeafe; color: #1e40af; }
.timeline-body { font-size: 0.9rem; }
.timeline-body a { color: var(--primary); text-decoration: none; }
.timeline-body a:hover { text-decoration: underline; }

/* Contact tags */
.contact-tag {
    display: inline-block; font-size: 0.7rem; font-weight: 500;
    padding: 0.15rem 0.5rem; border-radius: 3px;
    background: #e0e7ff; color: #3730a3;
}

/* Finance Dashboard */
.finance-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.finance-tab {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
}
.finance-tab:hover { border-color: var(--primary); color: var(--primary); }
.finance-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.finance-filters {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.finance-filter-btn {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.finance-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.finance-filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Stat card danger variant */
.stat-card-danger { border-color: var(--danger); background: #fef2f2; }
.stat-card-danger .stat-value { color: var(--danger); }

/* Reconciliation */
.recon-row-overdue { background: #fef2f2; }
.recon-form-row td { padding: 0 !important; }
.recon-inline-form { padding: 0.75rem 1rem; background: var(--bg); }
.recon-form-fields {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.recon-form-fields .form-group { margin-bottom: 0; min-width: 100px; flex: 1; }
.recon-form-fields .form-group label { font-size: 0.75rem; }
.recon-form-fields .form-group input,
.recon-form-fields .form-group select { padding: 0.35rem 0.5rem; font-size: 0.82rem; }

/* Aging brackets */
.aging-bracket { margin-bottom: 0.75rem; }
.aging-bracket summary { font-weight: 600; font-size: 0.9rem; }
.aging-card-green { border-color: var(--success); }
.aging-card-green .stat-value { color: var(--success); }
.aging-card-yellow { border-color: #f59e0b; background: #fffbeb; }
.aging-card-yellow .stat-value { color: #b45309; }
.aging-card-orange { border-color: #f97316; background: #fff7ed; }
.aging-card-orange .stat-value { color: #c2410c; }
.aging-card-red { border-color: var(--danger); background: #fef2f2; }
.aging-card-red .stat-value { color: var(--danger); }
.aging-card-darkred { border-color: #991b1b; background: #fef2f2; }
.aging-card-darkred .stat-value { color: #991b1b; }

/* ===========================================================================
   Boat Club Portal
   =========================================================================== */

/* Club body — same as staff: block layout, no sidebar */
.club-body { display: block; background: var(--bg); }
.club-login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* Login card */
.club-login-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
}
.club-login-card h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.25rem; color: var(--text); }
.club-login-subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.club-login-card .form-group { text-align: left; margin-bottom: 1rem; }
.club-login-card input { width: 100%; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; }
.club-login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15); }
.club-login-help { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }

.btn-club-primary {
    display: inline-block; padding: 0.65rem 1.5rem;
    background: var(--primary); color: white; border: none;
    border-radius: var(--radius); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.btn-club-primary:hover { background: #0b5ed7; }

/* Club topbar */
.club-topbar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 100;
}
.club-topbar-inner {
    max-width: 960px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between; height: 52px;
}
.club-brand {
    font-size: 1.1rem; font-weight: 700;
    color: var(--sidebar-text); text-decoration: none;
}
.club-nav-links { display: flex; gap: 0.25rem; }
.club-nav-link {
    color: var(--sidebar-text); text-decoration: none;
    font-size: 0.85rem; padding: 0.4rem 0.75rem;
    border-radius: var(--radius); transition: background 0.15s;
}
.club-nav-link:hover { background: rgba(255,255,255,0.1); }
.club-nav-link.active { background: rgba(255,255,255,0.15); font-weight: 600; }
.club-nav-logout { opacity: 0.6; }
.club-nav-logout:hover { opacity: 1; }

/* Club content area */
.club-content { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

/* Flash messages */
.club-flash {
    padding: 0.75rem 1rem; border-radius: var(--radius);
    margin-bottom: 1rem; font-size: 0.9rem;
}
.club-flash-success { background: #d1fae5; color: #065f46; }
.club-flash-error { background: #fee2e2; color: #991b1b; }
.club-flash-info { background: #dbeafe; color: #1e40af; }

/* Dashboard grid */
.club-dashboard-grid { display: flex; flex-direction: column; gap: 1.5rem; }

/* Quota card */
.club-quota-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.club-quota-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.club-quota-bar-wrapper { display: flex; flex-direction: column; gap: 0.35rem; }
.club-quota-bar {
    height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden;
}
.club-quota-fill {
    height: 100%; background: var(--primary); border-radius: 5px;
    transition: width 0.3s ease;
}
.club-quota-text { font-size: 0.82rem; color: var(--muted); }

/* Calendar card */
.club-calendar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.club-cal-nav {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 1rem;
}
.club-cal-nav h3 { font-size: 1.05rem; font-weight: 700; }

/* Calendar table */
.club-cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.club-cal-table th {
    padding: 0.5rem 0.25rem; text-align: center;
    font-size: 0.75rem; font-weight: 600; color: var(--muted);
    text-transform: uppercase;
}
.club-cal-cell {
    padding: 0.35rem; text-align: center; vertical-align: top;
    border: 1px solid var(--border); min-height: 52px; height: 52px;
    position: relative;
}
.club-cal-cell:hover:not(.club-cal-empty):not(.club-cal-past) {
    background: #f8f9fa;
}
.club-cal-day { font-size: 0.88rem; font-weight: 500; display: block; }
.club-cal-label {
    font-size: 0.65rem; font-weight: 600; display: block;
    margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em;
}

/* Calendar cell colors */
.club-cal-empty { background: transparent; border-color: transparent; }
.club-cal-past { background: #f9fafb; color: #9ca3af; }
.club-cal-past .club-cal-day { color: #9ca3af; }
.club-cal-available { background: #fff; cursor: pointer; }
.club-cal-available:hover { background: #f0fdf4 !important; border-color: var(--success); }
.club-cal-mine { background: #d1fae5; border-color: #86efac; }
.club-cal-mine .club-cal-label { color: #065f46; }
.club-cal-unavailable { background: #f3f4f6; border-color: #d1d5db; }
.club-cal-unavailable .club-cal-label { color: #6b7280; }
.club-cal-self-collect { background: #fef3c7; border-color: #fbbf24; cursor: pointer; }
.club-cal-self-collect:hover { background: #fde68a !important; border-color: #f59e0b; }
.club-cal-self-collect .club-cal-label { color: #92400e; }
.club-cal-today { outline: 2px solid var(--primary); outline-offset: -1px; }

/* Calendar legend */
.club-cal-legend {
    display: flex; gap: 1rem; flex-wrap: wrap;
    margin-top: 1rem; font-size: 0.78rem; color: var(--muted);
    align-items: center;
}

/* Upcoming bookings list */
.club-upcoming-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.club-upcoming-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.club-upcoming-list { display: flex; flex-direction: column; gap: 0.5rem; }
.club-upcoming-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.75rem; background: var(--bg); border-radius: var(--radius);
}

/* Modal */
.club-modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.club-modal-content {
    background: var(--surface); border-radius: 12px;
    padding: 1.5rem 2rem; max-width: 400px; width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.club-modal-content h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }

/* Club status badges */
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-completed { background: #f3f4f6; color: #6b7280; }
.status-open { background: #dbeafe; color: #1e40af; }
.status-drawn { background: #ede9fe; color: #5b21b6; }
.status-paused { background: #fef3c7; color: #92400e; }

/* Lost deal category badges */
.badge-loss-price { background: #fee2e2; color: #991b1b; }
.badge-loss-timing { background: #fef3c7; color: #92400e; }
.badge-loss-no_response { background: #f3f4f6; color: #6b7280; }
.badge-loss-competitor { background: #ede9fe; color: #5b21b6; }
.badge-loss-wrong_fit { background: #dbeafe; color: #1e40af; }
.badge-loss-availability { background: #fed7aa; color: #9a3412; }
.badge-loss-other { background: #e5e7eb; color: #374151; }

/* Mobile — club portal */
@media (max-width: 768px) {
    .club-topbar-inner { flex-direction: column; height: auto; padding: 0.5rem 0; gap: 0.25rem; }
    .club-nav-links { gap: 0.1rem; }
    .club-nav-link { font-size: 0.78rem; padding: 0.35rem 0.5rem; }
    .club-content { padding: 1rem; }
    .club-cal-cell { min-height: 40px; height: 40px; padding: 0.2rem; }
    .club-cal-day { font-size: 0.75rem; }
    .club-cal-label { font-size: 0.55rem; }
    .club-cal-table th { font-size: 0.65rem; }
    .club-cal-legend { font-size: 0.7rem; gap: 0.5rem; }
    .club-login-card { margin: 1rem; padding: 1.5rem 1.25rem; }
}

/* Monitoring — Alert Banner */
.alert-banner {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.alert-banner a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert-banner-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Monitoring nav badge */
.badge-monitoring-nav { background: var(--danger); color: white; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 10px; margin-left: 0.25rem; }

/* Monitoring — Status Cards */
.monitoring-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 0.5rem;
}
.dot-green { background: var(--success); box-shadow: 0 0 6px rgba(25, 135, 84, 0.4); }
.dot-red { background: var(--danger); box-shadow: 0 0 6px rgba(220, 53, 69, 0.4); animation: pulse-red 2s infinite; }
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 6px rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 12px rgba(220, 53, 69, 0.7); }
}
.monitoring-healthy { border-color: var(--success); background: #f0fdf4; }
.monitoring-failing { border-color: var(--danger); background: #fef2f2; }

/* ── Question Bank ── */
.qb-progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.qb-progress-fill { height: 100%; background: var(--success); border-radius: 4px; transition: width 0.3s; min-width: 2px; }

.qb-category-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.qb-pill {
    display: inline-block; padding: 0.35rem 0.8rem; border-radius: 20px;
    font-size: 0.78rem; text-decoration: none; color: var(--muted);
    background: var(--surface); border: 1px solid var(--border); transition: all 0.15s;
}
.qb-pill:hover { border-color: var(--primary); color: var(--primary); }
.qb-pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Add section */
.qb-add-section {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.qb-add-tabs {
    display: flex; border-bottom: 1px solid var(--border); background: #f8f9fa;
}
.qb-add-tab {
    padding: 0.5rem 1.25rem; border: none; background: none; font-size: 0.85rem;
    cursor: pointer; color: var(--muted); font-weight: 500; transition: all 0.15s;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.qb-add-tab:hover { color: var(--text); }
.qb-add-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }
.qb-add-panel { padding: 1rem; }
.qb-add-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.4rem; }

/* Question cards */
.qb-card {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border);
    border-radius: var(--radius); padding: 0.85rem 1rem; margin-bottom: 0.5rem; transition: all 0.2s;
}
.qb-card:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.qb-card.trained { border-left-color: var(--success); background: #f7fdf9; }
.qb-card-main { display: flex; align-items: center; gap: 0.75rem; }

.qb-trained-toggle {
    background: none; border: none; cursor: pointer; padding: 0.15rem;
    font-size: 1.3rem; line-height: 1; flex-shrink: 0;
}
.qb-trained-toggle:hover { transform: scale(1.15); }
.qb-tick.trained { color: var(--success); font-weight: bold; }
.qb-tick.untrained { color: #ccc; }

.qb-card-content { flex: 1; min-width: 0; }
.qb-question-text { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.25rem; line-height: 1.35; }
.qb-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.75rem; color: var(--muted); }

.qb-category-badge {
    display: inline-block; padding: 0.12rem 0.5rem; border-radius: 10px;
    background: #eef2ff; color: #4338ca; font-size: 0.7rem; font-weight: 500;
}
.qb-frequency { color: #9ca3af; }
.qb-source-badge { padding: 0.1rem 0.4rem; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: 0.68rem; }
.qb-last-tested { font-size: 0.7rem; color: #9ca3af; }

.qb-test-btn { padding: 0.35rem 0.85rem !important; font-size: 0.78rem !important; white-space: nowrap; flex-shrink: 0; }

.qb-test-panel {
    margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border);
}
.qb-thinking { padding: 1rem; color: var(--muted); font-size: 0.85rem; font-style: italic; }

/* Conversation messages */
.qb-conversation { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.85rem; }
.qb-msg { max-width: 85%; }
.qb-msg-customer { align-self: flex-end; }
.qb-msg-sophie { align-self: flex-start; }
.qb-msg-label { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.15rem; font-weight: 600; }
.qb-msg-customer .qb-msg-label { text-align: right; }
.qb-msg-customer .qb-msg-text {
    background: var(--primary); color: white; border-radius: var(--radius) var(--radius) 4px var(--radius);
    padding: 0.55rem 0.8rem; font-size: 0.88rem; line-height: 1.45;
}
.qb-msg-sophie .qb-msg-text {
    background: #f8faff; border: 1px solid #e2e8f0; border-radius: var(--radius) var(--radius) var(--radius) 4px;
    padding: 0.55rem 0.8rem; font-size: 0.88rem; line-height: 1.45;
}
.qb-msg-sophie .qb-msg-text p { margin-bottom: 0.35rem; }
.qb-msg-sophie .qb-msg-text p:last-child { margin-bottom: 0; }
.qb-reply-form { margin-bottom: 0.75rem; }

/* Discussion with Claude */
.qb-discuss-section { margin-bottom: 0.5rem; }
.qb-discussion-thread {
    background: #faf8f5; border: 1px solid #e8e0d4; border-radius: var(--radius);
    padding: 0.75rem; margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.qb-disc-msg { max-width: 90%; }
.qb-disc-user { align-self: flex-end; }
.qb-disc-assistant { align-self: flex-start; }
.qb-disc-label { font-size: 0.66rem; color: var(--muted); margin-bottom: 0.1rem; font-weight: 600; }
.qb-disc-user .qb-disc-label { text-align: right; }
.qb-disc-user .qb-disc-text {
    background: #1a1a2e; color: #e2e8f0; border-radius: var(--radius) var(--radius) 4px var(--radius);
    padding: 0.5rem 0.75rem; font-size: 0.83rem; line-height: 1.4;
}
.qb-disc-assistant .qb-disc-text {
    background: #fff; border: 1px solid #e8e0d4; border-radius: var(--radius) var(--radius) var(--radius) 4px;
    padding: 0.5rem 0.75rem; font-size: 0.83rem; line-height: 1.4;
}
.qb-discuss-btn { background: #6c5ce7 !important; }
.qb-discuss-btn:hover { background: #5a4bd1 !important; }

.qb-apply-btn { background: var(--success) !important; padding: 0.4rem 1.25rem !important; font-size: 0.82rem !important; }
.qb-apply-btn:hover { background: #157347 !important; }
.qb-apply-form {
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius);
    padding: 1rem; margin-top: 0.5rem;
}
.qb-apply-header {
    font-size: 0.9rem; font-weight: 700; color: var(--success); margin-bottom: 0.35rem;
}
.qb-apply-success {
    background: #d1fae5; border: 1px solid #6ee7b7; border-radius: var(--radius);
    padding: 0.75rem 1rem; font-size: 0.85rem; color: #065f46;
}
.qb-apply-success a { color: #047857; font-weight: 600; }

.qb-trained-btn {
    background: var(--success) !important; padding: 0.45rem 1.25rem !important;
    font-size: 0.85rem !important; font-weight: 600;
}
.qb-trained-btn:hover { background: #157347 !important; }
.qb-last-feedback {
    margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border);
    font-size: 0.78rem; color: var(--muted);
}

/* Find similar questions */
.qb-find-similar-area {
    margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--border);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
}
.qb-find-similar-btn {
    background: #6c5ce7 !important; padding: 0.4rem 1rem !important;
    font-size: 0.8rem !important; white-space: nowrap;
}
.qb-find-similar-btn:hover { background: #5a4bd1 !important; }

.qb-similar-panel {
    background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: var(--radius);
    padding: 1rem; margin-top: 0.5rem;
}
.qb-similar-header {
    font-size: 0.9rem; font-weight: 700; color: #6c5ce7; margin-bottom: 0.35rem;
}
.qb-similar-list {
    display: flex; flex-direction: column; gap: 0.35rem;
    max-height: 400px; overflow-y: auto; padding-right: 0.5rem;
}
.qb-similar-item {
    display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.45rem 0.6rem;
    background: white; border: 1px solid #e9e5f5; border-radius: var(--radius);
    cursor: pointer; font-size: 0.84rem; line-height: 1.35; transition: background 0.1s;
}
.qb-similar-item:hover { background: #faf8ff; }
.qb-similar-item input[type="checkbox"] { margin-top: 0.15rem; flex-shrink: 0; }
.qb-similar-question { flex: 1; }
.qb-similar-freq { font-size: 0.72rem; color: var(--muted); white-space: nowrap; margin-top: 0.1rem; }
.qb-similar-select-all {
    background: #ede9fe !important; border-color: #c4b5fd !important; font-size: 0.82rem;
}
.qb-similar-success {
    background: #d1fae5; border: 1px solid #6ee7b7; border-radius: var(--radius);
    padding: 0.75rem 1rem; font-size: 0.88rem; color: #065f46; font-weight: 500;
}

@media (max-width: 768px) {
    .qb-card-main { flex-direction: column; align-items: flex-start; }
    .qb-test-controls { align-self: flex-start; }
}

/* ============================================================
   Ask Sophie — Natural Language Analytics
   ============================================================ */

.ask-chips {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem;
}
.ask-chip {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
    padding: 0.4rem 0.9rem; font-size: 0.82rem; cursor: pointer;
    color: var(--text); transition: all 0.15s; white-space: nowrap;
}
.ask-chip:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.ask-table-wrap {
    overflow-x: auto; margin-top: 0.75rem; border-radius: var(--radius);
    border: 1px solid var(--border);
}
.ask-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.ask-table th {
    background: var(--bg); font-weight: 600; text-align: left;
    padding: 0.5rem 0.65rem; border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.ask-table td {
    padding: 0.4rem 0.65rem; border-bottom: 1px solid var(--border);
}
.ask-table tbody tr:hover { background: #f0f4ff; }
.ask-table tbody tr:last-child td { border-bottom: none; }

.ask-sql-toggle {
    margin-top: 0.6rem; font-size: 0.78rem;
}
.ask-sql-toggle summary {
    cursor: pointer; color: var(--muted); user-select: none;
}
.ask-sql-toggle summary:hover { color: var(--primary); }
.ask-sql-explanation {
    color: var(--muted); font-style: italic; margin: 0.35rem 0 0.25rem;
    font-size: 0.78rem;
}
.ask-sql-code {
    background: #1a1a2e; color: #e2e8f0; padding: 0.75rem 1rem;
    border-radius: var(--radius); overflow-x: auto; font-size: 0.78rem;
    line-height: 1.5; margin-top: 0.25rem;
}

/* ============================================================
   Date Range Picker
   ============================================================ */

/* Date range picker */
.date-range-picker { display: flex; align-items: center; gap: 0.5rem; }
.date-range-picker input[type="date"] {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.75rem;
    background: var(--surface);
    font-family: inherit;
}
.date-range-picker span { font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   Funnel Visualisation
   ============================================================ */

/* Funnel visualisation */
.funnel-visual { max-width: 600px; margin: 0 auto 2rem; }
.funnel-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    margin: 0 auto;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    border-radius: 4px;
}
.funnel-stage-name { font-weight: 700; }
.funnel-stage-count { margin-left: 0.5rem; font-weight: 400; opacity: 0.9; }
.funnel-stage-pct { margin-left: 0.5rem; font-size: 0.8rem; opacity: 0.8; }
.funnel-dropoff {
    text-align: center;
    padding: 0.3rem 0;
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 500;
}
.funnel-dropoff .arrow { color: var(--muted); }

/* Funnel analyse card */
.funnel-analyse-card {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}
.funnel-analyse-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--primary); }

.btn-analyse {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}
.btn-analyse:hover { background: #0b5ed7; }
.btn-analyse:disabled { opacity: 0.6; cursor: wait; }

/* Timing cards */
.timing-cards { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.timing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    flex: 1;
    min-width: 150px;
}
.timing-card .timing-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.timing-card .timing-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

/* ============================================================
   Weather Badges
   ============================================================ */

/* Weather badges */
/* Pre-enquiry funnel stages */
.funnel-stage-pre { opacity: 0.85; }

/* ============================================================
   Mystery Shopper
   ============================================================ */

.competitor-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.competitor-row input { flex: 1; }

.mystery-badge-draft { background: #e2e8f0; color: #475569; }
.mystery-badge-active { background: #dbeafe; color: #1e40af; }
.mystery-badge-completed { background: #dcfce7; color: #166534; }
.mystery-badge-cancelled { background: #fee2e2; color: #991b1b; }

.mystery-badge-pending { background: #f1f5f9; color: #64748b; }
.mystery-badge-contacted { background: #dbeafe; color: #1e40af; }
.mystery-badge-responding { background: #fef3c7; color: #92400e; }
.mystery-badge-no_response { background: #fee2e2; color: #991b1b; }

.mystery-messages { margin-top: 1rem; }
.mystery-msg {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.mystery-msg-outbound { background: #dbeafe; margin-right: 15%; }
.mystery-msg-inbound { background: #f1f5f9; margin-left: 15%; }
.mystery-msg-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; }

.score-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    background: var(--primary);
    vertical-align: middle;
}

.weather-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}
.weather-clear { background: #fef3c7; color: #92400e; }
.weather-cloudy { background: #e0e7ff; color: #3730a3; }
.weather-rain { background: #dbeafe; color: #1e40af; }
.weather-heavy-rain { background: #fee2e2; color: #991b1b; }
.weather-icon { font-size: 1.2rem; margin-right: 0.25rem; }

/* Bookings Pipeline — mini dots for list view */
.pipeline-mini { display: flex; gap: 3px; align-items: center; }
.pipeline-mini .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #dee2e6; flex-shrink: 0;
}
.pipeline-mini .dot.done { background: var(--success); }
.pipeline-mini .dot.active { background: var(--primary); box-shadow: 0 0 0 2px rgba(13,110,253,0.25); }

/* Bookings Pipeline — horizontal timeline for detail view */
.pipeline-timeline {
    display: flex; align-items: center; gap: 0;
    padding: 1.5rem 0; overflow-x: auto;
}
.pipeline-stage {
    display: flex; flex-direction: column; align-items: center;
    min-width: 80px; position: relative; flex-shrink: 0;
}
.pipeline-stage .dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: #dee2e6; border: 2px solid #dee2e6;
    z-index: 1;
}
.pipeline-stage.done .dot { background: var(--success); border-color: var(--success); }
.pipeline-stage.active .dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.2); }
.pipeline-stage .label {
    font-size: 0.7rem; color: var(--muted); margin-top: 0.5rem;
    text-align: center; line-height: 1.2; max-width: 90px;
}
.pipeline-stage.done .label { color: var(--success); font-weight: 600; }
.pipeline-stage.active .label { color: var(--primary); font-weight: 600; }
.pipeline-stage .date {
    font-size: 0.6rem; color: var(--muted); margin-top: 0.15rem;
}
.pipeline-connector {
    flex: 1; height: 2px; background: #dee2e6;
    min-width: 20px; align-self: flex-start; margin-top: 8px;
}
.pipeline-connector.done { background: var(--success); }

/* Attribution badges */
.badge-email { background: #dbeafe; color: #1e40af; }
.badge-widget { background: #ede9fe; color: #5b21b6; }
.badge-website { background: #d1fae5; color: #065f46; }
.badge-phone { background: #fef3c7; color: #92400e; }
.badge-referral { background: #fce7f3; color: #9d174d; }

/* Completed booking status */
.status-completed { background: #d1fae5; color: #065f46; }

/* Booking detail layout */
.booking-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
.booking-main { min-width: 0; }
.booking-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.booking-sidebar .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.booking-sidebar .card h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.75rem; }
.booking-sidebar .detail-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.3rem 0; }
.booking-sidebar .detail-label { color: var(--muted); }

/* Email log table */
.email-log { margin-top: 1rem; }
.email-log .log-entry { display: flex; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.email-log .log-type { font-weight: 600; min-width: 140px; }
.email-log .log-date { color: var(--muted); min-width: 100px; }

/* Manual send buttons */
.btn-send { background: var(--primary); color: #fff; border: none; padding: 0.4rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; }
.btn-send:hover { opacity: 0.9; }
.btn-send:disabled { background: var(--muted); cursor: not-allowed; }

@media (max-width: 900px) {
    .booking-layout { grid-template-columns: 1fr; }
    .pipeline-timeline { flex-wrap: wrap; }
}
