/* Woodville CRM — aligned with docs/designs (Module-4) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

[hidden],
.hidden {
    display: none !important;
}

:root,
[data-theme="light"] {
    --header-bg: #1e2d3d;
    --header-height: 52px;
    --chrome-footer-height: 60px;
    --chrome-footer-padding-x: 12px;
    --sidebar-width: 220px;
    --sidebar-width-collapsed: 56px;
    --list-panel-width: 300px;
    --primary: #2b7de9;
    --primary-dark: #1a6ad4;
    --primary-light: #e8f2fd;
    --danger: #e74c3c;
    --success: #22a06b;
    --text: #1a2b3c;
    --text-muted: #6b7c93;
    --border: #e4e9ef;
    --bg-page: #f5f7fa;
    --bg-white: #ffffff;
    --bg-hover: #f8fafc;
    --bg-subtle: #fafbfc;
    --input-bg: #ffffff;
    --topbar-search-bg: rgba(255, 255, 255, 0.12);
    --topbar-search-border: rgba(255, 255, 255, 0.2);
    --topbar-fg: #ffffff;
    --radius: 8px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 3px rgba(26, 43, 60, 0.06);
    --shadow-dropdown: 0 8px 24px rgba(26, 43, 60, 0.12);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --badge-green-bg: #d4edda;
    --badge-green-fg: #1e6b3a;
    --badge-blue-bg: #d6e8ff;
    --badge-blue-fg: #1a5fb4;
    --badge-purple-bg: #ede9fe;
    --badge-purple-fg: #5b21b6;
    --badge-cyan-bg: #d4f5f5;
    --badge-cyan-fg: #0e7c86;
    --badge-orange-bg: #ffe8cc;
    --badge-orange-fg: #b35c00;
    --badge-red-bg: #fde2e2;
    --badge-red-fg: #c0392b;
    --badge-grey-bg: #ecf0f1;
    --badge-grey-fg: #7f8c8d;
    --alert-danger-bg: #fdeaea;
    --alert-danger-fg: #922b21;
    --alert-danger-border: #f5c6cb;
    --alert-success-bg: #e8f8ef;
    --alert-success-fg: #1e6b45;
    --alert-success-border: #b8e6cf;
    --alert-info-bg: #e8f4fd;
    --alert-info-fg: #1a5276;
    --alert-info-border: #bee5eb;
    --danger-hover-bg: #fef2f2;
    --outline-danger-hover: #fef5f5;
    --comm-btn-border: #c5cdd8;
    --comm-btn-fg: #5a6b7d;
    --overlay-backdrop: rgba(30, 45, 61, 0.88);
    --focus-ring: rgba(43, 125, 233, 0.15);
    color-scheme: light;
}

[data-theme="dark"] {
    --header-bg: #0d1117;
    --primary: #58a6ff;
    --primary-dark: #79b8ff;
    --primary-light: #1c2d4a;
    --danger: #f85149;
    --success: #3fb950;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --bg-page: #0d1117;
    --bg-white: #161b22;
    --bg-hover: #21262d;
    --bg-subtle: #1c2128;
    --input-bg: #0d1117;
    --topbar-search-bg: #21262d;
    --topbar-search-border: #30363d;
    --topbar-fg: #e6edf3;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.45);
    --badge-green-bg: #1a3d2a;
    --badge-green-fg: #7ee787;
    --badge-blue-bg: #1a2f4d;
    --badge-blue-fg: #79c0ff;
    --badge-purple-bg: #2d2450;
    --badge-purple-fg: #d2a8ff;
    --badge-cyan-bg: #1a3333;
    --badge-cyan-fg: #56d4dd;
    --badge-orange-bg: #3d2a14;
    --badge-orange-fg: #ffa657;
    --badge-red-bg: #3d1f1f;
    --badge-red-fg: #ff7b72;
    --badge-grey-bg: #30363d;
    --badge-grey-fg: #8b949e;
    --alert-danger-bg: #3d1f1f;
    --alert-danger-fg: #ff7b72;
    --alert-danger-border: #6e3030;
    --alert-success-bg: #1a3d2a;
    --alert-success-fg: #7ee787;
    --alert-success-border: #2a4d3a;
    --alert-info-bg: #1a2f4d;
    --alert-info-fg: #79c0ff;
    --alert-info-border: #304d6e;
    --danger-hover-bg: #3d1f1f;
    --outline-danger-hover: #3d1f1f;
    --comm-btn-border: #484f58;
    --comm-btn-fg: #8b949e;
    --overlay-backdrop: rgba(0, 0, 0, 0.75);
    --focus-ring: rgba(88, 166, 255, 0.25);
    color-scheme: dark;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

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

/* —— App shell —— */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.topbar {
    height: var(--header-height);
    background: var(--header-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}
.topbar-logo,
.site-logo {
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    text-decoration: none;
    line-height: 0;
}
.topbar-logo:hover,
.site-logo:hover { opacity: 0.9; }
.topbar-logo img,
.site-logo img {
    height: 32px;
    width: auto;
    max-width: min(280px, 42vw);
    display: block;
}
.site-logo--login {
    justify-content: center;
    margin: 0 auto 20px;
    width: 100%;
}
.site-logo--login:not(.site-logo--login-mark) img {
    height: 44px;
    max-width: 100%;
}
/* Main sign-in page only — full OG wordmark (login-logo.png) inside login card */
.site-logo--login.site-logo--login-mark {
    margin: 0 auto 24px;
    width: 100%;
}
.site-logo--login.site-logo--login-mark img {
    height: auto;
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-icon-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    background: transparent;
    border: none;
    cursor: pointer;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,0.1); }

.notifications-wrap { position: relative; }
.notifications-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
}
.notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
    z-index: 200;
}
.notifications-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.notifications-list { list-style: none; margin: 0; padding: 0; }
.notifications-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.notifications-item.is-read { opacity: 0.65; }
.notifications-item-title a { color: var(--text); font-weight: 600; text-decoration: none; }
.notifications-item-body { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.notifications-item-time { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

.workflow-start-wrap { position: relative; display: inline-block; margin-left: 8px; }
.workflow-start-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}
.workflow-start-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}
.workflow-start-item:hover { background: var(--bg-muted); }

/* Header global search */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.topbar-search-panel {
    display: none;
    flex-direction: column;
    position: relative;
    min-width: 0;
}
.topbar-search.is-open .topbar-search-panel {
    display: flex;
}
.topbar-search-input-wrap {
    position: relative;
}
.topbar-search-input {
    width: min(360px, calc(100vw - 200px));
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--topbar-search-border);
    border-radius: var(--radius);
    background: var(--topbar-search-bg);
    color: var(--topbar-fg);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.topbar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}
[data-theme="dark"] .topbar-search-input::placeholder {
    color: var(--text-muted);
}
.topbar-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--focus-ring);
}
.topbar-search-input-wrap::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.65;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}
[data-theme="dark"] .topbar-search-input-wrap::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b949e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
}
.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    max-height: 360px;
    overflow-y: auto;
    z-index: 2000;
}
.global-search-result {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
}
.global-search-result:last-child {
    border-bottom: none;
}
.global-search-result:hover,
.global-search-result:focus {
    background: var(--bg-hover);
    outline: none;
}
.global-search-result-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    line-height: 1.35;
}
.global-search-result-sub {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Theme toggle icons */
.theme-icon {
    display: block;
}
[data-theme="light"] .theme-icon-moon,
[data-theme="dark"] .theme-icon-sun {
    display: none;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.95);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.08);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4ade80;
}
.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b8cce, #4a6fa5);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    color: #fff;
}

.shell-body {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

/* Main column beside sidebar — scrolls independently of the nav */
.shell-body > .entity-list-page,
.shell-body > .entity-detail-page,
.shell-body > .entity-form-page,
.shell-body > .page-content {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
}

/* Main navigation sidebar */
html.sidebar-collapsed {
    --sidebar-width: var(--sidebar-width-collapsed);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
    transition: width 0.2s ease;
}
.sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 10px 4px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-page);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    width: calc(100% - 20px);
}
.sidebar-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: transparent;
}
.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
html.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-footer {
    height: var(--chrome-footer-height);
    padding: 0 var(--chrome-footer-padding-x);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.sidebar-footer .sidebar-logout-form {
    width: 100%;
}
.sidebar-footer .sidebar-logout {
    padding: 8px 12px;
}
.sidebar-logout-form { margin: 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
}
.sidebar-link > span:not(:first-child),
.sidebar-group-label > span:last-child,
.sidebar-toggle-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.sidebar-link:hover svg { color: var(--primary); }
.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.sidebar-link.active svg { color: var(--primary); }
.sidebar-sublink {
    padding-left: 12px;
    font-weight: 400;
}
.sidebar-group {
    margin: 8px 0 4px;
}
.sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.sidebar-group-label svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.sidebar-group.is-active .sidebar-group-label {
    color: var(--primary);
}
.sidebar-group.is-active .sidebar-group-label svg {
    color: var(--primary);
}

/* Admin nested submenu (Settings, Config) — match sidebar-sublink styling */
.sidebar-submenu {
    margin: 0;
}
.sidebar-submenu > summary {
    list-style: none;
}
.sidebar-submenu > summary::-webkit-details-marker,
.sidebar-submenu > summary::marker {
    display: none;
    content: '';
}
.sidebar-submenu__chevron {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    transition: transform 0.15s ease;
}
.sidebar-submenu__chevron svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}
.sidebar-submenu[open] > .sidebar-submenu__summary .sidebar-submenu__chevron {
    transform: rotate(180deg);
}
.sidebar-submenu.is-active > .sidebar-submenu__summary {
    background: var(--primary-light);
    color: var(--primary);
}
.sidebar-submenu.is-active > .sidebar-submenu__summary svg,
.sidebar-submenu.is-active > .sidebar-submenu__summary .sidebar-submenu__chevron svg {
    color: var(--primary);
}
.sidebar-logout {
    color: var(--text-muted);
}
.sidebar-logout:hover {
    color: var(--danger);
    background: var(--danger-hover-bg);
}
.sidebar-logout:hover svg { color: var(--danger); }

/* Collapsed sidebar */
html.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    padding: 8px;
}
html.sidebar-collapsed .sidebar-toggle-label,
html.sidebar-collapsed .sidebar-link > span,
html.sidebar-collapsed .sidebar-group-label > span:last-child {
    display: none;
}
html.sidebar-collapsed .sidebar-group-label {
    justify-content: center;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
html.sidebar-collapsed .sidebar-group-label svg {
    width: 18px;
    height: 18px;
}
html.sidebar-collapsed .sidebar-sublink {
    padding-left: 9px;
    justify-content: center;
}
html.sidebar-collapsed .sidebar-submenu > .sidebar-submenu__summary {
    justify-content: center;
}
html.sidebar-collapsed .sidebar-submenu > .sidebar-submenu__summary > span:not(.sidebar-submenu__chevron),
html.sidebar-collapsed .sidebar-submenu__chevron,
html.sidebar-collapsed .sidebar-submenu .sidebar-sublink:not(.sidebar-submenu__summary) {
    display: none;
}
html.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 9px;
}
html.sidebar-collapsed .sidebar-group {
    margin: 4px 0;
}

.workspace {
    flex: 1;
    display: flex;
    min-width: 0;
    background: var(--bg-page);
}

/* Split: list + detail (legacy sidebar layout) */
.workspace-split {
    display: flex;
    flex: 1;
    min-width: 0;
    height: calc(100vh - var(--header-height));
}

/* Full-page entity list (index) */
.entity-list-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-white);
}

.list-panel {
    width: var(--list-panel-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.list-panel--full {
    width: 100%;
    max-width: 100%;
    border-right: none;
    flex: 1;
    min-height: 0;
}

.entity-list-page .list-panel-header {
    padding: 20px 32px 12px;
}

.list-panel-toolbar {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.entity-list-page .list-panel-toolbar .search-box {
    margin: 12px 32px 0;
    max-width: none;
}

.entity-list-page .list-panel-toolbar .filter-chips {
    padding: 8px 32px 12px;
}

.list-panel-toolbar .filter-chips {
    padding: 8px 16px 12px;
}

.list-empty-msg {
    padding: 24px 16px;
    color: var(--text-muted);
    margin: 0;
}

/* Full-page entity detail (show) */
.entity-detail-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.detail-panel--full {
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-height: 0;
}

.entity-detail-page .detail-top {
    padding-left: 32px;
    padding-right: 32px;
}

.entity-detail-page .detail-body {
    padding: 24px 32px;
}

.entity-detail-page .detail-footer {
    padding-left: 32px;
    padding-right: 32px;
}

.entity-detail-page .stat-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.entity-detail-page .data-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.entity-detail-page .card .table {
    display: table;
    width: 100%;
}

/* Full-page create / edit forms */
.entity-form-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 24px 32px;
    overflow-y: auto;
    background: var(--bg-page);
    box-sizing: border-box;
}

.entity-form-page .investor-form,
.entity-form-page .form-section,
.entity-form-page > .card {
    max-width: none;
    width: 100%;
}

.investment-kind-card {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--primary-light);
}

/* Searchable investor picker */
.investor-picker {
    position: relative;
    width: 100%;
}
.investor-picker-input-wrap {
    position: relative;
}
.investor-picker-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
}
.investor-picker-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.investor-picker-input-wrap::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.45;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7c93'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}
.investor-picker-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1500;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    max-height: 240px;
    overflow-y: auto;
}
.investor-picker-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.investor-picker-option:last-child {
    border-bottom: none;
}
.investor-picker-option:hover,
.investor-picker-option:focus {
    background: var(--bg-hover);
    outline: none;
}
.investor-picker-option-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.investor-picker-option-sub {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.investor-picker-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 13px;
}
.list-panel-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.list-panel-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}
.list-panel-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}
.list-panel-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.btn-add {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.search-box {
    margin: 12px 16px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
}
.search-box::before {
    content: '';
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    opacity: 0.4;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7c93'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
    align-items: center;
}
.chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-muted);
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
}
button.chip {
    appearance: none;
    -webkit-appearance: none;
}
button.chip:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.chip.active, a.chip.active, button.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.list-scroll {
    flex: 1;
    overflow-y: auto;
}
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}
.list-item--rich {
    padding: 0;
    gap: 0;
    cursor: pointer;
}
.list-item--rich .list-item-actions {
    cursor: default;
}
.list-item--rich.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.list-item-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 8px 14px 16px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.list-item-main:hover {
    background: var(--bg-hover);
}
.list-item--rich.active .list-item-main {
    background: transparent;
}
.list-item-body {
    flex: 1;
    min-width: 0;
}
.list-row-head {
    display: grid;
    grid-template-columns: 40px minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(200px, 1.2fr) auto;
    gap: 12px 20px;
    align-items: center;
    padding: 8px 0 8px 32px;
    margin-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-page);
}
.list-row-head-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.list-row-head-label--name {
    padding-left: 0;
}
.list-row-head-spacer {
    width: 40px;
}
.list-row-head-spacer--actions {
    width: 120px;
}
.list-item--spread .list-item-main--spread {
    flex: 1;
    display: grid;
    grid-template-columns: 40px minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(200px, 1.2fr);
    gap: 12px 20px;
    align-items: center;
    padding: 14px 8px 14px 32px;
    min-width: 0;
}
.list-item-avatar-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}
.list-item-col--identity {
    text-decoration: none;
    color: inherit;
}
.list-item-col--identity:hover .list-item-name {
    color: var(--primary);
}
.list-item-col--identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.list-item-col--field {
    min-width: 0;
    display: flex;
    align-items: center;
}
.list-item-field-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.list-item-field-value--link {
    color: var(--primary);
}
.list-item-field-value--link:hover {
    text-decoration: underline;
}
.list-item-field-value--empty {
    color: var(--text-muted);
    font-weight: 400;
}
.list-item--spread .list-item-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item--spread .list-item-sub,
.list-grid--applications {
    grid-template-columns:
        72px
        minmax(200px, 1.8fr)
        minmax(120px, 1fr)
        minmax(150px, 1.1fr)
        minmax(120px, 0.9fr)
        minmax(100px, 0.8fr);
}
.list-row-head--columns.list-grid--applications {
    grid-template-columns:
        72px
        minmax(200px, 1.8fr)
        minmax(120px, 1fr)
        minmax(150px, 1.1fr)
        minmax(120px, 0.9fr)
        minmax(100px, 0.8fr)
        52px;
    padding: 8px 16px 8px 16px;
    gap: 12px 16px;
}
.list-grid--investments {
    grid-template-columns:
        72px
        minmax(180px, 1.6fr)
        minmax(110px, 1fr)
        minmax(130px, 1fr)
        minmax(90px, 0.85fr)
        minmax(120px, 1fr)
        minmax(100px, 0.85fr);
}
.list-row-head--columns.list-grid--investments {
    grid-template-columns:
        72px
        minmax(180px, 1.6fr)
        minmax(110px, 1fr)
        minmax(130px, 1fr)
        minmax(90px, 0.85fr)
        minmax(120px, 1fr)
        minmax(100px, 0.85fr)
        52px;
    padding: 8px 16px 8px 16px;
    gap: 12px 16px;
}
.list-item--columns .list-item-main--columns {
    flex: 1;
    display: grid;
    gap: 12px 16px;
    align-items: center;
    padding: 12px 8px 12px 16px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.list-item--columns .list-item-col--data {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}
.list-item--columns .list-item-col--data .badge {
    align-self: flex-start;
}
.list-item--columns .list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}
.list-item--columns .list-item-actions {
    padding-right: 12px;
}
.list-item--spread .list-item-meta {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item-meta {
    font-size: 13px;
    color: var(--text);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    border-left: 1px solid var(--border);
}
.list-item-action-btn {
    width: 40px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: none;
    background: transparent;
    border-left: 1px solid var(--border);
    text-decoration: none;
    padding: 0;
    cursor: pointer;
}
.list-item-actions .list-item-action-btn:first-child {
    border-left: none;
}
.list-item-action-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}
.list-item-action-btn svg {
    width: 18px;
    height: 18px;
}
.list-item-action-btn--view {
    color: var(--text-muted);
}
.list-item:hover { background: var(--bg-hover); }
.list-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.table--context-menu tbody tr[data-list-row] {
    cursor: context-menu;
}
.table-actions-col {
    width: 52px;
    text-align: center;
    white-space: nowrap;
}
.table-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.table-kebab-btn {
    color: #666;
}
.table-kebab-btn:hover {
    color: var(--text);
    background: var(--bg-hover);
}
.table-kebab-btn svg {
    width: 20px;
    height: 20px;
}
.table-row-actions .list-item-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
}
.table-row-actions .list-item-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.table-row-actions .list-item-action-btn svg {
    width: 18px;
    height: 18px;
}

.list-context-menu {
    position: fixed;
    z-index: 5000;
    min-width: 200px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    padding: 6px 0;
}
.list-context-menu[hidden],
.list-context-menu-item[hidden],
.list-context-menu-sep[hidden] {
    display: none !important;
}
.list-context-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
}
.list-context-menu-item:hover {
    background: var(--bg-hover);
}
.list-context-menu-item--danger {
    color: var(--danger);
}
.list-context-menu-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}
.list-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.list-item-name { font-weight: 600; font-size: 14px; margin: 0; }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

.detail-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
}
.detail-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}

/* Detail header (Figma client view) */
.detail-top {
    padding: 16px 24px 0;
    background: var(--bg-white);
}
.detail-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.back-link {
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.edit-link {
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.edit-link svg { width: 14px; height: 14px; }
.edit-link:hover { color: var(--primary-dark); }

.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.detail-hero-text {
    flex: 1;
    min-width: 200px;
}
.detail-title-row {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}
.detail-title {
    color: var(--text);
}
.detail-title-sep {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 20px;
}
.detail-reference {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-muted);
}
.detail-reference strong {
    color: var(--text);
    font-weight: 700;
}
.detail-meta-line {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.detail-meta-line strong {
    color: var(--text);
    font-weight: 600;
}
.detail-header-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.comm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}
.comm-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--comm-btn-border);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--comm-btn-fg);
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.comm-btn svg {
    width: 20px;
    height: 20px;
}
.comm-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.comm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.detail-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    list-style: none;
    margin: 0;
}
.detail-tabs li { margin: 0; }
.detail-tabs a {
    display: block;
    padding: 14px 20px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.detail-tabs a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.detail-tabs .tab-alert::after {
    content: '◆';
    color: var(--danger);
    font-size: 8px;
    margin-left: 4px;
    vertical-align: super;
}

.detail-body { padding: 24px; flex: 1; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}
.badge-client, .badge-green { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.badge-lead, .badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.badge-prospect, .badge-purple { background: var(--badge-purple-bg); color: var(--badge-purple-fg); }
.badge-cyan { background: var(--badge-cyan-bg); color: var(--badge-cyan-fg); }
.badge-orange { background: var(--badge-orange-bg); color: var(--badge-orange-fg); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-fg); }
.badge-grey { background: var(--badge-grey-bg); color: var(--badge-grey-fg); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline-danger {
    background: var(--bg-white);
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover { background: var(--outline-danger-hover); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Cards & tables */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card { margin-bottom: 0; }
.stat-card .label { color: var(--text-muted); font-size: 12px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .value { font-size: 28px; font-weight: 700; margin: 0; }

/* Investor compliance documents accordion */
.compliance-accordion {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}
.compliance-accordion > summary {
    list-style: none;
}
.compliance-accordion > summary::-webkit-details-marker {
    display: none;
}
.compliance-accordion > summary::marker {
    content: '';
    display: none;
}
.compliance-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
}
.compliance-accordion__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
}
.compliance-accordion__meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.compliance-accordion__chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
    transition: transform 0.2s ease;
}
.compliance-accordion[open] > .compliance-accordion__summary .compliance-accordion__chevron {
    transform: rotate(180deg);
}
.compliance-accordion[open] > .compliance-accordion__summary {
    border-bottom: 1px solid var(--border);
}
.compliance-accordion__body {
    padding: 16px 20px 20px;
}
.compliance-accordion__hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.compliance-accordion__body .table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.compliance-accordion__body .table {
    margin: 0;
}
.compliance-accordion__footer {
    margin: 12px 0 0;
    font-size: 13px;
}
.compliance-accordion__footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.compliance-accordion__footer a:hover {
    text-decoration: underline;
}

/* Application documents tab — accordion + split preview */
.app-doc-accordions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.app-doc-accordion {
    margin: 0;
}
.app-doc-accordion__body {
    padding: 0;
}
.app-doc-split {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
    gap: 0;
    min-height: 420px;
}
.app-doc-split__panel {
    padding: 16px 20px 20px;
}
.app-doc-split__ai {
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
}
.app-doc-split__heading {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.app-doc-split__empty {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.app-doc-ai-section {
    margin-bottom: 16px;
}
.app-doc-ai-section__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.app-doc-ai-dl {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(120px, 38%) 1fr;
    gap: 6px 12px;
    font-size: 13px;
}
.app-doc-ai-dl dt {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted);
}
.app-doc-ai-dl dd {
    margin: 0;
    word-break: break-word;
}
.app-doc-ai-errors {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--danger);
}
.app-doc-raw-json {
    margin: 12px 0 16px;
    font-size: 12px;
}
.app-doc-raw-json summary {
    cursor: pointer;
    color: var(--text-muted);
}
.app-doc-raw-json pre {
    margin: 8px 0 0;
    max-height: 200px;
    overflow: auto;
    font-size: 11px;
    background: var(--bg-white);
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.app-doc-edit {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.app-doc-edit__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
}
.app-doc-edit .form-group {
    margin-bottom: 10px;
}
.app-doc-edit .form-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-muted);
}
.app-doc-edit input[type="text"],
.app-doc-edit select,
.app-doc-edit textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
}
.app-doc-preview__filename {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 500;
}
.app-doc-preview__frame-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-white);
    min-height: 480px;
}
.app-doc-preview__frame {
    display: block;
    width: 100%;
    height: 520px;
    border: none;
}
.app-doc-preview__hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.app-doc-preview__hint a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
.app-doc-preview__hint a:hover {
    text-decoration: underline;
}
.app-doc-preview__placeholder {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    min-height: 280px;
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    font-size: 13px;
    color: var(--text-muted);
}
@media (max-width: 960px) {
    .app-doc-split {
        grid-template-columns: 1fr;
    }
    .app-doc-split__ai {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .app-doc-preview__frame {
        height: 400px;
    }
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.data-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.data-field p { margin: 0; font-weight: 500; font-size: 14px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--bg-hover); }

/* Timeline (History tab style) */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px; top: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-white);
}
.timeline-item.alert::before { background: var(--danger); }
.timeline-date { font-size: 12px; color: var(--text-muted); }
.timeline-title { font-weight: 600; margin: 4px 0; }
.timeline-agent { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 6px; }

.activity-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.activity-filters-form .form-group {
    min-width: 180px;
}

/* Littsy-style payment details */
.payment-details-card--full {
    width: 100%;
    max-width: none;
}
.payment-details-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.payment-details-card-hint {
    margin: 0 0 20px;
}
.payment-details-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.payment-details-panel .payment-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    align-items: start;
    margin-bottom: 16px;
}
.payment-details-panel .payment-details-row .form-group,
.payment-details-panel .payment-details-row .copy-field {
    margin-bottom: 0;
    min-width: 0;
}
.copy-field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.copy-field-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.copy-field-value {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    user-select: all;
    cursor: text;
    word-break: break-word;
}
.copy-field-btn {
    flex-shrink: 0;
    align-self: stretch;
}
.copy-field-btn.is-copied {
    color: var(--success);
    border-color: var(--success);
}
.payment-details-panel--edit .form-group input,
.payment-details-panel--edit .form-group select {
    width: 100%;
}
@media (max-width: 768px) {
    .payment-details-panel .payment-details-row {
        grid-template-columns: 1fr;
    }
}

.sidebar-footer,
.detail-footer {
    height: var(--chrome-footer-height);
    padding: 0 var(--chrome-footer-padding-x);
    border-top: 1px solid var(--border);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-white);
}

.detail-footer {
    margin-top: auto;
    justify-content: space-between;
}
.btn-delete { color: var(--danger); background: none; border: none; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: inherit; }

/* Page (dashboard, call log) */
.page-content {
    flex: 1;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
}
.page-title { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.page-subtitle { color: var(--text-muted); margin: 0 0 24px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.toolbar .filter-chips { padding: 0; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-danger { background: var(--alert-danger-bg); color: var(--alert-danger-fg); border: 1px solid var(--alert-danger-border); }
.alert-success { background: var(--alert-success-bg); color: var(--alert-success-fg); border: 1px solid var(--alert-success-border); }
.alert-info { background: var(--alert-info-bg); color: var(--alert-info-fg); border: 1px solid var(--alert-info-border); }
.currency-icon-cell { font-size: 18px; line-height: 1; }
.currency-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-page);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-bg);
}
.login-wrap { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card .subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
}
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-white);
}
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-section { margin-bottom: 16px; }
.form-section-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form-row .form-group { flex: 1; min-width: 160px; }
.form-row-3 .form-group { min-width: 140px; }
.form-subheading {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}
.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.task-compose-card {
    margin-bottom: 16px;
    padding: 20px 24px;
}
.task-compose-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.task-compose-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.task-compose-submit {
    min-width: 148px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}

.comment-compose-card {
    margin-bottom: 16px;
    padding: 20px 24px;
}
.comment-compose-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.comment-compose-field {
    margin-bottom: 0;
}
.comment-compose-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.comment-compose-textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    resize: vertical;
}
.comment-compose-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.comment-compose-footer {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-top: 16px;
}
.comment-compose-visibility {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.comment-compose-visibility label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.comment-compose-select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.comment-compose-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.comment-compose-submit {
    flex-shrink: 0;
    min-width: 148px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
}
@media (max-width: 640px) {
    .comment-compose-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .comment-compose-submit {
        width: 100%;
    }
}

.alert-compose-card {
    margin-bottom: 20px;
}
.alert-compose-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}
.alert-compose-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
}
.alert-compose-span-full {
    grid-column: 1 / -1;
}
.alert-compose-grid label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}
.alert-compose-grid input[type="text"],
.alert-compose-grid textarea,
.alert-compose-readonly,
.alert-compose-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.alert-compose-readonly {
    background: var(--surface-muted, #f4f4f5);
    cursor: default;
}
.alert-compose-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}
.entity-alerts-scope-note {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.entity-alerts-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.entity-alerts-delete-btn {
    color: var(--danger);
}
.entity-alerts-delete-btn:hover {
    background: var(--danger-hover-bg);
    border-color: var(--danger);
    color: var(--danger);
}
.entity-alert-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.entity-alert-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.entity-alert-banner__meta {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.85;
}
.entity-alert-banner__header {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}
.entity-alert-banner__message {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}
.entity-alert-banner--red {
    background: #fef2f2;
    border-color: #fecaca;
    color: #7f1d1d;
}
.entity-alert-banner--amber {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}
.entity-alert-banner--yellow {
    background: #fefce8;
    border-color: #fef08a;
    color: #713f12;
}
.entity-alert-banner--blue {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.entity-alert-banner--green {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #14532d;
}
.entity-alert-banner--grey {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #3f3f46;
}
.entity-alert-swatch {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
@media (max-width: 768px) {
    .alert-compose-grid {
        grid-template-columns: 1fr;
    }
}

.phone-row { align-items: center; }
.phone-primary-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
    margin: 0;
}
.phone-primary-btn {
    white-space: nowrap;
}
.joint-linked-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.unlink-label { font-size: 13px; font-weight: 400; cursor: pointer; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.table-wrap { overflow-x: auto; }

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

/* App confirm modal */
.app-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-backdrop);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.app-modal-backdrop:not([hidden]) {
    display: flex;
}
.app-modal {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
}
.app-modal-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}
.app-modal-message {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}
.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Incoming call overlay */
.call-overlay-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-backdrop);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.call-overlay-backdrop.is-visible { display: flex; }
.call-overlay-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 28px 32px;
    min-width: 340px;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
}
.call-overlay-card h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.call-overlay-card h2::before {
    content: '';
    width: 22px; height: 22px;
    background: var(--primary);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") center/contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") center/contain;
    background: var(--primary);
}
.call-overlay-meta { margin: 8px 0; font-size: 14px; }
.call-overlay-meta strong { color: var(--text); min-width: 56px; display: inline-block; }
.call-overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}
.call-matches { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.call-matches a { display: block; padding: 6px 0; font-weight: 500; }

.entity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

/* Investment transactions tab (Littsy-style repayment schedule) */
.investment-transactions-card {
    padding: 0;
    overflow: hidden;
}
.investment-transactions-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.investment-transactions-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.investment-transactions-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    color: var(--success);
}
.investment-transactions-icon svg {
    width: 28px;
    height: 28px;
}
.investment-transactions-heading {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.investment-transactions-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.investment-transactions-actions .btn svg {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    margin-right: 4px;
}
.investment-transactions-form {
    margin: 0;
}
.investment-transactions-body {
    padding: 0;
}
.investment-transactions-hint {
    margin: 0;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.investment-transactions-table {
    margin: 0;
    font-size: 13px;
}
.investment-transactions-table thead th {
    background: var(--bg-subtle);
    font-weight: 600;
    white-space: nowrap;
}
.investment-transactions-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.investment-transactions-table tbody tr.txn-row td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.investment-transactions-table tbody tr.txn-row--primary td {
    background: var(--badge-blue-bg);
    color: var(--badge-blue-fg);
}
.investment-transactions-table tbody tr.txn-row--warning td {
    background: var(--badge-orange-bg);
    color: var(--badge-orange-fg);
}
.investment-transactions-table tbody tr.txn-row--success td {
    background: var(--alert-success-bg);
    color: var(--alert-success-fg);
}
.investment-transactions-table tbody tr.txn-row--info td {
    background: var(--alert-info-bg);
    color: var(--alert-info-fg);
}
.investment-transactions-table tbody tr.txn-row--muted td {
    background: var(--badge-grey-bg);
    color: var(--badge-grey-fg);
}
.investment-transactions-table tbody tr.investment-txn-row {
    cursor: context-menu;
}
.investment-transactions-empty {
    text-align: center;
    padding: 28px 16px !important;
    color: var(--text-muted);
}
.txn-status-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    vertical-align: middle;
}
.txn-status-pill--due {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}
.txn-status-pill--paid {
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}
.investment-txn-context-menu {
    position: absolute;
    z-index: 1200;
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    padding: 4px 0;
}
.investment-txn-context-menu[hidden] {
    display: none !important;
}
.investment-txn-context-item {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
}
.investment-txn-context-item:hover {
    background: var(--bg-hover);
}

/* Entity Drive documents tab */
.entity-drive-documents__list-wrap {
    margin: 0 -1px -1px;
}
.entity-drive-documents__table {
    width: 100%;
}
.entity-drive-documents__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.entity-drive-documents__title {
    margin: 0;
    font-size: 1rem;
}
.entity-drive-documents__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.entity-drive-documents__view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.entity-drive-documents__view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    background: var(--bg-white);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}
.entity-drive-documents__view-btn + .entity-drive-documents__view-btn {
    border-left: 1px solid var(--border);
}
.entity-drive-documents__view-btn.is-active,
.entity-drive-documents__view-btn[aria-pressed="true"] {
    background: var(--bg-hover);
    color: var(--text);
}
.entity-drive-documents__view-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.entity-drive-documents[data-view="list"] [data-documents-panel="grid"] {
    display: none;
}
.entity-drive-documents[data-view="grid"] [data-documents-panel="list"] {
    display: none;
}
.entity-drive-documents__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.drive-doc-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.drive-doc-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.drive-doc-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-hover);
    color: var(--accent);
}
.drive-doc-card__icon svg {
    width: 22px;
    height: 22px;
}
.drive-doc-card__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}
.drive-doc-card__meta {
    font-size: 12px;
    color: var(--text-muted);
}
.drive-doc-list__icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
    color: var(--accent);
}
.drive-doc-list__icon svg {
    width: 18px;
    height: 18px;
}
.drive-doc-list__action {
    text-align: right;
    white-space: nowrap;
}
.entity-drive-documents__empty,
.entity-drive-documents__notice {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.entity-drive-documents__notice {
    margin-bottom: 12px;
}
.entity-drive-documents__embed {
    width: 100%;
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
}

/* Document template visual editor */
.document-template-editor__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.document-template-editor__head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.document-template-editor__placeholders {
    margin-bottom: 16px;
    padding: 16px 20px;
}
.document-template-editor__placeholders-title {
    margin: 0 0 4px;
    font-size: 15px;
}
.document-template-editor__placeholders-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.document-template-editor__placeholder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.document-template-editor__form {
    padding: 20px 24px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.document-template-editor__form .form-group textarea {
    min-height: 320px;
}
.document-template-editor__form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.document-template-editor__save-note {
    font-size: 13px;
    color: var(--text-muted);
}

/* Investment document generate */
/* Entity documents stack (template panel + folder card) */
.entity-documents-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.doc-template-panel {
    padding: 0;
    overflow: hidden;
}
.doc-template-panel__toolbar {
    padding: 16px 20px 0;
    margin-bottom: 12px;
}
.doc-template-panel__intro {
    margin: 0 20px 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}
.doc-template-panel__empty {
    padding: 0 20px 16px;
}
.doc-template-panel__table-wrap {
    margin: 0;
}
.doc-template-panel .entity-drive-documents__table {
    margin: 0;
}
/* Document generate modal (body-level overlay) */
.doc-generate-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: var(--overlay-backdrop);
    pointer-events: auto;
}
.doc-generate-modal-backdrop:not([hidden]) {
    display: flex;
}
.doc-generate-modal-backdrop[hidden] {
    display: none !important;
}
html.doc-generate-modal-open {
    overflow: hidden;
}
.doc-generate-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    flex: 0 0 auto;
    margin: 0;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px 28px 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    pointer-events: auto;
}
.doc-generate-modal__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}
.doc-generate-modal__template {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.doc-generate-modal__section {
    margin-bottom: 20px;
}
.doc-generate-modal__legend {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.doc-generate-modal__section-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}
.doc-generate-modal__format-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.doc-generate-format-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.doc-generate-format-btn:hover:not(.is-active) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.doc-generate-format-btn.is-active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.doc-generate-modal__action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.doc-generate-action-btn {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.doc-generate-action-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.doc-generate-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.doc-generate-action-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}
.doc-generate-action-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg-hover);
    color: var(--primary);
}
.doc-generate-action-btn__icon svg {
    width: 20px;
    height: 20px;
}
.doc-generate-action-btn__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.doc-generate-action-btn__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.doc-generate-action-btn__desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}
.doc-generate-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 4px;
}

/* Application review actions */
.entity-detail-page .application-review-actions {
    margin: 0 0 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.application-review-actions__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
}
@media (max-width: 860px) {
    .application-review-actions__layout {
        grid-template-columns: 1fr;
    }
}
.application-review-actions__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.application-review-actions__hint {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}
.application-review-actions__warning {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--danger);
}
.application-review-actions__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}
.application-review-actions__form {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}
.application-review-actions__notes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.application-review-actions__notes summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
}
.application-review-actions__notes-field {
    margin: 12px 0 0;
}
.application-review-actions__notes-form textarea {
    width: 100%;
    max-width: 100%;
}
.application-review-actions__notes-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.app-doc-split__heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.app-doc-split__heading-row .app-doc-split__heading {
    margin: 0;
}
.app-doc-ai-rerun-form {
    margin: 0;
}

/* Application create */
.application-create-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.application-create-tabs__btn {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.application-create-tabs__btn.is-active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.application-create-investor-mode {
    border: 0;
    margin: 0 0 16px;
    padding: 0;
}
.application-create-investor-mode__legend {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.application-create-investor-mode__options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.application-create-investor-mode__options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.application-create-actions {
    margin-top: 16px;
}
.application-create-panel--drive {
    max-width: 640px;
}
.application-create-drive-intro {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--primary-light);
    border: 1px solid rgba(43, 125, 233, 0.2);
}
.application-create-drive-intro__icon {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 2px;
}
.application-create-panel-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 820px;
}

/* Document template letter preview */
.document-letter-preview-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.document-letter-preview-card__label {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.document-letter-preview {
    background: #d8dce3;
    border-radius: var(--radius);
    padding: 28px 20px 36px;
}
.document-letter-preview__page {
    max-width: 210mm;
    min-height: 280mm;
    margin: 0 auto;
    padding: 20mm 18mm 22mm;
    background: #fff;
    color: #1a1a1a;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 8px 24px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}
.document-letter-preview__content {
    font-size: 11pt;
    line-height: 1.55;
    font-family: 'Times New Roman', Times, Georgia, serif;
}
.document-letter-preview__content table {
    width: 100%;
    border-collapse: collapse;
}
.document-letter-preview__content td,
.document-letter-preview__content th {
    border: 1px solid #ccc;
    padding: 6px 8px;
    vertical-align: top;
}
.document-letter-preview__empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}
@media (max-width: 900px) {
    .document-letter-preview {
        padding: 16px 12px 24px;
    }
    .document-letter-preview__page {
        min-height: auto;
        padding: 16mm 14mm;
    }
}

/* Email template preview */
.email-template-preview__html {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}
.email-template-preview__html p {
    margin: 0 0 0.75em;
}
.email-template-preview__text {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}
.email-template-form {
    width: 100%;
    max-width: none;
}
.email-template-form__meta,
.email-template-form__body {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.email-template-form__meta {
    margin-bottom: 16px;
    padding: 20px 24px;
}
.email-template-form__body {
    padding: 20px 24px;
}
.email-template-form__body .form-group textarea {
    min-height: 280px;
}

/* WYSIWYG editor card + variable drawer */
.wysiwyg-editor-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.wysiwyg-editor-card__title {
    margin: 0;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
html.template-variables-drawer-open,
html.doc-template-settings-drawer-open {
    overflow: hidden;
}

/* Document template settings drawer */
.doc-template-settings-drawer[hidden] {
    display: none !important;
}
.doc-template-settings-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}
.doc-template-settings-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}
.doc-template-settings-drawer__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    max-width: 100%;
    height: 100%;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.doc-template-settings-drawer:not([hidden]) .doc-template-settings-drawer__panel {
    transform: translateX(0);
}
.doc-template-settings-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.doc-template-settings-drawer__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}
.doc-template-settings-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
}
.doc-template-settings-form .form-group:last-of-type {
    margin-bottom: 20px;
}
.template-variables-drawer[hidden] {
    display: none !important;
}
.template-variables-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}
.template-variables-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}
.template-variables-drawer__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(400px, 100vw);
    max-width: 100%;
    height: 100%;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.template-variables-drawer:not([hidden]) .template-variables-drawer__panel {
    transform: translateX(0);
}
.template-variables-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.template-variables-drawer__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}
.template-variables-drawer__intro,
.template-variables-drawer__legacy {
    margin: 0;
    padding: 12px 20px 0;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.template-variables-drawer__legacy {
    padding-top: 8px;
}
.template-variables-drawer__search-wrap {
    padding: 12px 20px;
    flex-shrink: 0;
}
.template-variables-drawer__search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text);
}
.template-variables-drawer__search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.template-variables-drawer__groups {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 20px 20px;
}
.template-variables-group {
    margin-bottom: 16px;
}
.template-variables-group__heading {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.template-variables-group__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.template-variables-item + .template-variables-item {
    border-top: 1px solid var(--border);
}
.template-variables-item__btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: var(--bg-white);
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    color: inherit;
}
.template-variables-item__btn:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}
.template-variables-item__key {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.template-variables-drawer__empty {
    margin: 0;
    padding: 0 20px 20px;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Entity preview drawer (investor / introducer quick view) */
html.entity-preview-drawer-open {
    overflow: hidden;
}
.entity-preview-drawer[hidden] {
    display: none !important;
}
.entity-preview-drawer {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}
.entity-preview-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}
.entity-preview-drawer__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    max-width: 100%;
    height: 100%;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.entity-preview-drawer:not([hidden]) .entity-preview-drawer__panel {
    transform: translateX(0);
}
.entity-preview-drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 0;
    flex-shrink: 0;
}
.entity-preview-drawer__top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.entity-preview-drawer__popout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.entity-preview-drawer__popout:hover {
    color: var(--primary);
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}
.entity-preview-drawer__popout svg {
    width: 18px;
    height: 18px;
}
.entity-preview-drawer__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px 0;
    flex-shrink: 0;
}
.entity-preview-drawer__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.entity-preview-drawer__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.entity-preview-drawer__tabs {
    display: flex;
    gap: 20px;
    padding: 16px 20px 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.entity-preview-drawer__tab {
    margin: 0;
    padding: 0 0 12px;
    border: 0;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: default;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.entity-preview-drawer__tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.entity-preview-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 24px;
}
.entity-preview-drawer__loading,
.entity-preview-drawer__error,
.entity-preview-drawer__empty {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.entity-preview-drawer__error {
    color: var(--danger, #b91c1c);
}
.entity-preview-drawer__section {
    margin-bottom: 20px;
}
.entity-preview-drawer__section-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.entity-preview-drawer__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}
.entity-preview-drawer__field label {
    display: block;
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}
.entity-preview-drawer__field p {
    margin: 0;
    font-size: 13px;
    color: var(--text);
    word-break: break-word;
}
.entity-preview-drawer__table {
    font-size: 13px;
}
.entity-preview-drawer__table th {
    font-size: 11px;
}
.entity-preview-drawer__more {
    margin: 10px 0 0;
    font-size: 13px;
}
.entity-preview-drawer__more a {
    color: var(--primary);
    font-weight: 500;
}
a.entity-preview-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
a.entity-preview-link:hover {
    text-decoration: underline;
}
/* Preview triggers in the header toolbar keep circular comm-btn styling */
.comm-actions a.comm-btn[data-entity-preview] {
    color: var(--comm-btn-fg);
    font-weight: inherit;
    text-decoration: none;
}
.comm-actions a.comm-btn[data-entity-preview]:hover {
    text-decoration: none;
}
@media (max-width: 520px) {
    .entity-preview-drawer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Inbox triage */
.inbox-triage-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
}
.inbox-triage-week-label {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}
.inbox-triage-score-line {
    margin: 4px 0 0;
    font-size: 14px;
}
.inbox-triage-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.inbox-triage-panel-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}
.inbox-triage-leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.inbox-triage-leaderboard-list li {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.inbox-triage-leaderboard-list li:last-child {
    border-bottom: none;
}
.inbox-triage-rank {
    font-weight: 700;
    color: var(--text-muted);
}
.inbox-triage-points {
    font-weight: 600;
}
.inbox-triage-progress {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.inbox-triage-email-card {
    margin-bottom: 16px;
    min-height: 200px;
}
.inbox-triage-email-meta p {
    margin: 0 0 6px;
    font-size: 13px;
}
.inbox-triage-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}
.inbox-triage-body {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.inbox-triage-pad-wrap {
    text-align: center;
}
.inbox-triage-pad {
    display: inline-grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-width: 420px;
    width: 100%;
}
.inbox-triage-pad-middle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.inbox-triage-pad-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 72px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.inbox-triage-pad-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-soft, rgba(59, 130, 246, 0.08));
}
.inbox-triage-pad-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.inbox-triage-pad-flash {
    transform: scale(0.97);
    border-color: var(--primary);
}
.inbox-triage-pad-key {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}
.inbox-triage-pad-label {
    font-size: 12px;
    font-weight: 600;
}
.inbox-triage-hints {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.inbox-triage-empty-state,
.inbox-triage-empty {
    color: var(--text-muted);
    font-size: 14px;
}
.inbox-triage-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.inbox-triage-help-overlay[hidden] {
    display: none;
}
.inbox-triage-help-card {
    max-width: 360px;
    width: 100%;
}
.inbox-triage-help-card ul {
    margin: 0 0 16px;
    padding-left: 0;
    list-style: none;
}
.inbox-triage-help-card li {
    margin: 8px 0;
    font-size: 14px;
}
@media (max-width: 900px) {
    .inbox-triage-layout {
        grid-template-columns: 1fr;
    }
}
