/* ============================================================
   Omega CRM — Modern UI
   ============================================================ */

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

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
    --primary:        #2563EB;
    --primary-hover:  #1D4ED8;
    --primary-light:  rgba(37, 99, 235, 0.1);
    --sidebar-width:  260px;
    --sidebar-bg:     #0F172A;
    --sidebar-text:   #94A3B8;
    --sidebar-text-active: #FFFFFF;
    --sidebar-muted:  #94A3B8;
    --sidebar-hover:  rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(37, 99, 235, 0.15);
    --text:           #0F172A;
    --text-muted:     #64748B;
    --text-light:     #94A3B8;
    --border:         #E2E8F0;
    --border-light:   #F1F5F9;
    --bg:             #F8FAFC;
    --bg-white:       #FFFFFF;
    --bg-subtle:      #F1F5F9;
    --radius:         8px;
    --radius-lg:      12px;
    --radius-xl:      16px;
    --shadow:         0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl:      0 20px 60px rgba(0, 0, 0, 0.15);
    --success:        #10B981;
    --success-bg:     #D1FAE5;
    --success-text:   #065F46;
    --warning:        #F59E0B;
    --warning-bg:     #FEF3C7;
    --warning-text:   #92400E;
    --danger:         #EF4444;
    --danger-bg:      #FEE2E2;
    --danger-text:    #991B1B;
    --info:           #3B82F6;
    --info-bg:        #DBEAFE;
    --info-text:      #1D4ED8;
    --surface:        #FFFFFF;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font: inherit;
    border: none;
    background: none;
}

input, select, textarea {
    font: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* ============================================================
   Layout
   ============================================================ */
#app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.sidebar-hidden {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    flex: 1;
}

.sidebar-close {
    display: none;
    color: var(--sidebar-muted);
    padding: 0.25rem;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.15s;
}

.sidebar-close:hover {
    color: #FFFFFF;
    background: var(--sidebar-hover);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-nav li + li {
    margin-top: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 16px;
    border-radius: 8px;
    margin: 2px 8px;
    color: var(--sidebar-muted);
    transition: all 0.15s ease;
    font-size: 13.5px;
    font-weight: 400;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #E2E8F0;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #FFFFFF;
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-link svg,
.nav-link i[data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-link.active svg,
.nav-link.active i[data-lucide] {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--sidebar-muted);
    font-size: 13.5px;
    transition: all 0.15s;
}

.sidebar-logout:hover {
    background: var(--sidebar-hover);
    color: #E2E8F0;
}

.sidebar-logout svg,
.sidebar-logout i[data-lucide] {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

/* ============================================================
   Sidebar section divider
   ============================================================ */
.nav-section {
    padding: 1.25rem 1rem 0.375rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-section span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.6);
}

/* ============================================================
   Hamburger toggle (mobile)
   ============================================================ */
#sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 300;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--sidebar-bg);
    color: #FFFFFF;
    box-shadow: var(--shadow-md);
}

#sidebar-toggle svg,
#sidebar-toggle i[data-lucide] {
    width: 20px;
    height: 20px;
    display: block;
}

/* ============================================================
   Sidebar overlay (mobile)
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================================
   Main content area
   ============================================================ */
#page-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* When sidebar is hidden (login page) remove the offset */
#sidebar.sidebar-hidden ~ #page-content,
#sidebar.sidebar-hidden + * + #page-content,
#sidebar.sidebar-hidden ~ .sidebar-overlay + * + #page-content {
    margin-left: 0;
}

/* ============================================================
   Page header
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================================
   Login page
   ============================================================ */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--sidebar-bg);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 2rem;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.login-card.card {
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-error {
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--danger-bg);
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    color: var(--danger-text);
    font-size: 13px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--bg-white);
    color: #374151;
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #CBD5E1;
}

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

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
    border-color: #DC2626;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn svg,
.btn i[data-lucide] {
    width: 16px;
    height: 16px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.4;
}

.btn-back:hover {
    color: var(--primary);
}

.btn-back svg {
    width: 0.9em;
    height: 0.9em;
    flex-shrink: 0;
}

/* ============================================================
   Badges / Pills
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #DC2626; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-yellow { background: #FEF9C3; color: #CA8A04; }

/* Status badges */
.badge-status-active   { background: #D1FAE5; color: #065F46; }
.badge-status-inactive { background: #FEE2E2; color: #991B1B; }
.badge-status-prospect { background: #DBEAFE; color: #1E40AF; }
.badge-status-dnc      { background: #F3F4F6; color: #374151; }

/* Role badges */
.badge-role-admin  { background: #EDE9FE; color: #5B21B6; }
.badge-role-staff  { background: #DBEAFE; color: #1E40AF; }
.badge-role-driver { background: #FEF3C7; color: #92400E; }

/* Campaign badges */
.badge-draft     { background: #F3F4F6; color: #6B7280; border: 1px solid #E5E7EB; }
.badge-scheduled { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-sending   { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-sent      { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.badge-email     { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }
.badge-sms       { background: #FDF2F8; color: #9D174D; border: 1px solid #FBCFE8; }

.cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* ============================================================
   Toast notifications
   ============================================================ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    max-width: 360px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary); }
.toast-warning { background: var(--warning); }

/* ============================================================
   Utility
   ============================================================ */
.hidden {
    display: none !important;
}

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

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.required {
    color: var(--danger);
    margin-left: 2px;
}

.req {
    color: var(--danger);
    margin-left: 2px;
}

.code {
    font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-search {
    flex: 1 1 220px;
    min-width: 160px;
}

.filter-select {
    flex: 0 0 auto;
    min-width: 140px;
}

.filter-input {
    flex: 1 1 180px;
    min-width: 140px;
}

.filter-btn {
    flex-shrink: 0;
}

/* ============================================================
   Data table
   ============================================================ */
.table-scroll,
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-white);
    box-shadow: var(--shadow);
}

.table-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.data-table th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.data-table tbody tr {
    background: var(--bg-white);
    transition: background 0.1s;
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.row-link {
    cursor: pointer;
}

.row-link:hover td:first-child {
    color: var(--primary);
}

.td-email {
    color: var(--primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 200px;
}

.td-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.action-col {
    width: 80px;
    white-space: nowrap;
    text-align: right;
}

.action-col .btn + .btn,
.action-col .btn + .in-use-hint {
    margin-left: 4px;
}

.actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
    align-items: center;
}

/* ============================================================
   Loading and empty states
   ============================================================ */
.loading-state {
    padding: 2rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 3rem auto;
}

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

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 1rem 0 0.5rem;
    flex-wrap: wrap;
}

.pg-btn,
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.pg-btn:hover:not(:disabled):not(.active),
.page-btn:hover:not(:disabled):not(.active) {
    background: var(--bg);
    border-color: #CBD5E1;
}

.pg-btn.active,
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.pg-btn:disabled,
.pg-btn-disabled,
.page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 14px;
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.modal-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 1rem;
}

.modal-wide,
.modal.modal-wide {
    max-width: 720px;
}

/* ============================================================
   Planner Log Contact modal — wrapping pill pickers + layout
   (NEW, minimal. Replaces the clipping .tabs/.tab-btn used for the
   Outcome & Contact-Frequency selectors so every option WRAPS and
   stays fully visible/selectable, incl. Seasonal. Presentation only.)
   ============================================================ */
.lc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.lc-pill {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: var(--bg-white);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.lc-pill:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.lc-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.lc-twocol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .lc-twocol { grid-template-columns: 1fr; }
}

.lc-panel {
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.lc-panel-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.lc-disclosure { margin-bottom: 1rem; }

.lc-disclosure > summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    list-style: none;
}

.lc-disclosure > summary::-webkit-details-marker { display: none; }
.lc-disclosure > summary::before        { content: '\25B8  '; }
.lc-disclosure[open] > summary::before  { content: '\25BE  '; }

/* ============================================================
   Form helpers
   ============================================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.chk-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
}

.chk-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chk-label {
    font-size: 14px;
    cursor: pointer;
}

.seasons-picker {
    margin-top: -6px;
    margin-bottom: 4px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.seasons-picker .form-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

/* ============================================================
   Customer detail layout
   ============================================================ */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

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

.detail-aside {
    position: sticky;
    top: 1rem;
}

.detail-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.detail-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.detail-company {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 1rem;
}

.detail-header {
    margin-bottom: 1.5rem;
}

.detail-content {
    margin-bottom: 1.5rem;
}

.detail-btn-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================================
   Tabs
   ============================================================ */
.card-tabs {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tabs,
.detail-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
}

.tabs::-webkit-scrollbar,
.detail-tabs::-webkit-scrollbar {
    display: none;               /* Chrome/Safari */
}

.tab-btn {
    padding: 12px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
    padding: 1.25rem;
}

.tab-panel.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
}

/* ============================================================
   Overview grid
   ============================================================ */
.ov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .ov-grid {
        grid-template-columns: 1fr;
    }
}

.ov-full {
    grid-column: 1 / -1;
}

.ov-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.ov-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 6px;
    font-size: 14px;
}

.ov-label {
    flex: 0 0 110px;
    color: var(--text-muted);
    font-size: 13px;
}

.ov-value {
    flex: 1;
    word-break: break-word;
    font-weight: 500;
}

/* ============================================================
   Summary card (aside)
   ============================================================ */
.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.sc-spend {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.sc-spend-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.sc-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    gap: 0.5rem;
}

.sc-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.sc-value {
    font-weight: 500;
    text-align: right;
}

/* ============================================================
   Misc detail helpers
   ============================================================ */
.notes-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.stub-panel {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================
   Password field with show/hide toggle
   ============================================================ */
.input-with-toggle {
    display: flex;
    align-items: stretch;
}

.input-with-toggle .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.pw-toggle {
    padding: 0 12px;
    border: 1px solid #D1D5DB;
    border-left: none;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.pw-toggle:hover {
    background: var(--border);
    color: var(--text);
}

/* ============================================================
   Field hint (below inputs)
   ============================================================ */
.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   Temp-password display box
   ============================================================ */
.temp-password-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    background: #EFF6FF;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    text-align: center;
    user-select: all;
    color: var(--primary);
}

/* ============================================================
   Settings page
   ============================================================ */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 760px;
}

.settings-section {
    /* inherits from .card */
}

.settings-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-section-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}

@media (max-width: 600px) {
    .settings-grid { grid-template-columns: 1fr; }
}

.settings-inline-result {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-top: 1rem;
}

.settings-inline-result.hidden { display: none; }

.settings-inline-result.result-success {
    background: #ECFDF5;
    color: var(--success-text);
    border: 1px solid #A7F3D0;
}

.settings-inline-result.result-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #FECACA;
}

/* Settings notice (info bar at top of a section) */
.settings-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 4px;
}

.settings-notice i {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.settings-notice code {
    font-family: monospace;
    font-size: 12px;
    background: rgba(37, 99, 235, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Integration items — rows inside the Integrations card */
.integration-list {
    margin-top: 4px;
}

.integration-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.integration-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.integration-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    min-width: 140px;
    padding-top: 5px; /* vertically centre against btn-sm height */
    flex-shrink: 0;
}

.integration-item-label i {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.integration-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.integration-item-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.integration-result {
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    line-height: 1.4;
}

.integration-result.hidden { display: none; }

.integration-result.result-success { color: var(--success-text); }

.integration-result.result-error   { color: var(--danger-text); }


@media (max-width: 500px) {
    .integration-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .integration-item-actions {
        align-items: flex-start;
        width: 100%;
    }
    .integration-item-buttons {
        justify-content: flex-start;
    }
    .integration-result {
        text-align: left;
    }
}

/* Sync status grid */
.sync-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 500px) {
    .sync-status-grid { grid-template-columns: 1fr; }
}

.sync-status-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sync-status-value {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

.sync-not-configured {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.sync-not-configured i {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

/* ============================================================
   Activity timeline
   ============================================================ */
.timeline {
    padding: 12px 16px;
}

.tl-entry {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.tl-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: #6B7280;
    margin-top: 2px;
}

.tl-icon i { width: 16px; height: 16px; }

/* Per-type icon colours */
.tl-type-call           .tl-icon { background: #EFF6FF; color: #3B82F6; }
.tl-type-email          .tl-icon { background: #EFF6FF; color: #3B82F6; }
.tl-type-sms            .tl-icon { background: #EFF6FF; color: #3B82F6; }
.tl-type-visit          .tl-icon { background: #F5F3FF; color: #8B5CF6; }
.tl-type-note           .tl-icon { background: #F3F4F6; color: #6B7280; }
.tl-type-quote          .tl-icon { background: #FFF7ED; color: #F59E0B; }
.tl-type-follow-up      .tl-icon { background: #FFFBEB; color: #D97706; }
.tl-type-follow-up-done .tl-icon { background: #ECFDF5; color: #10B981; }
.tl-type-order          .tl-icon { background: #ECFDF5; color: #059669; }
.tl-type-status-change  .tl-icon { background: #F3F4F6; color: #6B7280; }

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

.tl-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.tl-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

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

.tl-date {
    font-size: 12px;
    color: var(--text-light);
    margin-left: auto;
    white-space: nowrap;
}

.tl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.tl-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.tl-badge-outcome { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.tl-badge-due     { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.tl-badge-done    { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }

.tl-content {
    font-size: 14px;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.load-more-wrap {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.tl-campaign-badge {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 999px;
    background: #DBEAFE;
    color: #1E40AF;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.tl-campaign-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.tl-campaign-link:hover {
    text-decoration: underline;
}

/* ============================================================
   Files grid
   ============================================================ */
.files-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
}

@media (max-width: 768px) {
    .files-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .files-grid { grid-template-columns: 1fr; }
}

.file-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-white);
    transition: all 0.2s;
}

.file-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.file-icon {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.file-icon i { width: 24px; height: 24px; }

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.file-cat-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}

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

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

.file-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

/* Upload progress */
.upload-progress {
    height: 6px;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.upload-progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 9999px;
    transition: width 0.1s linear;
}

.upload-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ============================================================
   DAILY PLANNER
   ============================================================ */
.planner-date { margin-top: 2px; }

/* Summary bar */
.planner-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    font-size: 14px;
    box-shadow: var(--shadow);
}

.ps-item        { color: var(--text-muted); }
.ps-item strong { color: var(--text); }
.ps-sep         { color: var(--border); }

.ps-overdue   strong { color: #DC2626; }
.ps-today     strong { color: #2563EB; }
.ps-checkins  strong { color: #16A34A; }
.ps-call      strong { color: #16A34A; }
.ps-dormant   strong { color: #D97706; }
.ps-prospects strong { color: #7C3AED; }

/* Section container */
.planner-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.planner-section:hover {
    box-shadow: var(--shadow-md);
}

.planner-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}

.planner-section-header:hover {
    background: var(--bg);
}

/* Accent left border per section */
.planner-section-overdue   .planner-section-header { border-left: 4px solid #DC2626; }
.planner-section-today     .planner-section-header { border-left: 4px solid #2563EB; }
.planner-section-checkins  .planner-section-header { border-left: 4px solid #16A34A; }
.planner-section-call      .planner-section-header { border-left: 4px solid #16A34A; }
.planner-section-dormant   .planner-section-header { border-left: 4px solid #D97706; }
.planner-section-large     .planner-section-header { border-left: 4px solid #0D9488; }
.planner-section-prospects .planner-section-header { border-left: 4px solid #7C3AED; }

.planner-section-title {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    color: var(--text);
}

.planner-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-subtle);
    color: #374151;
}

/* Accent badge colours */
.planner-section-overdue   .planner-count-badge { background: #FEE2E2; color: #991B1B; }
.planner-section-today     .planner-count-badge { background: #DBEAFE; color: #1D4ED8; }
.planner-section-checkins  .planner-count-badge { background: #DCFCE7; color: #166534; }
.planner-section-call      .planner-count-badge { background: #DCFCE7; color: #166534; }
.planner-section-dormant   .planner-count-badge { background: #FEF3C7; color: #92400E; }
.planner-section-large     .planner-count-badge { background: #CCFBF1; color: #115E59; }
.planner-section-prospects .planner-count-badge { background: #EDE9FE; color: #5B21B6; }

.planner-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.planner-toggle i { width: 16px; height: 16px; }

.planner-section-body { padding: 4px 0; }

.planner-empty {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Planner card */
.planner-card {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s;
}

.planner-card:hover {
    background: var(--bg);
    transform: translateY(-1px);
}

.planner-card:last-child { border-bottom: none; }

.planner-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.planner-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--primary);
    text-decoration: none;
}

.planner-card-name:hover { text-decoration: underline; }

.planner-card-company {
    font-size: 13px;
    color: var(--text-muted);
}

.planner-overdue-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.planner-card-notes {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Follow-up section: distinguish an existing Customer from a Prospect at a
   glance via a coloured left border (textual badges added in JS too). */
.planner-card-cust { border-left: 4px solid var(--primary); }
.planner-card-prosp { border-left: 4px solid var(--warning); }

.planner-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.planner-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.planner-phone {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.planner-phone:hover { text-decoration: underline; }

.planner-last-contact,
.planner-dormant-info { color: var(--text-muted); }

.planner-freq-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.planner-freq-none {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-color: var(--border);
}

.planner-prospect-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: #EDE9FE;
    color: #5B21B6;
    border: 1px solid #DDD6FE;
}

.planner-order-total {
    font-weight: 600;
    color: #0D9488;
    font-size: 14px;
}

.planner-thankyou {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    background: #CCFBF1;
    color: #115E59;
    border: 1px solid #99F6E4;
}

.planner-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Inline action forms */
.inline-action { margin-top: 10px; }

.inline-action-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ia-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.inline-action-btns {
    display: flex;
    gap: 8px;
}

.sf-seasons {
    padding-top: 6px;
}

/* ============================================================
   Campaign stats grid
   ============================================================ */
.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Stat cards (shared: dashboard, campaigns, reports)
   ============================================================ */
.stat-cards-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.stat-card {
    flex: 1 1 140px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.2s;
}

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

.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}

.stat-card-link:hover { border-color: var(--primary); }

.stat-card-overdue {
    border-color: var(--danger);
    background: #FFF5F5;
}

.stat-card-overdue .stat-value { color: var(--danger); }

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-pct {
    font-size: 13px;
    color: var(--primary);
    margin-top: 3px;
    font-weight: 600;
}

/* ============================================================
   Campaign wizard steps
   ============================================================ */
.modal-steps {
    display: flex;
    align-items: center;
    padding: 16px 24px 0;
    gap: 0;
}

.modal-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-step:last-child { flex: none; }

.modal-step .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.modal-step.active .step-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.modal-step.done .step-num {
    background: var(--success);
    color: #fff;
}

.modal-step.active .step-label { color: var(--text); font-weight: 600; }
.modal-step.done  .step-label  { color: var(--success); }

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    border-radius: 1px;
}

.step-connector.done { background: var(--success); }

/* Audience filter builder */
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 540px) {
    .filter-row { grid-template-columns: 1fr; }
}

.audience-estimate {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-muted);
}

.audience-estimate strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* SMS counter */
.sms-counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.sms-counter.warn  { color: #D97706; }
.sms-counter.error { color: var(--danger); }

/* Content preview */
.content-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.content-preview.html-preview {
    white-space: normal;
}

/* Review summary list */
.review-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.review-list li {
    display: flex;
    gap: 8px;
}

.review-list .rl-label {
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
}

/* Quill editor sizing */
.ql-container { font-size: 14px; }
.ql-editor    { min-height: 200px; max-height: 320px; overflow-y: auto; }

/* ============================================================
   Tag picker
   ============================================================ */
.tag-picker {
    position: relative;
}

.tag-picker-search {
    width: 100%;
}

.tag-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 120;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 180px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.tag-picker-option {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.1s;
}

.tag-picker-option:hover { background: var(--bg); }

.tag-picker-empty {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.tag-picker-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 26px;
}

.tag-picker-placeholder {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.75;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 10px;
    background: var(--primary);
    color: #fff;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.tag-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.12s;
}

.tag-pill-remove:hover { background: rgba(255, 255, 255, 0.45); }

/* ============================================================
   Email preview modal
   ============================================================ */
.content-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.email-preview-modal {
    max-width: 680px;
}

.email-preview-body-wrap {
    background: #F0F0F0;
    padding: 24px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

.email-preview-body {
    background: #FFFFFF;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.email-preview-body h1 { font-size: 1.5rem; font-weight: 700; margin: 12px 0; }
.email-preview-body h2 { font-size: 1.25rem; font-weight: 600; margin: 12px 0; }
.email-preview-body p  { margin: 8px 0; }
.email-preview-body ul,
.email-preview-body ol { padding-left: 24px; margin: 8px 0; }
.email-preview-body a  { color: var(--primary); }
.email-preview-body img { max-width: 100%; height: auto; }

/* ============================================================
   One-to-one messaging modals
   ============================================================ */
.merge-btns-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.merge-btns-label {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.source-textarea {
    width: 100%;
    min-height: 300px;
    font-family: 'Consolas', 'Menlo', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}

.source-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================================
   Dashboard & Reports
   ============================================================ */

/* Dashboard grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-span-2 { grid-column: 1 !important; }
}

.dash-span-2 {
    grid-column: 1 / -1;
}

.dash-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}

.dash-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

/* Revenue panel */
.revenue-panel {
    display: flex;
    align-items: stretch;
    gap: 1.5rem;
}

.revenue-block { flex: 1; }
.revenue-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.revenue-amount { font-size: 28px; font-weight: 700; color: var(--primary); }
.revenue-orders { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.revenue-change { font-size: 13px; margin-top: 6px; }
.revenue-change-up   { color: var(--success); }
.revenue-change-down { color: var(--danger); }
.revenue-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
    flex-shrink: 0;
}

/* Team table */
.team-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.team-table th,
.team-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.team-table th { font-weight: 600; color: var(--text-muted); font-size: 12px; }
.team-table tr:last-child td { border-bottom: none; }
.ta-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Dormant alert card */
.dormant-alert {
    border-color: var(--warning);
    background: #FFFBEB;
}

/* Storage bar */
.storage-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.storage-bar-fill.storage-bar-alert {
    background: var(--danger);
}

/* Chart container */
.chart-container {
    position: relative;
    height: 240px;
}

/* Activity feed (dashboard) */
.activity-feed { display: flex; flex-direction: column; gap: 10px; }

.activity-feed-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.activity-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.activity-icon--call   { background: #EFF6FF; color: #3B82F6; }
.activity-icon--email  { background: #EFF6FF; color: #3B82F6; }
.activity-icon--sms    { background: #EFF6FF; color: #3B82F6; }
.activity-icon--visit  { background: #F5F3FF; color: #8B5CF6; }
.activity-icon--note   { background: #F3F4F6; color: #6B7280; }
.activity-icon--order  { background: #ECFDF5; color: #059669; }

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

.activity-feed-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}

.activity-feed-content {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category colour dot */
.category-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================================
   Campaign / generic detail card
   ============================================================ */
.detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.detail-card-body {
    padding: 16px 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 12px;
    font-size: 14px;
}

.detail-grid dt {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-grid dd {
    color: var(--text);
    word-break: break-word;
}

/* ============================================================
   Categories & Tags page
   ============================================================ */
.two-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 860px) {
    .two-panel-grid { grid-template-columns: 1fr; }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.colour-pill {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    vertical-align: middle;
    flex-shrink: 0;
}

.colour-input {
    width: 2.5rem;
    height: 2.25rem;
    padding: 2px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: none;
}

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

.archived-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    transition: color 0.15s;
}

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

.archived-chevron {
    transition: transform 0.2s;
}

.in-use-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    padding: 3px 6px;
    cursor: default;
    color: var(--text-muted);
}

/* ============================================================
   Reports page
   ============================================================ */
.report-tabs-wrap { margin-bottom: 1rem; }

.report-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.report-tab {
    padding: 8px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    border-radius: var(--radius) var(--radius) 0 0;
}

.report-tab:hover { color: var(--text); }

.report-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.report-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.report-body,
.report-filter-body {
    /* container for report content */
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ============================================================
   Prospects — source badges
   ============================================================ */
.prospect-source-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.prospect-source-manual   { background: #E5E7EB; color: #374151; }
.prospect-source-csv      { background: #DBEAFE; color: #1D4ED8; }
.prospect-source-linkedin { background: #EDE9FE; color: #6D28D9; }
.prospect-source-referral { background: #D1FAE5; color: #065F46; }
.prospect-source-coldcall { background: #FEF3C7; color: #92400E; }
.prospect-source-other    { background: #E5E7EB; color: #374151; }

/* ============================================================
   Prospects — import results panel
   ============================================================ */
.import-results {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.import-summary {
    display: flex;
    gap: 1.5rem;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.import-ok    { color: var(--success-text); font-weight: 600; }
.import-skip  { color: var(--warning-text); font-weight: 600; }
.import-error { color: var(--danger-text); font-weight: 600; }

.import-error-list {
    list-style: none;
    margin: 0;
    padding: 8px 16px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.import-error-list li {
    padding: 3px 0;
    border-bottom: 1px solid var(--border-light);
}

.import-error-list li:last-child {
    border-bottom: none;
}

/* ============================================================
   Dropdown menu
   ============================================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 190px;
    z-index: 200;
    overflow: hidden;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.12s;
}

.dropdown-item:hover {
    background: var(--bg);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: var(--danger-bg);
}

/* ============================================================
   Audit Log page
   ============================================================ */
.al-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.al-wrap {
    /* container */
}

.al-action {
    font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.al-dt {
    white-space: nowrap;
    font-size: 13px;
}

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

.al-table {
    font-size: 14px;
}

/* Changes diff */
.diff-details summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--primary);
    user-select: none;
    padding: 2px 0;
    font-weight: 500;
}

.diff-details summary:hover {
    text-decoration: underline;
}

.diff-table {
    margin-top: 8px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.diff-table th,
.diff-table td {
    padding: 3px 8px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.diff-table th {
    background: var(--bg);
    font-weight: 600;
}

.diff-field { color: var(--text-muted); font-style: italic; }
.diff-old   { color: #991B1B; text-decoration: line-through; }
.diff-new   { color: #065F46; }
.diff-arrow { color: var(--text-muted); text-align: center; }

/* ============================================================
   User management: card grid layout
   ============================================================ */
.user-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

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

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

.user-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.user-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.user-card-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-card-email {
    font-size: 14px;
    color: var(--text-muted);
    word-break: break-all;
}

.user-card-login {
    font-size: 13px;
    color: var(--text-light);
}

.user-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.user-card-actions .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
}

/* ============================================================
   Select element: custom dropdown arrow (cross-browser)
   ============================================================ */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

/* ============================================================
   Responsive — below 768px
   ============================================================ */
@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%);
        display: flex;
    }

    #sidebar.sidebar-hidden {
        display: none;
    }

    #sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

    #sidebar-toggle {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    #page-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 56px;
        min-width: 0;
        overflow-x: hidden;
    }

    /* Customer list table: hide less-important columns */
    #customers-wrap .data-table th:nth-child(3),
    #customers-wrap .data-table td:nth-child(3),
    #customers-wrap .data-table th:nth-child(4),
    #customers-wrap .data-table td:nth-child(4),
    #customers-wrap .data-table th:nth-child(6),
    #customers-wrap .data-table td:nth-child(6),
    #customers-wrap .data-table th:nth-child(7),
    #customers-wrap .data-table td:nth-child(7),
    #customers-wrap .data-table th:nth-child(8),
    #customers-wrap .data-table td:nth-child(8) {
        display: none;
    }

    /* Stat cards: 2-col grid on mobile */
    .stat-cards-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal: full-screen on mobile */
    .modal-overlay {
        padding: 0;
        align-items: stretch;
        backdrop-filter: none;
    }

    .modal {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    /* Audit log filter bar: stack vertically */
    .al-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .al-filter-bar > * {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Hide IP column on mobile audit log */
    .al-table th:last-child,
    .al-table td:last-child {
        display: none;
    }

    /* Also hide Entity ID column */
    .al-table th:nth-child(5),
    .al-table td:nth-child(5) {
        display: none;
    }

    /* Prospects table: hide secondary columns */
    #p-list-wrap .data-table th:nth-child(2),
    #p-list-wrap .data-table td:nth-child(2),
    #p-list-wrap .data-table th:nth-child(4),
    #p-list-wrap .data-table td:nth-child(4),
    #p-list-wrap .data-table th:nth-child(6),
    #p-list-wrap .data-table td:nth-child(6),
    #p-list-wrap .data-table th:nth-child(7),
    #p-list-wrap .data-table td:nth-child(7) {
        display: none;
    }

    /* Campaigns list table: hide secondary columns */
    #campaigns-list-wrap .data-table th:nth-child(4),
    #campaigns-list-wrap .data-table td:nth-child(4),
    #campaigns-list-wrap .data-table th:nth-child(5),
    #campaigns-list-wrap .data-table td:nth-child(5),
    #campaigns-list-wrap .data-table th:nth-child(6),
    #campaigns-list-wrap .data-table td:nth-child(6) {
        display: none;
    }

    /* Campaign results table: hide Opened/Clicked columns */
    #recipients-table-wrap .data-table th:nth-child(5),
    #recipients-table-wrap .data-table td:nth-child(5),
    #recipients-table-wrap .data-table th:nth-child(6),
    #recipients-table-wrap .data-table td:nth-child(6) {
        display: none;
    }

    /* Users table: hide Last Login and wrap actions */
    #users-wrap .data-table th:nth-child(5),
    #users-wrap .data-table td:nth-child(5) {
        display: none;
    }

    #users-wrap .td-actions {
        flex-wrap: wrap;
        white-space: normal;
    }

    #users-wrap .data-table .td-email {
        word-break: break-all;
    }

    /* Categories table: hide Sort column */
    #cats-panel .data-table th:nth-child(3),
    #cats-panel .data-table td:nth-child(3) {
        display: none;
    }
}

/* Stat cards: 1-col on very small screens */
@media (max-width: 400px) {
    .stat-cards-row {
        grid-template-columns: 1fr;
    }
}

/* Planner cards: actions stack on narrow screens */
@media (max-width: 540px) {
    .planner-card-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .planner-card-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Campaign wizard: hide step labels */
    .modal-step .step-label {
        display: none;
    }
}

/* Reports: tabs scroll + filter bar stacks */
@media (max-width: 600px) {
    .report-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .report-tabs .tab-btn {
        white-space: nowrap;
    }

    /* Prospects filter bar: stack */
    #p-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    #p-filter-bar .form-control,
    #p-filter-bar .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .report-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .report-filter-bar .form-control,
    .report-filter-bar .btn {
        width: 100%;
    }
}

/* ============================================================
   Orders tab
   ============================================================ */

.order-summary-bar {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.order-summary-item {
    flex: 1;
    padding: 12px 16px;
    border-right: 1px solid var(--border);
}

.order-summary-item:last-child {
    border-right: none;
}

.order-summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.order-summary-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.order-summary-spend {
    font-size: 20px;
    color: var(--primary);
}

.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
}

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

.order-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.order-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.order-card-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.order-card-actions {
    display: flex;
    gap: 6px;
}

.order-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.order-source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.order-source-woo {
    background: #0d908620;
    color: #0d9086;
    border: 1px solid #0d908640;
}

.order-source-manual {
    background: var(--border-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.order-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.order-status-completed  { background: #d1fae5; color: #065f46; }
.order-status-processing { background: #dbeafe; color: #1e40af; }
.order-status-pending    { background: #fef3c7; color: #92400e; }
.order-status-refunded   { background: #f3f4f6; color: #374151; }
.order-status-cancelled  { background: #fee2e2; color: #991b1b; }

.order-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-meta-sep {
    color: var(--border);
}

.order-notes {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

.line-items-section {
    margin-top: 8px;
}

.line-items-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.line-items-toggle i {
    width: 14px;
    height: 14px;
}

.line-items-body {
    margin-top: 8px;
}

.line-items-body.hidden {
    display: none;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.line-items-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid var(--border);
}

.line-items-table td {
    padding: 5px 8px 5px 0;
    color: var(--text);
    vertical-align: top;
}

.line-items-table td:nth-child(2),
.line-items-table td:nth-child(3),
.line-items-table td:nth-child(4) {
    text-align: right;
}

/* Add Order modal — line items form table */

.line-items-form-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 4px;
}

.line-items-form-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 4px 6px 6px 0;
    border-bottom: 1px solid var(--border);
}

.line-item-row td {
    padding: 4px 6px 4px 0;
    vertical-align: middle;
}

.line-item-row .li-del-btn {
    padding: 3px 7px;
}

.order-running-total {
    text-align: right;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.order-running-total strong {
    color: var(--text);
    font-size: 16px;
}

@media (max-width: 500px) {
    .order-summary-bar {
        flex-direction: column;
    }
    .order-summary-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .order-summary-item:last-child {
        border-bottom: none;
    }
    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   Delivery Calendar -- Phase 9
   ============================================================ */

.delivery-calendar { padding: 0 2rem 2rem; }

/* Toolbar */
.cal-toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.delivery-view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.delivery-view-toggle .vtab { padding: 6px 14px; font-size: 0.8125rem; font-weight: 500; border: none; background: var(--bg-white); color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; border-right: 1px solid var(--border); }
.delivery-view-toggle .vtab:last-child { border-right: none; }
.delivery-view-toggle .vtab.active { background: var(--primary); color: #fff; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .btn-nav { padding: 6px 10px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text); font-size: 0.875rem; transition: background 0.15s; }
.cal-nav .btn-nav:hover { background: var(--bg-subtle); }
.cal-nav .cal-period { font-weight: 600; font-size: 0.9375rem; min-width: 160px; text-align: center; color: var(--text); }

/* Day View */
.cal-day-view { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cal-slot-col { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-slot-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.cal-slot-header-left { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.875rem; }
.cal-capacity-badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 20px; background: var(--primary-light); color: var(--primary); font-weight: 500; }
.cal-capacity-badge.full { background: #fee2e2; color: #991b1b; }
.cal-slot-col.cal-slot-full .cal-slot-header { background: #fff5f5; }
.cal-slot-col.cal-slot-unavailable { opacity: 0.55; }
.cal-slot-col.cal-slot-unavailable .cal-slot-header { background: #f3f4f6; }
.cal-slot-unavailable-msg { padding: 1rem; color: var(--text-muted); font-size: 0.8125rem; font-style: italic; }
.cal-slot-body { padding: 10px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.cal-slot-add { margin-top: auto; padding-top: 8px; }

/* Delivery Card */
.delivery-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.delivery-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.delivery-card-name { font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 2px; }
.delivery-card-company { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.delivery-card-meta { font-size: 0.775rem; color: var(--text-muted); line-height: 1.5; }
.delivery-card-meta a { color: var(--primary); text-decoration: none; }
.delivery-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.delivery-card-vehicle { font-size: 0.75rem; color: var(--text-muted); }

/* Status Badges */
.delivery-status-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.delivery-status-scheduled        { background: #dbeafe; color: #1e40af; }
.delivery-status-out_for_delivery { background: #fef3c7; color: #92400e; }
.delivery-status-delivered        { background: #d1fae5; color: #065f46; }
.delivery-status-failed           { background: #fee2e2; color: #991b1b; }
.delivery-status-cancelled        { background: #f3f4f6; color: #6b7280; }

/* Week View */
.cal-week-view { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week-day { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; min-height: 120px; }
.cal-week-day:hover { box-shadow: var(--shadow-md); }
.cal-week-day.delivery-day { border-color: #bfdbfe; background: #f0f7ff; }
.cal-week-day-inactive { background: var(--bg-subtle); opacity: 0.6; cursor: default; }
.cal-week-day-inactive:hover { box-shadow: none; }
.cal-week-day-header { padding: 8px 10px 6px; border-bottom: 1px solid var(--border); }
.cal-week-day-name { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.cal-week-day-num { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.cal-week-day-num.today { color: var(--primary); }
.cal-week-slots { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-week-slot-row { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.cal-week-slot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.cal-week-slot-dot.full { background: #ef4444; }
.cal-week-mini-cards { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-week-mini-card { padding: 3px 6px; border-radius: 4px; background: #f0f7ff; font-size: 0.72rem; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-week-mini-card:hover { background: #dbeafe; }

/* Month View */
.cal-month-view { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-month-header-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.cal-month-dow { padding: 8px 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); text-align: center; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 8px; min-height: 76px; cursor: pointer; transition: background 0.12s; }
.cal-month-cell:nth-child(7n) { border-right: none; }
.cal-month-cell:hover { background: #f0f7ff; }
.cal-month-cell.other-month { background: var(--bg-subtle); cursor: default; opacity: 0.5; }
.cal-month-cell.other-month:hover { background: var(--bg-subtle); }
.cal-month-cell.today { background: #eff6ff; }
.cal-month-cell.delivery-day { border-top: 2px solid #bfdbfe; }
.cal-month-cell-num { font-size: 0.8125rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cal-month-cell.today .cal-month-cell-num { color: var(--primary); }
.cal-month-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-month-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.cal-month-dot.am   { background: #2563eb; }
.cal-month-dot.pm   { background: #7c3aed; }
.cal-month-dot.full { background: #ef4444; }
.cal-month-count { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Delivery Detail Modal */
.delivery-detail-section { margin-bottom: 1rem; }
.delivery-detail-section h4 { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.delivery-detail-row { display: flex; gap: 8px; font-size: 0.875rem; margin-bottom: 4px; }
.delivery-detail-label { color: var(--text-muted); min-width: 110px; flex-shrink: 0; }
.delivery-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.delivery-failed-reason { width: 100%; margin-top: 8px; }

/* Customer Overview Delivery Section */
.cust-deliveries-section { margin-top: 1rem; }
.cust-deliveries-section h3 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.cust-delivery-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 0.8125rem; }
.cust-delivery-item:last-child { border-bottom: none; }
.cust-delivery-item-date { font-weight: 600; color: var(--text); min-width: 80px; }
.cust-delivery-item-slot { color: var(--text-muted); font-size: 0.775rem; }
.cust-delivery-item-products { color: var(--text-muted); font-size: 0.775rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings delivery days checkboxes */
.delivery-days-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.delivery-days-row label { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.8125rem; font-weight: 500; transition: background 0.12s, border-color 0.12s; }

@media (max-width: 900px) { .cal-week-view { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
    .cal-day-view { grid-template-columns: 1fr; }
    .cal-week-view { grid-template-columns: repeat(2, 1fr); }
    .delivery-calendar { padding: 0 1rem 1.5rem; }
}

/* Hide the reCAPTCHA badge inside the CRM app — it is only needed on the public
   sign-up form which loads its own stylesheet. */
.grecaptcha-badge { display: none !important; }

/* ============================================================
   Driver Dashboard — mobile-first delivery view
   ============================================================ */

/* Page wrapper — constrained width, centred, comfortable mobile padding */
.driver-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.driver-page-header {
    margin-bottom: 20px;
}

.driver-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 2px;
}

.driver-page-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Delivery card ────────────────────────────────────────── */
.driver-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

/* Header row: name/company on left, status badge on right */
.driver-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.driver-card-identity {
    flex: 1;
    min-width: 0;
}

.driver-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-card-company {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Slot badge: morning (amber) / afternoon (indigo) */
.driver-slot-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.driver-slot-badge i { width: 13px; height: 13px; }

.driver-slot-morning {
    background: #FEF3C7;
    color: #92400E;
}

.driver-slot-afternoon {
    background: #EDE9FE;
    color: #5B21B6;
}

.driver-slot-date {
    font-weight: 400;
}

/* Phone button — full-width, prominent, green */
.driver-phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: #10B981;
    color: #fff;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 12px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.driver-phone-btn:hover { background: #059669; color: #fff; }
.driver-phone-btn i { width: 18px; height: 18px; flex-shrink: 0; }

/* Address block */
.driver-card-address {
    background: var(--bg-subtle);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.driver-card-address-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.driver-card-address-label i { width: 12px; height: 12px; }

.driver-card-address-lines {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.55;
}

/* Products / items row */
.driver-card-products {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text);
}

.driver-card-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.driver-card-label i { width: 12px; height: 12px; }

.driver-card-products-text {
    color: var(--text);
    line-height: 1.4;
}

/* Notes box — amber tint */
.driver-card-notes {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #78350F;
    line-height: 1.45;
}

.driver-card-notes i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

/* Failed reason box — red tint */
.driver-card-failed {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: var(--danger-bg);
    border: 1px solid #FCA5A5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: var(--danger-text);
    line-height: 1.45;
}

.driver-card-failed i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

/* ── Action area ──────────────────────────────────────────── */
.driver-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.driver-action-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Base driver button — full width, large tap target */
.driver-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, filter 0.15s;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.driver-btn:active { filter: brightness(0.92); }
.driver-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.driver-btn i { width: 17px; height: 17px; flex-shrink: 0; }

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

.driver-btn-success   { background: #10B981; color: #fff; }
.driver-btn-success:hover { background: #059669; }

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

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

/* Inline fail form */
.driver-fail-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-fail-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Driver Called checkbox row */
.driver-called-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 2px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
}

.driver-called-chk {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.driver-called-label-text {
    font-weight: 500;
    flex: 1;
}

.driver-called-time {
    font-size: 0.775rem;
    color: var(--text-muted);
}

/* ── Empty / error states ─────────────────────────────────── */
.driver-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.driver-empty-icon {
    margin-bottom: 14px;
    color: var(--border);
}

.driver-empty-icon i { width: 56px; height: 56px; }

.driver-empty p {
    font-size: 1rem;
    margin: 0;
}

.driver-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.driver-error i { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Upcoming section ─────────────────────────────────────── */
.driver-upcoming-section {
    margin-top: 24px;
}

.driver-upcoming-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.driver-upcoming-toggle:hover { background: var(--bg-subtle); }
.driver-upcoming-toggle i { width: 18px; height: 18px; color: var(--text-muted); }

.driver-upcoming-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 8px;
    margin-left: 6px;
}

#drv-upcoming-body {
    padding-top: 12px;
}

/* Date heading inside upcoming body */
.driver-upcoming-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 10px;
    margin-bottom: 2px;
}

.driver-upcoming-day-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}

.driver-day-count {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 2px 9px;
    border: 1px solid var(--border);
}
