/* ============================================================
   ALS Sales Hub — Global Styles
   ============================================================ */

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

:root {
    /* Brand colours — ALS default; overridden by JS for BCS */
    --brand:       #003087;
    --brand-light: #e8edf7;
    --brand-text:  #ffffff;

    /* Neutrals */
    --bg:          #f0f2f5;
    --surface:     #ffffff;
    --border:      #dde1e7;
    --text:        #1a1f36;
    --text-muted:  #6b7280;
    --text-light:  #9ca3af;

    /* Status colours */
    --success:       #16a34a;
    --success-light: #dcfce7;
    --danger:        #dc2626;
    --danger-light:  #fee2e2;
    --warning:       #d97706;
    --warning-light: #fef3c7;
    --info:          #0284c7;
    --info-light:    #e0f2fe;

    /* Layout */
    --sidebar-w:  210px;
    --topbar-h:   52px;
    --statusbar-h: 26px;
    --radius:     6px;
    --radius-lg:  10px;
    --shadow:     0 1px 4px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.12);

    /* Sidebar */
    --sidebar-bg:          #0f1629;
    --sidebar-item-hover:  rgba(255,255,255,0.06);
    --sidebar-item-active: rgba(255,255,255,0.12);
    --sidebar-text:        rgba(255,255,255,0.75);
    --sidebar-text-active: #ffffff;
    --sidebar-border:      rgba(255,255,255,0.08);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ============================================================
   App shell — sidebar + main
   ============================================================ */

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

#sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    -webkit-app-region: drag;
}

/* Logo */
#sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    -webkit-app-region: no-drag;
}

#logo-mark {
    width: 34px;
    height: 34px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#logo-text {
    display: flex;
    flex-direction: column;
}

#logo-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: 0.2px;
}

#logo-version {
    font-size: 10px;
    color: var(--sidebar-text);
    opacity: 0.6;
}

/* Nav list */
#nav-list {
    list-style: none;
    padding: 10px 8px;
    flex: 1;
    overflow-y: auto;
    -webkit-app-region: no-drag;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.12s, color 0.12s;
    position: relative;
    -webkit-app-region: no-drag;
}

.nav-item:hover {
    background: var(--sidebar-item-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-item-active);
    color: var(--sidebar-text-active);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--brand);
    border-radius: 0 2px 2px 0;
    left: -8px;
}

.nav-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    font-size: 10px;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Nav section dividers */
.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 2px;
}

/* Sidebar footer — brand switcher */
#sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    -webkit-app-region: no-drag;
}

#brand-switcher {
    display: flex;
    gap: 6px;
}

.brand-btn {
    flex: 1;
    background: rgba(255,255,255,0.08);
    color: var(--sidebar-text);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 7px 0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: background 0.12s, color 0.12s;
}

.brand-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.brand-btn.active {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}

/* ============================================================
   MAIN AREA
   ============================================================ */

#main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Top bar */
#topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    -webkit-app-region: drag;
    box-shadow: var(--shadow);
}

#topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-app-region: no-drag;
}

#topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

#topbar-brand-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
}

#topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-app-region: no-drag;
}

#topbar-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Content area */
#content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.module-view {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.module-view.active {
    display: flex;
}

.module-inner {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

/* Status bar */
#statusbar {
    height: var(--statusbar-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

#statusbar-text {
    font-size: 11px;
    color: var(--text-muted);
}

#statusbar-brand {
    font-size: 11px;
    color: var(--text-light);
}

/* ============================================================
   BUTTONS
   ============================================================ */

button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    transition: opacity 0.12s, background 0.12s;
    line-height: 1;
}

button:hover  { opacity: 0.88; }
button:active { opacity: 0.72; }

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 5px 8px;
}

.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-close {
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px 8px;
}

.btn-sm {
    font-size: 11px;
    padding: 4px 10px;
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    padding: 4px 6px;
    font-size: 14px;
    border-radius: 4px;
}

.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ============================================================
   STAT CARDS
   ============================================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--brand);
}

.stat-card.danger  { border-top-color: var(--danger); }
.stat-card.success { border-top-color: var(--success); }
.stat-card.warning { border-top-color: var(--warning); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

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

/* ============================================================
   STATS STRIP (pipeline module)
   ============================================================ */

.stats-strip {
    display: flex;
    gap: 24px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.strip-stat strong    { color: var(--text); }
.success-text strong  { color: var(--success); }
.danger-text strong   { color: var(--danger); }
.warning-text strong  { color: var(--warning); }

/* ============================================================
   PANELS
   ============================================================ */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
    flex-shrink: 0;
}

.panel-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}

.panel-badge {
    font-size: 11px;
    font-weight: 700;
    background: var(--brand-light);
    color: var(--brand);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.panel-badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.panel-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex-shrink: 0;
}

/* ============================================================
   ITEM LISTS (Today cards)
   ============================================================ */

.item-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-list.scrollable {
    overflow-y: auto;
    max-height: 320px;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.12s;
}

.action-card:hover { border-color: var(--brand); }

.action-card.overdue {
    border-left: 3px solid var(--danger);
    background: var(--danger-light);
}

.action-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.action-card-company {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-card-reason {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.action-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.chip {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.chip-priority-vh { background: var(--danger-light);   color: var(--danger); }
.chip-priority-h  { background: var(--warning-light);  color: var(--warning); }
.chip-priority-m  { background: var(--brand-light);    color: var(--brand); }
.chip-priority-l  { background: #f0f0f0;               color: #666; }

.chip-type-renewal    { background: #fde68a; color: #92400e; }
.chip-type-quote      { background: var(--info-light); color: var(--info); }
.chip-type-opp        { background: #ede9fe; color: #6d28d9; }

.chip-overdue   { background: var(--danger-light);   color: var(--danger); }
.chip-value     { background: var(--brand-light);    color: var(--brand); font-weight: 700; }
.chip-days      { background: #f0f0f0;               color: #555; }

/* Opp cards (pipeline section in Today) */
.opp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.opp-score-ring {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.opp-body { flex: 1; min-width: 0; }

.opp-company {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opp-reason {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.opp-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */

.module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--surface);
    width: 260px;
    outline: none;
    transition: border-color 0.12s;
}

.search-input:focus { border-color: var(--brand); }

.filter-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    outline: none;
}

.toolbar-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #fafbfc;
    border-bottom: 2px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.data-table th:hover { color: var(--text); }

.data-table th.right,
.data-table td.right {
    text-align: right;
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8f9fc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.client-row-expanded td { background: #eef2ff !important; }
.client-expand-row td { padding: 0 !important; }
.client-expand-row:hover td { background: transparent !important; cursor: default; }

.data-table .col-company { font-weight: 600; }
.data-table .col-quote   { font-family: monospace; font-size: 11px; color: var(--text-muted); }

/* Compact table variant */
.compact-table th,
.compact-table td { padding: 7px 10px; }

/* Priority badges in table */
.p-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.p-badge-vh { background: var(--danger-light);  color: var(--danger); }
.p-badge-h  { background: var(--warning-light); color: var(--warning); }
.p-badge-m  { background: var(--brand-light);   color: var(--brand); }
.p-badge-l  { background: #f0f0f0;              color: #666; }

/* Heat badges */
.heat-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.heat-hot      { background: #fee2e2; color: #991b1b; }
.heat-engaged  { background: #fef3c7; color: #92400e; }
.heat-warm     { background: var(--brand-light); color: var(--brand); }
.heat-cold     { background: #f0f0f0; color: #666; }
.heat-bounced  { background: #fce7f3; color: #9d174d; }
.heat-negative { background: #f3f4f6; color: #374151; }

/* ============================================================
   TAB BAR
   ============================================================ */

.tab-bar {
    display: flex;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}

.tab {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: calc(var(--radius) - 1px);
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

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

.empty-module-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 40px;
    opacity: 0.3;
    margin-bottom: 4px;
}

.empty-module-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.empty-module-state p {
    font-size: 13px;
    max-width: 380px;
    line-height: 1.6;
}

/* ============================================================
   LOADING / ERROR
   ============================================================ */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 13px;
    padding: 40px;
}

.error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--danger);
    font-size: 13px;
    padding: 40px;
    text-align: center;
}

/* ============================================================
   CONTACTS GRID
   ============================================================ */

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
}

.contact-card:hover { box-shadow: var(--shadow-md); }

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.contact-company {
    font-size: 12px;
    color: var(--text-muted);
}

.contact-email,
.contact-phone {
    font-size: 12px;
    color: var(--text-muted);
}

.contact-card--site {
    border-left: 3px solid var(--brand);
    background: #fafbff;
}

.contact-detail {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-site {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 4px;
    padding: 2px 5px;
    align-self: flex-start;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-header h2 {
    font-size: 15px;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: #fafbfc;
}

/* Form fields inside modals */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.field-group input,
.field-group select,
.field-group textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color 0.12s;
}

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

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

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

/* ============================================================
   UTILITY
   ============================================================ */

.hidden { display: none !important; }

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============================================================
   TASKS MODULE
   ============================================================ */

.overdue-banner {
    background: var(--danger);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    animation: pulse-banner 2s ease-in-out infinite;
}

@keyframes pulse-banner {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.85; }
}

.banner-punch {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.task-card:hover { box-shadow: var(--shadow-md); }

.task-card.overdue        { border-left-color: var(--danger);  background: #fff9f9; }
.task-card.due-today      { border-left-color: var(--warning); background: #fffdf7; }
.task-card.done           { border-left-color: #ccc; opacity: 0.6; }
.task-card.type-call      { border-left-color: #0284c7; }
.task-card.type-email     { border-left-color: #7c3aed; }
.task-card.type-quote     { border-left-color: var(--brand); }
.task-card.type-chase     { border-left-color: var(--warning); }
.task-card.type-marketing { border-left-color: #16a34a; }

.task-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s;
}

.task-check:hover     { border-color: var(--brand); }
.task-check.checked   { background: var(--success); border-color: var(--success); color: #fff; font-size: 11px; }

.task-body    { flex: 1; min-width: 0; }

.task-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.task-card.done .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.task-due {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.task-due.overdue   { background: var(--danger-light);  color: var(--danger); }
.task-due.today     { background: var(--warning-light); color: var(--warning); }
.task-due.upcoming  { background: #f0f0f0;              color: #555; }
.task-due.done      { background: var(--success-light); color: var(--success); }

.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s;
}

.task-card:hover .task-actions { opacity: 1; }

/* ============================================================
   TRANSCRIPTS MODULE
   ============================================================ */

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

.transcript-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.transcript-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand); }

.transcript-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transcript-date  { font-size: 11px; color: var(--text-muted); }

.transcript-ai-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #ede9fe;
    color: #6d28d9;
    align-self: flex-start;
}

.transcript-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.detail-header h3 { flex: 1; font-size: 15px; font-weight: 700; }
.detail-header span { font-size: 12px; color: var(--text-muted); }

.detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.detail-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.detail-col .panel { flex: 1; overflow: hidden; }

.transcript-raw {
    font-size: 11px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    line-height: 1.6;
    overflow-y: auto;
    max-height: 480px;
}

.ai-section { margin-bottom: 14px; }
.ai-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.ai-item {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.ai-item:last-child { border-bottom: none; }

/* ============================================================
   RESEARCH MODULE
   ============================================================ */

/* FileMaker import */
.import-panel { display: flex; flex-direction: column; gap: 16px; }

.import-drop-zone {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
    border-color: var(--brand);
    background: var(--brand-light);
}

.import-drop-zone .drop-icon { font-size: 36px; }
.import-drop-zone h3 { font-size: 15px; font-weight: 700; }
.import-drop-zone p  { font-size: 13px; color: var(--text-muted); max-width: 420px; }
.import-note         { font-size: 11px; color: var(--text-light); }

.field-mapping {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.mapping-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    background: #f8f9fc;
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.mapping-source { font-weight: 600; flex: 1; }
.mapping-arrow  { color: var(--text-muted); }
.mapping-target { color: var(--brand); font-weight: 600; flex: 1; }
.mapping-skip   { color: var(--text-light); font-style: italic; }

/* Website advisor */
.website-advisor { display: flex; flex-direction: column; gap: 16px; }

.advisor-sites {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.advisor-site-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.advisor-site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.advisor-site-name { font-size: 14px; font-weight: 700; }
.advisor-site-url  { font-size: 11px; color: var(--text-muted); }

.advisor-output {
    padding: 14px 16px;
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    font-size: 12px;
    line-height: 1.7;
}

.advisor-section       { margin-bottom: 14px; }
.advisor-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand);
    margin-bottom: 6px;
}

.advisor-rec {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: flex-start;
}

.advisor-rec:last-child { border-bottom: none; }

.rec-priority {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}

.rec-high   { background: var(--danger-light);  color: var(--danger); }
.rec-medium { background: var(--warning-light); color: var(--warning); }
.rec-low    { background: #f0f0f0;              color: #555; }

.thinking-dots::after {
    content: "...";
    animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
    0%   { content: "."; }
    33%  { content: ".."; }
    66%  { content: "..."; }
    100% { content: "."; }
}

/* ============================================================
   PIPELINE — engagement score chip + loss reason
   ============================================================ */

.pipeline-row { cursor: pointer; }
.pipeline-row:hover td { background: var(--brand-light); }

/* Score chip reuses heat-badge colour classes */
.score-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Loss reason shown under company name */
.loss-reason {
    font-size: 11px;
    color: var(--danger);
    margin-top: 2px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.loss-reason-unknown { color: var(--text-muted); }

/* ============================================================
   QUOTE DETAIL PANEL
   ============================================================ */

.quote-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

.qd-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-alt, #f8f9fa);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 12px;
    flex-shrink: 0;
}

.qd-meta-item { display: inline-flex; align-items: center; gap: 4px; }

.qd-note {
    width: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    background: #fffbf0;
    border-left: 3px solid var(--warning, #f59e0b);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Right column: timeline on top, PDF below */
.qd-timeline-panel { flex: 0 0 38%; min-height: 0; overflow: hidden; }
.qd-pdf-panel      { flex: 1;       min-height: 0; overflow: hidden; margin-top: 12px; }

/* AI chat bubbles */
.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 14px;
}

.chat-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.chat-body {
    font-size: 12px;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: var(--radius);
    word-break: break-word;
}
.chat-body p  { margin: 0 0 6px; }
.chat-body p:last-child { margin-bottom: 0; }
.chat-body ul { margin: 4px 0 6px 16px; padding: 0; }
.chat-body li { margin-bottom: 3px; }
.chat-body hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.chat-user .chat-body {
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
}
.chat-assistant .chat-body {
    background: var(--surface-alt, #f8f9fa);
    border-left: 3px solid var(--border);
}

/* Timeline entries */
.timeline-entry {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
}
.timeline-entry:last-child { border-bottom: none; }

.timeline-date  { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; min-width: 90px; }
.timeline-field { font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.timeline-change { color: var(--text); flex: 1; }

/* PDF raw text */
.qd-pdf-text {
    font-size: 11px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
}

/* ===========================================================================
   PA BRIEFING — Today view
   =========================================================================== */

.pa-greeting-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.pa-greeting-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.pa-greeting-summary {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.pa-greeting-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.pa-stat {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pa-stat strong {
    font-size: 18px;
    color: var(--brand);
    margin-right: 2px;
}

.pa-sections {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pa-section {}

.pa-section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 0 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.pa-section-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pa-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 7px 7px 0 0 !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pa-item:hover {
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pa-item-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.pa-item-body { flex: 1; min-width: 0; }

.pa-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.pa-item-company {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pa-item-reason {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.pa-item-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.pa-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 6px;
}

.pa-item-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: #f0fdf4;
    padding: 1px 6px;
    border-radius: 10px;
}

.pa-item-days {
    font-size: 11px;
    color: var(--text-muted);
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 10px;
}

.pa-last-outcome {
    font-size: 10px;
    color: var(--text-muted);
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
    font-style: italic;
}

.pa-last-note {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    padding: 3px 6px;
    border-left: 2px solid var(--border);
    line-height: 1.4;
    max-width: 600px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================================================================
   COMPANIES MODULE
   =========================================================================== */

/* Status badges */
.co-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: capitalize;
}
.co-status-prospect { background: #dbeafe; color: #1e40af; }
.co-status-customer { background: #dcfce7; color: #166534; }
.co-status-lapsed   { background: #fee2e2; color: #991b1b; }
.co-status-supplier { background: #fef9c3; color: #854d0e; }
.co-status-partner  { background: #f3e8ff; color: #6b21a8; }
.co-status-other    { background: #f3f4f6; color: #4b5563; }

.co-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* List table CRM link button */
.co-crm-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    opacity: 0.45;
    padding: 0 3px;
    vertical-align: middle;
    transition: opacity .15s;
}
.co-crm-link:hover { opacity: 1; }

/* Detail header */
.codet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.codet-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.codet-header-title h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.codet-header-actions { display: flex; gap: 8px; }

/* Tab bar */
.codet-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    padding: 0 20px;
    background: var(--surface);
}
.codet-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.codet-tab:hover { color: var(--text); }
.codet-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* Tab panels */
.codet-tab-panels {
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 152px);
}
.codet-tab-panel { display: none; }
.codet-tab-panel.active { display: block; }

/* Details tab */
.codet-details-view { margin-bottom: 16px; }
.codet-detail-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
}
.codet-detail-row:last-child { border-bottom: none; }
.codet-detail-label {
    flex: 0 0 100px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    padding-top: 1px;
}
.codet-detail-val { flex: 1; color: var(--text); }
.codet-detail-val a { color: var(--brand); text-decoration: none; }

/* Edit form */
.codet-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.codet-form-grid label,
.codet-form-address label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    gap: 4px;
}
.codet-form-address { margin-top: 20px; }
.codet-form-address-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

/* Contacts tab */
.codet-tab-toolbar { margin-bottom: 14px; }
.codet-contact-form-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.codet-contact-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--surface);
}
.codet-contact-name { font-weight: 700; font-size: 14px; }
.codet-contact-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.codet-contact-links { display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.codet-contact-link { font-size: 12px; color: var(--brand); text-decoration: none; }
.codet-contact-link:hover { text-decoration: underline; }
.codet-contact-notes {
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 8px;
    padding: 6px 8px;
    border-left: 3px solid var(--border);
    line-height: 1.5;
}
.codet-contact-actions { display: flex; gap: 6px; margin-top: 10px; }

/* Notes tab */
.codet-note-composer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

/* Activity / Notes timeline */
.codet-timeline-list { padding-top: 4px; }
.co-timeline-entry {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.co-timeline-entry:last-child { border-bottom: none; }
.co-tl-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.co-tl-when { font-size: 11px; color: var(--text-muted); }
.co-tl-text {
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text);
}
.co-timeline-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    text-transform: capitalize;
}
.co-tl-note     { background: #f3f4f6; color: #374151; }
.co-tl-call     { background: #dbeafe; color: #1e40af; }
.co-tl-email    { background: #fef9c3; color: #854d0e; }
.co-tl-meeting  { background: #f3e8ff; color: #6b21a8; }
.co-tl-visit    { background: #dcfce7; color: #166534; }
.co-tl-activity { background: #e0f2fe; color: #075985; }

/* PA item quick-actions (Feature 1 — Today call list) */
.pa-item-wrap { display: flex; flex-direction: column; }

/* Buttons live OUTSIDE the clickable pa-item div to avoid any event-bubbling issues */
.pa-quick-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px 14px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 7px 7px;
    margin-bottom: 2px;
}

.pa-quick-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
    line-height: 1.3;
    color: var(--text);
}
.pa-quick-btn:hover { background: #f3f4f6; border-color: var(--brand); }
.pa-quick-btn.logged { background: #d1fae5 !important; border-color: #059669 !important; color: #065f46; }
.pa-crm-btn { background: #eff6ff !important; border-color: #93c5fd !important; color: #1d4ed8 !important; font-weight: 600; }
.pa-crm-btn:hover { background: #dbeafe !important; border-color: #3b82f6 !important; }

/* ------------------------------------------------------------------ */
/* Cold Calls / Signals module                                         */
/* ------------------------------------------------------------------ */
.muted-note { font-size: 11px; color: var(--text-muted); align-self: center; margin-left: 8px; }

#signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    padding: 4px 0 24px;
}

.sig-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.sig-head { display: flex; gap: 11px; align-items: flex-start; }
.sig-score {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: #fff;
}
.sig-head-main { flex: 1; min-width: 0; }
.sig-company { font-size: 14px; font-weight: 700; color: var(--text); }
.sig-person  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.sig-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }
.sig-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .03em;
    padding: 1px 7px; border-radius: 10px; color: #fff;
}
.sig-product {
    font-size: 10px; font-weight: 600; color: var(--brand);
    background: var(--brand-light); padding: 1px 7px; border-radius: 10px;
}
.sig-loc { font-size: 10px; color: var(--text-muted); }

/* Urgency colours */
.sig-hot,  .sig-badge.sig-hot  { background: #dc2626; }
.sig-warm, .sig-badge.sig-warm { background: #f59e0b; }
.sig-luke, .sig-badge.sig-luke { background: #0ea5e9; }
.sig-cold, .sig-badge.sig-cold { background: #6b7280; }

.sig-opening {
    font-size: 12px; line-height: 1.5; color: var(--text);
    background: #f9fafb; border: 1px solid #eef0f3; border-radius: 7px;
    padding: 7px 9px;
}
.sig-details { font-size: 11px; }
.sig-details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.sig-signals { margin: 6px 0 4px; padding-left: 16px; color: var(--text-muted); line-height: 1.45; }
.sig-summary { margin: 4px 0 0; color: var(--text-muted); line-height: 1.5; font-style: italic; }
.sig-contact { font-size: 11px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sig-altcontact { color: var(--text-muted); }
.sig-phone { color: var(--brand); font-weight: 600; text-decoration: none; }
.sig-phone:hover { text-decoration: underline; }
.sig-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.sig-actions a.pa-quick-btn { text-decoration: none; }
.sig-draft-btn { background: #eff6ff !important; border-color: #93c5fd !important; color: #1d4ed8 !important; font-weight: 600; }

/* Outcome logging row */
.sig-outcomes { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; border-top: 1px dashed var(--border); padding-top: 8px; }
.sig-outcomes-label { font-size: 11px; color: var(--text-muted); margin-right: 2px; }
.sig-oc { font-size: 11px; }
.sig-oc-called:hover  { background: #d1fae5 !important; border-color: #059669 !important; }
.sig-oc-no:hover      { background: #fef3c7 !important; border-color: #d97706 !important; }
.sig-oc-booked:hover  { background: #dbeafe !important; border-color: #2563eb !important; }
.sig-oc-unfit:hover   { background: #fee2e2 !important; border-color: #dc2626 !important; }

/* Actioned state + status chip */
.sig-card.sig-actioned { opacity: 0.72; }
.sig-status {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600; color: #374151;
    background: #f3f4f6; border-radius: 6px; padding: 4px 8px;
}
.sig-status-called      { background: #d1fae5; color: #065f46; }
.sig-status-no-answer   { background: #fef3c7; color: #92400e; }
.sig-status-booked      { background: #dbeafe; color: #1e40af; }
.sig-status-not-suitable{ background: #fee2e2; color: #991b1b; }
.sig-reset {
    margin-left: auto; border: none; background: transparent; cursor: pointer;
    font-size: 13px; color: inherit; opacity: 0.7; padding: 0 2px;
}
.sig-reset:hover { opacity: 1; }

/* AI draft box */
.sig-draftbox { border-top: 1px dashed var(--border); padding-top: 8px; }
.sig-draft-text {
    width: 100%; min-height: 120px; resize: vertical;
    font-size: 12px; line-height: 1.5; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 7px;
    font-family: inherit; color: var(--text);
}
.sig-draft-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sig-draft-actions a.pa-quick-btn { text-decoration: none; }

/* Prospect call queue cards */
.prospect-item { border-left: 3px solid #0369a1; background: #f0f9ff; }
.prospect-rank { background: #0369a1 !important; color: #fff !important; font-size: 16px !important; }
.prospect-called-btn { background: #dcfce7 !important; border-color: #86efac !important; color: #166534 !important; font-weight: 600; }
.prospect-called-btn:hover { background: #bbf7d0 !important; border-color: #4ade80 !important; }
.prospect-dismiss-btn { background: #fee2e2 !important; border-color: #fca5a5 !important; color: #991b1b !important; }
.prospect-dismiss-btn:hover { background: #fecaca !important; border-color: #f87171 !important; }

.pa-brief-box {
    margin: -2px 0 4px 36px;
    padding: 10px 14px;
    background: var(--brand-light, #e8edf7);
    border-left: 3px solid var(--brand, #003087);
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

.pa-spoke-form {
    margin: -2px 0 4px 36px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 0 6px 6px 0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Pipeline brief expand row (Feature 2) */
.pipeline-brief-row td {
    padding: 12px 16px !important;
    background: var(--brand-light, #e8edf7) !important;
    border-top: none !important;
    border-left: 3px solid var(--brand, #003087) !important;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    cursor: default;
}
.pipeline-brief-row:hover td { background: var(--brand-light, #e8edf7) !important; }

/* Email Template Library (Feature 3) */
.template-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.template-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.template-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.template-card-title {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    color: var(--text);
}
.template-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}
.template-fields {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.template-fields input, .template-fields textarea {
    flex: 1;
    min-width: 140px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    background: var(--bg);
    color: var(--text);
}
.template-result {
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
    cursor: text;
    user-select: all;
}
#today-templates-section .section-toggle-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

/* ===========================================================================
   RENEWAL BOARD
   =========================================================================== */

.renewal-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
}

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

.renewal-lane {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.renewal-lane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.renewal-lane-header .lane-count {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.renewal-lane-header .lane-value {
    font-size: 11px;
    font-weight: 600;
    opacity: .8;
}

.renewal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.renewal-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.renewal-card-urgency {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.renewal-card-body { padding-left: 6px; }

.renewal-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.renewal-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.renewal-card-days {
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.renewal-card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.renewal-followup-prompt {
    margin-top: 6px;
    padding: 8px 10px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 11px;
}

/* Warm badge on LC table rows */
.warm-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 1px 5px;
    border-radius: 8px;
    background: #fef3c7;
    color: #92400e;
    margin-left: 4px;
    vertical-align: middle;
}

/* ===========================================================================
   CALL CARD
   =========================================================================== */

.call-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.call-card-body {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 16px 20px 20px;
    overflow: hidden;
}

.call-card-left {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.call-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-width: 0;
}

.cc-panel {
    flex: 0 0 auto;
}

.cc-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.cc-box-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cc-opener {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    font-style: italic;
}

.cc-aim {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    font-weight: 600;
}

.cc-keypoints {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text);
}

.cc-keypoints li { margin-bottom: 2px; }

.cc-outcome-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.cc-outcome-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.cc-outcome-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text);
    transition: all 0.12s;
    white-space: nowrap;
}

.cc-outcome-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.cc-outcome-btn.selected {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.cc-btn-won.selected  { background: var(--success); border-color: var(--success); }
.cc-btn-lost.selected { background: var(--danger);  border-color: var(--danger);  }
.cc-btn-snooze.selected { background: #9ca3af; border-color: #9ca3af; }

.cc-outcome-extra {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-outcome-note {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    color: var(--text);
    background: var(--bg);
    box-sizing: border-box;
}

.cc-outcome-extra-btns {
    display: flex;
    gap: 8px;
}

.cc-followup {
    margin-top: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 14px;
}

.cc-followup-text {
    font-size: 12px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.cc-detail-row {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.5;
}

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

.cc-detail-label {
    width: 90px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 1px;
}

.cc-detail-val {
    flex: 1;
    color: var(--text);
    word-break: break-word;
}

.cc-activity-entry {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.cc-activity-entry:last-child { border-bottom: none; }

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

.cc-act-text {
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 12px;
}

.loading-state-sm {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
    margin: 0;
}

/* ==========================================================================
   Parker Leads module
   ========================================================================== */

/* Import preview grid */
.parker-preview-grid     { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; }
.parker-preview-row      { display: contents; }
.parker-preview-key      { font-weight: 600; font-size: 12px; color: #6b7280; align-self: start; padding-top: 2px; }
.parker-preview-val      { font-size: 12px; color: #111827; white-space: pre-wrap; word-break: break-word; }

/* Detail modal layout */
.parker-detail-dialog    { width: 860px; max-width: 96vw; }
.parker-detail-body      { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px; overflow-y: auto; max-height: calc(85vh - 120px); }
.parker-detail-info      { border-right: 1px solid #e5e7eb; padding-right: 20px; }
.parker-section-heading  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; margin: 0 0 8px; }
.parker-dl               { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; font-size: 12px; margin: 0; }
.parker-dl dt            { font-weight: 600; color: #6b7280; align-self: start; padding-top: 2px; }
.parker-dl dd            { margin: 0; color: #111827; word-break: break-word; }
.parker-enquiry-pre      { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px; font-family: inherit; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow-y: auto; margin: 0; }

/* Status action buttons */
.parker-status-buttons   { display: flex; flex-wrap: wrap; gap: 6px; }
.parker-action-btn       { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid #d1d5db; background: #f9fafb; color: #374151; }
.parker-action-btn:hover { background: #f3f4f6; }
.parker-action-won       { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.parker-action-won:hover { background: #dcfce7; }
.parker-action-lost      { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.parker-action-lost:hover{ background: #fee2e2; }
.parker-action-reopen    { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

/* Table row hover */
.parker-row:hover td     { background: #f0f6ff; }

/* ============================================================
   FIELD SERVICE MANAGEMENT (BigChange module)
   ============================================================ */

/* --- Shared toolbar / filter bar (augment existing .module-toolbar) --- */
.module-toolbar  { flex-wrap: wrap; gap: 10px; }
.toolbar-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-select   { height: 32px; padding: 0 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; background: #fff; }
.filter-search   { height: 32px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; width: 200px; }

/* --- Alert banners --- */
.fsm-alert-banner {
    margin: 12px 24px 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.fsm-alert-red   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.fsm-alert-amber { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* --- Data tables --- */
.table-wrap      { overflow-x: auto; padding: 0 24px 24px; }
.data-table      { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th   { text-align: left; padding: 8px 10px; background: #f8fafc; border-bottom: 2px solid #e5e7eb; font-weight: 600; color: #374151; white-space: nowrap; }
.data-table td   { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; color: #374151; vertical-align: middle; }
.data-table tbody tr:hover td { background: #f8fafc; cursor: pointer; }

/* --- Status badges --- */
.fsm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}
.fsm-badge-raised    { background: #f3f4f6; color: #374151; }
.fsm-badge-scheduled { background: #dbeafe; color: #1e40af; }
.fsm-badge-en-route  { background: #fed7aa; color: #9a3412; }
.fsm-badge-on-site   { background: #dcfce7; color: #166534; }
.fsm-badge-completed { background: #ccfbf1; color: #0f766e; }
.fsm-badge-invoiced  { background: #ede9fe; color: #6d28d9; }
.fsm-badge-cancelled { background: #fee2e2; color: #b91c1c; }
.fsm-badge-active    { background: #dcfce7; color: #166534; }
.fsm-badge-expired   { background: #f3f4f6; color: #6b7280; }
.fsm-badge-pending-renewal { background: #fffbeb; color: #92400e; }
.fsm-badge-breakdown { background: #fef2f2; color: #b91c1c; }
.fsm-badge-planned-maintenance { background: #eff6ff; color: #1e40af; }
.fsm-badge-installation { background: #f0fdf4; color: #166534; }
.fsm-badge-survey    { background: #faf5ff; color: #7e22ce; }
.fsm-badge-yes       { background: #dcfce7; color: #166534; }
.fsm-badge-no        { background: #f3f4f6; color: #6b7280; }

/* Priority colouring in cells */
.fsm-priority-urgent { color: #b91c1c; font-weight: 700; }
.fsm-priority-high   { color: #d97706; font-weight: 600; }
.fsm-priority-medium { color: #374151; }
.fsm-priority-low    { color: #9ca3af; }

/* Service due colouring */
.fsm-due-overdue  { color: #b91c1c; font-weight: 700; }
.fsm-due-soon     { color: #d97706; font-weight: 600; }
.fsm-due-ok       { color: #166534; }

/* --- Engineer cards grid --- */
.fsm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px 24px;
}
.fsm-eng-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.fsm-eng-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
.fsm-eng-card-name  { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.fsm-eng-card-meta  { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.fsm-eng-card-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fsm-skill-tag { background: var(--brand-light); color: var(--brand); border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 600; text-transform: capitalize; }

/* --- Modal widths --- */
.fsm-modal-wide       { width: 860px; max-width: 96vw; }
.fsm-modal-fullscreen { width: 960px; max-width: 98vw; max-height: 95vh; display: flex; flex-direction: column; }
.fsm-modal-fullscreen .modal-body { flex: 1; overflow-y: auto; }

/* --- FSM form layout --- */
.fsm-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fsm-form-col  { display: flex; flex-direction: column; gap: 0; }

/* --- Linked section inside modal --- */
.fsm-linked-section {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.fsm-linked-header { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }

/* --- Status bar and action buttons inside job modal --- */
.fsm-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 14px;
    font-size: 13px;
    color: #6b7280;
}
.fsm-status-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fsm-status-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.fsm-status-btn:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }

/* --- Job body two-col layout --- */
.fsm-job-body { padding: 0 20px 8px; }

/* --- Checkboxes group --- */
.fsm-checkbox-group { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fsm-checkbox-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fsm-checkbox-group input[type="checkbox"] { width: 14px; height: 14px; }

/* --- Job sheet section dividers --- */
.fsm-sheet-section { padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.fsm-sheet-section:last-child { border-bottom: none; }
.fsm-sheet-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); margin-bottom: 10px; }

/* --- Parts row builder in job sheet --- */
.js-part-row { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.js-part-row input, .js-part-row select { height: 30px; padding: 0 6px; font-size: 12px; border: 1px solid #d1d5db; border-radius: 5px; }
.js-part-row .btn-remove { width: 24px; height: 24px; border: none; background: #fee2e2; color: #b91c1c; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; }

/* --- Schedule grid --- */
.schedule-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-bottom: 1px solid #e5e7eb;
}
.schedule-week-label { font-size: 15px; font-weight: 700; color: #111827; min-width: 200px; text-align: center; }
.schedule-grid {
    display: grid;
    overflow-x: auto;
    font-size: 12px;
}
.schedule-col-header { background: #f8fafc; padding: 8px; font-weight: 700; text-align: center; border-bottom: 2px solid #e5e7eb; border-right: 1px solid #e5e7eb; color: #374151; font-size: 12px; }
.schedule-engineer-label { padding: 6px 10px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; font-weight: 600; font-size: 12px; color: #374151; white-space: nowrap; }
.schedule-cell { padding: 4px; border-bottom: 1px solid #f0f0f0; border-right: 1px solid #e5e7eb; min-height: 48px; vertical-align: top; background: #fff; }
.schedule-job-chip {
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

/* --- Today screen FSM cards --- */
.fsm-today-section { padding: 0 24px 16px; }
.fsm-today-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9ca3af; margin: 16px 0 8px; }
.fsm-today-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.fsm-today-card {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.fsm-today-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.fsm-today-card-num  { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1; }
.fsm-today-card-label { font-size: 12px; color: #6b7280; margin-top: 4px; }
.fsm-today-card-sub   { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.fsm-today-card-urgent .fsm-today-card-num { color: #b91c1c; }
.fsm-today-card-warn  .fsm-today-card-num  { color: #d97706; }

/* ============================================================
   EXPENSES MODULE
   ============================================================ */
.exp-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.exp-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}
.exp-odo-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.exp-field-label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    gap: 5px;
}
.exp-input {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}
.exp-input:focus { border-color: var(--brand); }

/* Inline table cell inputs */
.exp-cell-input {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    color: var(--text);
    background: transparent;
    width: 100%;
    min-width: 0;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.exp-cell-input:focus,
.exp-cell-input:hover {
    border-color: var(--border);
    background: #f9fafb;
}
.exp-cell-wide { min-width: 110px; }
.exp-cell-num  { width: 70px; text-align: right; }

.exp-cell-select {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    color: var(--text);
    background: transparent;
    width: 100%;
    min-width: 80px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.exp-cell-select:focus,
.exp-cell-select:hover {
    border-color: var(--border);
    background: #f9fafb;
}
.exp-del-btn {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}
.exp-del-btn:hover { color: #ef4444; background: #fef2f2; }

#exp-journeys-table td,
#exp-costs-table td {
    padding: 3px 4px;
    vertical-align: middle;
}
