/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-sidebar: #1e1b4b;
    --color-sidebar-end: #312e81;
    --color-sidebar-label: #f1ac4e;   /* section-group labels — legible gold on the navy */
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-bg: #eff6ff;
    --color-active: #059669;
    --color-active-bg: #ecfdf5;
    --color-pending: #d97706;
    --color-pending-bg: #fffbeb;
    --color-cancelled: #dc2626;
    --color-cancelled-bg: #fef2f2;
    --color-completed: #6366f1;
    --color-completed-bg: #eef2ff;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --sidebar-w: 240px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: 14px;
    background: linear-gradient(to right, #1e1b4b 240px, #f8fafc 240px);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--color-text); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }

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

.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    padding: 1.25rem 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: width 0.2s ease;
    /* Mobile shell fix (v3.57): these overflow values lived as an inline
       style on the aside and always won; adopted here verbatim so removing
       the inline style keeps rendering identical (the nav scrolls when
       taller than the viewport). */
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.sidebar-brand-text span {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.75rem;
    flex: 1;
    overflow: visible;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
}

.sidebar-link:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--color-text);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* === Main Content Area === */
.app-main {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px;
}

@media (max-width: 768px) {
    .app-main { margin-left: 0; }
}

.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    overflow: hidden;
    flex-shrink: 0;
}

.topbar-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.topbar-logout {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
}

.topbar-logout:hover {
    background: var(--color-bg);
    color: var(--color-cancelled);
}

.topbar-logout svg { width: 18px; height: 18px; }

/* === Top Bar Actions (notifications + user name) === */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-user-name {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Topbar icon buttons */
.topbar-icon-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    position: relative;
    transition: background 0.15s, color 0.15s;
}
.topbar-icon-btn:hover { background: var(--color-primary-bg); color: var(--color-primary); }

/* Network status chip (Phase 02b, v4.71): the one place connection state
   lives; replaces the floating bottom-left badge. Deliberately the ONLY
   shaped element in the actions group, which is what makes it findable
   without being loud; keep it that way. min-width so the topbar does not
   jump as the label changes length. Online is the only state without a
   fill, on purpose: it is what everyone sees on every page all day, so
   it must read as a label, not an alert. */
.topbar-net-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 82px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-net-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.topbar-net-chip.is-online { border-color: var(--color-border); background: transparent; color: var(--color-text-muted); }
.topbar-net-chip.is-online .topbar-net-dot { background: #16a34a; }
/* Offline mode: a decision you made; the loudest thing in the topbar. */
.topbar-net-chip.is-offline-mode { background: #b45309; border-color: #b45309; color: #fff; }
/* No signal: a condition that happened to you; quieter than offline mode
   on purpose so the two never look alike. */
.topbar-net-chip.is-nosignal { background: #fef3c7; border-color: #d97706; color: #92400e; }
.topbar-net-chip.is-syncing { background: #0d9488; border-color: #0d9488; color: #fff; }
.topbar-net-chip.is-auth { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.topbar-icon-btn .notif-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #dc2626; border: 2px solid #fff;
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px;
    gap: 0;
    border: 1px solid #e2e8f0;
}
.theme-toggle-btn {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    color: var(--color-text-muted); font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}
.theme-toggle-btn.active { background: #fff; color: var(--color-text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Notification slide-in panel */
.notif-panel-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 9999;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.notif-panel-backdrop.open { opacity: 1; pointer-events: auto; }
.notif-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 100vw;
    background: #fff; box-shadow: -8px 0 24px rgba(0,0,0,0.12);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.25s ease;
    z-index: 10000;
}
.notif-panel-backdrop.open .notif-panel { transform: translateX(0); }
.notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid #e5e7eb;
}
.notif-panel-header h3 { margin: 0; font-size: 1.1rem; }
.notif-panel-meta { font-size: 0.75rem; color: var(--color-text-muted); margin-left: 8px; }
.notif-panel-close {
    background: transparent; border: none; font-size: 1.3rem;
    cursor: pointer; color: var(--color-text-muted); padding: 4px;
}
.notif-panel-tabs {
    display: flex; gap: 0; padding: 0 20px; border-bottom: 1px solid #e5e7eb;
}
.notif-panel-tab {
    padding: 10px 14px; font-size: 0.8125rem; font-weight: 500;
    background: transparent; border: none; border-bottom: 2px solid transparent;
    color: var(--color-text-muted); cursor: pointer; transition: color 0.15s;
}
.notif-panel-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.notif-panel-tab .tab-count {
    background: #e5e7eb; color: #374151; font-size: 0.65rem; font-weight: 700;
    padding: 1px 6px; border-radius: 999px; margin-left: 4px;
}
.notif-panel-body { flex: 1; overflow-y: auto; }
.notif-section-label {
    padding: 10px 20px 4px; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted);
}
.notif-panel-item {
    display: flex; gap: 12px; padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6; text-decoration: none; color: inherit;
    transition: background 0.1s; position: relative;
}
.notif-panel-item:hover { background: #f9fafb; }
.notif-panel-item.unread { background: #f8faff; }
.notif-panel-item.unread::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; border-radius: 0 2px 2px 0;
}
.notif-panel-item.unread[data-type="event"]::before      { background: #3b82f6; }
.notif-panel-item.unread[data-type="task"]::before       { background: #f59e0b; }
.notif-panel-item.unread[data-type="mention"]::before    { background: #a855f7; }
.notif-panel-item.unread[data-type="crm"]::before        { background: #14b8a6; }
.notif-panel-item.unread[data-type="document"]::before   { background: #64748b; }
.notif-panel-item.unread[data-type="assessment"]::before { background: #22c55e; }
.notif-panel-item.unread::after {
    content: ''; position: absolute; top: 18px; right: 16px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary);
}
.notif-panel-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-panel-icon.ni-event      { background: #eff6ff; }
.notif-panel-icon.ni-task       { background: #fff7ed; }
.notif-panel-icon.ni-crm        { background: #f0fdfa; }
.notif-panel-icon.ni-mention    { background: #faf5ff; }
.notif-panel-icon.ni-document   { background: #f8fafc; }
.notif-panel-icon.ni-assessment { background: #f0fdf4; }
.notif-panel-icon.ni-default    { background: #f8fafc; }
.notif-panel-content { flex: 1; min-width: 0; }
.notif-panel-title { font-size: 0.8125rem; font-weight: 600; color: #111; }
.notif-panel-desc { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 1px; }
.notif-panel-time { font-size: 0.7rem; color: var(--color-text-light); margin-top: 2px; }
.notif-panel-body { padding-bottom: 56px; }
.notif-panel-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-top: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    margin-bottom: 56px;
}
.notif-panel-footer a { color: var(--color-primary); text-decoration: none; }
.notif-panel-footer a:hover { text-decoration: underline; }

/* === Notification Bell === */
.notif-wrapper {
    position: relative;
}
.notif-bell {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.15s, color 0.15s;
}
.notif-bell:hover {
    background: var(--color-bg);
    color: var(--color-text);
}
.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #DC2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid var(--color-surface);
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.notif-dropdown-header strong {
    font-size: 0.875rem;
    color: var(--color-text);
}
.notif-mark-all {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}
.notif-mark-all:hover { background: var(--color-primary-bg); }
.notif-list {
    overflow-y: auto;
    max-height: 350px;
}
.notif-loading {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}
.notif-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.12s;
}
.notif-item:hover { background: var(--color-bg); text-decoration: none; }
.notif-item.unread { background: #EFF6FF; }
.notif-item.unread:hover { background: #DBEAFE; }
.notif-item-message {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}
.notif-item-time {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}
.notif-empty {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* === Assessment Styles === */
/* Band pill (contacts list + cards) */
.assess-band-pill {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
}

/* Assessment result block (contact detail page) */
.assess-result {
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}
.assess-result:last-child { border-bottom: none; }
.assess-result-older {
    opacity: 0.7;
}
.assess-result-older:hover { opacity: 1; }

.assess-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.assess-band-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.assess-band-badge {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
}
.assess-progress {
    font-size: 0.8125rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.assess-progress-up { color: #16A34A; }
.assess-progress-up::before { content: '\25B2'; font-size: 0.6rem; }
.assess-progress-down { color: #DC2626; }
.assess-progress-down::before { content: '\25BC'; font-size: 0.6rem; }

.assess-score-group {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.assess-pct {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}
.assess-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Overall bar */
.assess-overall-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.assess-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Domain chart */
.assess-domains {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.assess-domain {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.assess-domain-bar-wrap {
    width: 100%;
    height: 100px;
    background: #f1f5f9;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.assess-domain-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 2px;
}
.assess-domain-score {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 0.35rem;
}
.assess-domain-label {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    line-height: 1.2;
    margin-top: 0.15rem;
}
.assess-focus-area { color: #DC2626; font-weight: 600; }
.assess-focus-tag {
    display: block;
    font-size: 0.5625rem;
    background: #FEE2E2;
    color: #DC2626;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-top: 0.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .assess-domains {
        grid-template-columns: repeat(4, 1fr);
    }
    .notif-dropdown {
        width: 300px;
        right: -1rem;
    }
}

.app-content {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
}

.app-footer {
    padding: 1rem 2rem;
    font-size: 0.75rem;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}
.app-footer a { color: var(--color-primary); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* === Mobile Sidebar Toggle === */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 50;
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 30;
}

.sidebar-backdrop.visible { display: block; }

/* === Notices === */
.notice {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.notice h2 { font-size: 1.0625rem; margin-bottom: 0.35rem; }
.notice p { color: var(--color-text-muted); margin-bottom: 0.35rem; }
.notice p:last-child { margin-bottom: 0; }
.notice code { background: var(--color-bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.notice pre { background: var(--color-bg); padding: 0.75rem 1rem; border-radius: 4px; overflow-x: auto; margin: 0.6rem 0; font-size: 0.85rem; }

.notice-error { border-left: 3px solid var(--color-cancelled); }
.notice-info { border-left: 3px solid var(--color-primary); }
.notice-setup { border-left: 3px solid var(--color-primary); }

/* === Toolbar / Page Header === */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.toolbar h2 { font-size: 1.25rem; font-weight: 600; }
.toolbar h3 { font-size: 1.0625rem; font-weight: 600; }

.search-input,
.form-input {
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: var(--color-text);
}

.search-input { min-width: 240px; }

.search-input:focus,
.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* === Cards & Panels === */
.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* === Data Table === */
.events-table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    vertical-align: middle;
}

.data-table thead th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--color-border);
}

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

.data-table tbody tr + tr td {
    border-top: 1px solid var(--color-border);
}

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

.past-row { opacity: 0.6; }
.past-row:hover { opacity: 0.85; }
.empty-state { padding: 2rem; text-align: center; color: var(--color-muted); background: var(--color-card); border-radius: var(--radius); }

.event-name { font-weight: 500; color: var(--color-text); }
.event-name a { color: var(--color-text); }
.event-name a:hover { color: var(--color-primary); text-decoration: none; }

/* === Status Badges === */
.status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.status-active { background: var(--color-active-bg); color: var(--color-active); }
.status-teal { background: #ccfbf1; color: #115e59; }
.status-pending { background: var(--color-pending-bg); color: var(--color-pending); }
.status-cancelled { background: var(--color-cancelled-bg); color: var(--color-cancelled); }
.status-completed { background: var(--color-completed-bg); color: var(--color-completed); }
.status-default { background: var(--color-bg); color: var(--color-text-muted); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

/* display:inline-flex above beats the UA sheet's [hidden] rule, so
   element.hidden was silently inert on every .btn (v5.10; the same
   defect v4.92 fixed for .org-form-grid labels). This restores it.
   Placed directly after .btn so specificity is not in question. */
.btn[hidden] { display: none; }

.btn:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    text-decoration: none;
}

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-border-strong);
}

.btn-danger { background: var(--color-cancelled); border-color: var(--color-cancelled); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-link {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* === Back Link === */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.back-link:hover { color: var(--color-text); }

/* === Event Detail === */
.event-detail {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.event-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.event-detail-header h2 { font-size: 1.375rem; }

.event-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.meta-card {
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
}

.meta-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
}

.meta-value { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }

.event-description {
    padding: 0.9rem 0;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.event-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.75rem; }

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-muted);
}

/* === Sections === */
.section { margin-bottom: 2rem; }
.section h3 { font-size: 1.0625rem; margin-bottom: 0.75rem; }

/* === Sessions === */
.sessions-list { display: flex; flex-direction: column; gap: 0.5rem; }

.session-card {
    display: flex;
    gap: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
}

.session-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    min-width: 150px;
}

.session-info strong { display: block; font-size: 0.875rem; color: var(--color-text); }

.session-presenters,
.session-venue,
.session-desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.session-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.event-code-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.event-code { font-size: 0.8rem; color: var(--color-text-muted); font-family: 'SF Mono', Menlo, Consolas, monospace; }

/* === Presenter Grid (directory) === */
.presenter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.presenter-card-link { text-decoration: none; color: inherit; }

.presenter-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.presenter-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.presenter-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9375rem;
    flex-shrink: 0;
    overflow: hidden;
}
.presenter-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.presenter-avatar-lg {
    width: 96px !important;
    height: 96px !important;
    font-size: 1.75rem !important;
}

.presenter-card-info { min-width: 0; flex: 1; }

.presenter-card-info strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.1rem;
}

.presenter-card-email,
.presenter-card-phone {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presenter-card-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary, #2563eb);
    margin-bottom: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presenter-card-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-surface-alt, #f3f4f6);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.presenter-card-badge-arlo {
    color: #1e3a8a;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.sync-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #1e3a8a;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* Team card hidden state (admin-only badge + dimmed card) */
.presenter-card-link.team-card-hidden {
    position: relative;
    opacity: 0.55;
}
.presenter-card-link.team-card-hidden:hover { opacity: 0.85; }

.team-hidden-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    background: #6b7280;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

/* === Presenter Header (detail page) === */
.presenter-header {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.presenter-header .presenter-avatar {
    width: 96px;
    height: 96px;
    font-size: 1.75rem;
}

.presenter-bio {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    max-width: 60ch;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 760px) {
    .profile-details-grid { grid-template-columns: 1fr; }
}
.profile-address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.5;
}
.text-muted { color: var(--color-text-muted); font-size: 0.9rem; }

.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.form-card-header h3 { margin: 0; }

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.btn-secondary:hover {
    background: rgba(37, 99, 235, 0.08);
}

.presenter-info h2 { font-size: 1.375rem; font-weight: 600; }

.presenter-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.presenter-meta a { color: var(--color-primary); }

.meta-sep { margin: 0 0.4rem; color: var(--color-text-light); }

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

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-detail {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Event Cards / Accordion === */
.event-cards {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.event-accordion {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.event-accordion:hover { border-color: var(--color-primary); }

.event-accordion.open {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.event-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.4rem;
    cursor: pointer;
    user-select: none;
}

.event-accordion-summary { flex: 1; min-width: 0; }

.event-accordion-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.event-accordion-title strong { font-size: 0.9375rem; font-weight: 600; color: var(--color-text); }

.days-away-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--color-pending-bg);
    color: var(--color-pending);
}

.event-accordion-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.event-accordion-chevron {
    font-size: 1.5rem;
    color: var(--color-text-light);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
    line-height: 1;
}

.event-accordion.open .event-accordion-chevron { transform: rotate(90deg); }

.event-accordion-body {
    display: none;
    padding: 0 1.4rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.event-accordion.open .event-accordion-body { display: block; }

.accordion-section { padding: 0.9rem 0; }
.accordion-section + .accordion-section { border-top: 1px solid var(--color-border); }

.accordion-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.55rem;
}

.accordion-session-row {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    align-items: baseline;
}

.accordion-session-date {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 100px;
    flex-shrink: 0;
    color: var(--color-text);
}

.accordion-session-info { display: flex; flex-direction: column; }
.accordion-session-time { font-size: 0.8125rem; font-weight: 500; color: var(--color-text); }
.accordion-session-name { font-size: 0.8125rem; color: var(--color-text-muted); }

/* === Login Page === */
.login-body {
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: var(--font);
}

.login-wrapper { width: 100%; max-width: 440px; }

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2.5rem 2.25rem 2.25rem;
    box-shadow: var(--shadow-md);
}

.login-hero {
    margin: 0 0 1.75rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: block;
}
.login-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.login-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-header { text-align: center; margin-bottom: 1.75rem; }

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.03em;
}

.login-header p {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

.login-error {
    background: var(--color-cancelled-bg);
    color: var(--color-cancelled);
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 3px solid var(--color-cancelled);
}

.login-form .form-group { margin-bottom: 1rem; }

.login-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

.form-input { width: 100%; }

.login-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.9375rem;
    justify-content: center;
    margin-top: 0.35rem;
}

.login-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 1.5rem;
}

/* === User Management === */
.users-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.users-form-wrap { position: sticky; top: 80px; }

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}

.form-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.user-form .form-group { margin-bottom: 0.9rem; }

.user-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

.form-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.radio-group, .checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--color-bg);
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.checkbox-grid { max-height: 200px; overflow-y: auto; }

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--color-text);
    cursor: pointer;
    margin-bottom: 0;
}

.radio-label input, .checkbox-label input { margin: 0; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
}

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

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dashboard-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.dashboard-card-detail {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* === Links Page === */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.link-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    display: block;
    color: inherit;
}

.link-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.link-card strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.link-card span {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .presenter-grid { grid-template-columns: repeat(2, 1fr); }
    .users-layout { grid-template-columns: 1fr; }
    .users-form-wrap { position: static; }
}

@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 4px 0 12px rgba(0,0,0,0.1);
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sidebar.open { transform: translateX(0); }
    /* Mobile shell fix (v3.57): the wrapper had NO mobile rule, so a
       transparent fixed 240px pane sat over the left of the phone screen
       intercepting taps even with the drawer closed. Zero width = zero
       interactive footprint; the drawer itself is position:fixed to the
       viewport (overflow on the wrapper is visible), so opening it is
       unaffected. */
    .sidebar-wrapper { width: 0; }
    /* Background paint fix (v3.58): the body paints the page background,
       and its desktop gradient reserves a navy 240px underlay column for
       the fixed sidebar. With phone content now full width (v3.57), that
       navy column showed through every transparent area (left edge, gaps
       between cards). On phones the body paints flat light instead; the
       drawer keeps its own navy gradient (.sidebar background), so the
       open drawer and desktop are pixel-identical. Dark theme already
       flattens the body and is unaffected. */
    body { background: #f8fafc; }
    .topbar { padding: 0 1rem 0 4rem; }
    .app-content { padding: 1.25rem; }
    .topbar-name { display: none; }
    /* Net chip narrows at the SAME breakpoint that drops .topbar-name
       above: that is the width where the topbar is out of room. The
       short label itself is chosen in JS (the footer paint block swaps
       the label text via matchMedia at this same 768px), so it stays a
       real text node the chip's aria-live region can announce; Online's
       short string is empty, collapsing the chip to its dot. */
    .topbar-net-chip { min-width: 0; }
}

@media (max-width: 640px) {
    .presenter-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-input { min-width: 0; width: 100%; }
    .event-meta-grid { grid-template-columns: 1fr 1fr; }
    .session-card { flex-direction: column; gap: 0.25rem; }
    .session-time { min-width: auto; }
    .event-accordion-title { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
    .accordion-session-row { flex-direction: column; gap: 0.15rem; }
    .accordion-session-date { min-width: auto; }
    .data-table th, .data-table td { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
}

/* Welcome banner (dashboard) */
.welcome-banner {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}
.welcome-banner h2 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
    color: var(--color-text);
    font-weight: 600;
}
.welcome-banner p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Links page */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid transparent;
}
.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--color-primary);
}
.link-card-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    border-radius: 8px;
}
.link-card-icon svg { width: 22px; height: 22px; }
.link-card-text { display: flex; flex-direction: column; gap: 0.15rem; }
.link-card-text strong { color: var(--color-text); font-weight: 600; font-size: 0.95rem; }
.link-card-text span { color: var(--color-text-muted); font-size: 0.825rem; }

/* Account page */
.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.25rem;
    align-items: start;
}

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

.form-section-heading {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding-top: 1rem;
}

.profile-image-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.profile-image-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--color-border, #e5e7eb);
}
.profile-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-image-controls { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.profile-image-controls .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}

textarea.form-input {
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:disabled {
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .account-layout { grid-template-columns: 1fr; }
}
.profile-info { display: flex; flex-direction: column; gap: 0.75rem; }
.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.profile-row:last-child { border-bottom: none; }
.profile-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}
.profile-value { color: var(--color-text); font-size: 0.9rem; }

/* Topbar user link (clickable avatar + name) */
.topbar-user-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.topbar-user-link:hover { background: rgba(37, 99, 235, 0.08); }

/* Login logo */
.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}
.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== Events Page (v16) ===== */
.section {
    margin-bottom: 2rem;
}
.muted-count {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    margin-left: 0.75rem;
}

/* View toggle (My Events / All Events) */
.view-toggle {
    display: inline-flex;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.view-toggle-btn {
    padding: 0.5rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.view-toggle-btn:hover {
    color: var(--color-text, #111827);
}
.view-toggle-btn.active {
    background: #2563EB;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

/* This Week cards */
.this-week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}
.this-week-card {
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    padding: 1.125rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.this-week-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.this-week-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.this-week-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    margin: 0.25rem 0 0;
    line-height: 1.35;
}
.this-week-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6b7280);
}
.this-week-facilitators {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6b7280);
    font-style: italic;
}
.this-week-card .btn {
    align-self: flex-start;
    margin-top: 0.25rem;
}

/* Quick cards — date-prominent with colored left border */
.qc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 4px; }
.qc-card {
    display: flex; align-items: stretch; gap: 0;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 14px 16px; text-decoration: none; color: inherit;
    transition: box-shadow 0.15s;
}
.qc-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.qc-date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 40px; line-height: 1.1; }
.qc-date-mon { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.04em; }
.qc-date-num { font-size: 1.35rem; font-weight: 700; }
.qc-date-dow { font-size: 0.6rem; color: #94a3b8; }
.qc-divider { width: 1px; background: #e5e7eb; margin: 0 12px; align-self: stretch; opacity: 0.5; }
.qc-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.qc-title { font-size: 0.8125rem; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-meta { font-size: 0.75rem; color: #6b7280; margin-top: 2px; }
.qc-sep { margin: 0 4px; }
.qc-fac { font-size: 0.7rem; color: #94a3b8; font-style: italic; margin-top: 2px; }
@media (max-width: 1100px) { .qc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .qc-grid { grid-template-columns: 1fr; } }

/* Events list toolbar + grouped rows */
.ev-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 12px 0; margin-bottom: 8px;
}
.ev-search-input {
    flex: 1; min-width: 200px; max-width: 360px;
    padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px;
    font-size: 0.875rem; background: #fff;
}
.ev-search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.ev-status-pills, .ev-type-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.ev-pill {
    padding: 5px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 500;
    border: 1px solid var(--color-border); background: #fff; color: var(--color-text-muted);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.ev-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ev-pill.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.ev-pill-count { font-weight: 700; margin-left: 2px; }

.ev-group { margin-bottom: 4px; }
.ev-group-head {
    display: flex; align-items: baseline; gap: 8px;
    padding: 8px 16px; background: #eff6ff; border-bottom: 1px solid #bfdbfe;
}
.ev-group-head h3 {
    font-size: 0.75rem; font-weight: 700; margin: 0;
    text-transform: uppercase; letter-spacing: 0.05em; color: #1d4ed8;
}
.ev-group-count { font-size: 0.7rem; color: #60a5fa; font-weight: 500; }
.ev-row:nth-child(odd) { background: #fff; }
.ev-row:nth-child(even) { background: #f8fafc; }

.ev-legend { display: flex; gap: 14px; align-items: center; padding: 6px 8px; font-size: 0.7rem; color: #6b7280; }
.ev-legend-item { display: flex; align-items: center; gap: 5px; }
.ev-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.ev-col-header {
    display: grid;
    grid-template-columns: 56px 1fr 140px 110px auto 20px;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.ev-row {
    display: grid;
    grid-template-columns: 56px 1fr 140px 110px auto 20px;
    align-items: center;
    gap: 12px;
    padding: 16px 8px;
    border-bottom: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.ev-row:hover { background: #eef2ff !important; }

.ev-row-date { text-align: center; line-height: 1.1; }
.ev-date-mon { display: block; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: var(--color-primary); letter-spacing: 0.04em; }
.ev-date-num { display: block; font-size: 1.25rem; font-weight: 700; color: #111; }
.ev-date-dow { display: block; font-size: 0.65rem; color: var(--color-text-muted); }

.ev-row-main { min-width: 0; }
.ev-row-code { font-size: 0.7rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ev-row-title { font-size: 0.875rem; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-row-meta { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 1px; }
.ev-meta-sep { margin: 0 4px; }

.ev-row-client { font-size: 0.8125rem; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ev-row-enrol { text-align: right; }
.ev-enrol-frac { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ev-enrol-bar { width: 60px; height: 5px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin: 3px 0 0 auto; }
.ev-enrol-fill { height: 100%; border-radius: 3px; }
.ev-enrol-pct { font-size: 0.65rem; color: var(--color-text-muted); }

.ev-row-chevron { color: #d1d5db; flex-shrink: 0; }
.ev-row:hover .ev-row-chevron { color: var(--color-text-muted); }

@media (max-width: 900px) {
    .ev-col-header { grid-template-columns: 50px 1fr auto 16px; }
    .ev-col-header span:nth-child(3), .ev-col-header span:nth-child(4) { display: none; }
    .ev-row { grid-template-columns: 50px 1fr auto 16px; }
    .ev-row-client, .ev-row-enrol { display: none; }
}
@media (max-width: 640px) {
    .ev-toolbar { flex-direction: column; align-items: stretch; }
    .ev-search-input { max-width: none; }
    .ev-row { grid-template-columns: 44px 1fr 16px; gap: 8px; }
    .ev-row .status-badge { display: none; }
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem 1.125rem;
    background: #f9fafb;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    margin-bottom: 1rem;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 160px;
    flex: 1 1 160px;
}
.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
}
.filter-group select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
#filter-clear {
    padding-bottom: 0.6rem;
    white-space: nowrap;
}

/* Location pills */
.location-pill {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.location-online {
    background: #dbeafe;
    color: #1e40af;
}
.location-in-person {
    background: #dcfce7;
    color: #166534;
}
.location-live-web {
    background: #ede9fe;
    color: #5b21b6;
}
.location-unknown {
    background: #f3f4f6;
    color: #4b5563;
}
.location-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6b7280);
    margin-top: 0.25rem;
}

/* Days Away */
.days-away-cell {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6b7280);
    font-weight: 500;
}
.days-away-cell.days-soon {
    color: #047857;
    font-weight: 600;
}
.days-away-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.days-away-badge.days-soon {
    background: #d1fae5;
    color: #047857;
}

.event-code-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6b7280);
    margin-top: 0.125rem;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.event-facilitator {
    font-size: 0.8125rem;
    color: var(--color-text, #374151);
}

/* Past Events collapsible */
.past-events-details {
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}
.past-events-details > summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: background 0.15s;
}
.past-events-details > summary:hover {
    background: #f9fafb;
}
.past-events-details > summary::-webkit-details-marker {
    display: none;
}
.past-events-summary-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}
.past-events-chevron {
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--color-text-muted, #6b7280);
    transition: transform 0.2s ease;
    line-height: 1;
}
.past-events-details[open] .past-events-chevron {
    transform: rotate(90deg);
}
.past-events-details .events-table-wrap {
    border-top: 1px solid var(--color-border, #e5e7eb);
}

@media (max-width: 768px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-group { min-width: 0; }
    .this-week-grid { grid-template-columns: 1fr; }
}

/* ===== Events Enhancements v17 ===== */

/* Top-of-page controls row (view + mode toggle) */
.events-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.events-controls-row .view-toggle { margin-bottom: 0; }

.mode-toggle {
    display: inline-flex;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.mode-toggle-btn svg {
    width: 16px;
    height: 16px;
}
.mode-toggle-btn:hover { color: var(--color-text, #111827); }
.mode-toggle-btn.active {
    background: #2563EB;
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

/* Client / Organisation text under event name */
.client-org-name {
    font-size: 0.8125rem;
    color: #2563EB;
    font-weight: 500;
    margin-top: 0.1875rem;
}
.event-time-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6b7280);
    margin-top: 0.125rem;
}

/* Registration chip */
.reg-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: #f3f4f6;
    color: #374151;
}
.reg-chip.reg-met {
    background: #d1fae5;
    color: #047857;
}
.reg-chip.reg-close {
    background: #fef3c7;
    color: #b45309;
}
.reg-chip.reg-not-met {
    background: #fee2e2;
    color: #b91c1c;
}

/* Min met pill */
.min-pill {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.min-pill.min-met {
    background: #d1fae5;
    color: #047857;
}
.min-pill.min-close {
    background: #fef3c7;
    color: #b45309;
}
.min-pill.min-not-met {
    background: #fee2e2;
    color: #b91c1c;
}
.min-pill.min-none {
    background: #f3f4f6;
    color: #9ca3af;
}

/* This Week stats row */
.this-week-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Event detail — summary bar */
.event-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin: 1rem 0 1.25rem;
    overflow: hidden;
}
.summary-stat {
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--color-border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.summary-stat:last-child { border-right: none; }
.summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
}
.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text, #111827);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.summary-value .status-badge,
.summary-value .min-pill {
    font-size: 0.6875rem;
}

/* Client org banner */
.client-org-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}
.client-org-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e40af;
}
.client-org-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a8a;
}
.client-org-code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: #1e40af;
    background: #dbeafe;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* Presenter chip cards on event detail */
.presenters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.presenter-chip-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.15s ease;
}
.presenter-chip-card:hover {
    border-color: #2563EB;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}
.presenter-chip-card .presenter-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    font-size: 0.9375rem;
}
.presenter-chip-info {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-width: 0;
    flex: 1;
}
.presenter-chip-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    text-decoration: none;
}
.presenter-chip-name:hover {
    color: #2563EB;
}
.presenter-chip-email {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6b7280);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.presenter-chip-email:hover {
    color: #2563EB;
}

/* ===== Calendar View ===== */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.calendar-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    color: var(--color-text, #111827);
    font-size: 1.375rem;
    text-decoration: none;
    transition: all 0.15s ease;
    font-weight: 600;
    line-height: 1;
}
.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.calendar-month-label {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text, #111827);
    margin: 0;
}
.calendar-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--color-text-muted, #6b7280);
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.legend-dot.cal-active  { background: #3b82f6; }
.legend-dot.cal-met     { background: #10b981; }
.legend-dot.cal-not-met { background: #f59e0b; }
.legend-dot.cal-draft   { background: #9ca3af; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background: var(--color-border, #e5e7eb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.calendar-dow {
    background: #f9fafb;
    padding: 0.625rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #6b7280);
}
.calendar-cell {
    background: #fff;
    min-height: 110px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.calendar-cell.out-of-month {
    background: #fafafa;
    color: #d1d5db;
}
.calendar-cell.out-of-month .calendar-cell-num {
    color: #d1d5db;
}
.calendar-cell.is-today {
    background: #eff6ff;
}
.calendar-cell-num {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    margin-bottom: 0.125rem;
}
.calendar-cell.is-today .calendar-cell-num {
    color: #2563EB;
    font-weight: 700;
}
.calendar-event {
    display: block;
    padding: 0.25rem 0.4375rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
    border-left: 3px solid transparent;
    transition: all 0.12s ease;
}
.calendar-event:hover {
    transform: translateX(1px);
    filter: brightness(0.95);
}
.cal-ev-time {
    font-weight: 700;
    margin-right: 0.25rem;
}
.calendar-event.cal-active {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: #3b82f6;
}
.calendar-event.cal-met {
    background: #d1fae5;
    color: #065f46;
    border-left-color: #10b981;
}
.calendar-event.cal-not-met {
    background: #fef3c7;
    color: #92400e;
    border-left-color: #f59e0b;
}
.calendar-event.cal-draft {
    background: #f3f4f6;
    color: #4b5563;
    border-left-color: #9ca3af;
}
.calendar-event.cal-cancel {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #ef4444;
    text-decoration: line-through;
}

@media (max-width: 768px) {
    .events-controls-row { flex-direction: column; align-items: stretch; }
    .mode-toggle, .view-toggle { justify-content: center; }
    .calendar-header { flex-direction: column; align-items: flex-start; }
    .calendar-cell { min-height: 80px; padding: 0.25rem; }
    .calendar-event { font-size: 0.625rem; padding: 0.125rem 0.25rem; }
    .calendar-dow { padding: 0.375rem 0.125rem; font-size: 0.625rem; }
    .event-summary-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .summary-stat {
        border-right: none;
        border-bottom: 1px solid var(--color-border, #e5e7eb);
    }
}

/* =========================================================================
   Resource Utilization
   ========================================================================= */

.utilization-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.month-selector-form { margin: 0; }
.month-selector input[type="month"] {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    min-width: 160px;
}

/* Progress bar — shared between admin table and dashboard widget */
.util-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.util-bar {
    flex: 1;
    min-width: 90px;
    height: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.util-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.25s ease;
}
.util-bar-fill.util-green  { background: #10b981; }
.util-bar-fill.util-yellow { background: #f59e0b; }
.util-bar-fill.util-red    { background: #ef4444; }

.util-pct {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 42px;
    text-align: right;
}
.util-pct.util-green,
.stat-value.util-green  { color: #059669; }
.util-pct.util-yellow,
.stat-value.util-yellow { color: #d97706; }
.util-pct.util-red,
.stat-value.util-red    { color: #dc2626; }

/* Person cell in the table */
.util-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.util-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.util-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.util-role {
    display: block;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-transform: capitalize;
}

/* Goal delta pills */
.util-goal-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.util-goal-target {
    font-weight: 600;
    font-size: 0.875rem;
}
.util-goal-delta {
    font-size: 0.6875rem;
    font-weight: 600;
}
.util-goal-up   { color: #059669; }
.util-goal-down { color: #dc2626; }

/* Inline edit row */
.row-editing td {
    background: #eff6ff;
    border-bottom: 1px solid #dbeafe;
}
.row-edit-panel td {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
}
.util-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1.25rem;
    align-items: end;
    max-width: 720px;
}
.util-edit-grid .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Totals row styling */
.util-totals-row td {
    background: #f8fafc;
    border-top: 2px solid var(--color-border, #e5e7eb);
    font-size: 0.875rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

/* Dashboard personal utilization card */
.my-util-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-left: 4px solid #2563eb;
    border-radius: var(--radius, 10px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.my-util-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
    gap: 1rem;
}
.my-util-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}
.my-util-headline {
    display: block;
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 600;
}
.my-util-pct {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.my-util-pct.util-green  { color: #059669; }
.my-util-pct.util-yellow { color: #d97706; }
.my-util-pct.util-red    { color: #dc2626; }
.my-util-card .util-bar { height: 12px; }
.my-util-goal {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

@media (max-width: 720px) {
    .utilization-toolbar { flex-direction: column; align-items: stretch; }
    .util-edit-grid { grid-template-columns: 1fr; }
    .my-util-header { flex-direction: column; align-items: flex-start; }
    .my-util-pct { font-size: 1.5rem; }
}

/* =========================================================================
   Event Documents
   ========================================================================= */

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.doc-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius, 10px);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-row:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    background: #6b7280;
}
.doc-icon-pdf { background: #dc2626; }
.doc-icon-doc { background: #2563eb; }
.doc-icon-xls { background: #059669; }
.doc-icon-ppt { background: #ea580c; }
.doc-icon-img { background: #7c3aed; }
.doc-icon-zip { background: #475569; }
.doc-icon-default { background: #6b7280; }

.doc-info {
    flex: 1;
    min-width: 0;
}
.doc-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-name:hover { color: #2563eb; text-decoration: underline; }
.doc-desc {
    font-size: 0.8125rem;
    color: var(--color-text, #374151);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted, #6b7280);
    margin-top: 0.25rem;
}
.doc-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.doc-actions form { margin: 0; }

.doc-upload-form {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius, 10px);
    padding: 1.25rem 1.5rem;
}
.doc-upload-grid {
    display: grid;
    grid-template-columns: 2fr 2fr auto;
    gap: 1rem;
    align-items: end;
}
.doc-upload-grid .form-actions {
    display: flex;
    align-items: center;
}
.doc-upload-grid input[type="file"] {
    padding: 0.4rem;
}

@media (max-width: 720px) {
    .doc-row { flex-wrap: wrap; }
    .doc-actions { width: 100%; justify-content: flex-end; }
    .doc-upload-grid { grid-template-columns: 1fr; }
}

/* =====================================================
   Event Details — Job Overview / Job Site / Contacts / Notes
   ===================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.detail-cell {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.detail-cell-wide { grid-column: span 2; }
@media (max-width: 720px) { .detail-cell-wide { grid-column: span 1; } }
.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.detail-value {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 500;
    word-break: break-word;
}
.detail-value-block {
    font-weight: 400;
    white-space: pre-wrap;
    line-height: 1.45;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.contact-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.contact-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.1rem;
}
.contact-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}
.contact-card-line {
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
}
.contact-card-line:hover { text-decoration: underline; }

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.notes-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.notes-card:nth-child(2) {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.notes-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notes-card-gated {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.notes-card-body {
    font-size: 0.92rem;
    color: #1f2937;
    white-space: pre-wrap;
    line-height: 1.5;
}

.details-form h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.35rem;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

/* =====================================================
   Resources page
   ===================================================== */
.resources-section { margin-bottom: 1.5rem; }
.resources-section-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1.1rem;
}
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}
.resource-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.resource-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: #d1d5db;
}
.resource-card-file   { border-left: 3px solid #059669; }
.resource-card-url    { border-left: 3px solid #2563eb; }
.resource-card-copy   { border-left: 3px solid #d97706; }
.resource-card-body   { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.resource-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}
.resource-card-desc {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}
.resource-card-meta {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.resource-card-url {
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resource-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.resource-card-missing {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

/* Modal (reused for resource add/edit) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: #111827; }
.modal-card form { padding: 1rem 1.25rem 1.25rem; }

/* =====================================================
   Event Detail — Redesign (hero + two-column layout)
   ===================================================== */
.event-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 1.25rem;
}
.event-hero-main { flex: 1; min-width: 0; }
.event-hero-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}
.event-hero-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    letter-spacing: -0.02em;
}
.event-hero-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
}
.event-hero-client {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
    color: #374151;
}
.event-hero-client-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-right: 0.5rem;
}
.event-hero-client-code {
    display: inline-block;
    font-size: 0.7rem;
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 0.4rem;
    font-weight: 600;
}
.event-hero-actions { flex-shrink: 0; }

.status-badge.status-public {
    background: #ecfdf5;
    color: #065f46;
}

/* Two column layout */
.event-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 1.25rem;
    align-items: start;
}
.event-main, .event-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}
@media (max-width: 1024px) {
    .event-layout { grid-template-columns: 1fr; }
    .quick-menu { display: none; }
    .quick-menu + .toolbox-divider { display: none; }
}

/* Public seminars on PHONES only (v3.59): surface Job Details for ER at the
   top of the stacked column. The ER card is nested inside the side toolbox
   (not a sibling of the stacked sections), so display:contents promotes the
   toolbox sections to items of the single-column event-layout grid, whose
   auto-placement then honors order. Result: ER first, then the main column,
   then Quick Links and Documents exactly as before. The promoted sections
   lose the toolbox panel's shared chrome, so non-ER sections get their own
   card here (ER keeps its ov-card styling via its id rules) and the
   now-floating dividers hide. Client/contract events and every width from
   768px up are untouched. */
@media (max-width: 767px) {
    .event-layout--public .event-side,
    .event-layout--public .event-side-toolbox { display: contents; }
    .event-layout--public #job-details-er { order: -1; }
    .event-layout--public .event-side-toolbox > .toolbox-divider { display: none; }
    .event-layout--public .event-side-toolbox > .toolbox-section:not(#job-details-er) {
        background: var(--color-surface, #fff);
        border: 1px solid var(--color-border, #e5e7eb);
        border-radius: var(--radius, 8px);
        padding: 1rem 1.1rem;
    }
}

/* Panels */
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.panel:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.panel-header {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.005em;
}
.panel-count {
    font-weight: 500;
    color: #9ca3af;
    font-size: 0.85rem;
}
.panel-body { padding: 1.25rem; }
.panel-body-tight { padding: 0.85rem 1.1rem; }
.panel-side .panel-header { padding: 0.75rem 1rem; }
.panel-side .panel-body { padding: 0.85rem 1rem; }

/* Empty placeholders */
.empty-placeholder {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.88rem;
    margin: 0;
}

/* Job Site */
.venue-name-lg {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}
.venue-name-lg.empty-placeholder { font-weight: 500; }
.venue-addr {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}
.job-site-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.ppe-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.ppe-badge-off {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
    font-weight: 500;
}
.warning-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    margin-top: 0.6rem;
}
.warning-box-red {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #ef4444;
}
.warning-box-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
    margin-bottom: 0.3rem;
}
.warning-box-red .warning-box-label { color: #991b1b; }
.warning-box-body {
    font-size: 0.88rem;
    color: #451a03;
    line-height: 1.5;
    white-space: pre-wrap;
}
.warning-box-red .warning-box-body { color: #450a0a; }

/* Contacts */
.contacts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.contact-person {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.15s, background 0.15s;
}
.contact-person:hover {
    background: #fff;
    border-color: #c7d2fe;
}
.contact-person-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}
.contact-person-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}
.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.contact-person-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: #111827;
}
.contact-person-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
}
.contact-person-line:hover { text-decoration: underline; }
.contact-person-line svg { flex-shrink: 0; color: #6b7280; }

/* Notes tabs */
.notes-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
    margin: -0.25rem -0.25rem 0.9rem;
    padding: 0 0.25rem;
}
.notes-tab {
    background: none;
    border: none;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}
.notes-tab:hover { color: #111827; }
.notes-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.notes-pane { display: none; }
.notes-pane-active { display: block; }
.notes-pane-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.notes-pane-gated {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.notes-pane-visibility {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.notes-pane-body {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #1f2937;
    white-space: pre-wrap;
}
.notes-pane-coord .notes-pane-body {
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.notes-pane-fac .notes-pane-body {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.notes-pane-body.empty-placeholder { font-style: italic; color: #9ca3af; }

/* Session timeline */
.session-timeline {
    position: relative;
    padding-left: 1.25rem;
}
.session-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 2px;
    background: #e5e7eb;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.1rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.25rem;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2563eb;
}
.timeline-date {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563eb;
    margin-bottom: 0.15rem;
}
.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}
.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.83rem;
    color: #6b7280;
    flex-wrap: wrap;
}
.session-type-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.session-type-inperson { background: #dbeafe; color: #1e40af; }
.session-type-remote   { background: #dcfce7; color: #166534; }
.timeline-desc {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 0.3rem;
    line-height: 1.45;
}

/* Document dropzone */
.doc-upload-form-new { margin-top: 1rem; }
.doc-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    color: #6b7280;
    text-align: center;
}
.doc-dropzone:hover,
.doc-dropzone-active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}
.doc-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.doc-dropzone-icon { color: #9ca3af; transition: color 0.15s; }
.doc-dropzone:hover .doc-dropzone-icon,
.doc-dropzone-active .doc-dropzone-icon { color: #2563eb; }
.doc-dropzone-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
}
.doc-dropzone-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}
.doc-upload-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.doc-upload-row .form-input { flex: 1; }
@media (max-width: 640px) {
    .doc-upload-row { flex-direction: column; }
}

/* Sidebar panels */
.shift-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.shift-col {
    flex: 1;
    text-align: center;
}
.shift-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.2rem;
}
.shift-time {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}
.shift-arrow {
    color: #d1d5db;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}
.stat-row-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Compact registrations list (sidebar) */
.search-input-sm {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.5rem;
}
.reg-compact-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.reg-compact-row {
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    background: #f9fafb;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.reg-compact-row:hover {
    background: #fff;
    border-color: #e5e7eb;
}
.reg-compact-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
}
.reg-compact-org {
    font-size: 0.76rem;
    color: #6b7280;
}
.status-badge-xs {
    font-size: 0.62rem;
    padding: 1px 6px;
    align-self: flex-start;
}

.event-description-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

/* Doc icon colors (refined) */
.doc-icon-pdf { background: #fee2e2; color: #b91c1c; }
.doc-icon-doc { background: #dbeafe; color: #1d4ed8; }
.doc-icon-xls { background: #dcfce7; color: #15803d; }
.doc-icon-ppt { background: #ffedd5; color: #c2410c; }
.doc-icon-img { background: #f3e8ff; color: #7e22ce; }
.doc-icon-zip { background: #fef3c7; color: #a16207; }
.doc-icon-default { background: #f3f4f6; color: #6b7280; }

/* =====================================================
   Resources Page — Redesign (sections + edit mode)
   ===================================================== */
.resources-page-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}
.resources-page-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
#edit-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#edit-mode-toggle.edit-mode-active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
#edit-mode-toggle.edit-mode-active svg { stroke: #fff; }

/* Section containers with color accents */
.rsection {
    border-radius: 10px;
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 1.75rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    transition: box-shadow 0.15s;
}
.rsection-blue {
    background: #f0f7ff;
    border-left-color: #2563eb;
    border-color: #dbeafe;
}
.rsection-green {
    background: #f0fdf4;
    border-left-color: #16a34a;
    border-color: #bbf7d0;
}
.rsection-purple {
    background: #faf5ff;
    border-left-color: #7c3aed;
    border-color: #e9d5ff;
}
.rsection-orange {
    background: #fff7ed;
    border-left-color: #ea580c;
    border-color: #fed7aa;
}

.rsection-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.rsection-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
}
.rsection-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.rsection-blue   .rsection-icon,
.rsection-blue   .rsection-title   { color: #2563eb; }
.rsection-green  .rsection-icon,
.rsection-green  .rsection-title   { color: #16a34a; }
.rsection-purple .rsection-icon,
.rsection-purple .rsection-title   { color: #7c3aed; }
.rsection-orange .rsection-icon,
.rsection-orange .rsection-title   { color: #ea580c; }

.rsection-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
}

/* Card grid */
.rcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Cards — clean white, subtle shadow */
.rcard {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: box-shadow 0.15s, transform 0.15s;
}
.rcard:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.rcard-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.rcard-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.005em;
}
.rcard-desc {
    font-size: 0.83rem;
    color: #6b7280;
    line-height: 1.45;
}
.rcard-meta {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.1rem;
}

.rcard-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Subtle outlined Open / Download / Copy button */
.rcard-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rcard-btn:hover {
    background: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
}

/* Not-configured badge (view mode) */
.rcard-unconfigured { opacity: 0.75; }
.rcard-status-pill {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

/* Admin edit/delete buttons — hidden by default (view mode), shown in edit mode */
.rcard-admin-actions {
    display: none;
    gap: 0.4rem;
    margin-left: auto;
}
.resources-layout[data-edit-mode="on"] .rcard-admin-actions {
    display: inline-flex;
}
/* In edit mode, emphasise unconfigured cards with a dashed border */
.resources-layout[data-edit-mode="on"] .rcard-unconfigured {
    border: 1.5px dashed #d1d5db;
    opacity: 1;
}
.resources-layout[data-edit-mode="on"] .rcard-unconfigured .rcard-status-pill {
    background: #fef3c7;
    color: #92400e;
}

.rcard-edit-btn,
.rcard-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rcard-edit-btn {
    border: 1px solid #d1d5db;
    color: #4b5563;
}
.rcard-edit-btn:hover {
    background: #f9fafb;
    border-color: #6b7280;
    color: #111827;
}
.rcard-delete-btn {
    border: 1px solid #fecaca;
    color: #dc2626;
}
.rcard-delete-btn:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* =====================================================
   Sidebar — Indigo redesign
   ===================================================== */
.sidebar {
    background: linear-gradient(180deg, var(--color-sidebar) 0%, var(--color-sidebar-end) 100%);
    border-right: none;
    padding: 1.25rem 0 0.75rem;
    transition: width 0.2s ease, padding 0.2s ease;
}
.sidebar-brand {
    padding: 0 1.4rem 1.1rem;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 1rem;
    gap: 0.85rem;
}
/* New SVG logo — full + icon variants */
.sidebar-logo-full { display: block; }
.sidebar-logo-icon { display: none; }

.sidebar-brand-text strong {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}
.sidebar-brand-text span {
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
    font-weight: 500;
}

/* Nav + group labels */
.sidebar-nav {
    padding: 0 0.85rem;
    gap: 0.15rem;
}
.sidebar-group-label {
    padding: 0.85rem 0.75rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-sidebar-label);
}

/* Links */
.sidebar-link {
    position: relative;
    color: rgba(255,255,255,0.7);
    border-radius: 7px;
    padding: 0.6rem 0.85rem 0.6rem 1rem;
    transition: background 0.15s, color 0.15s;
}
.sidebar-link svg {
    color: rgba(255,255,255,0.7);
    transition: color 0.15s;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}
.sidebar-link:hover svg { color: #ffffff; }

.sidebar-link.active {
    background: rgba(255,255,255,0.95);
    color: #1e1b4b;
    font-weight: 600;
}
.sidebar-link.active svg { color: #1e1b4b; }
.sidebar-link.active::before {
    display: none;
}

/* Sidebar wrapper */
.sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    z-index: 41;
    overflow: visible !important;
    transition: width 0.2s ease;
}
/* Mobile guard re-assertion (v4.25). The redesign rule above is LATER in
   the cascade than the v3.57 phone guard (the width:0 inside the 768px
   media block much earlier in this file), so at equal specificity it won
   at phone widths and re-created the invisible fixed 240px tap-eating
   pane over the left of every page. Re-assert the guard here, after the
   redesign block. Belt and suspenders: the closed-state wrapper and
   backdrop also drop pointer-events, so a future cascade regression of
   the sizing cannot eat taps again; the drawer itself restores
   pointer-events so it stays tappable when open. */
@media (max-width: 768px) {
    .sidebar-wrapper { width: 0; pointer-events: none; }
    .sidebar-wrapper .sidebar { pointer-events: auto; }
    .sidebar-backdrop:not(.visible) { pointer-events: none; }
}


/* User area (bottom of sidebar) */
.sidebar-user {
    margin-top: 1.5rem;
    padding: 0.85rem 0.85rem 0.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    text-decoration: none;
    color: #e2e8f0;
    transition: background 0.15s;
}
.sidebar-user-link:hover {
    background: #1e293b;
    text-decoration: none;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-user-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-badge {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sidebar-user-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}
.sidebar-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.sidebar-logout:hover {
    color: #f87171;
    background: #1e293b;
    text-decoration: none;
}

/* Hamburger (mobile toggle) — match navy theme */
.sidebar-toggle {
    background: #0f172a;
    border: 1px solid #1e293b;
}
.sidebar-toggle span { background: #f1f5f9; }



/* =========================================================================
   Presenters management page
   ========================================================================= */
.presenters-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.presenters-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.add-presenter-panel {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}
.add-presenter-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: #0F172A;
    padding: .25rem 0;
    list-style: none;
}
.add-presenter-panel summary::-webkit-details-marker { display: none; }
.add-presenter-panel summary::before {
    content: "+";
    display: inline-block;
    width: 1.25rem;
    color: #2563EB;
    font-weight: 700;
}
.add-presenter-panel[open] summary::before { content: "−"; }
.add-presenter-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
    padding-top: 1rem;
    border-top: 1px solid #F1F5F9;
    margin-top: .5rem;
}
@media (max-width: 640px) {
    .add-presenter-form { grid-template-columns: 1fr; }
}

.presenters-table .row-dim td { opacity: .55; }
.presenters-table .row-dim td:last-child,
.presenters-table .row-dim td:nth-last-child(2) { opacity: 1; }

.arlo-id {
    background: #F1F5F9;
    color: #475569;
    padding: .125rem .5rem;
    border-radius: 4px;
    font-size: .75rem;
    font-family: "SFMono-Regular", Consolas, monospace;
}

.src-pill {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 600;
    padding: .1875rem .5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.src-pill.src-arlo   { background: #DBEAFE; color: #1D4ED8; }
.src-pill.src-manual { background: #F1F5F9; color: #475569; }

/* Toggle switch */
.toggle-switch {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #CBD5E1;
    border: none;
    position: relative;
    cursor: pointer;
    transition: background .15s ease;
    padding: 0;
    vertical-align: middle;
}
.toggle-switch:hover { background: #94A3B8; }
.toggle-switch.is-on { background: #10B981; }
.toggle-switch.is-on:hover { background: #059669; }
.toggle-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: transform .15s ease;
}
.toggle-switch.is-on .toggle-switch-thumb { transform: translateX(20px); }

.table-link { color: #2563EB; text-decoration: none; }
.table-link:hover { text-decoration: underline; }


/* =========================================================================
   Chunked discovery progress modal
   ========================================================================= */
.discover-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.discover-modal[hidden] { display: none; }
.discover-modal-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, .5);
}
.discover-modal-card h3 {
    margin: 0 0 .75rem;
    font-size: 1.0625rem;
    color: #0F172A;
}
.discover-modal-message {
    margin: 0 0 1rem;
    color: #475569;
    font-size: .875rem;
    min-height: 2.5em;
}
.discover-bar {
    height: 10px;
    background: #F1F5F9;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.discover-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #3B82F6);
    border-radius: 999px;
    width: 1%;
    transition: width .3s ease;
}
.discover-modal-actions {
    display: flex;
    justify-content: flex-end;
}
.discover-modal-actions .btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* =========================================================================
   Event detail — Quick Links panel (top of right sidebar)
   ========================================================================= */
.quick-links-panel {
    /* Card chrome dropped — Quick Links lives inside .event-side-toolbox now. */
}
.quick-links-panel .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.quick-links-panel .panel-head h3 {
    margin: 0;
    font-size: .8125rem;
    font-weight: 700;
    color: #0F172A;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.quick-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .375rem;
}
.quick-link-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.quick-link-row a {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .625rem;
    border-radius: 7px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    min-width: 0;
}
.quick-link-row a:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}
.quick-link-row a svg {
    flex-shrink: 0;
    color: #64748B;
}
.quick-link-row a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.quick-link-row .quick-link-del {
    background: transparent;
    border: 1px solid #FECACA;
    color: #DC2626;
    border-radius: 6px;
    padding: .25rem .375rem;
    cursor: pointer;
    line-height: 1;
    font-size: .75rem;
}
.quick-link-row .quick-link-del:hover {
    background: #FEF2F2;
}
.quick-links-empty {
    color: #94A3B8;
    font-size: .8125rem;
    font-style: italic;
    padding: .25rem 0 .5rem;
}
.quick-links-add {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed #E2E8F0;
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}
.quick-links-add input {
    width: 100%;
    padding: .4375rem .625rem;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: .8125rem;
    font-family: inherit;
}
.quick-links-add input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.quick-links-add .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
.quick-links-add button {
    justify-self: end;
}

/* =========================================================================
   News / Company Updates
   ========================================================================= */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.news-feed-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.dashboard-news { margin-bottom: 1.75rem; }

.news-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-left: 4px solid #94a3b8;
    border-radius: var(--radius, 10px);
    padding: 1.1rem 1.35rem;
    box-shadow: var(--shadow);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.news-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.news-card.news-pinned {
    border-left-color: #2563eb;
    background: #f8fafc;
}

.news-card-head {
    display: flex;
    align-items: center;
    gap: .625rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.news-cat {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #e2e8f0;
    color: #475569;
}
.news-cat-update       { background: #e2e8f0; color: #475569; }
.news-cat-announcement { background: #dbeafe; color: #1d4ed8; }
.news-cat-policy       { background: #fef3c7; color: #b45309; }
.news-cat-kudos        { background: #dcfce7; color: #15803d; }
.news-cat-alert        { background: #fee2e2; color: #b91c1c; }

.news-pin-badge {
    font-size: .6875rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.news-date {
    margin-left: auto;
    font-size: .75rem;
    color: var(--color-text-muted);
}

.news-title {
    margin: 0 0 .5rem 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}
h4.news-title { font-size: 1rem; }

.news-body {
    color: var(--color-text);
    font-size: .9375rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .75rem;
    padding-top: .625rem;
    border-top: 1px solid #f1f5f9;
    font-size: .75rem;
    color: var(--color-text-muted);
}
.news-audience { font-style: italic; }
.news-actions {
    margin-left: auto;
    display: flex;
    gap: .75rem;
}
.btn-link-danger { color: #dc2626; }
.btn-link-danger:hover { color: #991b1b; }

/* =========================================================================
   Dashboard v2 — Hero, Next Job, Stats, Util, Event Cards, Widgets
   ========================================================================= */

/* ---- 1. Gradient hero banner ---- */
.dash-hero {
    position: relative;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border-radius: 14px;
    padding: 2rem 2.25rem 1.75rem;
    margin-bottom: 1.5rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(37, 99, 235, .18);
    overflow: hidden;
}
.dash-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%);
    pointer-events: none;
}
.dash-hero-inner { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.dash-role-badge {
    display: inline-block;
    padding: .3rem .75rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #cbd5e1;
    margin-bottom: .75rem;
}
.dash-hero-greeting {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.15;
}
.dash-hero-date {
    margin: .35rem 0 0 0;
    font-size: .9375rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}
.dash-hero-sub {
    margin: .5rem 0 0 0;
    font-size: .875rem;
    color: rgba(255,255,255,0.6);
}
.dash-hero-today {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: .85rem 1.1rem;
    min-width: 200px;
    max-width: 280px;
    flex-shrink: 0;
}
.dash-today-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,0.5);
    margin-bottom: .35rem;
}
.dash-today-name { font-size: .875rem; font-weight: 600; color: #fff; }
.dash-today-time { font-size: .8125rem; color: rgba(255,255,255,0.7); margin-top: .15rem; }
.dash-today-loc  { font-size: .75rem; color: rgba(255,255,255,0.5); margin-top: .1rem; }
.dash-today-btn  {
    display: inline-block; margin-top: .5rem;
    font-size: .75rem; color: #fff; text-decoration: none;
    padding: .25rem .65rem; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px; transition: background .15s;
}
.dash-today-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

.dash-hero-alert {
    position: relative;
    z-index: 1;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .85rem 1.1rem;
    background: rgba(251, 191, 36, .14);
    border: 1px solid rgba(251, 191, 36, .5);
    border-radius: 10px;
    color: #fef3c7;
    font-size: .9375rem;
}
.dash-alert-icon { font-size: 1.15rem; }
.dash-alert-text { flex: 1; }
.dash-alert-text strong { color: #fde68a; font-weight: 600; }
.dash-alert-loc { color: #fcd34d; }
.dash-alert-btn {
    padding: .45rem .9rem;
    background: #fbbf24;
    color: #78350f;
    font-weight: 600;
    font-size: .8125rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background .15s ease;
}
.dash-alert-btn:hover { background: #f59e0b; }

/* ---- 2. Next Job hero card ---- */
.next-job-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-left: 5px solid #2563EB;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.next-job-hero.next-job-empty {
    border-left-color: #cbd5e1;
    background: #f8fafc;
}
.next-job-left { flex: 1; min-width: 0; }
.next-job-label {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #2563EB;
    margin-bottom: .35rem;
}
.next-job-empty .next-job-label { color: #94a3b8; }
.next-job-title {
    margin: 0 0 .75rem 0;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--color-text, #0f172a);
    line-height: 1.2;
}
.next-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: #64748b;
    font-size: .9375rem;
}
.next-job-meta-empty { color: #94a3b8; margin: 0; }
.njm-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.njm-item svg { color: #94a3b8; flex-shrink: 0; }
.next-job-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .9rem;
}
.next-job-countdown {
    font-size: 1.85rem;
    font-weight: 700;
    color: #2563EB;
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.next-job-btn {
    display: inline-block;
    padding: .65rem 1.25rem;
    background: #2563EB;
    color: #fff;
    font-weight: 600;
    font-size: .875rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .2);
}
.next-job-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* ---- 3. Stats row v2 ---- */
.stats-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stats-grid-v2.stats-grid-staff { grid-template-columns: repeat(3, 1fr); }
.stats-grid-v2.stats-grid-contract { grid-template-columns: 1fr; max-width: 400px; }

.stat-card.stat-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem 1.35rem;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card.stat-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}
.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-blue   .stat-icon { background: #dbeafe; color: #2563EB; }
.stat-green  .stat-icon { background: #d1fae5; color: #059669; }
.stat-purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.stat-orange .stat-icon { background: #ffedd5; color: #ea580c; }
.stat-teal   .stat-icon { background: #ccfbf1; color: #0d9488; }

.stat-card.stat-v2 .stat-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.stat-card.stat-v2 .stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .2rem;
}
.stat-value-lg {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text, #0f172a);
    line-height: 1;
    letter-spacing: -.02em;
}
.stat-card.stat-v2 .stat-detail {
    font-size: .8125rem;
    color: #64748b;
    margin-top: .3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 4. Utilization section ---- */
.util-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}
.util-section > :only-child { grid-column: 1 / -1; }
.my-util-card.my-util-card-v2 { margin-bottom: 0; }
.util-bar.util-bar-lg {
    height: 14px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}
.util-bar.util-bar-lg .util-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}
.util-bar-fill.util-green  { background: linear-gradient(90deg, #10b981, #059669); }
.util-bar-fill.util-yellow { background: linear-gradient(90deg, #fbbf24, #d97706); }
.util-bar-fill.util-red    { background: linear-gradient(90deg, #f87171, #dc2626); }

.team-util-card {
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}
.team-util-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .9rem;
}
.team-util-header h3 {
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
}
.team-util-list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.team-util-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.team-util-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #e2e8f0;
    display: grid;
    place-items: center;
    color: #475569;
    font-size: .75rem;
    font-weight: 600;
}
.team-util-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-util-info { flex: 1; min-width: 0; }
.team-util-name {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
    margin-bottom: .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.util-bar.util-bar-sm {
    height: 6px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}
.util-bar.util-bar-sm .util-bar-fill {
    height: 100%;
    border-radius: 999px;
}
.team-util-pct {
    font-size: .8125rem;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}
.team-util-pct.util-green  { color: #059669; }
.team-util-pct.util-yellow { color: #d97706; }
.team-util-pct.util-red    { color: #dc2626; }

/* ---- 5. News v2 ---- */
.dashboard-news-v2 .toolbar-actions {
    display: flex;
    align-items: center;
    gap: .875rem;
}
.dashboard-news-v2 .news-feed-compact {
    grid-template-columns: repeat(2, 1fr);
}
.news-card.news-pinned {
    background: #FFFBEB;
    border-left-color: #f59e0b;
    border-color: #fde68a;
}
.news-pin-star {
    color: #f59e0b;
    font-size: 1.05rem;
    font-weight: 700;
}
.news-card.news-pinned .news-pin-badge { color: #b45309; }

/* ---- 6. Coming Up event cards grid ---- */
.coming-up-section { margin-top: .25rem; margin-bottom: 1.75rem; }
.event-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.event-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 12px;
    padding: 1.1rem 1.3rem 1.25rem;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.event-card:hover {
    transform: translateY(-2px);
    border-color: #2563EB;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .1);
}
.event-card.event-card-thisweek {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    border-color: #bfdbfe;
}
.event-card-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}
.event-badge {
    display: inline-block;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.event-badge-week { background: #dbeafe; color: #1d4ed8; }
.event-badge-ppe  { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.event-card-head .status-badge { margin-left: auto; }

.event-card-title {
    margin: 0 0 .65rem 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
    line-height: 1.3;
}
.event-card-meta {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    color: #64748b;
    font-size: .8125rem;
    margin-bottom: 1rem;
}
.ecm-row {
    display: flex;
    align-items: center;
    gap: .45rem;
}
.ecm-row svg { color: #94a3b8; flex-shrink: 0; }
.event-card-btn {
    align-self: flex-start;
    margin-top: auto;
}

/* ---- 7. Role-specific widgets ---- */
.attention-card,
.mydocs-card {
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 1.15rem 1.4rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.mydocs-card { border-left-color: #2563EB; }

.attention-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .9rem;
}
.attention-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
}
.attention-count {
    padding: .15rem .55rem;
    background: #fef3c7;
    color: #b45309;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}
.attention-list,
.mydocs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.attention-list li,
.mydocs-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .875rem;
}
.attention-list li:last-child,
.mydocs-list li:last-child { border-bottom: none; }
.attention-list a {
    color: var(--color-text, #0f172a);
    font-weight: 600;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attention-list a:hover { color: #2563EB; }
.attention-date {
    color: #64748b;
    font-size: .75rem;
    flex-shrink: 0;
}
.attention-issues {
    color: #b45309;
    font-size: .75rem;
    font-style: italic;
    flex-shrink: 0;
}

.mydocs-list a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text, #0f172a);
    flex: 1;
    min-width: 0;
}
.mydocs-list a:hover strong { color: #2563EB; }
.mydocs-list strong {
    font-size: .875rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mydocs-event {
    font-size: .75rem;
    color: #64748b;
    margin-top: .1rem;
}
.mydocs-date {
    color: #64748b;
    font-size: .75rem;
    flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
    .stats-grid-v2 { grid-template-columns: repeat(2, 1fr); }
    .event-cards-grid { grid-template-columns: 1fr; }
    .dashboard-news-v2 .news-feed-compact { grid-template-columns: 1fr; }
    .util-section { grid-template-columns: 1fr; }
    .next-job-hero { flex-direction: column; align-items: flex-start; }
    .next-job-right { align-items: flex-start; text-align: left; }
}
@media (max-width: 600px) {
    .dash-hero { padding: 1.5rem 1.35rem 1.35rem; }
    .dash-hero-greeting { font-size: 1.5rem; }
    .stats-grid-v2 { grid-template-columns: 1fr; }
    .next-job-title { font-size: 1.3rem; }
    .next-job-countdown { font-size: 1.5rem; }
}

/* =========================================================================
   Announcements page (news.php)
   ========================================================================= */
.announcements-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.announcements-page-title {
    margin: 0 0 .25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--color-text, #0f172a);
}
.announcements-page-sub {
    margin: 0;
    color: var(--color-text-muted, #64748b);
    font-size: .9375rem;
}
.announcements-page-actions {
    display: flex;
    gap: .625rem;
    align-items: center;
}

/* List */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 860px;
}

/* Card */
.announcement-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 1.35rem 1.5rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.announcement-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.announcement-card.is-pinned {
    background: #FFFBEB;
    border-color: #fde68a;
    box-shadow: 0 2px 6px rgba(245, 158, 11, .12);
}

.announcement-pin-marker {
    position: absolute;
    top: -10px;
    left: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    background: #f59e0b;
    color: #fff;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: 0 2px 6px rgba(245, 158, 11, .3);
}

.announcement-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}
.announcement-author {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.announcement-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #dbeafe;
    display: grid;
    place-items: center;
    color: #1d4ed8;
    font-weight: 600;
    font-size: .8125rem;
    flex-shrink: 0;
}
.announcement-avatar img { width: 100%; height: 100%; object-fit: cover; }
.announcement-author-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.announcement-author-meta strong {
    font-size: .875rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
}
.announcement-author-meta span {
    font-size: .75rem;
    color: var(--color-text-muted, #64748b);
}

.announcement-actions {
    display: flex;
    gap: .4rem;
}
.btn.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn.btn-danger:hover { background: #b91c1c; }

.announcement-title {
    margin: 0 0 .55rem 0;
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--color-text, #0f172a);
    line-height: 1.3;
}
.announcement-body {
    font-size: .9375rem;
    line-height: 1.6;
    color: var(--color-text, #0f172a);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 1rem;
}

.announcement-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding-top: .85rem;
    border-top: 1px solid #f1f5f9;
}
.announcement-card.is-pinned .announcement-footer { border-top-color: #fde68a; }
.announcement-visible-label {
    font-size: .75rem;
    color: var(--color-text-muted, #64748b);
    font-weight: 500;
    margin-right: .25rem;
}
.announcement-role-chip {
    display: inline-block;
    padding: .2rem .6rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
}
.announcement-role-chip.chip-all {
    background: #dcfce7;
    color: #15803d;
}

/* Empty state */
.announcements-empty {
    max-width: 520px;
    margin: 3rem auto;
    text-align: center;
    padding: 2.5rem 2rem;
    background: #fff;
    border: 1px dashed var(--color-border, #e5e7eb);
    border-radius: 8px;
    color: var(--color-text-muted, #64748b);
}
.announcements-empty svg {
    color: #cbd5e1;
    margin-bottom: .75rem;
}
.announcements-empty h3 {
    margin: 0 0 .4rem 0;
    color: var(--color-text, #0f172a);
    font-size: 1.125rem;
}
.announcements-empty p { margin: 0; font-size: .9375rem; }

/* Edit mode styling — echoes Resources page */
.btn.edit-mode-active {
    background: #2563EB;
    color: #fff;
    border-color: #2563EB;
}
.announcements-list.is-edit-mode .announcement-card {
    border-style: dashed;
}

/* =========================================================================
   Announcement Modal
   ========================================================================= */
.ann-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}
.ann-modal.is-open { display: flex; }
.ann-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}
.ann-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: annModalIn .2s ease;
}
@keyframes annModalIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ann-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.ann-modal-head h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text, #0f172a);
}
.ann-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 .25rem;
    transition: color .15s ease;
}
.ann-modal-close:hover { color: #0f172a; }
.ann-modal-form {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
}
.ann-modal-form .form-group { margin-bottom: 1.1rem; }
.form-group-label {
    display: block;
    font-weight: 600;
    font-size: .8125rem;
    color: var(--color-text, #0f172a);
    margin-bottom: .5rem;
}

/* Role checkbox grid in modal */
.role-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
}
.role-checkbox {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .75rem;
    background: #f8fafc;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
    font-size: .8125rem;
    transition: border-color .15s ease, background .15s ease;
}
.role-checkbox:hover {
    border-color: #2563EB;
    background: #f0f7ff;
}
.role-checkbox input { margin: 0; }
.role-checkbox input:checked + span { color: #2563EB; font-weight: 600; }

.ann-modal-form .form-actions {
    display: flex;
    gap: .625rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 640px) {
    .announcements-page-header { flex-direction: column; align-items: stretch; }
    .role-checkbox-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Pre-Job Checklist (event.php panel + templates page + dashboard widget)
   ========================================================================= */

/* Progress bar at top of panel */
.checklist-progress {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.checklist-progress-bar {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.checklist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #10b981);
    border-radius: 999px;
    transition: width .4s ease;
}
.checklist-progress-label {
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    min-width: 80px;
    text-align: right;
}

/* Category section */
.checklist-category { margin-bottom: 1.5rem; }
.checklist-category:last-child { margin-bottom: 0; }
.checklist-cat-head {
    margin: 0 0 .65rem 0;
    padding-bottom: .5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.checklist-cat-icon { font-size: 1rem; }

/* Item list */
.checklist-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem .85rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color .15s ease, background .15s ease;
}
.checklist-item:hover {
    border-color: #cbd5e1;
}
.checklist-item.is-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

/* Custom checkbox */
.checklist-item-check {
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}
.checklist-item-check input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.checklist-item-check input:disabled { cursor: not-allowed; }
.checklist-checkbox-visual {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
    position: relative;
}
.checklist-item-check input:checked ~ .checklist-checkbox-visual {
    background: #10b981;
    border-color: #10b981;
}
.checklist-item-check input:checked ~ .checklist-checkbox-visual::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checklist-item-check input:disabled ~ .checklist-checkbox-visual {
    opacity: .5;
}

/* Item body */
.checklist-item-main {
    flex: 1;
    min-width: 0;
}
.checklist-item-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.checklist-item-title {
    font-size: .9375rem;
    font-weight: 600;
    color: #0f172a;
}
.checklist-item.is-done .checklist-item-title {
    color: #64748b;
    text-decoration: line-through;
}
.checklist-item-desc {
    margin-top: .3rem;
    font-size: .8125rem;
    color: #64748b;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Role badges */
.checklist-role-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.checklist-role-badge.role-coordination { background: #ede9fe; color: #6d28d9; }
.checklist-role-badge.role-facilitator  { background: #dbeafe; color: #1d4ed8; }
.checklist-role-badge.role-both         { background: #dcfce7; color: #15803d; }

.checklist-required-badge {
    display: inline-block;
    padding: .15rem .55rem;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Completion footer inside item */
.checklist-item-completion {
    margin-top: .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .6rem;
    background: #dcfce7;
    color: #15803d;
    border-radius: 6px;
    font-size: .75rem;
}
.checklist-item-completion strong { color: #166534; }
.checklist-item-completion[hidden] { display: none; }

/* Delete button */
.checklist-delete-form {
    margin: 0;
    flex-shrink: 0;
}
.checklist-delete-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .35rem;
    transition: color .15s ease;
}
.checklist-delete-btn:hover { color: #dc2626; }

/* Add forms */
.checklist-add-form {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}
.checklist-add-form h4 {
    margin: 0 0 .75rem 0;
    font-size: .875rem;
    font-weight: 600;
    color: #0f172a;
}
.checklist-add-form .cl-form-row { margin-bottom: .65rem; }
.checklist-add-form input[type="text"],
.checklist-add-form textarea,
.checklist-add-form select {
    width: 100%;
    padding: .5rem .7rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: .8125rem;
    font-family: inherit;
    background: #fff;
}
.checklist-add-form input[type="text"]:focus,
.checklist-add-form textarea:focus,
.checklist-add-form select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.cl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: .5rem;
    align-items: center;
}
.cl-inline-check {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8125rem;
    color: #475569;
    white-space: nowrap;
}
.cl-inline-check input { width: auto; }
.cl-form-actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}

/* Panel header action buttons */
.panel-header .panel-actions {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

/* =========================================================================
   Checklist Templates page
   ========================================================================= */
.checklist-templates-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}
.checklist-templates-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tpl-category {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.tpl-cat-count {
    margin-left: auto;
    padding: .15rem .55rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
}
.tpl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.tpl-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.tpl-row:last-child { border-bottom: none; }
.tpl-info { flex: 1; min-width: 0; }
.tpl-info strong {
    display: block;
    font-size: .9375rem;
    font-weight: 600;
    color: #0f172a;
}
.tpl-desc {
    margin-top: .25rem;
    font-size: .8125rem;
    color: #64748b;
    line-height: 1.5;
}
.tpl-actions {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

/* Settings sub-nav (users.php) */
.settings-subnav {
    display: flex;
    gap: .5rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.settings-subnav-link {
    padding: .5rem .9rem;
    font-size: .875rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s ease, color .15s ease;
}
.settings-subnav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.settings-subnav-link.active {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Dashboard — Action Required widget */
.action-required-card {
    border-left-color: #2563EB;
}
.action-required-card .attention-count {
    background: #dbeafe;
    color: #1d4ed8;
}
.ar-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.ar-event {
    display: block;
    font-size: .75rem;
    color: #64748b;
    font-weight: 400;
    margin-top: .1rem;
}

@media (max-width: 860px) {
    .checklist-templates-layout { grid-template-columns: 1fr; }
    .cl-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .checklist-item { flex-wrap: wrap; }
    .panel-header .panel-actions { width: 100%; margin-top: .5rem; }
}

/* =========================================================================
   MY SCHEDULE — personal month calendar
   ========================================================================= */
.myschedule-page { display: flex; flex-direction: column; gap: 1.5rem; }
.myschedule-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.myschedule-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem 0; color: var(--color-text, #0f172a); }
.myschedule-sub { margin: 0; color: var(--color-text-muted, #64748b); font-size: .9375rem; }

.calendar-card {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.calendar-nav { display: flex; gap: .375rem; }
.calendar-month-label { margin: 0; text-align: center; font-size: 1.25rem; font-weight: 600; color: #0f172a; }
.calendar-legend {
    display: flex;
    gap: .875rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: .75rem;
    color: #64748b;
}
.calendar-legend span { display: inline-flex; align-items: center; gap: .375rem; }
.calendar-legend .dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 3px;
}
.dot-confirmed  { background: #2563eb; }
.dot-min-met    { background: #16a34a; }
.dot-this-week  { background: #f59e0b; }
.dot-past       { background: #94a3b8; }
.dot-pto        { background: #f9a8c4; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border, #e2e8f0);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}
.calendar-dow {
    background: #f8fafc;
    padding: .5rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-align: center;
}
.calendar-cell {
    background: #fff;
    min-height: 96px;
    padding: .375rem;
    display: flex;
    flex-direction: column;
    gap: .1875rem;
    position: relative;
    overflow: hidden;
}
.calendar-cell.out-of-month { background: #f8fafc; }
.calendar-cell.out-of-month .calendar-cell-num { color: #cbd5e1; }
.calendar-cell.is-today {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px #2563eb;
}
.calendar-cell-num {
    font-size: .8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: .125rem;
}
.calendar-cell.is-today .calendar-cell-num { color: #2563eb; }

.cal-pill {
    display: block;
    font-size: .6875rem;
    line-height: 1.25;
    padding: .1875rem .375rem;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    border: 0;
}
.cal-pill:hover { filter: brightness(1.08); color: #fff; }
.cal-pill.pill-confirmed { background: #2563eb; }
.cal-pill.pill-min-met   { background: #16a34a; }
.cal-pill.pill-this-week { background: #f59e0b; color: #422006; }
.cal-pill.pill-past      { background: #cbd5e1; color: #475569; }
.cal-pill.pill-pto       { background: #fbcfe8; color: #831843; border: 1px dashed #f9a8d4; }

/* Multi-day event segments (Option B — connected per-cell bars) */
.cal-pill.seg-start,
.calendar-event.seg-start {
    border-radius: 4px 0 0 4px;
    margin-right: -0.5rem;
    padding-right: 0.5rem;
}
.cal-pill.seg-mid,
.calendar-event.seg-mid {
    border-radius: 0;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.cal-pill.seg-end,
.calendar-event.seg-end {
    border-radius: 0 4px 4px 0;
    margin-left: -0.5rem;
    padding-left: 0.5rem;
}

/* Upcoming list card */
.upcoming-card {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.upcoming-title { font-size: 1.125rem; font-weight: 600; margin: 0 0 1rem 0; color: #0f172a; }
.upcoming-empty { padding: 2rem 1rem; text-align: center; }
.upcoming-empty p { margin: .25rem 0; }
.upcoming-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .625rem; }
.upcoming-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: .875rem 1rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.upcoming-row:hover { border-color: #cbd5e1; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
.upcoming-row.upcoming-pto { background: #fdf2f8; border-color: #fbcfe8; }
.upcoming-date {
    text-align: center;
    border-right: 1px solid var(--color-border, #e2e8f0);
    padding-right: 1rem;
}
.upcoming-date-mon { font-size: .6875rem; color: #ef4444; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.upcoming-date-day { font-size: 1.375rem; font-weight: 700; color: #0f172a; line-height: 1; margin-top: .125rem; }
.upcoming-info { min-width: 0; }
.upcoming-name { font-weight: 600; font-size: .9375rem; color: #0f172a; margin-bottom: .125rem; }
.upcoming-name a { color: inherit; text-decoration: none; }
.upcoming-name a:hover { color: #2563eb; text-decoration: underline; }
.upcoming-meta { font-size: .8125rem; color: #64748b; display: flex; gap: .375rem; flex-wrap: wrap; }
.upcoming-days { font-size: .8125rem; font-weight: 600; color: #2563eb; white-space: nowrap; }

@media (max-width: 900px) {
    .calendar-toolbar { grid-template-columns: 1fr; text-align: center; }
    .calendar-legend  { justify-content: center; }
    .calendar-cell    { min-height: 72px; }
    .cal-pill         { font-size: .625rem; }
}
@media (max-width: 640px) {
    .calendar-cell    { min-height: 58px; padding: .25rem; }
    .calendar-cell-num { font-size: .75rem; }
    .cal-pill         { padding: .125rem .25rem; }
    .upcoming-row     { grid-template-columns: 50px 1fr; }
    .upcoming-days    { grid-column: 2; font-size: .75rem; margin-top: .25rem; }
}

/* =========================================================================
   MY DOCUMENTS — personal document hub
   ========================================================================= */
.mydocs-page { display: flex; flex-direction: column; gap: 1.25rem; }
.mydocs-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.mydocs-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem 0; color: #0f172a; }
.mydocs-sub   { margin: 0; color: #64748b; font-size: .9375rem; }

.mydocs-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: .75rem 1rem;
}
.mydocs-search { position: relative; flex: 1; min-width: 240px; }
.mydocs-search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.mydocs-search .form-input { padding-left: 2.25rem; width: 100%; }
.mydocs-sort { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: #475569; }
.mydocs-sort .form-input { padding: .4375rem .625rem; font-size: .875rem; }

.mydocs-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 1rem;
    text-align: center;
}
.mydocs-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.mydocs-empty h3 { margin: .25rem 0 .5rem 0; font-size: 1.125rem; color: #0f172a; }

.mydocs-list { display: flex; flex-direction: column; gap: .75rem; }
.mydocs-group {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.mydocs-group[open] .mydocs-chevron { transform: rotate(180deg); }
.mydocs-group-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.mydocs-group-head::-webkit-details-marker { display: none; }
.mydocs-group-head:hover { background: #f8fafc; }
.mydocs-group-info { flex: 1; min-width: 0; }
.mydocs-group-name { font-size: 1rem; font-weight: 600; color: #0f172a; margin-bottom: .125rem; }
.mydocs-group-name a { color: inherit; text-decoration: none; }
.mydocs-group-name a:hover { color: #2563eb; }
.mydocs-group-meta { font-size: .8125rem; color: #64748b; display: flex; gap: .375rem; flex-wrap: wrap; }
.mydocs-group-count {
    background: #eff6ff;
    color: #2563eb;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .625rem;
    border-radius: 999px;
}
.mydocs-chevron { color: #94a3b8; transition: transform .15s ease; flex-shrink: 0; }

.mydocs-files {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--color-border, #e2e8f0);
    background: #fafbfc;
}
.mydocs-file {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: .875rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #eef2f6;
}
.mydocs-file:last-child { border-bottom: 0; }
.mydocs-file-icon { font-size: 1.5rem; text-align: center; }
.mydocs-file-info { min-width: 0; }
.mydocs-file-name {
    font-weight: 500;
    font-size: .9375rem;
    color: #0f172a;
    text-decoration: none;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.mydocs-file-name:hover { color: #2563eb; text-decoration: underline; }
.mydocs-file-desc { font-size: .8125rem; color: #475569; margin-top: .125rem; }
.mydocs-file-meta { font-size: .75rem; color: #94a3b8; margin-top: .25rem; display: flex; gap: .375rem; flex-wrap: wrap; }

@media (max-width: 640px) {
    .mydocs-file { grid-template-columns: 28px 1fr; }
    .mydocs-file .btn { grid-column: 2; justify-self: start; margin-top: .5rem; }
}

/* =========================================================================
   CRM MODULE — Contacts / Organisations / Leads (Phase 1)
   ========================================================================= */
.crm-page { display: flex; flex-direction: column; gap: 1.25rem; }
.crm-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.crm-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem 0; color: #0f172a; }
.crm-sub { margin: 0; color: #64748b; font-size: .9375rem; }
.crm-cache-bar { display: flex; align-items: center; gap: .75rem; }
.crm-cache-age { font-size: .75rem; color: #94a3b8; }
.crm-breadcrumb { margin-bottom: -.5rem; }
.crm-breadcrumb a { color: #2563eb; text-decoration: none; font-size: .875rem; }
.crm-breadcrumb a:hover { text-decoration: underline; }

/* Filter bar */
.crm-filter-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: .75rem 1rem;
}
.crm-search { position: relative; flex: 1; min-width: 240px; }
.crm-search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.crm-search .form-input { padding-left: 2.25rem; width: 100%; }
.crm-filter-bar select.form-input { padding: .4375rem .625rem; font-size: .875rem; max-width: 220px; }

.crm-view-toggle { display: inline-flex; margin-left: auto; border: 1px solid var(--color-border, #e2e8f0); border-radius: 6px; overflow: hidden; }
.crm-view-toggle a { padding: .4375rem .625rem; color: #64748b; display: inline-flex; align-items: center; }
.crm-view-toggle a.active { background: #2563eb; color: #fff; }
.crm-view-toggle a:not(.active):hover { background: #f1f5f9; }

/* Avatars */
.crm-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    color: #fff; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .875rem;
    flex-shrink: 0;
}
.crm-avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.crm-avatar-lg { width: 80px; height: 80px; font-size: 1.5rem; }

/* Empty states */
.crm-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 1rem;
    text-align: center;
}
.crm-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.crm-empty h3 { margin: .25rem 0 .5rem 0; color: #0f172a; }
.crm-empty-inner { padding: 1.25rem; text-align: center; }

/* Table view */
.crm-table-wrap {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table thead th {
    background: #f8fafc;
    text-align: left;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
    font-weight: 600;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.crm-table tbody td {
    padding: .75rem 1rem;
    border-bottom: 1px solid #eef2f6;
    font-size: .875rem;
    color: #334155;
    vertical-align: middle;
}
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table tbody tr:hover { background: #f8fafc; }
.crm-name-link { color: #0f172a; font-weight: 600; text-decoration: none; }
.crm-name-link:hover { color: #2563eb; }

/* Card grid */
.crm-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.crm-contact-card {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .375rem;
}
.crm-contact-card:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(37,99,235,0.1); transform: translateY(-2px); }
.crm-contact-card .crm-avatar { width: 64px; height: 64px; font-size: 1.125rem; margin-bottom: .25rem; }
.crm-contact-card-name { font-weight: 600; color: #0f172a; }
.crm-contact-card-title { font-size: .8125rem; color: #475569; }
.crm-contact-card-org { font-size: .8125rem; color: #2563eb; font-weight: 500; }
.crm-contact-card-meta { font-size: .75rem; color: #94a3b8; display: flex; flex-direction: column; gap: .125rem; word-break: break-word; }

/* Detail pages */
.crm-detail-header {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.crm-org-icon { font-size: 3rem; line-height: 1; }
.crm-detail-headinfo { flex: 1; min-width: 0; }
.crm-detail-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 .25rem 0; color: #0f172a; }
.crm-detail-title { font-size: .9375rem; color: #475569; margin-bottom: .125rem; }
.crm-detail-org { font-size: .9375rem; color: #2563eb; font-weight: 500; margin-bottom: .5rem; }
.crm-detail-org a { color: inherit; text-decoration: none; }
.crm-detail-org a:hover { text-decoration: underline; }
.crm-detail-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.crm-link-pill {
    display: inline-flex; align-items: center; gap: .375rem;
    background: #eff6ff; color: #2563eb;
    padding: .375rem .75rem; border-radius: 999px;
    font-size: .8125rem; text-decoration: none; font-weight: 500;
}
.crm-link-pill:hover { background: #dbeafe; }

.crm-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.crm-detail-main, .crm-detail-side { display: flex; flex-direction: column; gap: 1.25rem; }

.crm-count-pill {
    background: #eff6ff;
    color: #2563eb;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .625rem;
    border-radius: 999px;
}

.crm-info-list { margin: 0; padding: 1rem 1.25rem; display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; }
.crm-info-list dt { color: #64748b; font-size: .8125rem; font-weight: 500; }
.crm-info-list dd { margin: 0; color: #0f172a; font-size: .8125rem; word-break: break-word; }

/* Event history list */
.crm-event-history { list-style: none; margin: 0; padding: 0; }
.crm-event-row {
    display: flex; align-items: center; gap: 1rem;
    padding: .875rem 1.25rem;
    border-top: 1px solid #eef2f6;
}
.crm-event-row:first-child { border-top: 0; }
.crm-event-info { flex: 1; min-width: 0; }
.crm-event-name { font-weight: 600; color: #0f172a; margin-bottom: .125rem; }
.crm-event-name a { color: inherit; text-decoration: none; }
.crm-event-name a:hover { color: #2563eb; }
.crm-event-meta { font-size: .8125rem; color: #64748b; display: flex; gap: .375rem; }
.crm-event-status { font-size: .75rem; padding: .25rem .5rem; background: #f1f5f9; color: #475569; border-radius: 4px; }

/* Org contacts list */
.crm-org-contact-list { list-style: none; padding: 0; margin: 0; }
.crm-org-contact-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid #eef2f6;
}
.crm-org-contact-row:first-child { border-top: 0; }
.crm-org-contact-name { font-weight: 600; color: #0f172a; }
.crm-org-contact-name a { color: inherit; text-decoration: none; }
.crm-org-contact-name a:hover { color: #2563eb; }
.crm-org-contact-title { font-size: .8125rem; color: #64748b; }
.crm-org-contact-meta { font-size: .8125rem; color: #475569; display: flex; flex-direction: column; align-items: flex-end; gap: .125rem; }
.crm-org-contact-meta a { color: #2563eb; text-decoration: none; }

/* =========================================================================
   LEADS — Kanban board + slide-out
   ========================================================================= */
.crm-leads-page { padding-bottom: 2rem; }

.leads-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.leads-stat { padding: 0 .5rem; border-left: 1px solid #f1f5f9; }
.leads-stat:first-child { border-left: 0; }
.leads-stat-label { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .25rem; }
.leads-stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; }

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(240px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
}
.kanban-col {
    background: #f8fafc;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 78vh;
}
.kanban-col-header {
    padding: .875rem 1rem;
    border-top: 3px solid;
    border-radius: 10px 10px 0 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-col-title { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: #0f172a; font-size: .875rem; }
.kanban-col-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.kanban-col-meta { font-size: .75rem; color: #64748b; display: flex; gap: .5rem; align-items: center; }
.kanban-col-count { background: #f1f5f9; padding: .125rem .5rem; border-radius: 999px; font-weight: 600; }
.kanban-col-value { color: #16a34a; font-weight: 600; }

.kanban-col-body { padding: .75rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .625rem; }
.kanban-empty { text-align: center; color: #94a3b8; font-size: .8125rem; padding: 1.5rem 0; }

.kanban-card {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: .75rem .875rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.kanban-card:hover { border-color: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,0.12); transform: translateY(-1px); }
.kanban-card-topic { font-weight: 600; color: #0f172a; font-size: .875rem; line-height: 1.35; }
/* Expedite flag (v3.53): rendered only when crm_leads.is_expedite is set;
   non-expedited leads show nothing urgency-related anywhere. */
.lead-expedite-badge { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kanban-card-contact { font-size: .75rem; color: #475569; }
.kanban-card-row { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; }
.kanban-card-value { color: #16a34a; font-weight: 600; }
.kanban-card-date { color: #64748b; }
.kanban-card-foot { display: flex; align-items: center; gap: .5rem; padding-top: .25rem; border-top: 1px dashed #f1f5f9; }
.kanban-urgency { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.urgency-red { background: #ef4444; }
.urgency-amber { background: #f59e0b; }
.urgency-green { background: #16a34a; }
.kanban-days { font-size: .6875rem; color: #64748b; }

/* Slide-out panel */
.lead-panel-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 100;
    opacity: 0;
    transition: opacity .2s ease;
}
.lead-panel-overlay.open { opacity: 1; }

.lead-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 92vw;
    background: #fff;
    border-left: 1px solid var(--color-border, #e2e8f0);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
    z-index: 101;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}
.lead-panel.open { transform: translateX(0); }
.lead-panel-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lead-panel-head h3 { margin: 0; font-size: 1.0625rem; color: #0f172a; }
.lead-panel-close {
    background: none; border: 0;
    width: 32px; height: 32px;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
}
.lead-panel-close:hover { background: #f1f5f9; color: #0f172a; }
.lead-panel-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.lead-panel-body h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; margin: 1.25rem 0 .5rem 0; }
.lead-panel-body h4:first-child { margin-top: 0; }
.lead-panel-info { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 1rem 0; }
.lead-panel-info dt { color: #64748b; font-size: .8125rem; }
.lead-panel-info dd { margin: 0; color: #0f172a; font-size: .8125rem; text-transform: capitalize; }

@media (max-width: 1100px) {
    .crm-detail-grid { grid-template-columns: 1fr; }
    .leads-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .kanban-board { grid-template-columns: repeat(5, 260px); }
}
@media (max-width: 700px) {
    .crm-filter-bar { flex-direction: column; align-items: stretch; }
    .crm-filter-bar select.form-input { max-width: 100%; }
    .crm-view-toggle { margin-left: 0; align-self: flex-start; }
    .leads-stats-bar { grid-template-columns: 1fr 1fr; }
    .crm-detail-header { flex-direction: column; text-align: center; }
}

/* =========================================================================
   ROLE-SPECIFIC DASHBOARD LAYOUTS (v3)
   ========================================================================= */

/* Two-column layout used by admin, coordination, leadership */
.dash-two-col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.dash-col-left, .dash-col-right { display: flex; flex-direction: column; gap: 1.25rem; }

@media (max-width: 900px) {
    .dash-two-col { grid-template-columns: 1fr; }
}

/* Panel (generic card container used in dashboards) */
.panel {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}
.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-header h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #0f172a; }
.panel-empty { padding: 1.5rem 1.25rem; text-align: center; }
.panel-footer { padding: .75rem 1.25rem; border-top: 1px solid #f1f5f9; text-align: right; }

/* Coordination urgent alert */
.coord-urgent-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: .875rem 1.25rem;
    font-size: .9375rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* Team Activity list (admin / coordination) */
.team-activity-list { list-style: none; padding: 0; margin: 0; }
.team-activity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.team-activity-row:last-child { border-bottom: 0; }
.team-activity-avatar { flex-shrink: 0; }
.team-activity-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.team-activity-info { flex: 1; min-width: 0; font-size: .9375rem; color: #334155; }
.team-activity-info em { font-style: normal; color: #2563eb; font-weight: 500; }
.team-activity-meta { font-size: .8125rem; color: #64748b; margin-top: .125rem; }

/* Needs Attention v2 */
.attention-list-v2 { list-style: none; padding: 0; margin: 0; }
.attention-list-v2 li {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.attention-list-v2 li:last-child { border-bottom: 0; }
.attn-name { font-weight: 600; color: #0f172a; text-decoration: none; flex: 1; min-width: 0; }
.attn-name:hover { color: #2563eb; }
.attn-date { font-size: .75rem; color: #64748b; }
.attn-badges { display: flex; gap: .375rem; flex-wrap: wrap; width: 100%; }
.attn-badge {
    font-size: .6875rem;
    background: #fef2f2;
    color: #ef4444;
    padding: .125rem .5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Week events list (coordination) */
.week-events-list { list-style: none; padding: 0; margin: 0; }
.week-event-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.week-event-row:last-child { border-bottom: 0; }
.week-event-info { flex: 1; min-width: 0; }
.week-event-name { font-weight: 600; color: #0f172a; text-decoration: none; display: block; margin-bottom: .125rem; }
.week-event-name:hover { color: #2563eb; }
.week-event-meta { font-size: .8125rem; color: #64748b; display: flex; gap: .375rem; flex-wrap: wrap; }
.week-event-checks { display: flex; gap: .25rem; font-size: .875rem; }

/* News card mini (dashboard version) */
.news-card-mini {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.news-card-mini:last-child { border-bottom: 0; }
.news-card-mini.news-pinned { background: #fffbeb; }
.news-card-mini h4 { margin: 0 0 .25rem 0; font-size: .9375rem; font-weight: 600; color: #0f172a; }
.news-card-mini p { margin: 0 0 .375rem 0; font-size: .8125rem; color: #475569; line-height: 1.5; }
.news-card-mini .news-date { font-size: .75rem; color: #94a3b8; }

/* CRM quick stats (admin / leadership sidebar widget) */
.crm-quick-stats { padding: .75rem 1.25rem; margin: 0; }
.cqs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.cqs-row:last-child { border-bottom: 0; }
.crm-quick-stats dt { color: #64748b; font-size: .8125rem; font-weight: 500; }
.crm-quick-stats dd { margin: 0; color: #0f172a; font-size: .9375rem; font-weight: 700; }
.crm-quick-stats-horiz {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.crm-quick-stats-horiz .cqs-row {
    flex-direction: column;
    text-align: center;
    border-bottom: 0;
    border-right: 1px solid #f1f5f9;
    padding: .75rem .5rem;
}
.crm-quick-stats-horiz .cqs-row:last-child { border-right: 0; }
.crm-quick-stats-horiz dd { font-size: 1.25rem; margin-top: .25rem; }

/* Quick links row (facilitators) */
.quick-links-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
}
.quick-link-card {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: #0f172a;
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    transition: border-color .15s, box-shadow .15s;
}
.quick-link-card:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.ql-icon { font-size: 1.5rem; }

/* Contract facilitator job list */
.contract-jobs-list { list-style: none; padding: 0; margin: 0; }
.contract-job-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.contract-job-row:last-child { border-bottom: 0; }
.contract-job-name { font-weight: 600; color: #0f172a; }
.contract-job-meta { font-size: .8125rem; color: #64748b; margin-top: .125rem; }

.contract-docs-list { list-style: none; padding: 0; margin: 0; }
.contract-docs-list li {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
}
.contract-docs-list li:last-child { border-bottom: 0; }
.contract-docs-list a { color: #0f172a; text-decoration: none; font-size: .875rem; }
.contract-docs-list a:hover { color: #2563eb; }

@media (max-width: 700px) {
    .crm-quick-stats-horiz { grid-template-columns: 1fr 1fr; }
    .quick-links-row { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   TASKS PAGE
   ===================================================================== */
.tasks-page { max-width: 800px; }

/* Tab bar */
.tasks-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.tasks-tab {
    padding: .65rem 1.25rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.tasks-tab:hover { color: var(--color-text); }
.tasks-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.tasks-tab-badge {
    background: #e0e7ff;
    color: #3b52c9;
    font-size: .7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.tasks-tab.active .tasks-tab-badge {
    background: #2563eb;
    color: #fff;
}

/* Add form */
.tasks-add-form {
    margin-bottom: 1.25rem;
}
.tasks-add-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.tasks-add-input { flex: 1; }
.tasks-add-date { width: 160px; }
.tasks-add-notes-row { margin-top: .5rem; }
.tasks-add-notes { width: 100%; }
.tasks-toggle-notes {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .8rem;
    cursor: pointer;
    padding: .25rem 0;
    margin-top: .25rem;
}
.tasks-toggle-notes:hover { color: #2563eb; }

/* Task cards */
.tasks-list { display: flex; flex-direction: column; gap: .5rem; }
.task-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: .75rem 1rem;
    transition: border-color .15s, box-shadow .15s;
}
.task-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.task-card.task-overdue {
    border-left: 3px solid #dc2626;
}

/* Checkbox */
.task-check-form { display: flex; align-items: center; }
.task-checkbox {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 2px;
    border-radius: 50%;
    transition: color .15s;
    display: flex;
    flex-shrink: 0;
}
.task-checkbox:hover { color: #2563eb; }
.task-checked { color: #16a34a; }
.task-checked:hover { color: #b91c1c; }

/* Content */
.task-content { flex: 1; min-width: 0; }
.task-title {
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-text);
    word-break: break-word;
}
.task-notes {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .25rem;
    line-height: 1.4;
}
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .35rem;
    font-size: .75rem;
}
.task-due {
    color: var(--text-muted);
    font-weight: 500;
}
.task-due.due-overdue { color: #dc2626; }
.task-due.due-today { color: #ea580c; font-weight: 600; }
.task-due.due-soon { color: #d97706; }
.task-creator { color: var(--text-muted); }
.task-completed-info { color: var(--text-muted); font-style: italic; }

/* Done tasks */
.task-done { opacity: .6; }
.task-done .task-title { text-decoration: line-through; color: var(--text-muted); }

/* Actions */
.task-actions {
    display: flex;
    gap: .25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}
.task-card:hover .task-actions { opacity: 1; }
.task-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
}
.task-action-btn:hover { color: #2563eb; background: #f1f5f9; }
.task-delete:hover { color: #dc2626; background: #fef2f2; }

/* Completed section */
.tasks-completed-section { margin-top: 1.5rem; }
.tasks-completed-toggle {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: .5rem 0;
}
.tasks-completed-toggle:hover { color: var(--color-text); }
.tasks-done-list { margin-top: .5rem; }

/* Empty state */
.tasks-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: .9rem;
}

/* Edit modal */
.task-edit-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1000;
}
.task-edit-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    z-index: 1001;
}

@media (max-width: 600px) {
    .tasks-add-row { flex-wrap: wrap; }
    .tasks-add-date { width: 100%; }
    .task-actions { opacity: 1; }
}

/* =====================================================================
   PUBLIC SEMINARS WIDGET (Dashboard)
   ===================================================================== */
.pub-seminars-table-wrap { overflow-x: auto; }
.pub-seminars-table { font-size: .85rem; }
.pub-seminars-table th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
    font-weight: 600;
    padding: .6rem .75rem;
    border-bottom: 2px solid var(--border-color);
}
.pub-seminars-table td { padding: .65rem .75rem; vertical-align: middle; }
.pub-seminar-name {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}
.pub-seminar-name:hover { color: #2563eb; }
.pub-seminar-date { white-space: nowrap; font-size: .8rem; color: var(--text-muted); }
.pub-seminar-loc { font-size: .8rem; color: var(--text-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-seminar-pres { font-size: .8rem; color: var(--text-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Days badge */
.days-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--text-muted);
}
.days-badge.days-urgent { background: #fef2f2; color: #dc2626; }
.days-badge.days-soon { background: #fff7ed; color: #ea580c; }
.days-badge.days-near { background: #fffbeb; color: #d97706; }

/* Registration count */
.reg-count {
    font-weight: 700;
    font-size: .9rem;
}
.reg-cap { font-weight: 400; color: var(--text-muted); font-size: .8rem; }
.reg-count.reg-full { color: #16a34a; }
.reg-count.reg-met { color: #2563eb; }
.reg-count.reg-some { color: #d97706; }
.reg-count.reg-low { color: #dc2626; }
.reg-min-warn {
    font-size: .65rem;
    color: #dc2626;
    font-weight: 500;
    margin-top: 1px;
}

/* Fill bar */
.fill-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.fill-bar {
    flex: 1;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}
.fill-bar-inner {
    height: 100%;
    border-radius: 3px;
    transition: width .3s ease;
}
.fill-bar-inner.fill-low { background: #dc2626; }
.fill-bar-inner.fill-med { background: #d97706; }
.fill-bar-inner.fill-high { background: #16a34a; }
.fill-pct {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
}

@media (max-width: 768px) {
    .pub-seminars-table .pub-seminar-pres,
    .pub-seminars-table th:nth-child(7) { display: none; }
}

/* =====================================================================
   TASKS V2 — Enhanced task management
   ===================================================================== */
.tasks-page-v2 { max-width: 1200px; }

/* Filter bar */
.tasks-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.tasks-filter-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.tasks-filter-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.tasks-filter-select {
    font-size: .8125rem;
    padding: .375rem .75rem;
    min-width: 120px;
    max-width: 160px;
}
.tasks-search {
    max-width: 200px;
}
.tasks-search .form-input {
    font-size: .8125rem;
    padding-left: 2rem;
}

/* View toggle (My Tasks / All Tasks) */
.tasks-view-toggle {
    display: flex;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
}
.tasks-view-btn {
    padding: .375rem .875rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    background: #fff;
    border: none;
    transition: all .15s;
}
.tasks-view-btn:hover { background: #f8fafc; color: var(--color-text); }
.tasks-view-btn.active {
    background: #2563eb;
    color: #fff;
}
.tasks-view-btn + .tasks-view-btn {
    border-left: 1px solid var(--border-color, #e2e8f0);
}

/* Display toggle (List / Board) */
.tasks-display-toggle {
    display: flex;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
}
.tasks-display-btn {
    padding: .375rem .5rem;
    color: var(--text-muted);
    background: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all .15s;
}
.tasks-display-btn:hover { background: #f8fafc; color: var(--color-text); }
.tasks-display-btn.active { background: #f1f5f9; color: #2563eb; }
.tasks-display-btn + .tasks-display-btn { border-left: 1px solid var(--border-color, #e2e8f0); }

/* Add task panel */
.tasks-add-panel {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.tasks-add-form-v2 .form-group { margin-bottom: .75rem; }
.tasks-add-form-v2 .form-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .25rem;
}
.tasks-add-row-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: .75rem;
}
.tasks-tag-checks {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.tasks-tag-check {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8125rem;
    color: var(--color-text);
    cursor: pointer;
}
.tasks-tag-check input[type="checkbox"] { accent-color: #2563eb; }
.tasks-add-actions {
    display: flex;
    gap: .5rem;
    margin-top: .25rem;
}

/* Task group headers */
.task-group { margin-bottom: 1.25rem; }
.task-group-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    border-left: 3px solid var(--group-color, #64748b);
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    margin-bottom: .5rem;
    cursor: default;
    user-select: none;
}
.task-group-complete .task-group-header { cursor: pointer; }
.task-group-emoji { font-size: .875rem; }
.task-group-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--color-text);
}
.task-group-count {
    font-size: .7rem;
    font-weight: 600;
    background: var(--group-color, #64748b);
    color: #fff;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.task-group-body {
    display: flex;
    flex-direction: column;
    gap: .375rem;
}

/* Task rows (list view) */
.task-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .875rem;
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, opacity .3s;
}
.task-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.task-row-overdue { border-left: 3px solid #dc2626; }
.task-row-done { opacity: .55; }
.task-row-done .task-row-title { text-decoration: line-through; color: var(--text-muted); }
.task-completing { opacity: .3; transition: opacity .35s; }

/* Checkbox circle */
.task-row-checkbox {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    display: flex;
}
.task-check-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    color: transparent;
}
.task-row:hover .task-check-circle { border-color: #2563eb; }
.task-check-circle.task-checked {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* Row content */
.task-row-content { flex: 1; min-width: 0; }
.task-row-title {
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-text);
    word-break: break-word;
    line-height: 1.35;
}
.task-row-desc {
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .15rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

/* Row meta (badges, date, assignee) */
.task-row-meta {
    display: flex;
    align-items: center;
    gap: .375rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.task-row-due {
    font-size: .75rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}
.task-row-due.due-overdue { color: #dc2626; font-weight: 600; }
.task-row-due.due-today { color: #d97706; font-weight: 600; }

/* Row actions (show on hover) */
.task-row-actions {
    display: flex;
    gap: .25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}
.task-row:hover .task-row-actions { opacity: 1; }

/* Priority badges */
.priority-badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: capitalize;
}
.priority-low    { background: #f1f5f9; color: #94a3b8; }
.priority-medium { background: #eff6ff; color: #2563eb; }
.priority-high   { background: #fffbeb; color: #d97706; }
.priority-urgent { background: #fef2f2; color: #dc2626; }

/* Tag badges */
.tag-badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 8px;
    white-space: nowrap;
    background: color-mix(in srgb, var(--tag-color, #64748b) 12%, transparent);
    color: var(--tag-color, #64748b);
}

/* Assignee avatar (small) */
.task-assignee-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3b52c9;
    font-size: .625rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* ---- Task Panel (slide-out detail) ---- */
.task-panel-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 100;
    opacity: 0;
    transition: opacity .2s ease;
}
.task-panel-overlay.open { opacity: 1; }

.task-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 480px; max-width: 94vw;
    background: #fff;
    border-left: 1px solid var(--color-border, #e2e8f0);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
    z-index: 101;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}
.task-panel.open { transform: translateX(0); }
.task-panel-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.task-panel-head h3 { margin: 0; font-size: 1.0625rem; color: #0f172a; font-weight: 600; }
.task-panel-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}
.task-panel-body h4 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin: 1.5rem 0 .5rem 0;
    font-weight: 600;
}
.task-panel-body h4:first-child { margin-top: 0; }
.task-panel-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    font-size: .875rem;
}
.task-panel-actions {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
}

/* Comments in panel */
.task-comment {
    display: flex;
    gap: .625rem;
    margin-bottom: .75rem;
}
.task-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3b52c9;
    font-size: .625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.task-comment-body { flex: 1; min-width: 0; }
.task-comment-meta {
    font-size: .75rem;
    color: #64748b;
    margin-bottom: .2rem;
}
.task-comment-meta strong { color: #334155; font-weight: 600; }
.task-comment-meta span { margin-left: .5rem; font-size: .6875rem; }
.task-comment-text {
    font-size: .8125rem;
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
}
.task-comment-form {
    margin-top: .75rem;
}
.task-comment-form textarea { font-size: .8125rem; }

/* Activity log in panel */
.task-activity-log {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.task-activity-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .8125rem;
    color: #475569;
    line-height: 1.4;
}
.task-activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    margin-top: .35rem;
}
.task-activity-item strong { font-weight: 600; color: #334155; }
.task-activity-time {
    font-size: .6875rem;
    color: #94a3b8;
    white-space: nowrap;
    margin-left: auto;
}

/* Edit form in panel */
.task-edit-panel-form .form-group { margin-bottom: .75rem; }
.task-edit-panel-form .form-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .25rem;
}

/* ---- Task Board (Kanban) ---- */
.task-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
}
.task-kanban-col.drag-over {
    background: #eff6ff;
    border-color: #2563eb;
}
.task-kanban-card {
    cursor: pointer;
}
.task-kanban-card.dragging {
    opacity: .4;
}

@media (max-width: 900px) {
    .tasks-filter-bar { flex-direction: column; align-items: stretch; }
    .tasks-filter-left, .tasks-filter-right { width: 100%; }
    .tasks-add-row-fields { grid-template-columns: 1fr; }
    .task-board { grid-template-columns: repeat(3, 260px); }
    .task-row-actions { opacity: 1; }
    .task-row-desc { max-width: 200px; }
}
@media (max-width: 600px) {
    .tasks-filter-left { flex-direction: column; }
    .tasks-filter-select { max-width: none; width: 100%; }
    .tasks-search { max-width: none; width: 100%; }
    .task-row-meta { display: none; }
}

/* ============================================================
   Lead Sources Dashboard (crm-sources.php)
   ============================================================ */

/* Top stats row */
.sources-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sources-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.sources-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}
.sources-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Source performance cards (2-col grid) */
.sources-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.sources-card .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sources-source-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.sources-badge-sm { font-size: 0.625rem; padding: 0.15rem 0.5rem; }
.sources-card-body {
    padding: 1.25rem;
}
.sources-card-metric-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.sources-card-metric {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.sources-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}
.sources-metric-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.sources-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.trend-up { color: #16A34A; }
.trend-up::before { content: '\25B2'; font-size: 0.6rem; }
.trend-down { color: #DC2626; }
.trend-down::before { content: '\25BC'; font-size: 0.6rem; }
.sources-card-sub-metrics {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}
.sources-sep { margin: 0 0.35rem; }
.sources-card-detail {
    margin-bottom: 0.75rem;
}
.sources-detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}
.sources-detail-value {
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
}
.sources-avg-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sources-avg-num {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
}
.sources-avg-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.sources-avg-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
/* Domain average bars */
.sources-domain-avgs { display: flex; flex-direction: column; gap: 5px; }
.domain-avg-row { display: flex; align-items: center; gap: 6px; }
.domain-avg-label { font-size: 0.75rem; color: var(--color-text, #374151); min-width: 105px; flex-shrink: 0; white-space: nowrap; }
.domain-avg-score { font-size: 0.75rem; font-weight: 600; color: #111; min-width: 48px; flex-shrink: 0; white-space: nowrap; }
.domain-avg-pct { font-size: 0.7rem; color: var(--color-text-muted, #6B7280); min-width: 46px; flex-shrink: 0; white-space: nowrap; }
.domain-avg-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; min-width: 40px; }
.domain-avg-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.sources-band-dist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.sources-band-dist .assess-band-pill strong {
    margin-left: 0.25rem;
}
.sources-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.sources-keyword {
    display: inline-block;
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #334155;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.sources-keyword small {
    color: var(--color-text-muted);
    font-weight: 400;
}
.sources-card-link {
    display: inline-block;
    margin-top: 0.5rem;
}

/* Funnel visualization */
.sources-funnel-panel {
    margin-bottom: 1.5rem;
}
.sources-funnel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.funnel-stage {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.funnel-bar-wrap {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}
.funnel-bar {
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    transition: width 0.5s ease;
}
.funnel-bar-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.funnel-meta {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.funnel-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
    min-width: 160px;
}
.funnel-pct {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text);
    min-width: 40px;
}
.funnel-dropoff {
    font-size: 0.6875rem;
    color: #DC2626;
    font-weight: 500;
    white-space: nowrap;
}
.funnel-conv {
    font-size: 0.6875rem;
    color: #16A34A;
    font-weight: 600;
    white-space: nowrap;
}
.funnel-days {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-style: italic;
    white-space: nowrap;
}

/* Recent submissions */
.sources-recent-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.sources-search-form {
    display: flex;
    align-items: center;
}
.sources-search-input {
    width: 260px;
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
}
.sources-recent-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.8125rem;
}
.sources-recent-email {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}
.sources-topic-snip {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Responsive */
@media (max-width: 900px) {
    .sources-stats-row { grid-template-columns: repeat(2, 1fr); }
    .sources-cards-grid { grid-template-columns: 1fr; }
    .funnel-meta { min-width: 180px; }
    .funnel-label { min-width: 120px; }
    .sources-search-input { width: 200px; }
}
@media (max-width: 600px) {
    .sources-stats-row { grid-template-columns: 1fr 1fr; }
    .funnel-stage { flex-direction: column; align-items: stretch; }
    .funnel-meta { min-width: auto; }
    .sources-search-input { width: 160px; }
}

/* ========================================================
   Notification Preferences
   ======================================================== */
.notif-prefs-container {
    max-width: 700px;
}
.notif-prefs-intro {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.notif-prefs-group {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}
.notif-prefs-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}
.notif-prefs-group-header h3 {
    margin: 0;
    font-size: 0.9375rem;
}
.notif-prefs-group-header svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.notif-prefs-table {
    width: 100%;
    border-collapse: collapse;
}
.notif-prefs-table thead th {
    padding: 8px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.notif-prefs-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: opacity 0.2s;
}
.notif-prefs-table tbody tr:last-child {
    border-bottom: none;
}
.notif-prefs-table td {
    padding: 12px 16px;
    vertical-align: middle;
}
.notif-pref-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text);
}
.notif-pref-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.notif-pref-always {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 22px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Login page success message */
.login-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    text-align: center;
}

/* Secondary button variant */
.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover {
    background: var(--color-border);
    text-decoration: none;
}

/* ========================================================
   CRM Pipeline v2 — Kanban + List + Modals
   ======================================================== */

/* Kanban board — horizontal scroll with 6 columns */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}
.kanban-col {
    flex: 0 0 220px;
    min-width: 220px;
    background: var(--color-bg);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
}
.kanban-col-header {
    padding: 12px;
    border-top: 3px solid #ccc;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 1;
}
.kanban-col-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
}
.kanban-col-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kanban-col-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.kanban-col-count {
    background: var(--color-bg);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.6875rem;
}
.kanban-col-value {
    font-weight: 500;
}
.kanban-col-body {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kanban-col-body.drag-over {
    background: var(--color-primary-bg);
    border-radius: 0 0 var(--radius) var(--radius);
}
.kanban-empty {
    text-align: center;
    padding: 24px 8px;
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

/* Lead cards */
.kanban-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: grab;
    transition: box-shadow 0.15s, border-color 0.15s;
    position: relative;
    text-align: left;
    width: 100%;
    font-size: inherit;
}
.kanban-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}
.kanban-card.dragging {
    opacity: 0.5;
    box-shadow: var(--shadow-md);
}
.kanban-card-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text);
    margin-bottom: 2px;
    line-height: 1.3;
}
.kanban-card-company {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.kanban-card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.kanban-card-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-active);
}
.kanban-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.kanban-card-days {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}
.kanban-card-days.days-warning {
    color: #D97706;
    font-weight: 600;
}
.kanban-card-days.days-danger {
    color: #DC2626;
    font-weight: 600;
}
.kanban-card-owner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kanban-card-actions {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
}
.kanban-card:hover .kanban-card-actions {
    display: flex;
}
.kanban-card-view {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
}
.kanban-card-view:hover {
    background: var(--color-primary-hover);
}

/* Source badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* Stage pills (clickable in detail panel) */
.stage-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 12px 0;
}
.stage-pill {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--color-bg);
    color: var(--color-text-muted);
}
.stage-pill:hover {
    border-color: currentColor;
}
.stage-pill.active {
    color: #fff;
    border-color: transparent;
}

/* CRM List view table */
.leads-list-table {
    width: 100%;
    border-collapse: collapse;
}
.leads-list-table th {
    padding: 8px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
}
.leads-list-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8125rem;
    vertical-align: middle;
}
.leads-list-table tr:hover {
    background: var(--color-primary-bg);
}
.leads-list-table .stage-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
}

/* Lead slide-out panel */
.lead-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s;
}
.lead-panel-overlay.open {
    opacity: 1;
}
.lead-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lead-panel.open {
    transform: translateX(0);
}
.lead-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.lead-panel-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.lead-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    line-height: 1;
}
.lead-panel-close:hover {
    color: var(--color-text);
}
.lead-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Lead detail info grid */
.lead-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.lead-info-item {
    display: flex;
    flex-direction: column;
}
.lead-info-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}
.lead-info-value {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Lead panel tabs */
.lead-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin: 16px 0 12px;
}
.lead-tab {
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.lead-tab:hover {
    color: var(--color-text);
}
.lead-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.lead-tab-pane {
    display: none;
}
.lead-tab-pane.active {
    display: block;
}

/* Activity timeline */
.activity-timeline {
    padding-left: 20px;
    border-left: 2px solid var(--color-border);
    margin: 0;
    list-style: none;
}
.activity-item {
    position: relative;
    padding: 0 0 16px 16px;
    font-size: 0.8125rem;
}
.activity-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-surface);
}
.activity-item-date {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    display: block;
    margin-top: 2px;
}

/* Won/Lost modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    width: 400px;
    max-width: 90vw;
}
.modal-card h3 {
    margin: 0 0 16px;
    font-size: 1.0625rem;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* New lead panel */
.new-lead-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
.new-lead-panel.open {
    transform: translateX(0);
}

/* Contact search dropdown */
.contact-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}
.contact-search-item {
    padding: 8px 12px;
    font-size: 0.8125rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
}
.contact-search-item:hover {
    background: var(--color-primary-bg);
}
.contact-search-item:last-child {
    border-bottom: none;
}
.contact-search-new {
    color: var(--color-primary);
    font-weight: 600;
}

/* View toggle buttons */
.crm-view-toggle button {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 6px 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
}
.crm-view-toggle button:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.crm-view-toggle button:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}
.crm-view-toggle button.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Primary button */
.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    text-decoration: none;
}

/* Leads contact badges */
.lead-badge-active {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #DBEAFE;
    color: #1D4ED8;
}
.lead-badge-won {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #DCFCE7;
    color: #15803D;
}
.lead-badge-arlo {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #EDE9FE;
    color: #6D28D9;
}

/* Pipeline mini bar on dashboard */
.pipeline-mini-bar {
    display: flex;
    gap: 2px;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 16px 16px;
}

/* Inline editable fields */
.inline-edit {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: inherit;
    font-family: inherit;
    background: transparent;
    transition: border-color 0.15s;
    width: 100%;
}
.inline-edit:hover {
    border-color: var(--color-border);
}
.inline-edit:focus {
    border-color: var(--color-primary);
    outline: none;
    background: var(--color-surface);
}

/* Lead tasks list in panel */
.lead-tasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lead-task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8125rem;
}
.lead-task-item:last-child {
    border-bottom: none;
}
.lead-task-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
}
.lead-task-check.done {
    background: var(--color-active);
    border-color: var(--color-active);
}
.lead-task-title {
    flex: 1;
}
.lead-task-due {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* Lead History Cards (contact detail page) */
.lead-history-card {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}
.lead-history-active {
    background: #f0f9ff;
}
.lead-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.lead-history-topic {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 4px;
}
.lead-history-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #059669;
}
.lead-history-owner, .lead-history-source, .lead-history-notes {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.lead-history-days {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ============================================================
   CRM — Stats Bar, Notes Input, Note Cards, Tags, Follow-ups
   ============================================================ */

/* Stats bar */
.crm-stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.crm-stat-card {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: center;
}
.crm-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.crm-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Notes input area */
.notes-input-area {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.notes-type-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}
.notes-type-tab {
    background: none;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
}
.notes-type-tab:hover {
    background: #f8fafc;
    color: #0f172a;
}
.notes-type-tab.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
    font-weight: 600;
}
.notes-input-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Note cards */
.notes-list {
    /* container for note-card items */
}
.note-card {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.note-card:last-child { border-bottom: 0; }
.note-card-pinned {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
}
.note-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.375rem;
}
.note-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    color: #475569;
}
.note-contact-label {
    font-size: 0.75rem;
    color: #2563eb;
    font-weight: 500;
}
.note-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
}
.note-actions {
    display: flex;
    gap: 0.25rem;
}
.note-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0.4;
    transition: opacity 0.15s;
    padding: 2px;
}
.note-card:hover .note-action-btn { opacity: 0.8; }
.note-action-btn:hover { opacity: 1; }
.note-card-body {
    font-size: 0.875rem;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

/* Contact notes collapsible section (org page) */
.org-contact-notes-section {
    border-top: 1px solid var(--color-border, #e5e7eb);
}
.org-contact-notes-summary {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    user-select: none;
}
.org-contact-notes-summary:hover { color: #0f172a; }

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}
.tag-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    padding: 0;
    margin-left: 0.125rem;
    color: inherit;
}
.tag-remove-btn:hover { opacity: 1; }
.tags-add-wrap {
    padding: 0.5rem 1rem 0.75rem;
    position: relative;
}
.tags-dropdown {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}
.tags-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tag-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8125rem;
    border-radius: 4px;
    text-align: left;
    width: 100%;
    color: #0f172a;
}
.tag-dropdown-item:hover { background: #f1f5f9; }
.tag-pill-sm {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 0.8125rem;
    padding: 0;
    font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* Follow-ups */
.followups-list {
    /* container */
}
.followup-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.followup-item:last-child { border-bottom: 0; }
.followup-completed {
    opacity: 0.5;
}
.followup-overdue {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}
.followup-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.followup-date {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
}
.followup-contact {
    font-size: 0.8125rem;
    color: #2563eb;
}
.followup-status-badge {
    font-size: 0.6875rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #64748b;
    margin-left: auto;
}
.followup-complete-btn {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    cursor: pointer;
}
.followup-complete-btn:hover {
    background: #dcfce7;
}
.followup-note {
    font-size: 0.8125rem;
    color: #475569;
    margin-top: 0.25rem;
}
.followup-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.followup-quick-add {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* CRM Timeline (overrides for the CRM activity feed) */
.crm-page .timeline-list {
    padding-left: 0;
}
.crm-page .timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    position: relative;
}
.crm-page .timeline-item:last-child { border-bottom: 0; }
.crm-page .timeline-dot {
    position: static;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    border: none;
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1.4;
}
.crm-page .timeline-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.125rem;
}
.crm-page .timeline-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}
.timeline-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .crm-stats-bar {
        flex-direction: column;
    }
    .crm-stat-card {
        min-width: 0;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .kanban-col {
        flex: 0 0 200px;
        min-width: 200px;
    }
    .lead-panel, .new-lead-panel {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ============================================================
   CRM Phase 2 Components
   ============================================================ */

/* --- Notes System --- */
.notes-input-area { padding: 16px; border-bottom: 1px solid var(--color-border); }
.notes-type-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.notes-type-tab {
    padding: 6px 12px; border-radius: 6px; border: 1px solid var(--color-border);
    background: transparent; cursor: pointer; font-size: 0.8125rem;
    transition: all 0.15s;
}
.notes-type-tab:hover { background: var(--color-bg); }
.notes-type-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.notes-input-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.notes-list { }
.note-item { padding: 12px 16px; border-bottom: 1px solid var(--color-border); position: relative; }
.note-item:last-child { border-bottom: none; }
.note-item:hover .note-actions { opacity: 1; }
.note-pinned { background: #FFFBEB; border-left: 3px solid #D97706; }
.note-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.8125rem; }
.note-type-icon { font-size: 0.875rem; }
.note-author { font-weight: 600; color: var(--color-text); }
.note-time { color: var(--color-text-muted); margin-left: auto; }
.note-body { font-size: 0.875rem; color: var(--color-text); line-height: 1.5; white-space: pre-wrap; }
.note-pin-indicator { color: #D97706; font-size: 0.75rem; margin-left: 4px; }
.note-actions { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity 0.15s; display: flex; gap: 4px; }
.note-actions button { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; cursor: pointer; }
.note-actions button:hover { background: var(--color-border); }
.note-edit-area { margin-top: 8px; }

/* --- Activity Timeline --- */
.timeline-list { padding: 0; }
.timeline-month-group { }
.timeline-month-label {
    padding: 8px 16px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 1;
}
.timeline-item { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; flex-shrink: 0;
    background: var(--color-bg); border: 1px solid var(--color-border);
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-desc { font-size: 0.8125rem; color: var(--color-text); line-height: 1.4; }
.timeline-meta { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 2px; }
.timeline-item-arlo .timeline-icon { background: #F0FDFA; border-color: #0891B2; color: #0891B2; }

/* --- Tags --- */
.tags-list { padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 500; color: #fff;
    white-space: nowrap;
}
.tag-pill .tag-remove {
    cursor: pointer; margin-left: 2px; opacity: 0.7;
    font-size: 0.875rem; line-height: 1;
}
.tag-pill .tag-remove:hover { opacity: 1; }
.tags-add-wrap { padding: 8px 16px; position: relative; }
.tags-dropdown {
    position: absolute; bottom: 100%; left: 16px; right: 16px;
    background: #fff; border: 1px solid var(--color-border);
    border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 20; max-height: 200px; overflow-y: auto;
}
.tags-dropdown-list { }
.tags-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; font-size: 0.8125rem;
    border: none; background: none; width: 100%; text-align: left;
}
.tags-dropdown-item:hover { background: var(--color-bg); }
.tag-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tag-pill-sm { font-size: 0.6875rem; padding: 2px 8px; border-radius: 10px; }
.tag-pill-more { background: #E5E7EB !important; color: #6B7280 !important; font-size: 0.6875rem; }
.tag-more { font-size: 0.6875rem; color: var(--color-text-muted); padding: 2px 6px; }
.crm-tag-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.crm-contact-card-owner { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px; }

/* --- Follow-ups --- */
.followups-list { padding: 0; }
.followup-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--color-border);
}
.followup-item:last-child { border-bottom: none; }
.followup-item-overdue { background: #FEF2F2; }
.followup-due { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; min-width: 80px; }
.followup-due-overdue { color: #DC2626; }
.followup-due-today { color: #D97706; }
.followup-note { flex: 1; font-size: 0.8125rem; color: var(--color-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.followup-complete-btn {
    padding: 4px 10px; border-radius: 4px; border: 1px solid #16A34A;
    color: #16A34A; background: transparent; font-size: 0.75rem;
    cursor: pointer; white-space: nowrap;
}
.followup-complete-btn:hover { background: #16A34A; color: #fff; }
.followup-quick-add {
    padding: 12px 16px; border-top: 1px solid var(--color-border);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* --- Contact Ownership --- */
.contact-owner-section select { font-size: 0.875rem; }

/* --- Tags Settings --- */
.tag-settings-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-bottom: 1px solid var(--color-border);
}
.tag-settings-row:last-child { border-bottom: none; }
.tag-settings-color { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.tag-settings-name { flex: 1; font-weight: 500; font-size: 0.875rem; }
.tag-settings-count { font-size: 0.8125rem; color: var(--color-text-muted); }
.tag-settings-actions { display: flex; gap: 4px; }
.color-picker-row { display: flex; gap: 4px; flex-wrap: wrap; }
.color-picker-swatch {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: border-color 0.15s;
}
.color-picker-swatch:hover { border-color: var(--color-text-muted); }
.color-picker-swatch.selected { border-color: var(--color-text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--color-text); }

/* --- CRM Global Search --- */
.crm-search-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 6px;
    border: 1px solid var(--color-border); background: var(--color-bg);
    font-size: 0.8125rem; color: var(--color-text-muted);
    cursor: pointer; transition: all 0.15s;
}
.crm-search-trigger:hover { border-color: var(--color-primary); color: var(--color-primary); }
.crm-search-trigger kbd { font-size: 0.6875rem; padding: 1px 4px; border: 1px solid var(--color-border); border-radius: 3px; background: #fff; }
.crm-search-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
}
.crm-search-modal {
    background: #fff; border-radius: 12px;
    width: 600px; max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}
.crm-search-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 16px; border-bottom: 1px solid var(--color-border);
}
.crm-search-icon { font-size: 1.125rem; }
.crm-search-global-input {
    flex: 1; border: none; outline: none; font-size: 1rem;
    background: transparent; color: var(--color-text);
}
.crm-search-kbd { font-size: 0.6875rem; padding: 2px 6px; border: 1px solid var(--color-border); border-radius: 3px; color: var(--color-text-muted); }
.crm-search-results { max-height: 60vh; overflow-y: auto; }
.crm-search-group { }
.crm-search-group-title {
    padding: 8px 16px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}
.crm-search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--color-border);
    text-decoration: none; color: inherit;
}
.crm-search-result-item:hover { background: var(--color-bg); }
.crm-search-result-name { font-weight: 500; font-size: 0.875rem; }
.crm-search-result-meta { font-size: 0.8125rem; color: var(--color-text-muted); }
.crm-search-empty { padding: 24px; text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }
.crm-search-recent { padding: 8px 0; }
.crm-search-recent-title { padding: 8px 16px; font-size: 0.75rem; color: var(--color-text-muted); font-weight: 600; }
.crm-search-recent-item { padding: 8px 16px; cursor: pointer; font-size: 0.875rem; }
.crm-search-recent-item:hover { background: var(--color-bg); }

/* --- Duplicate Detection --- */
.duplicate-warning {
    background: #FFFBEB; border: 1px solid #D97706; border-radius: 8px;
    padding: 12px 16px; margin: 12px 0;
}
.duplicate-warning-title { font-weight: 600; color: #92400E; margin-bottom: 4px; }
.duplicate-match { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.duplicate-match-info { flex: 1; }
.duplicate-match-name { font-weight: 500; }
.duplicate-match-email { font-size: 0.8125rem; color: var(--color-text-muted); }

/* --- Dashboard Follow-up Widgets --- */
.followup-widget-list { padding: 0; }
.followup-widget-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; font-size: 0.8125rem;
}
.followup-widget-name { font-weight: 500; }
.followup-widget-due { color: var(--color-text-muted); margin-left: auto; font-size: 0.75rem; }
.followup-widget-overdue { color: #DC2626; }

/* --- Sidebar Beta Badge --- */
.sidebar-beta-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 2px;
}

/* --- Beta Feature Banner --- */
.beta-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #92400e;
}
.beta-banner svg { flex-shrink: 0; }
.beta-banner-text { flex: 1; }
.beta-banner-dismiss {
    background: none; border: none; cursor: pointer;
    color: #92400e; font-size: 1.2rem; padding: 0 4px;
    opacity: 0.6; transition: opacity 0.15s;
}
.beta-banner-dismiss:hover { opacity: 1; }

/* --- Quick Disable Popover --- */
.ff-quick-trigger {
    background: none; border: 1px solid transparent; cursor: pointer;
    color: var(--color-text-secondary, #9ca3af); padding: 4px;
    border-radius: 6px; transition: all 0.15s; line-height: 1;
}
.ff-quick-trigger:hover {
    color: var(--color-text, #111); background: var(--color-bg-secondary, #f3f4f6);
    border-color: var(--color-border, #e5e7eb);
}
.ff-quick-popover-wrap { position: relative; display: inline-block; }
.ff-quick-popover {
    display: none; position: absolute; top: calc(100% + 6px); right: 0;
    background: #fff; border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 16px; min-width: 240px; z-index: 50;
}
.ff-quick-popover.open { display: block; }
.ff-quick-popover-name {
    font-weight: 600; font-size: 0.92rem; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--color-border, #f0f0f0);
}
.ff-quick-popover-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0; font-size: 0.85rem;
}
.ff-quick-popover-row label { color: var(--color-text, #111); }
.ff-quick-popover-link {
    display: block; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--color-border, #f0f0f0);
    font-size: 0.82rem; color: #2563eb; text-decoration: none;
}
.ff-quick-popover-link:hover { text-decoration: underline; }

/* ============================================================
   DARK MODE
   Activated by [data-theme="dark"] on <html>. The user's choice
   is persisted in localStorage as `mira-theme`.
   Overrides CSS custom properties first, then individual element
   selectors that don't yet flow through tokens.
   ============================================================ */
[data-theme="dark"] {
    --color-bg:                #0f172a;
    --color-surface:           #1e293b;
    --color-surface-alt:       #1e293b;
    --color-border:            #334155;
    --color-border-strong:     #475569;
    --color-border-tertiary:   #1e293b;
    --color-text:              #e2e8f0;
    --color-text-primary:      #f1f5f9;
    --color-text-muted:        #94a3b8;
    --color-text-secondary:    #94a3b8;
    --color-text-tertiary:     #94a3b8;
    --color-link:              #60a5fa;
    --color-background-success:#064e3b;
    --color-text-success:      #6ee7b7;
    --color-background-warning:#451a03;
    --color-text-warning:      #fcd34d;
    color-scheme: dark;
}

/* Page-level surfaces */
[data-theme="dark"] body,
[data-theme="dark"] body.app-body,
[data-theme="dark"] .app-content,
[data-theme="dark"] .main-content { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .topbar { background: #1e293b; border-bottom-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .topbar-icon-btn { color: #cbd5e1; }
[data-theme="dark"] .topbar-icon-btn:hover { background: #334155; color: #fff; }
/* Dark mode is disabled today, but every other topbar element carries a
   dark rule and the net chip must not be the one thing that breaks if it
   is ever re-enabled. Filled states keep their own colors. */
[data-theme="dark"] .topbar-net-chip.is-online { border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .topbar-user-name { color: #e2e8f0; }
[data-theme="dark"] .topbar-search input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .topbar-search input::placeholder { color: #64748b; }

/* Sidebar — already dark; leave it */
[data-theme="dark"] .sidebar { background: #0f172a; }

/* Cards / panels */
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .event-hero,
[data-theme="dark"] .quick-links-panel,
[data-theme="dark"] .panel-side,
[data-theme="dark"] .section { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .panel-header { background: #1e293b; border-bottom-color: #334155; }
[data-theme="dark"] .panel-header h3 { color: #f1f5f9; }
[data-theme="dark"] .panel-body { color: #e2e8f0; }
[data-theme="dark"] .empty-placeholder { color: #94a3b8; }

/* Headings + body text + links */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: #f1f5f9; }
[data-theme="dark"] a { color: #60a5fa; }
[data-theme="dark"] a:hover { color: #93c5fd; }

/* Form inputs */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-input {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #64748b; }
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .form-input:focus { border-color: #6366f1; outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
[data-theme="dark"] label, [data-theme="dark"] .form-label, [data-theme="dark"] .form-hint { color: #cbd5e1; }
[data-theme="dark"] small { color: #94a3b8; }

/* Tables */
[data-theme="dark"] table,
[data-theme="dark"] .data-table { color: #e2e8f0; }
[data-theme="dark"] thead { background: #1e293b; }
[data-theme="dark"] thead th,
[data-theme="dark"] .data-table th { background: #1e293b; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] tbody td,
[data-theme="dark"] .data-table td { border-color: #334155; }
[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(30,41,59,.5); }
[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] .data-table tr:hover { background: #334155; }

/* Buttons — keep primary indigo, dark-tone secondary */
[data-theme="dark"] .btn { color: #fff; }
[data-theme="dark"] .btn-secondary { background: #334155; color: #e2e8f0; border-color: #475569; }
[data-theme="dark"] .btn-secondary:hover { background: #475569; }
[data-theme="dark"] .btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* Notices / alerts */
[data-theme="dark"] .notice { color: #e2e8f0; }
[data-theme="dark"] .notice-info    { background: #1e3a8a; border-color: #2563eb; color: #dbeafe; }
[data-theme="dark"] .notice-success { background: #064e3b; border-color: #059669; color: #d1fae5; }
[data-theme="dark"] .notice-warning { background: #451a03; border-color: #b45309; color: #fef3c7; }
[data-theme="dark"] .notice-error   { background: #450a0a; border-color: #b91c1c; color: #fecaca; }

/* Status badges — keep semantic colors but darken backgrounds */
[data-theme="dark"] .status-badge.status-default  { background: #334155; color: #e2e8f0; border-color: #475569; }
[data-theme="dark"] .status-badge.status-active   { background: #064e3b; color: #6ee7b7; border-color: #059669; }
[data-theme="dark"] .status-badge.status-teal     { background: #042f2e; color: #5eead4; border-color: #0d9488; }
[data-theme="dark"] .status-badge.status-pending  { background: #451a03; color: #fcd34d; border-color: #b45309; }
[data-theme="dark"] .status-badge.status-completed{ background: #1e3a8a; color: #93c5fd; border-color: #2563eb; }
[data-theme="dark"] .status-badge.status-cancelled{ background: #450a0a; color: #fca5a5; border-color: #b91c1c; }

/* Modals / overlays */
[data-theme="dark"] .modal,
[data-theme="dark"] .event-modal,
[data-theme="dark"] .ag-modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .ff-modal { background: #1e293b; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .event-modal-overlay,
[data-theme="dark"] .ag-modal-overlay,
[data-theme="dark"] .ff-modal-backdrop { background: rgba(0,0,0,.6); }
[data-theme="dark"] .event-modal-header,
[data-theme="dark"] .event-modal-footer,
[data-theme="dark"] .ag-modal-header,
[data-theme="dark"] .ag-modal-footer { border-color: #334155; }

/* Sidebar nav active state — keep indigo highlight, just dim labels otherwise */
[data-theme="dark"] .sidebar-link { color: #cbd5e1; }
[data-theme="dark"] .sidebar-link:hover { background: rgba(255,255,255,.05); color: #fff; }
[data-theme="dark"] .sidebar-link.active { background: #312e81; color: #fff; }
/* Section-group labels keep their gold (var(--color-sidebar-label)) in dark mode
   too — the sidebar stays navy across themes, so no dark override is needed. */

/* Theme-toggle button active state — already styled for light mode at line 296.
   In dark mode, swap so the active button uses a dark fill instead of white. */
[data-theme="dark"] .theme-toggle { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .theme-toggle-btn { color: #94a3b8; }
[data-theme="dark"] .theme-toggle-btn:hover { color: #e2e8f0; }
[data-theme="dark"] .theme-toggle-btn.active { background: #334155; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* Borders / dividers */
[data-theme="dark"] hr { border-color: #334155; }
[data-theme="dark"] .divider { background: #1e293b; }

/* Code-style / mono blocks */
[data-theme="dark"] code, [data-theme="dark"] pre, [data-theme="dark"] .code { background: #0f172a; color: #e2e8f0; border-color: #334155; }

/* Search inputs */
[data-theme="dark"] .search-input,
[data-theme="dark"] .search-input-sm { background: #1e293b; color: #e2e8f0; border-color: #334155; }

/* Common helper-text muted */
[data-theme="dark"] .muted, [data-theme="dark"] .text-muted { color: #94a3b8; }

/* === Dark mode body gradient fix === */
[data-theme="dark"] body {
    background: linear-gradient(to right, #0f172a 240px, #0f172a 240px) !important;
    color: #e2e8f0;
}
[data-theme="dark"] .app-content {
    background: #0f172a !important;
}
[data-theme="dark"] .topbar {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

/* ============================================================
   Shared hub icon buttons + data-tip tooltips (v4.23).
   .hub-icon-btn: the 34px bordered icon action used across the
   BizDev hub lists and the organization page's proposal rows.
   [data-tip]: pure-CSS tooltip bubble above the element on hover
   and keyboard focus, dark pill-family colors, 150ms show delay.
   ============================================================ */
.hub-icon-btn { width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; background:#fff; border:1px solid #D1D5DB; border-radius:7px; color:#475569; cursor:pointer; padding:0; vertical-align:middle; box-sizing:border-box; text-decoration:none; font-family:inherit; }
.hub-icon-btn + .hub-icon-btn { margin-left:6px; }
.hub-icon-btn:hover:not(:disabled) { background:#F1F5F9; color:#111827; }
.hub-icon-btn:disabled { color:#CBD5E1; border-color:#E5E7EB; cursor:default; }
.hub-icon-btn svg { width:16px; height:16px; }
[data-tip] { position:relative; }
[data-tip]::after {
    content:attr(data-tip);
    position:absolute; bottom:calc(100% + 5px); left:50%; transform:translateX(-50%) scale(0);
    transform-origin:bottom center;
    background:#475569; color:#F8FAFC;
    font-size:12px; font-weight:600; line-height:1.2; padding:5px 9px; border-radius:6px;
    white-space:nowrap; opacity:0; pointer-events:none;
    transition:opacity .12s ease, transform .12s ease;
    z-index:10050;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity:1; transform:translateX(-50%) scale(1); transition-delay:.15s; }

/* Proposal comm log entry text + type icon (v4.31); the icon markup comes
   from includes/bizdev-comm-icons.php. */
.bdp-log-text { display: flex; align-items: flex-start; gap: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bdp-log-ico { flex: none; color: #94A3B8; display: inline-flex; margin-top: 1px; }
.bdp-log-ico svg { width: 14px; height: 14px; }

/* Comm log entry editing (v4.35): reduced icon button, edited stamp,
   inline editor. Shared by all three log surfaces. */
.hub-icon-btn--sm { width: 26px; height: 26px; border-radius: 6px; }
.hub-icon-btn--sm svg { width: 13px; height: 13px; }
.bdp-log-entry { position: relative; padding-right: 34px; }
.bdp-log-entry .hub-icon-btn--sm { position: absolute; top: 6px; right: 0; }
.bdp-log-edited { font-size: .68rem; color: #94A3B8; }
.bdp-log-editwrap textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }
.bdp-log-editrow { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

/* BD v2 priority flags (v4.37): Needs Attention (amber) and Urgent (red)
   toggles, 30px, gray outline when off; static indicators for viewers
   and the closed rows. */
.hub-flag-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #D1D5DB; border-radius: 7px; color: #94A3B8; cursor: pointer; padding: 0; vertical-align: middle; }
.hub-flag-btn + .hub-flag-btn { margin-left: 4px; }
.hub-flag-btn svg { width: 15px; height: 15px; }
.hub-flag-btn:hover { color: #64748B; }
.hub-flag-btn.is-on-attention { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.hub-flag-btn.is-on-urgent { background: #FEE2E2; border-color: #FCA5A5; color: #B91C1C; }
.hub-flag-static { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; vertical-align: middle; }
.hub-flag-static svg { width: 15px; height: 15px; }
.hub-flag-static.is-attention { color: #B45309; }
.hub-flag-static.is-urgent { color: #DC2626; }
.bdp-fup-datelabel { display: block; margin-top: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #475569; }

/* BizDev attachments strip (v4.41); markup from
   includes/bizdev-attachments-ui.php, mounted by all three expansions. */
.batt { background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; padding: 10px 12px; }
.batt-h { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #475569; margin-bottom: 6px; }
.batt-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #F1F5F9; font-size: .82rem; }
.batt-row:last-of-type { border-bottom: none; }
.batt-clip { display: inline-flex; color: #94A3B8; flex: none; }
.batt-clip svg { width: 14px; height: 14px; }
.batt-name { color: #2563EB; text-decoration: underline; overflow-wrap: anywhere; min-width: 0; }
.batt-meta { color: #94A3B8; font-size: .72rem; white-space: nowrap; margin-left: auto; }
/* Revision badge (v4.99): which proposal version a document belongs to. */
.batt-rev { font-size: .66rem; font-weight: 600; color: #4338CA; background: #EEF2FF; border: 1px solid #E0E7FF; border-radius: 999px; padding: 1px 7px; white-space: nowrap; flex-shrink: 0; }
.batt-del { background: none; border: none; color: #B91C1C; font-size: 1rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 4px; flex: none; }
.batt-del:hover { background: #FEF2F2; }
.batt-empty { font-size: .8rem; color: #94A3B8; font-style: italic; }
.batt-add { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.batt-attach { font-size: .78rem; }
.batt-status { font-size: .75rem; color: #475569; }
