/*
 * admin.css — BTIS Premium Design System
 * Teal-to-navy gradients. Frosted glass. Depth. Polish.
 */

/* ── Design tokens ───────────────────────────────── */
:root {
    --panel-radius: 12px;
    --panel-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    --panel-shadow-hover: 0 1px 2px rgba(0,0,0,0.02);
    --btn-radius: 8px;
    --input-radius: 8px;
    --teal: #076e6c;
    --teal-light: #31cdcf;
    --navy: #1d2951;
    --text-primary: #1d2951;
    --text-secondary: #7b868c;
    --text-muted: #b0b8c1;
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --border: #e2e6ea;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
}

/* ── Focus outline reset for Blazor navigation ──── */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus,
[tabindex]:focus {
    outline: none;
}

/* ── Page container ──────────────────────────────── */
.admin-page,
.quote-page {
    width: 100%;
    margin: 0;
    padding: 0;
}

.admin-page h1,
.quote-page h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

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

.header-actions {
    display: flex;
    gap: 10px;
}

/* ── Content panel ───────────────────────────────── */
.content-panel {
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    padding: 28px;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 24px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
    border: none;
    border-radius: var(--btn-radius);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(7, 110, 108, 0.25);
    transition: all 0.2s ease;
    line-height: 1;
    box-sizing: border-box;
}

.btn-primary:hover,
a.btn-primary:hover,
a.btn-primary:visited {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(7, 110, 108, 0.35);
    color: #fff;
    text-decoration: none;
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--navy);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--btn-radius);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
    line-height: 1;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background: #f5f7fa;
    border-color: #d0d5da;
    text-decoration: none;
}

.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Danger variant of btn-secondary — keeps the pill shape, recoloured for destructive actions. */
.btn-secondary.btn-danger {
    color: var(--danger, #c0392b);
    border-color: rgba(192, 57, 43, 0.4);
}
.btn-secondary.btn-danger:hover {
    background: rgba(192, 57, 43, 0.08);
    border-color: var(--danger, #c0392b);
}

/* ── Data tables ─────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    overflow: hidden;
}

.content-panel .data-table {
    box-shadow: none;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.data-table th {
    background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
    color: #fff;
    text-align: left;
    padding: 14px 18px;
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 13px 18px;
    border-bottom: 1px solid #f0f2f5;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #f8f9fb;
}

.inactive-row { opacity: 0.45; }

/* ── Status badges ───────────────────────────────── */
.status-badge,
[class^="status-"] {
    display: inline-block;
    padding: 4px 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.status-pendingapproval { background: #fef3cd; color: #856404; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-accepted { background: #076e6c; color: #ffffff; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-draft { background: #f0f2f5; color: #7b868c; }
.status-expired { background: #f0f2f5; color: #b0b8c1; }

/* ── Search bar ──────────────────────────────────── */
.search-bar {
    margin-bottom: 20px;
}

.search-bar .form-input {
    max-width: 100%;
}

.content-panel .search-bar {
    margin-bottom: 20px;
}

.content-panel .pagination {
    margin-top: 8px;
}

/* ── Forms ────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.config-grid {
    max-width: 600px;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--input-radius);
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: #f8f9fb;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(7, 110, 108, 0.08);
    background: #fff;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ── Action links ────────────────────────────────── */
.action-link {
    background: none;
    border: none;
    color: var(--teal);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-right: 12px;
    transition: color 0.15s ease;
}

.action-link:hover {
    color: var(--navy);
    text-decoration: underline;
}

.action-link.danger { color: var(--danger); }
.action-link.danger:hover { color: #c0392b; }

/* ── Pagination ──────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Alerts ──────────────────────────────────────── */
.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--panel-radius);
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--panel-radius);
}

/* ── Version supersession banner ─────────────────── */
.version-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 12px 18px;
    margin-bottom: 18px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-left: 4px solid #5b21b6;
    border-radius: var(--panel-radius);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: #4c1d95;
}

.version-banner-item a {
    color: #5b21b6;
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
}

.version-banner-item a:hover {
    text-decoration: underline;
}

.version-banner-item--newer {
    color: #1e3a8a;
}

.version-banner-item--newer a {
    color: #1d4ed8;
}

/* ── Inline button styled like an action link ────── */
.action-link--button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.action-link--button:disabled {
    opacity: 0.5;
    cursor: default;
}

.action-meta {
    color: var(--text-secondary);
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-style: italic;
    margin-right: 12px;
}

/* ── Import section ──────────────────────────────── */
.import-section {
    background: #f8f9fb;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: var(--panel-radius);
}

.import-section h3 { margin-bottom: 12px; }
.import-errors { color: var(--danger); font-size: 13px; }

/* ── Panel utility ───────────────────────────────── */
.panel {
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: var(--panel-shadow-hover);
}

/* ── Pricing sections ────────────────────────────── */
/* ─── Quote Detail Page ─── */
.detail-panel {
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.detail-panel-header h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
}

.pricing-breakdown {
    display: flex;
    flex-direction: column;
    max-width: 500px;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
}

.pricing-row--note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 12px;
}

.pricing-row--total {
    border-top: 2px solid var(--teal);
    border-bottom: none;
    font-weight: 700;
    font-size: 15px;
    padding-top: 8px;
    color: var(--navy);
}

.pricing-row--meta {
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: none;
    padding: 3px 0;
}

.row-flagged td {
    background: rgba(243, 156, 18, 0.06);
}

.status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 8px;
}
.status-draft { color: var(--text-secondary); background: #f0f2f5; }
.status-pendingapproval { color: #92400e; background: rgba(243, 156, 18, 0.12); }
.status-approved { color: #166534; background: rgba(39, 174, 96, 0.12); }
.status-accepted { color: #ffffff; background: #076e6c; }
.status-rejected { color: #991b1b; background: rgba(231, 76, 60, 0.10); }
.status-expired { color: var(--text-secondary); background: #f0f2f5; }

.data-table tbody tr.clickable-row { cursor: pointer; transition: background 0.15s; }
.data-table tbody tr.clickable-row:hover { background: #f5f7fa; }

.btn-reject {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 24px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--danger);
    background: transparent;
    border: 1.5px solid var(--danger);
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    box-sizing: border-box;
}
.btn-reject:hover {
    background: rgba(231, 76, 60, 0.08);
}

.btn-table {
    height: 34px;
    padding: 0 16px;
    font-size: 12px;
}

.inline-input {
    width: 70px;
    height: 30px;
    padding: 2px 6px;
    font-size: 12px;
    text-align: center;
}

.review-phase-badge {
    display: inline-block;
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 4px;
}

.pricing-section {
    background: var(--bg-card);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    padding: 22px 28px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.pricing-section:hover {
    box-shadow: var(--panel-shadow-hover);
}

.pricing-section h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    margin: 0 0 8px;
}

/* ── Config info ─────────────────────────────────── */
.config-info {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 16px;
}

/* ── Password reset section ──────────────────────── */
.password-reset-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.password-reset-section h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
}

/* ── Reject modal ────────────────────────────────── */
.reject-modal {
    background: #fef8f0;
    border: 1px solid #fed7aa;
    border-radius: var(--panel-radius);
    padding: 20px 24px;
    margin-top: 20px;
}

.reject-modal h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 12px;
}

.reject-modal textarea {
    resize: vertical;
    min-height: 80px;
    padding: 12px 14px;
}

/* ── Commission / ISB confirmation modal ─────────── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-card {
    background: #fff;
    border-top: 3px solid var(--teal);
    border-radius: var(--panel-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 460px;
    padding: 24px 28px 22px;
}

.confirm-card__title {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 12px;
}

.confirm-card__body {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin: 0 0 22px;
}

.confirm-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── Select inputs ───────────────────────────────── */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b868c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ── Feedback modal ──────────────────────────────── */
.fb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fb-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fbSlideIn 0.2s ease;
}

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

.fb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border, #e2e6ea);
}

.fb-modal-header h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1d2951;
    margin: 0;
}

.fb-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #7b868c;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.fb-modal-close:hover {
    background: #f0f2f5;
    color: #1d2951;
}

.fb-modal form {
    padding: 24px 28px;
}

.fb-field {
    margin-bottom: 18px;
}

.fb-field label {
    display: block;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1d2951;
    margin-bottom: 6px;
}

.fb-field input[type="text"],
.fb-field textarea,
.fb-field select {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    color: #1d2951;
    background: #f8f9fb;
    border: 1.5px solid #e2e6ea;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.fb-field input:focus,
.fb-field textarea:focus,
.fb-field select:focus {
    border-color: #076e6c;
    box-shadow: 0 0 0 3px rgba(7, 110, 108, 0.08);
    background: #fff;
}

.fb-field textarea {
    resize: vertical;
    min-height: 100px;
}

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

.fb-file-input {
    width: 100%;
    padding: 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    border: 1.5px dashed #e2e6ea;
    border-radius: 8px;
    background: #f8f9fb;
    cursor: pointer;
}

.fb-file-hint {
    display: block;
    font-size: 11px;
    color: #7b868c;
    margin-top: 6px;
}

.fb-page-info {
    font-size: 12px;
    color: #7b868c;
    background: #f8f9fb;
    padding: 10px 14px;
    border-radius: 8px;
}

.fb-page-info span {
    word-break: break-all;
}

.fb-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* ── Feedback header button ──────────────────────── */
.header-feedback-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-feedback-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

/* ── Feedback badges ─────────────────────────────── */
.fb-badge {
    display: inline-block;
    padding: 3px 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.fb-cat-bug { background: #fee2e2; color: #991b1b; }
.fb-cat-featurerequest { background: #dbeafe; color: #1e40af; }
.fb-cat-improvement { background: #d1fae5; color: #065f46; }
.fb-cat-question { background: #e0e7ff; color: #3730a3; }
.fb-cat-other { background: #f0f2f5; color: #7b868c; }

.fb-sev-low { background: #d1fae5; color: #065f46; }
.fb-sev-medium { background: #fef3cd; color: #856404; }
.fb-sev-high { background: #fed7aa; color: #9a3412; }
.fb-sev-critical { background: #fee2e2; color: #991b1b; }

.fb-stat-open { background: #dbeafe; color: #1e40af; }
.fb-stat-underreview { background: #fef3cd; color: #856404; }
.fb-stat-inprogress { background: #d1fae5; color: #065f46; }
.fb-stat-resolved { background: #d1fae5; color: #065f46; }
.fb-stat-closed { background: #f0f2f5; color: #7b868c; }
.fb-stat-wontfix { background: #f0f2f5; color: #7b868c; }
.fb-stat-retestrequired { background: #ede9fe; color: #5b21b6; }
.fb-stat-moredetailsrequired { background: #fff3cd; color: #856404; }

/* ── Feedback detail layout ──────────────────────── */
.fb-detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.fb-detail-main,
.fb-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fb-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    padding: 24px;
}

.fb-card h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1d2951;
    margin: 0 0 16px;
}

.fb-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
}

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

.fb-detail-label {
    color: #7b868c;
    font-weight: 600;
}

.fb-detail-value {
    color: #1d2951;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.fb-response {
    padding: 16px;
    background: #f8f9fb;
    border-radius: 10px;
    margin-bottom: 12px;
}

.fb-response-internal {
    background: #fef3cd;
    border: 1px solid #fde68a;
}

.fb-response-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.fb-response-author {
    font-weight: 700;
    color: #1d2951;
}

.fb-response-date {
    color: #7b868c;
}

.fb-response-body {
    font-size: 13px;
    color: #1d2951;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fb-quick-actions .btn-primary,
.fb-quick-actions .btn-secondary {
    width: 100%;
    justify-content: center;
}

@media (max-width: 900px) {
    .fb-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════
   Phase 5/6 — Step 2 Asset Import (tabs, dropzone, preview)
════════════════════════════════════════════════════════════════ */

/* ── Input mode tabs ─────────────────────────────────────────── */
.asset-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-neutral-300, #d7d6d6);
    margin-bottom: 24px;
    gap: 0;
}
.asset-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 22px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-neutral-600, #747474);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.asset-tab:hover { color: var(--color-brand-teal, #076e6c); }
.asset-tab.active {
    color: var(--color-brand-teal, #076e6c);
    border-bottom-color: var(--color-brand-teal, #076e6c);
}

/* ── Dropzone ────────────────────────────────────────────────── */
.import-dropzone {
    border: 2px dashed var(--color-neutral-400, #d2d2d2);
    padding: 48px 32px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 24px;
    background: var(--color-neutral-50, #f6f6f6);
}
.import-dropzone.drag-over {
    border-color: var(--color-brand-teal, #076e6c);
    background: var(--color-brand-teal-10, rgba(7,110,108,0.06));
}
.dropzone-icon {
    width: 48px; height: 48px;
    color: var(--color-neutral-500, #aaa9a9);
    margin-bottom: 12px;
}
.dropzone-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-neutral-700, #333);
    margin-bottom: 6px;
}
.dropzone-sub {
    font-size: 13px;
    color: var(--color-neutral-600, #747474);
    margin-bottom: 12px;
}
.dropzone-browse {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
}
.dropzone-hint {
    font-size: 12px;
    color: var(--color-neutral-500, #aaa9a9);
    margin-top: 8px;
}
.import-error-msg {
    margin-top: 12px;
    color: var(--color-error, #c0392b);
    font-size: 13px;
    font-weight: 600;
}

/* ── Processing spinner ──────────────────────────────────────── */
.import-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 32px;
    gap: 16px;
}
.import-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--color-neutral-300, #d7d6d6);
    border-top-color: var(--color-brand-teal, #076e6c);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-spinner-label {
    font-size: 14px;
    color: var(--color-neutral-600, #747474);
    font-style: italic;
}

.import-sheet-note {
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    color: var(--color-neutral-600, #747474);
    margin: 0 0 12px;
}

/* ── Summary card ────────────────────────────────────────────── */
.import-summary-card {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-neutral-300, #d7d6d6);
    margin-bottom: 24px;
    overflow: hidden;
}
.import-summary-stat {
    flex: 1;
    padding: 20px 24px;
    text-align: center;
    border-right: 1px solid var(--color-neutral-300, #d7d6d6);
}
.import-summary-stat:last-child { border-right: none; }
.import-summary-stat .stat-value {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-neutral-800, #2b2b2b);
}
.import-summary-stat .stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-neutral-600, #747474);
    text-transform: uppercase;
    margin-top: 4px;
}
.import-summary-stat.matched .stat-value { color: var(--color-brand-teal, #076e6c); }
.import-summary-stat.unmatched .stat-value { color: var(--color-warning, #e67e22); }
.import-summary-stat.error .stat-value { color: var(--color-error, #c0392b); }

/* ── Preview table ───────────────────────────────────────────── */
.import-preview-wrap { margin-bottom: 24px; }
.import-preview-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-neutral-600, #747474);
    margin-bottom: 10px;
}
.import-preview-table-scroll {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--color-neutral-300, #d7d6d6);
}
.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.import-preview-table thead {
    position: sticky;
    top: 0;
    background: var(--color-brand-navy, #1d2951);
    color: #fff;
}
.import-preview-table th {
    padding: 9px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.import-preview-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--color-neutral-200, #ebeaea);
}
.import-preview-table tbody tr:hover { background: var(--color-neutral-50, #f6f6f6); }
.import-preview-table .row-matched { background: rgba(7,110,108,0.04); }
.import-preview-table .row-partial { background: rgba(230,126,34,0.04); }
.import-preview-table .row-unmatched { background: rgba(192,57,43,0.04); }
.import-preview-table .row-error { background: rgba(192,57,43,0.06); color: #aaa; }
.import-preview-table .row-num { color: var(--color-neutral-500, #aaa9a9); font-size: 11px; width: 40px; }
.import-preview-table .row-qty { width: 40px; text-align: center; }
.import-preview-table .row-raw { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-preview-table .row-match { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Warning banner (Phase 6 PDF import) ─────────────────────── */
.import-warning-banner {
    background: rgba(230,126,34,0.10);
    border-left: 4px solid var(--color-warning, #e67e22);
    padding: 12px 16px;
    font-size: 13px;
    color: #7d4e00;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.import-warning-banner svg { flex-shrink: 0; margin-top: 1px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.badge-success { background: rgba(7,110,108,0.12); color: var(--color-brand-teal, #076e6c); }
.badge-warning  { background: rgba(230,126,34,0.12); color: #a85000; }
.badge-error    { background: rgba(192,57,43,0.12); color: var(--color-error, #c0392b); }

/* ── Step 2 Asset Redesign ───────────────────────────────── */
.site-picker-wrap { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.site-picker-label { font-size: 0.85rem; color: var(--color-text-muted, #888); white-space: nowrap; }
.site-picker-select { width: auto; min-width: 140px; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.asset-search-wrap { margin-bottom: 1.5rem; }
.asset-search-input-wrap { position: relative; display: flex; gap: 0; align-items: stretch; }
.asset-search-input { flex: 1; }
.asset-search-input-wrap .asset-search-input { border-radius: var(--input-radius) 0 0 var(--input-radius); }
.asset-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: white; border: 1px solid var(--color-neutral-300, #ddd); box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 300px; overflow-y: auto; }
.asset-dropdown-item { padding: 0.6rem 1rem; cursor: pointer; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--color-neutral-200, #f0f0f0); }
.asset-dropdown-item:last-child { border-bottom: none; }
.asset-dropdown-item:hover, .asset-dropdown-item.highlighted { background: var(--color-surface-hover, #f0f4f8); }
.asset-dropdown-name { font-weight: 600; font-size: 0.9rem; }
.asset-dropdown-meta { font-size: 0.75rem; color: var(--color-text-muted, #888); }
.asset-manual-wrap { margin-bottom: 1.5rem; }
.asset-manual-label { font-size: 0.85rem; color: var(--color-text-muted, #888); margin-bottom: 0.5rem; }
.asset-manual-row { display: flex; gap: 0.5rem; align-items: center; }
.asset-manual-input { flex: 1; }
.asset-manual-qty { width: 70px; }
.asset-list-wrap { margin-bottom: 1.5rem; }
.asset-list-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
.asset-list { display: flex; flex-direction: column; gap: 0.4rem; }
.asset-list-item { display: flex; align-items: center; gap: 0.75rem; background: var(--color-neutral-50, #f9f9f9); border: 1px solid var(--color-neutral-200, #eee); padding: 0.5rem 0.75rem; }
.asset-list-name { flex: 1; font-size: 0.9rem; }
.asset-list-qty { font-size: 0.85rem; color: var(--color-text-muted, #888); white-space: nowrap; }
.asset-list-site { font-size: 0.75rem; color: var(--color-text-muted, #888); white-space: nowrap; background: var(--color-neutral-200, #eee); padding: 2px 8px; }
.asset-list-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}
.qty-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.qty-btn:first-child { border-radius: var(--btn-radius) 0 0 var(--btn-radius); }
.qty-btn:last-child { border-radius: 0 var(--btn-radius) var(--btn-radius) 0; }
.qty-btn:hover { background: #f5f7fa; border-color: var(--teal); color: var(--teal); }
.qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.asset-list-qty-input {
    width: 44px;
    height: 26px;
    border: none;
    border-top: 1.5px solid var(--border);
    border-bottom: 1.5px solid var(--border);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    background: #f8f9fb;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    padding: 0;
    box-sizing: border-box;
}
.asset-list-qty-input::-webkit-outer-spin-button,
.asset-list-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.asset-list-qty-input:focus {
    background: #fff;
    border-color: var(--teal);
}
.asset-list-remove { background: none; border: none; cursor: pointer; color: #e74c3c; font-size: 0.9rem; padding: 0 0.25rem; line-height: 1; }
.asset-list-remove:hover { color: #c0392b; }
.asset-list-empty { padding: 2rem; text-align: center; color: var(--color-text-muted, #888); font-size: 0.9rem; border: 1px dashed var(--color-neutral-300, #ddd); margin-bottom: 1.5rem; }

/* ─── Browse Dictionary Button ─── */
.browse-dict-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
    border: none;
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(7, 110, 108, 0.18);
}
.browse-dict-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(7, 110, 108, 0.3);
}

/* ─── Plant Dictionary Browser Modal ─── */
.dict-overlay {
    position: fixed;
    inset: 0;
    background: rgba(29, 41, 81, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: dictFadeIn 0.2s ease;
}
@keyframes dictFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dict-modal {
    background: var(--bg-card);
    width: 860px;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--panel-radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: dictSlideIn 0.25s ease;
}
@keyframes dictSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dict-header {
    background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
    color: #fff;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dict-header h2 {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #fff;
}
.dict-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}
.dict-close:hover { background: rgba(255, 255, 255, 0.25); }

.dict-search {
    padding: 16px 24px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--border);
}
.dict-search .form-input {
    width: 100%;
    border-radius: var(--input-radius);
}

.dict-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.dict-body::-webkit-scrollbar { width: 6px; }
.dict-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.dict-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.dict-loading,
.dict-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.dict-indent-loading {
    padding: 8px 48px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Tree inside modal ── */
.dict-tree { font-family: 'Raleway', sans-serif; }

.dict-node {
    border-bottom: 1px solid var(--border);
}
.dict-node:last-child { border-bottom: none; }
.dict-node--minor { border-bottom: none; }

.dict-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}
.dict-row:hover { background: #f5f7fa; }
.dict-row.expanded { background: rgba(7, 110, 108, 0.06); }

.dict-row--major {
    font-weight: 700;
    font-size: 14px;
    color: var(--navy);
}
.dict-row--minor {
    padding-left: 40px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.dict-chevron {
    width: 16px;
    font-size: 9px;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: center;
    transition: color 0.15s;
}
.dict-row:hover .dict-chevron { color: var(--teal); }

.dict-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dict-meta {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 2px 8px;
    background: #f0f2f5;
    border-radius: 4px;
}

.dict-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    white-space: nowrap;
    color: var(--teal);
    background: rgba(7, 110, 108, 0.08);
    border-radius: 4px;
}

/* ── Entry rows (selectable) ── */
.dict-entries { margin-left: 56px; }

.dict-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    border-left: 3px solid transparent;
}
.dict-entry:last-child { border-bottom: none; }
.dict-entry:hover {
    background: rgba(7, 110, 108, 0.06);
    border-left-color: var(--teal);
}

.dict-entry-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 600;
}
.dict-entry:hover .dict-entry-name { color: var(--teal); }

.dict-entry-std {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

/* Select hint on hover */
.dict-entry::after {
    content: 'SELECT';
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--teal);
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px 8px;
    border: 1.5px solid var(--teal);
    border-radius: 4px;
}
.dict-entry:hover::after { opacity: 1; }

/* ─── Step 1: Sites Section ─── */
.sites-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.sites-header h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.sites-empty {
    padding: 28px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    border: 1.5px dashed var(--border);
    border-radius: var(--panel-radius);
    margin-bottom: 16px;
}

.site-card {
    background: #f8f9fb;
    border: 1.5px solid var(--border);
    border-radius: var(--panel-radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.site-card-number {
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.site-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.site-remove:hover { opacity: 1; }

.site-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.site-card-fields .form-group {
    margin-bottom: 0;
}

.site-card-fields label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .site-card-fields { grid-template-columns: 1fr; }
}
