@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f6f8;
    color: #2d3748;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
    background: #1e293b;
    color: #f1f5f9;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }

/* ── Book Switcher ── */
.book-switcher { display: flex; align-items: center; gap: 6px; }

.book-select {
    padding: 5px 10px; border: 1px solid #475569; border-radius: 5px;
    background: #334155; color: #f1f5f9; font-size: 0.82rem;
    font-family: inherit; outline: none; cursor: pointer;
    max-width: 200px;
}
.book-select:focus { border-color: #93c5fd; }

.book-btn {
    background: none; border: 1px solid #475569; border-radius: 4px;
    color: #94a3b8; font-size: 0.82rem; cursor: pointer;
    padding: 4px 8px; line-height: 1; transition: all 0.15s;
}
.book-btn:hover { border-color: #93c5fd; color: #f1f5f9; }

/* ── Tab Bar ── */
.tab-bar {
    display: flex;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:hover { color: #334155; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.tab-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.4;
}

.tab-badge.hidden { display: none; }

/* ── Dashboard ── */
.dashboard {
    display: flex;
    gap: 12px;
    padding: 16px 24px 0;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #475569;
}

.stat-card:hover { border-left-color: #3b82f6; }
.stat-card.total { border-left-color: #475569; }

.stat-number { font-size: 1.5rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.65rem; color: #94a3b8; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ── Filters ── */
.filters {
    display: flex;
    gap: 8px;
    padding: 14px 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input, .filters select {
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    background: white;
    color: #334155;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filters input:focus, .filters select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.filters input { flex: 1; min-width: 220px; }
.filters select { min-width: 145px; }

.result-count { font-size: 0.78rem; color: #94a3b8; margin-left: auto; font-weight: 500; }

/* ── Table ── */
.table-container {
    padding: 0 24px 24px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

thead th {
    background: #f8fafc;
    padding: 9px 14px;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 1;
}

th.sortable { cursor: pointer; }
th.sortable:hover { color: #3b82f6; }
th.active-sort { color: #3b82f6; }
th.sortable::after { content: ' \2195'; font-size: 0.65rem; opacity: 0.35; }
th.active-sort::after { opacity: 1; }
th.sort-asc::after { content: ' \2191'; opacity: 1; }
th.sort-desc::after { content: ' \2193'; opacity: 1; }

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.08s;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* Disposition row highlights — muted, not distracting */
tbody tr.row-yellow { background: #fefce8 !important; }
tbody tr.row-yellow:hover { background: #fef9c3 !important; }
tbody tr.row-blue { background: #eff6ff !important; }
tbody tr.row-blue:hover { background: #dbeafe !important; }
tbody tr.row-red { background: #fef2f2 !important; }
tbody tr.row-red:hover { background: #fee2e2 !important; }
tbody tr.row-green { background: #f0fdf4 !important; }
tbody tr.row-green:hover { background: #dcfce7 !important; }

tbody td {
    padding: 8px 14px;
    font-size: 0.82rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.account-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.account-link:hover { text-decoration: underline; }

.phone-link { color: #2563eb; text-decoration: none; font-weight: 500; white-space: nowrap; }
.phone-link:hover { text-decoration: underline; }

.poc-cell { min-width: 120px; }
.poc-preview { font-size: 0.78rem; cursor: pointer; line-height: 1.35; color: #475569; }
.poc-preview:hover { color: #2563eb; }

.ga4-active { color: #16a34a; font-weight: 600; font-size: 0.78rem; }
.ga4-inactive { color: #cbd5e1; font-size: 0.78rem; }

.status-select, .disposition-select {
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.78rem;
    font-family: inherit;
    background: white;
    color: #334155;
    cursor: pointer;
    outline: none;
}
.disposition-select:focus, .stage-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59,130,246,0.08); }
.disposition-select { min-width: 165px; }

.stage-select {
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.75rem;
    font-family: inherit;
    background: white;
    color: #334155;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

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

.modal {
    background: white;
    border-radius: 10px;
    width: 680px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 24px 48px rgba(15,23,42,0.18);
    border: 1px solid #e2e8f0;
}

/* Account Detail Modal — near full-screen, two-column body */
.account-modal {
    width: 95vw;
    max-width: 1400px;
    max-height: 95vh;
    padding: 32px 36px;
}
.account-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}
.account-modal-col { min-width: 0; }
.account-modal-col .modal-section:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}
.account-modal .edit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.account-modal .edit-field.full-width { grid-column: 1 / -1; }
.account-modal #notes-list { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
@media (max-width: 1200px) {
    .account-modal .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .account-modal-body { grid-template-columns: 1fr; }
}

.modal-close {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none; font-size: 1.3rem;
    cursor: pointer; color: #94a3b8; line-height: 1;
}
.modal-close:hover { color: #334155; }

.modal-section {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}
.modal-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.modal-section h3 {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 12px;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.edit-field label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 3px;
    font-weight: 500;
}

.edit-field input, .edit-field select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.82rem;
    font-family: inherit;
    color: #334155;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.edit-field input:focus, .edit-field select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.edit-field.full-width { grid-column: 1 / -1; }

.edit-with-action { display: flex; gap: 6px; align-items: center; }
.edit-with-action input { flex: 1; }

.btn-zoom {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    text-decoration: none; font-size: 0.9rem;
    color: #64748b; flex-shrink: 0;
}
.btn-zoom:hover { background: #f1f5f9; color: #2563eb; }

.btn-lotlinx {
    display: flex; align-items: center; justify-content: center;
    height: 30px; padding: 0 8px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    text-decoration: none; flex-shrink: 0;
    background: white; transition: background 0.15s, border-color 0.15s;
}
.btn-lotlinx img { height: 14px; width: auto; }
.btn-lotlinx:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-save-account {
    margin-top: 14px;
    padding: 8px 22px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-save-account:hover { background: #1d4ed8; }

.save-confirm { margin-left: 12px; color: #16a34a; font-weight: 600; font-size: 0.82rem; }
.save-confirm.hidden { display: none; }

.excel-note {
    font-size: 0.8rem; color: #64748b;
    padding: 6px 10px; background: #f8fafc;
    border-radius: 5px; border: 1px solid #f1f5f9;
}

/* Contacts section header with inline Add button */
.contacts-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.contacts-section-header h3 { margin-bottom: 0; }
.btn-add-contact-primary {
    background: #2563eb; color: white; border: none;
    padding: 6px 14px; border-radius: 6px; cursor: pointer;
    font-size: 0.78rem; font-weight: 500; font-family: inherit;
}
.btn-add-contact-primary:hover { background: #1d4ed8; }

/* Contact person cards */
.contact-cards { display: flex; flex-direction: column; gap: 14px; }
.contact-card {
    border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 12px 14px; background: #f8fafc;
}
.contact-card-header {
    display: flex; gap: 8px; align-items: flex-start;
    margin-bottom: 10px;
}
.contact-card-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
.contact-person-field {
    padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.85rem; font-family: inherit; color: #1e293b;
    background: white; outline: none;
    min-width: 0;
}
.contact-person-field:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.contact-card-delete {
    background: white; border: 1px solid #fca5a5; color: #dc2626;
    width: 28px; height: 28px; border-radius: 5px; cursor: pointer;
    font-size: 1rem; line-height: 1;
    flex-shrink: 0;
}
.contact-card-delete:hover { background: #fef2f2; }
.contact-methods-wrap {
    display: flex; flex-direction: column; gap: 10px;
}

/* Additional Contacts (multiple phones/emails) */
.contacts-group { margin-bottom: 14px; }
.contacts-group:last-child { margin-bottom: 0; }
.contacts-subhead {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: #94a3b8;
}
.btn-add-contact {
    background: white; color: #2563eb; border: 1px solid #bfdbfe;
    padding: 4px 10px; border-radius: 5px; cursor: pointer;
    font-size: 0.72rem; font-weight: 500; font-family: inherit;
    text-transform: none; letter-spacing: 0;
}
.btn-add-contact:hover { background: #eff6ff; border-color: #2563eb; }
.contacts-list { display: flex; flex-direction: column; gap: 6px; }
.contact-row {
    display: grid;
    grid-template-columns: 140px 1fr auto auto;
    gap: 6px; align-items: center;
}
.contact-row .contact-label,
.contact-row .contact-value {
    padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.82rem; font-family: inherit; color: #334155; outline: none;
    min-width: 0;
}
.contact-row .contact-label:focus,
.contact-row .contact-value:focus {
    border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59,130,246,0.08);
}
.contact-delete {
    background: none; border: none; color: #cbd5e1; cursor: pointer;
    font-size: 1.1rem; padding: 0 6px; line-height: 1;
}
.contact-delete:hover { color: #ef4444; }

.modal-status-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.modal-status-row label { font-weight: 600; font-size: 0.82rem; color: #334155; }

.modal-status-select {
    padding: 7px 12px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.82rem; font-family: inherit;
    cursor: pointer; outline: none; color: #334155;
}
.modal-status-select:focus { border-color: #93c5fd; }

/* ── Notes ── */
.note-input-row { display: flex; gap: 8px; margin-bottom: 14px; }

.note-input-row textarea {
    flex: 1; padding: 8px 12px;
    border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 0.82rem; font-family: inherit;
    resize: vertical; min-height: 54px;
    outline: none; color: #334155;
}
.note-input-row textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }

.btn-add-note {
    padding: 8px 16px; background: #2563eb; color: white;
    border: none; border-radius: 6px; font-size: 0.82rem;
    font-weight: 500; font-family: inherit;
    cursor: pointer; white-space: nowrap; align-self: flex-end;
}
.btn-add-note:hover { background: #1d4ed8; }

.note-item {
    padding: 10px 12px; background: #f8fafc;
    border-radius: 6px; margin-bottom: 6px;
    border: 1px solid #f1f5f9;
}
.note-item .note-date { font-size: 0.7rem; color: #94a3b8; margin-bottom: 3px; }
.note-item .note-text { font-size: 0.82rem; line-height: 1.5; color: #334155; }

.empty-notes { color: #94a3b8; font-style: italic; font-size: 0.82rem; }

/* ── Inline notes in table ── */
.notes-cell { min-width: 260px; max-width: 380px; vertical-align: top; }

.inline-notes { display: flex; align-items: flex-start; gap: 5px; }

.note-preview {
    flex: 1; font-size: 0.76rem; color: #64748b;
    cursor: pointer;
    white-space: pre-wrap; word-break: break-word;
    line-height: 1.35;
    max-width: 340px;
}
.note-preview:hover { color: #2563eb; }

.empty-note { color: #cbd5e1; font-style: italic; }

.note-badge {
    background: #3b82f6; color: white;
    font-size: 0.62rem; padding: 1px 5px;
    border-radius: 8px; font-weight: 600;
}

.btn-inline-note {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid #e2e8f0; background: white;
    color: #3b82f6; font-size: 0.85rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; padding: 0; line-height: 1;
}
.btn-inline-note:hover { background: #3b82f6; color: white; border-color: #3b82f6; }

.inline-note-input { margin-top: 5px; }
.inline-note-input.hidden { display: none; }

.inline-note-input textarea {
    width: 100%; padding: 6px 10px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.78rem; font-family: inherit;
    resize: vertical; min-height: 44px;
    outline: none; color: #334155;
}
.inline-note-input textarea:focus { border-color: #93c5fd; }

.inline-note-actions { display: flex; gap: 5px; margin-top: 4px; }

.btn-save-note {
    padding: 4px 10px; background: #2563eb; color: white;
    border: none; border-radius: 4px;
    font-size: 0.75rem; font-family: inherit; cursor: pointer;
}
.btn-save-note:hover { background: #1d4ed8; }

.btn-cancel-note {
    padding: 4px 10px; background: #f1f5f9; color: #475569;
    border: none; border-radius: 4px;
    font-size: 0.75rem; font-family: inherit; cursor: pointer;
}
.btn-cancel-note:hover { background: #e2e8f0; }

/* ── Note edit/delete ── */
.note-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.note-actions { display: flex; gap: 3px; }

.btn-note-edit, .btn-note-delete {
    background: none; border: 1px solid #e2e8f0; border-radius: 3px;
    cursor: pointer; font-size: 0.78rem; padding: 2px 7px;
    color: #94a3b8; line-height: 1.2;
}
.btn-note-edit:hover { background: #f1f5f9; color: #2563eb; }
.btn-note-delete:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.note-edit-form { margin-top: 5px; }
.note-edit-form.hidden { display: none; }

.note-edit-form textarea {
    width: 100%; padding: 7px 10px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.82rem; font-family: inherit;
    resize: vertical; min-height: 54px;
    outline: none; color: #334155;
}
.note-edit-form textarea:focus { border-color: #93c5fd; }

/* ── Custom Columns ── */
.custom-col-header { position: relative; }

.col-delete-btn {
    background: none; border: none; color: #cbd5e1; cursor: pointer;
    font-size: 0.85rem; margin-left: 4px; padding: 0 2px;
    line-height: 1; opacity: 0; transition: opacity 0.15s;
}

th:hover .col-delete-btn { opacity: 1; }
.col-delete-btn:hover { color: #ef4444; }

.add-col-header { padding: 6px 8px !important; }

.btn-edit-cols {
    background: none; border: 1px solid #e2e8f0; border-radius: 5px;
    color: #94a3b8; font-size: 0.85rem; cursor: pointer;
    padding: 3px 7px; transition: all 0.15s;
}

.btn-edit-cols:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }

/* Column Manager Modal */
.colmgr-modal { width: 460px; padding: 24px; }

.colmgr-title { font-size: 1rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.colmgr-subtitle { font-size: 0.78rem; color: #94a3b8; margin-bottom: 16px; }

.colmgr-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; max-height: 50vh; overflow-y: auto; }

.colmgr-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; background: white;
    border: 1px solid #e2e8f0; border-radius: 6px;
    transition: background 0.1s;
}

.colmgr-item.builtin { background: #f8fafc; }
.colmgr-item[draggable="true"] { cursor: grab; }
.colmgr-item[draggable="true"]:active { cursor: grabbing; }

.colmgr-drag { color: #cbd5e1; font-size: 0.85rem; width: 18px; flex-shrink: 0; }

.colmgr-name { font-size: 0.85rem; color: #334155; font-weight: 500; flex: 1; }

.colmgr-badge {
    font-size: 0.65rem; color: #94a3b8; background: #f1f5f9;
    padding: 2px 6px; border-radius: 4px; font-weight: 500;
}

.colmgr-rename {
    flex: 1; border: 1px solid #e2e8f0; border-radius: 4px;
    padding: 4px 8px; font-size: 0.85rem; font-family: inherit;
    color: #334155; outline: none;
}
.colmgr-rename:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59,130,246,0.08); }

.colmgr-delete {
    background: none; border: none; color: #cbd5e1; cursor: pointer;
    font-size: 1rem; padding: 0 4px; line-height: 1;
}
.colmgr-delete:hover { color: #ef4444; }

.colmgr-add-row { display: flex; gap: 8px; }
.colmgr-add-row input {
    flex: 1; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 0.85rem; font-family: inherit; color: #334155; outline: none;
}
.colmgr-add-row input:focus { border-color: #93c5fd; }

/* Column Suggestions */
.colmgr-suggest-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin-bottom: 16px;
}
.colmgr-suggest-title {
    font-size: 0.85rem; font-weight: 600; color: #1e293b; margin-bottom: 2px;
}
.colmgr-suggest-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 40vh; overflow-y: auto;
    margin-top: 8px;
}
.colmgr-suggest-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px;
}
.colmgr-suggest-main { flex: 1; min-width: 0; }
.colmgr-suggest-name {
    font-size: 0.85rem; font-weight: 600; color: #334155;
}
.colmgr-suggest-meta {
    font-size: 0.72rem; color: #94a3b8; margin-top: 2px;
}
.colmgr-suggest-samples {
    font-size: 0.72rem; color: #64748b; margin-top: 4px;
    display: flex; flex-wrap: wrap; gap: 4px;
}
.colmgr-suggest-samples span {
    background: white; border: 1px solid #e2e8f0; border-radius: 3px;
    padding: 1px 6px;
}
.colmgr-suggest-add {
    background: #2563eb; color: white; border: none;
    padding: 6px 12px; border-radius: 5px; cursor: pointer;
    font-size: 0.78rem; font-weight: 500; font-family: inherit;
    flex-shrink: 0;
}
.colmgr-suggest-add:hover { background: #1d4ed8; }

/* Manage Book Modal */
.managebook-modal { width: 420px; padding: 24px; }
.managebook-label {
    display: block; font-size: 0.75rem; font-weight: 600;
    color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;
    margin: 16px 0 6px;
}
.managebook-input {
    width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0;
    border-radius: 6px; font-size: 0.9rem; font-family: inherit;
    color: #1e293b; outline: none; box-sizing: border-box;
}
.managebook-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59,130,246,0.08); }
.managebook-actions {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-top: 16px;
}
.managebook-delete {
    background: white; color: #dc2626; border: 1px solid #fca5a5;
    padding: 8px 14px; border-radius: 6px; cursor: pointer;
    font-size: 0.82rem; font-weight: 500; font-family: inherit;
}
.managebook-delete:hover { background: #fef2f2; border-color: #dc2626; }

.custom-cell {
    cursor: text; min-width: 80px;
    outline: none; border-radius: 3px;
    transition: background 0.1s;
}

.custom-cell:focus {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

/* ── Follow-Up Dashboard ── */
#view-followups.hidden { display: none; }

.fu-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px 24px;
}

.fu-stat {
    background: white;
    border-radius: 8px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #cbd5e1;
    text-align: center;
}

.fu-stat.overdue { border-left-color: #ef4444; }
.fu-stat.today { border-left-color: #f59e0b; }
.fu-stat.week { border-left-color: #3b82f6; }
.fu-stat.later { border-left-color: #94a3b8; }

.fu-stat-num { font-size: 1.6rem; font-weight: 700; color: #1e293b; }
.fu-stat-label { font-size: 0.68rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-top: 2px; }

.fu-content { padding: 0 24px 24px; }

.fu-empty { color: #94a3b8; font-style: italic; font-size: 0.85rem; padding: 32px 0; text-align: center; }

.fu-section { margin-bottom: 20px; }

.fu-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.fu-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fu-section-label.overdue { color: #ef4444; }
.fu-section-label.today { color: #f59e0b; }
.fu-section-label.week { color: #3b82f6; }
.fu-section-label.later { color: #94a3b8; }

.fu-section-count {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

.fu-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    border-left: 3px solid #cbd5e1;
    margin-bottom: 6px;
    transition: box-shadow 0.1s;
}

.fu-card:hover { box-shadow: 0 2px 8px rgba(15,23,42,0.06); }

.fu-card.overdue { border-left-color: #ef4444; background: #fefefe; }
.fu-card.today { border-left-color: #f59e0b; }
.fu-card.week { border-left-color: #3b82f6; }
.fu-card.later { border-left-color: #94a3b8; }

.fu-card-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    gap: 12px;
}

.fu-card-left { flex: 1; min-width: 0; }

.fu-card-account {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    margin-bottom: 3px;
}
.fu-card-account:hover { text-decoration: underline; }

.fu-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fu-card-time {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.fu-card-disp {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 500;
}

.fu-card-poc {
    font-size: 0.72rem;
    color: #94a3b8;
}

.fu-card-notes {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

.fu-card-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    align-items: center;
}

.fu-btn {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    background: white;
    color: #475569;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.1s;
}

.fu-btn:hover { background: #f1f5f9; }
.fu-btn.done { color: #16a34a; border-color: #bbf7d0; }
.fu-btn.done:hover { background: #f0fdf4; }
.fu-btn.call { font-size: 0.85rem; padding: 5px 8px; }
.fu-btn.reschedule { color: #2563eb; }
.fu-btn.edit { color: #2563eb; }
.fu-btn.delete { color: #94a3b8; border-color: #e2e8f0; font-size: 0.9rem; padding: 3px 8px; }
.fu-btn.delete:hover { color: #dc2626; background: #fef2f2; border-color: #fecaca; }

/* Follow-up inline edit form */
.fu-edit-form { padding: 10px 14px; border-top: 1px solid #f1f5f9; }
.fu-edit-form.hidden { display: none; }

.fu-edit-row { display: flex; gap: 10px; margin-bottom: 8px; }
.fu-edit-row .edit-field { flex: 1; }

.fu-edit-form textarea {
    width: 100%; padding: 7px 10px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.82rem; font-family: inherit;
    resize: vertical; outline: none; color: #334155;
}
.fu-edit-form textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }

.fu-edit-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ── Pipeline Dashboard ── */
.pipe-summary { padding: 16px 24px 0; }

.pipe-sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.pipe-sub-tab {
    padding: 9px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    margin-right: -1px;
    transition: color 0.15s, background 0.15s;
}

.pipe-sub-tab:hover { color: #334155; background: #e2e8f0; }
.pipe-sub-tab.active { color: #2563eb; background: white; font-weight: 600; border-bottom: 1px solid white; z-index: 1; position: relative; }

.pipe-stats-row {
    display: flex;
    gap: 10px;
    padding: 0 0 12px;
    flex-wrap: wrap;
}

.pipe-stat {
    background: white;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #cbd5e1;
    text-align: center;
}

.pipe-stat-num { font-size: 1.5rem; font-weight: 700; }
.pipe-stat-label { font-size: 0.68rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-top: 2px; }
.pipe-stat-pct { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }

.pipe-board { padding: 0 24px 24px; }

.pipe-board-grid {
    display: grid;
    gap: 10px;
    align-items: start;
}

.pipe-stat { flex: 1; min-width: 100px; }

.pipe-column {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 200px;
}

.pipe-col-header {
    padding: 10px 12px;
    border-bottom: 2px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipe-col-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #334155; }
.pipe-col-count { font-size: 0.72rem; color: #94a3b8; font-weight: 600; background: #e2e8f0; padding: 1px 7px; border-radius: 10px; }

.pipe-col-cards { padding: 8px; max-height: 65vh; overflow-y: auto; }

.pipe-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 9px 11px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: box-shadow 0.1s, border-color 0.1s;
}

.pipe-card:hover { box-shadow: 0 2px 6px rgba(15,23,42,0.08); border-color: #cbd5e1; }

.pipe-card-name { font-size: 0.8rem; font-weight: 600; color: #1e293b; margin-bottom: 3px; }
.pipe-card-disp { font-size: 0.66rem; color: #64748b; background: #f1f5f9; padding: 1px 6px; border-radius: 3px; display: inline-block; margin-bottom: 3px; }
.pipe-card-note { font-size: 0.7rem; color: #64748b; line-height: 1.35; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pipe-card-poc { font-size: 0.7rem; color: #94a3b8; }
.pipe-card-fu { font-size: 0.68rem; color: #f59e0b; margin-top: 3px; }
.pipe-card-last { font-size: 0.66rem; color: #cbd5e1; margin-top: 2px; }

.pipe-empty { color: #cbd5e1; font-style: italic; font-size: 0.78rem; text-align: center; padding: 20px 8px; }

/* Drag & drop */
.pipe-card[draggable="true"] { cursor: grab; }
.pipe-card[draggable="true"]:active { cursor: grabbing; }

.pipe-card-dragging {
    opacity: 0.4;
    border: 1px dashed #93c5fd !important;
    background: #eff6ff !important;
}

.pipe-drop-target {
    outline: 2px dashed #e2e8f0;
    outline-offset: -2px;
    transition: outline-color 0.15s, background 0.15s;
}

.pipe-drop-hover {
    outline-color: #3b82f6 !important;
    background: #eff6ff !important;
}

.pipe-drop-hover .pipe-col-cards {
    min-height: 80px;
}

/* ── Follow-Up Reminders ── */
#reminder-container {
    position: fixed; top: 16px; right: 16px;
    z-index: 2000; display: flex; flex-direction: column;
    gap: 8px; max-width: 380px;
}

.reminder-toast {
    background: white; border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 8px 24px rgba(15,23,42,0.14);
    padding: 14px 16px;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

.reminder-toast.overdue { border-left-color: #ef4444; }

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

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

.reminder-toast.dismissing { animation: slideOut 0.25s ease-in forwards; }

.reminder-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 6px;
}

.reminder-label {
    font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: #f59e0b;
}

.reminder-toast.overdue .reminder-label { color: #ef4444; }

.reminder-close {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 1.1rem; line-height: 1; padding: 0;
}
.reminder-close:hover { color: #334155; }

.reminder-account {
    font-size: 0.88rem; font-weight: 600; color: #1e293b;
    margin-bottom: 4px; cursor: pointer;
}
.reminder-account:hover { color: #2563eb; }

.reminder-time { font-size: 0.75rem; color: #64748b; margin-bottom: 4px; }

.reminder-notes { font-size: 0.78rem; color: #475569; line-height: 1.4; }

.reminder-actions { display: flex; gap: 6px; margin-top: 10px; }

.btn-reminder-done {
    padding: 5px 12px; background: #16a34a; color: white;
    border: none; border-radius: 4px; font-size: 0.75rem;
    font-family: inherit; font-weight: 500; cursor: pointer;
}
.btn-reminder-done:hover { background: #15803d; }

.btn-reminder-snooze {
    padding: 5px 12px; background: #f1f5f9; color: #475569;
    border: none; border-radius: 4px; font-size: 0.75rem;
    font-family: inherit; font-weight: 500; cursor: pointer;
}
.btn-reminder-snooze:hover { background: #e2e8f0; }

/* ── Follow-Up Modal ── */
.followup-modal { width: 440px; padding: 24px; }

.followup-title {
    font-size: 1rem; font-weight: 600; color: #1e293b;
    margin-bottom: 4px; border: none; padding: 0;
}

.followup-account {
    font-size: 0.82rem; color: #64748b; margin-bottom: 16px;
}

.followup-form { display: flex; flex-direction: column; gap: 12px; }

.followup-row { display: flex; gap: 10px; }
.followup-row .edit-field { flex: 1; }

.followup-form textarea {
    width: 100%; padding: 8px 10px;
    border: 1px solid #e2e8f0; border-radius: 5px;
    font-size: 0.82rem; font-family: inherit;
    resize: vertical; outline: none; color: #334155;
}
.followup-form textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }

.followup-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .filters { flex-direction: column; }
    .filters input, .filters select { min-width: 100%; }
    .edit-grid { grid-template-columns: 1fr; }
}
