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

:root {
    /* Japandi color palette - warm, natural, calming */
    --bg-primary: #FAF8F5;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F2ED;
    --bg-dark: #4A4540;
    --text-primary: #3D3A36;
    --text-secondary: #5C5851;
    --text-muted: #8A857D;
    --text-light: #FAF8F5;
    /* Sage green - primary accent, nature-inspired calm */
    --accent-primary: #8B9D83;
    --accent-primary-dark: #6B7D63;
    --accent-secondary: #B8C4BA;
    /* Warm earth tones */
    --accent-warm: #9C8979;
    --accent-warm-light: #E8DDD1;
    /* Muted terracotta for success - warm positive feedback */
    --accent-success: #7D9178;
    /* Soft clay for danger - gentle but clear */
    --accent-danger: #B8857A;
    /* Warm ochre for warnings */
    --accent-warning: #C9A86C;
    --accent-warning-light: #FDF6E7;
    --border-light: #E8E4DE;
    --border-medium: #D4CFC6;
    /* Softer shadows for zen-like depth */
    --shadow-soft: 0 2px 8px rgba(74, 69, 64, 0.04);
    --shadow-medium: 0 4px 20px rgba(74, 69, 64, 0.06);
    --shadow-elevated: 0 8px 40px rgba(74, 69, 64, 0.10);
    /* Slightly more rounded for organic feel */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 0 24px 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
}

.logo h1 {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.logo-icon.roofio-logo,
.logo-icon.frontage-logo {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 0;
}

.logo-icon.roofio-logo svg,
.logo-icon.frontage-logo svg {
    width: 40px;
    height: 40px;
    stroke: none;
}

.nav-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 16px;
}

.nav-container::-webkit-scrollbar {
    width: 6px;
}

.nav-container::-webkit-scrollbar-track {
    background: transparent;
}

.nav-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.nav-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: rgba(255,255,255,0.7);
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: var(--accent-primary);
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--accent-warm);
    color: var(--bg-dark);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sharepoint-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-danger);
}

.status-dot.connected {
    background: var(--accent-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Demo Mode Banner */
.demo-banner {
    background: var(--accent-warning-light);
    border-bottom: 2px solid var(--accent-warning);
    color: var(--text-primary);
    text-align: center;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 12px;
}

.page-content {
    padding: 32px 40px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-dark);
}

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

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
}

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

.card-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

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

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.green {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary);
}

.stat-icon.warm {
    background: rgba(196, 164, 132, 0.15);
    color: var(--accent-warm);
}

.stat-icon.blue {
    background: rgba(100, 140, 180, 0.15);
    color: #648CB4;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Fraunces', serif;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-change {
    font-size: 0.8125rem;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--accent-primary);
}

.stat-change.negative {
    color: var(--accent-danger);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

td {
    font-size: 0.9375rem;
}

tr:hover td {
    background: var(--bg-primary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary-dark);
}

.status-badge.pending {
    background: rgba(212, 168, 75, 0.15);
    color: #B8922F;
}

.status-badge.overdue {
    background: rgba(194, 124, 124, 0.15);
    color: var(--accent-danger);
}

.status-badge.vacant {
    background: rgba(138, 133, 125, 0.15);
    color: var(--text-muted);
}

.status-badge.renewal {
    background: rgba(74, 144, 200, 0.15);
    color: #2E7BC4;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    background: var(--bg-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 42, 38, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal.large {
    max-width: 900px;
}

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

.modal-header h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-light);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Page Sections */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: pageFadeIn 0.25s ease-out;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Loading skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-light) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 90%; }

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Inline field errors */
.field-error {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-danger);
    margin-top: 4px;
}

/* Toast entrance */
.toast-notification {
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

/* Document List */
.doc-list {
    list-style: none;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

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

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

.doc-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-muted);
}

.doc-icon.folder svg {
    stroke: var(--accent-warm);
}

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

.doc-name {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Lease Template */
.lease-preview {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px;
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
}

.lease-preview h3 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 18px;
}

.lease-preview .section {
    margin-bottom: 20px;
}

.lease-preview .section-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.lease-preview .placeholder {
    background: var(--accent-warm-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
}

/* Accounting */
.ledger-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ledger-item {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.ledger-item.income {
    border-left: 4px solid var(--accent-primary);
}

.ledger-item.expense {
    border-left: 4px solid var(--accent-danger);
}

.ledger-item.balance {
    border-left: 4px solid var(--accent-warm);
}

.ledger-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ledger-value {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--border-medium);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

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

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* Search */
.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    background: var(--bg-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-dark);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}

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

.toast.success {
    background: var(--accent-primary-dark);
}

.toast.error {
    background: var(--accent-danger);
}

.toast.warning {
    background: #9C8452;
}

/* Action Buttons in Table */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--border-light);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.quick-action {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-action:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-medium);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-primary);
}

.quick-action-text h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.quick-action-text p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Provision Tags */
.provision-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.provision-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.provision-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.provision-tag.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.provision-tag svg {
    width: 14px;
    height: 14px;
}

/* Search Results */
.search-results {
    margin-top: 24px;
}

.search-result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.search-result-item:hover {
    box-shadow: var(--shadow-medium);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.search-result-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-result-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.search-result-provision {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.search-result-provision mark {
    background: var(--accent-warm-light);
    color: var(--text-primary);
    padding: 1px 4px;
    border-radius: 3px;
}

.provision-type-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary-dark);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Debt Cards */
.debt-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.debt-summary-item {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.debt-summary-item.danger {
    border-left: 4px solid var(--accent-danger);
}

.debt-summary-item.warning {
    border-left: 4px solid var(--accent-warning);
}

.debt-summary-item.success {
    border-left: 4px solid var(--accent-primary);
}

.debt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.debt-card-header {
    background: var(--bg-tertiary);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.debt-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.debt-card-body {
    padding: 20px;
}

.debt-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.debt-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debt-detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.debt-detail-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.debt-detail-value.large {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
}

.debt-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.debt-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.debt-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.debt-progress-fill.warning {
    background: var(--accent-warning);
}

.debt-progress-fill.danger {
    background: var(--accent-danger);
}

/* Lease Document Card */
.lease-doc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    transition: var(--transition);
}

.lease-doc-card:hover {
    box-shadow: var(--shadow-medium);
}

.lease-doc-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lease-doc-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-warm);
}

.lease-doc-content {
    flex: 1;
    min-width: 0;
}

.lease-doc-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.lease-doc-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.lease-doc-provisions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lease-doc-provisions .mini-tag {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.lease-doc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lease-doc-info {
    flex: 1;
    min-width: 0;
}

.lease-doc-name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lease-doc-tenant {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.lease-documents-grid {
    display: grid;
    gap: 16px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: var(--surface-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
}

.info-item {
    font-size: 0.875rem;
}

.info-item strong {
    color: var(--text-muted);
    font-weight: 500;
}

/* Debt Metric */
.debt-metric {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    background: var(--bg-tertiary);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(124, 152, 133, 0.05);
}

.upload-zone.has-file {
    border-color: var(--accent-primary);
    background: rgba(124, 152, 133, 0.1);
    border-style: solid;
}

.upload-zone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-primary);
}

.upload-zone h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-zone p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.upload-zone .file-types {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-zone .uploaded-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.upload-zone .uploaded-file .file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.upload-zone .uploaded-file .remove-file {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone .uploaded-file .remove-file:hover {
    color: #A55A5A;
}

.extracted-data {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-primary);
}

.extracted-data h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extracted-data h4 svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-primary);
}

.extracted-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.extracted-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.extracted-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.extracted-item .value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.extracted-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* To-Do List Styles */
.todo-list {
    list-style: none;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: var(--transition);
}

.todo-item:hover {
    box-shadow: var(--shadow-medium);
}

.todo-item.completed {
    opacity: 0.6;
    background: var(--bg-tertiary);
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
}

.todo-item.high-priority {
    border-left: 4px solid var(--accent-danger);
}

.todo-item.medium-priority {
    border-left: 4px solid var(--accent-warning);
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.todo-content {
    flex: 1;
}

.todo-text {
    font-weight: 500;
    margin-bottom: 4px;
}

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

.todo-due-date.overdue {
    color: var(--accent-danger);
    font-weight: 600;
}

/* Bank Account Styles */
.bank-account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.bank-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.bank-account-name {
    font-weight: 600;
    font-size: 1.125rem;
}

.bank-account-balance {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.bank-account-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Statement Styles */
.statement-preview {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px;
    font-family: 'Times New Roman', serif;
    max-height: 600px;
    overflow-y: auto;
}

.statement-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.statement-table th,
.statement-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.statement-table th {
    background: #f5f5f5;
}

.statement-total {
    font-weight: bold;
    background: #f0f0f0;
}

/* Budget Styles */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.budget-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.budget-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin: 12px 0;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.budget-bar-fill.under {
    background: var(--accent-primary);
}

.budget-bar-fill.near {
    background: var(--accent-warning);
}

.budget-bar-fill.over {
    background: var(--accent-danger);
}

.variance-positive {
    color: var(--accent-primary);
}

.variance-negative {
    color: var(--accent-danger);
}

/* Claude AI Chat Styles */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 700px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: var(--accent-warm);
}

.ai-message-avatar svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.ai-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.ai-message.user .ai-message-content {
    background: var(--accent-primary);
    color: white;
}

.ai-chat-input {
    display: flex;
    gap: 12px;
}

.ai-chat-input input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
}

/* Lease Abstract Styles */
.abstract-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.abstract-header {
    background: var(--bg-tertiary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.abstract-body {
    padding: 20px;
}

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

.abstract-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.abstract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Vendor Management Styles */
.vendor-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.vendor-rating {
    display: flex;
    gap: 4px;
}

.vendor-rating svg {
    width: 16px;
    height: 16px;
    fill: var(--accent-warning);
    stroke: var(--accent-warning);
}

.vendor-rating svg.empty {
    fill: none;
    stroke: var(--border-medium);
}

/* E-Signature Styles */
.signature-workflow {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.signature-step {
    flex: 1;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
    position: relative;
}

.signature-step::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid var(--bg-tertiary);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.signature-step:last-child::after {
    display: none;
}

.signature-step.active {
    background: var(--accent-primary);
    color: white;
}

.signature-step.completed {
    background: var(--accent-success);
    color: white;
}

/* Audit Trail Styles */
.audit-timeline {
    position: relative;
    padding-left: 30px;
}

.audit-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.audit-entry {
    position: relative;
    padding: 16px 0;
    padding-left: 20px;
}

.audit-entry::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-secondary);
}

.audit-entry.warning::before {
    background: var(--accent-warning);
}

.audit-entry.danger::before {
    background: var(--accent-danger);
}

/* Dashboard Customization */
.dashboard-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    cursor: move;
}

.dashboard-widget.dragging {
    opacity: 0.5;
}

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

.widget-drag-handle {
    cursor: move;
    color: var(--text-muted);
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    align-items: center;
}

.bulk-actions .selected-count {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Rent Escalation Indicator */
.escalation-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(201, 168, 108, 0.15);
    color: var(--accent-warning);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.escalation-indicator svg {
    width: 14px;
    height: 14px;
}

/* Compliance Badge */
.compliance-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.compliance-status.compliant {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary-dark);
}

.compliance-status.warning {
    background: rgba(201, 168, 108, 0.15);
    color: #B8922F;
}

.compliance-status.non-compliant {
    background: rgba(194, 124, 124, 0.15);
    color: var(--accent-danger);
}

/* ============================================
   LEASE LIBRARY - Enhanced Module Styles
   ============================================ */

/* Toolbar */
.ll-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.ll-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

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

/* Search input with icon */
.ll-search-wrap {
    position: relative;
    min-width: 240px;
    flex: 1;
    max-width: 320px;
}

.ll-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    pointer-events: none;
}

.ll-search-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    background: var(--bg-primary);
    transition: var(--transition);
}

.ll-search-wrap input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.ll-search-wrap input::placeholder {
    color: var(--text-muted);
}

/* Filter selects */
.ll-filter-select {
    padding: 9px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 28px;
    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='%238A857D' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ll-filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* View toggle */
.ll-view-toggle {
    display: flex;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}

.ll-view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ll-view-btn:first-child {
    border-right: 1px solid var(--border-light);
}

.ll-view-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
}

.ll-view-btn:hover {
    background: var(--bg-tertiary);
}

.ll-view-btn.active {
    background: var(--accent-primary);
}

.ll-view-btn.active svg {
    stroke: white;
}

/* Results bar */
.ll-results-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--bg-tertiary);
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

.ll-active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ll-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ll-filter-pill button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.ll-filter-pill button:hover {
    color: var(--accent-danger);
}

/* Table styles */
.ll-table {
    width: 100%;
    border-collapse: collapse;
}

.ll-table th {
    padding: 12px 16px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

.ll-th-sortable {
    cursor: pointer;
    transition: color 0.2s;
}

.ll-th-sortable:hover {
    color: var(--accent-primary) !important;
}

.ll-sort-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.3;
    transition: opacity 0.2s, transform 0.2s;
}

.ll-th-sortable:hover .ll-sort-icon {
    opacity: 0.7;
}

.ll-th-sortable.sort-asc .ll-sort-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.ll-th-sortable.sort-desc .ll-sort-icon {
    opacity: 1;
}

.ll-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.ll-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.ll-table tbody tr:hover td {
    background: rgba(139, 157, 131, 0.04);
}

/* Document cell */
.ll-doc-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ll-doc-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ll-doc-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-warm);
}

.ll-doc-icon.linked {
    background: rgba(124, 152, 133, 0.12);
}

.ll-doc-icon.linked svg {
    stroke: var(--accent-primary);
}

.ll-doc-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Status pills */
.ll-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ll-status.active {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary-dark);
}

.ll-status.expiring {
    background: rgba(201, 168, 108, 0.18);
    color: #9A7B2E;
}

.ll-status.expired {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}

.ll-status.draft {
    background: rgba(138, 133, 125, 0.12);
    color: var(--text-muted);
}

/* Provision count badge */
.ll-prov-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ll-prov-count.has-provisions {
    background: rgba(124, 152, 133, 0.12);
    color: var(--accent-primary-dark);
}

/* Lease period display */
.ll-period {
    font-size: 0.8125rem;
}

.ll-period-dates {
    color: var(--text-primary);
}

.ll-period-remaining {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Rent display */
.ll-rent {
    font-weight: 600;
    font-family: 'Fraunces', serif;
    font-size: 0.9375rem;
}

/* Table action buttons */
.ll-actions {
    display: flex;
    gap: 6px;
}

/* Upload section collapse */
.ll-upload-card {
    margin-bottom: 0;
}

.ll-upload-body {
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s;
    overflow: hidden;
}

.ll-upload-body.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
}

/* Card view - enhanced lease card grid */
.ll-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.ll-lease-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ll-lease-card:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-secondary);
}

.ll-lease-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ll-lease-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ll-lease-card-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ll-lease-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ll-card-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ll-card-field-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.ll-card-field-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.ll-lease-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.ll-card-provisions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ll-card-prov-tag {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   PROPERTIES MODULE - Enhanced Styles
   ============================================ */

/* Property card grid */
.prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.prop-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.prop-card:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-secondary);
}

/* Card header with colored accent bar */
.prop-card-header {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.prop-card-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.prop-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prop-card-icon.commercial {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary);
}

.prop-card-icon.residential {
    background: rgba(100, 140, 180, 0.15);
    color: #648CB4;
}

.prop-card-icon.industrial {
    background: rgba(196, 164, 132, 0.15);
    color: var(--accent-warm);
}

.prop-card-icon.mixed {
    background: rgba(201, 168, 108, 0.15);
    color: var(--accent-warning);
}

.prop-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.prop-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prop-card-address {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Type badge */
.prop-type-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.prop-type-badge.commercial {
    background: rgba(124, 152, 133, 0.15);
    color: var(--accent-primary-dark);
}

.prop-type-badge.residential {
    background: rgba(100, 140, 180, 0.15);
    color: #4A7BA8;
}

.prop-type-badge.industrial {
    background: rgba(196, 164, 132, 0.15);
    color: #7A6450;
}

.prop-type-badge.mixed {
    background: rgba(201, 168, 108, 0.15);
    color: #9A7B2E;
}

/* Card body with metrics */
.prop-card-body {
    padding: 16px 20px;
}

.prop-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.prop-metric {
    text-align: center;
}

.prop-metric-value {
    font-family: 'Fraunces', serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.prop-metric-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Occupancy bar */
.prop-occupancy-bar {
    margin-top: 14px;
}

.prop-occupancy-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.prop-occupancy-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.prop-occupancy-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: var(--accent-primary);
}

.prop-occupancy-fill.partial {
    background: var(--accent-warning);
}

.prop-units-edit-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.prop-occupancy-bar:hover .prop-units-edit-btn {
    opacity: 1;
}

.prop-units-edit-btn:hover {
    color: var(--accent-primary);
}

.prop-occupancy-fill.vacant {
    background: var(--accent-danger);
}

/* Card footer */
.prop-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
}

.prop-card-tenants {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.prop-card-tenants svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-muted);
}

/* Property detail modal */
.prop-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.prop-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prop-detail-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.prop-detail-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .prop-grid {
        grid-template-columns: 1fr;
    }
    .prop-card-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

.prop-at-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    background: rgba(139,157,131,0.12);
    color: var(--text-primary);
}

/* ============================================
   PROPERTY DETAIL VIEW
   ============================================ */

#page-property-detail table {
    width: 100%;
    border-collapse: collapse;
}

#page-property-detail th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-tertiary);
}

#page-property-detail td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.pd-vendor-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-secondary);
}

/* Property Detail – Tenant Cards */
.pd-ten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.pd-ten-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pd-ten-card:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-secondary);
}

.pd-ten-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
}

.pd-ten-header .ten-avatar {
    width: 42px;
    height: 42px;
    font-size: 14px;
    flex-shrink: 0;
}

.pd-ten-name {
    flex: 1;
    min-width: 0;
}

.pd-ten-name h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-ten-name span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pd-ten-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-light);
    margin: 0 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pd-ten-stat {
    background: var(--bg-tertiary);
    padding: 10px 12px;
}

.pd-ten-stat label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.pd-ten-stat span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pd-ten-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-top: auto;
}

.pd-ten-days {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pd-ten-days.expiring { color: var(--accent-warm); }
.pd-ten-days.expired  { color: var(--accent-danger); }

.pd-ten-docs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.pd-ten-docs-btn:hover {
    opacity: 0.85;
}

.pd-ten-docs-btn .doc-count {
    background: rgba(255,255,255,0.25);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
}

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

/* ============================================
   TENANTS MODULE - Enhanced Styles
   ============================================ */

/* Tenant contact card grid.
   align-items:start prevents the grid from stretching every card in a row to
   match the tallest one — that stretching is what created the "5-6 lines of
   blank space above one line of text" effect on filtered/short result sets. */
.ten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
}

.ten-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    align-self: start;
}

.ten-card:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-secondary);
}

/* Card top section: avatar + name + status */
.ten-card-top {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ten-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.ten-avatar.green { background: var(--accent-primary); }
.ten-avatar.warm { background: var(--accent-warm); }
.ten-avatar.blue { background: #648CB4; }
.ten-avatar.gold { background: var(--accent-warning); }

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

.ten-card-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ten-card-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact details strip */
.ten-card-contact {
    display: flex;
    gap: 14px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.ten-card-contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ten-card-contact-item svg {
    width: 13px;
    height: 13px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}

/* Lease info grid inside card */
.ten-card-details {
    padding: 10px 16px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.ten-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ten-detail-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

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

/* Card footer */
.ten-card-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.ten-lease-remaining {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ten-lease-remaining svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.ten-lease-remaining.warning {
    color: var(--accent-warning);
}

.ten-lease-remaining.danger {
    color: var(--accent-danger);
}

/* Table avatar */
.ten-table-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ten-table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

.ten-table-name {
    font-weight: 600;
    font-size: 0.875rem;
}

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

/* Legal Notices Templates */
.ln-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.ln-template {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}

.ln-template:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.ln-template-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ln-template h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ln-template p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

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

/* Provision Search */
.prov-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

/* Reports Module */
.rpt-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.rpt-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.rpt-type-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.rpt-type-card.active {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.rpt-type-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rpt-type-icon svg {
    width: 20px;
    height: 20px;
}

.rpt-type-icon.green { background: rgba(139, 157, 131, 0.15); color: var(--accent-primary); }
.rpt-type-icon.green svg { stroke: var(--accent-primary); }
.rpt-type-icon.warm { background: rgba(156, 137, 121, 0.15); color: var(--accent-warm); }
.rpt-type-icon.warm svg { stroke: var(--accent-warm); }
.rpt-type-icon.blue { background: rgba(100, 140, 180, 0.15); color: #648CB4; }
.rpt-type-icon.blue svg { stroke: #648CB4; }
.rpt-type-icon.gold { background: rgba(212, 168, 75, 0.15); color: var(--accent-warning); }
.rpt-type-icon.gold svg { stroke: var(--accent-warning); }

.rpt-type-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rpt-type-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.rpt-panel {
    display: none;
}

.rpt-panel.active {
    display: block;
    animation: lgFadeIn 0.3s ease;
}

.rpt-occ-bar-wrap {
    margin-top: 8px;
}

.rpt-occ-prop {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.rpt-occ-prop:last-child {
    border-bottom: none;
}

.rpt-occ-name {
    min-width: 160px;
    font-weight: 600;
    font-size: 0.85rem;
}

.rpt-occ-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.rpt-occ-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.4s ease;
}

.rpt-occ-fill.high { background: var(--accent-primary); }
.rpt-occ-fill.medium { background: var(--accent-warning); }
.rpt-occ-fill.low { background: var(--accent-danger); }

.rpt-occ-pct {
    min-width: 60px;
    text-align: right;
    font-weight: 700;
    font-family: 'Fraunces', serif;
    font-size: 0.9rem;
}

.rpt-occ-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

@media (max-width: 768px) {
    .rpt-type-grid {
        grid-template-columns: 1fr 1fr;
    }
    .rpt-type-info p {
        display: none;
    }
    .rpt-occ-prop {
        flex-wrap: wrap;
    }
    .rpt-occ-name {
        min-width: 100%;
    }
}

/* Lease Generator Wizard */
.lg-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.lg-step {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    padding: 4px 0;
}

.lg-step.active,
.lg-step.completed {
    opacity: 1;
}

.lg-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.lg-step.active .lg-step-circle {
    background: var(--accent-primary);
    color: white;
}

.lg-step.completed .lg-step-circle {
    background: var(--accent-primary);
    color: white;
}

.lg-step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.lg-step.active .lg-step-label {
    color: var(--text-primary);
}

.lg-step.completed .lg-step-label {
    color: var(--accent-primary);
}

.lg-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
    min-width: 20px;
    max-width: 60px;
    transition: background 0.2s;
}

.lg-step-line.completed {
    background: var(--accent-primary);
}

.lg-step-panel {
    display: none;
}

.lg-step-panel.active {
    display: block;
    animation: lgFadeIn 0.3s ease;
}

@keyframes lgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lg-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 0;
}

.lg-upload-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-top: 16px;
}

.lg-upload-strip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.04);
}

/* Provisions Grid */
.lg-provisions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.lg-provision {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.lg-provision:hover {
    border-color: var(--accent-primary);
}

.lg-provision.selected {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}

.lg-provision-toggle {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lg-provision.selected .lg-provision-toggle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.lg-provision-toggle svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.15s;
}

.lg-provision.selected .lg-provision-toggle svg {
    opacity: 1;
}

.lg-provision-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.lg-provision-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Rent Schedule Summary */
.lg-rent-summary {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.lg-rent-summary-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.lg-rent-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
}

.lg-rent-row:last-child {
    border-bottom: none;
}

.lg-rent-row span:first-child {
    color: var(--text-muted);
}

.lg-rent-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Review Summary */
.lg-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lg-summary-section {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
}

.lg-summary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lg-summary-section h4 {
    font-family: 'Fraunces', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lg-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.85rem;
}

.lg-summary-row .label {
    color: var(--text-muted);
}

.lg-summary-row .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
}

.lg-summary-provisions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.lg-summary-prov-tag {
    padding: 4px 10px;
    background: rgba(139, 157, 131, 0.1);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .lg-stepper {
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px;
    }
    .lg-step-label {
        display: none;
    }
    .lg-step-line {
        min-width: 12px;
    }
    .lg-provisions-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive adjustments for Lease Library */
@media (max-width: 1200px) {
    .ll-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ll-toolbar-left {
        flex-wrap: wrap;
    }
    .ll-toolbar-right {
        justify-content: flex-end;
    }
    .ll-search-wrap {
        min-width: 200px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .ll-card-grid {
        grid-template-columns: 1fr;
    }
    .ll-search-wrap {
        min-width: 100%;
    }
    .ll-filter-select {
        flex: 1;
        min-width: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .page-header {
        padding: 20px;
    }

    .page-content {
        padding: 20px;
    }

    .ledger-summary {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TENANT PROFILE MODAL
   ============================================ */
.tp-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.tp-header-info h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.tp-contact {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.tp-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 10px;
}

.tp-property-card {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.tp-property-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-soft);
}

.tp-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tp-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tp-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tp-stat-value {
    font-weight: 600;
    font-size: 0.9375rem;
}

.tp-provisions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-provision-item {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.tp-provision-label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 2px;
}

.tp-provision-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tp-pct-rent {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-warm-light);
}

/* ============================================
   CONTRACT VIEW MODAL
   ============================================ */
.cv-document {
    padding: 24px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.cv-doc-header {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-medium);
}

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

.cv-section-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.cv-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9375rem;
}

.cv-label {
    color: var(--text-secondary);
}

.cv-services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cv-service-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-secondary);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================
   PROVISION TAG CLICKABLE
   ============================================ */
.provision-tag-clickable {
    cursor: pointer !important;
}

.provision-tag-clickable:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
}

/* ============================================
   AUTO TODO BADGE
   ============================================ */
.todo-auto-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--accent-primary);
    color: white;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    background: var(--bg-primary);
    overflow-y: auto;
    padding: 24px 16px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 32px 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    text-align: center;
    margin: auto 0;
}

@media (max-height: 720px) {
    .auth-screen { padding: 12px 16px; }
    .auth-container { padding: 24px 24px; }
    .auth-logo { margin-bottom: 16px; }
}

.auth-logo {
    margin-bottom: 28px;
}

.auth-field {
    text-align: left;
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.auth-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.15);
}

.auth-error {
    font-size: 0.85rem;
    color: var(--accent-danger);
    min-height: 20px;
    margin: 6px 0;
}

.auth-forgot {
    margin-top: 12px;
    font-size: 0.8rem;
    text-align: right;
}

.auth-forgot a {
    color: var(--text-muted);
    text-decoration: none;
}

.auth-forgot a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.auth-toggle {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* Demo Login */
.auth-demo-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-demo-divider::before,
.auth-demo-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-demo-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-demo-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
}

.auth-demo-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.auth-demo-hint {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-demo-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Hide sidebar + main when not authenticated */
body:not(.authenticated) .sidebar,
body:not(.authenticated) .main-content {
    display: none !important;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FAF8F5;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Button loading state (withLoad system) ──────────────────────────────── */
.btn-spin-icon {
    display: inline-block;
    width: 13px;
    height: 13px;
    animation: spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0;
    /* inherit stroke from button text color */
}

button[data-loading="1"] {
    pointer-events: none;
    opacity: 0.82;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button[data-loading="1"] span {
    vertical-align: middle;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ============================================================
   SIDEBAR USER SECTION
   ============================================================ */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: var(--text-light);
}

.sidebar-user-email {
    font-size: 0.75rem;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.sidebar-user .btn-icon {
    background: none;
    border: none;
    color: var(--text-light);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: opacity 0.2s, background 0.2s;
}

.sidebar-user .btn-icon:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* ── PDF Badge & Upload Progress ─────────────────────────── */

.ll-pdf-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-danger);
    background: rgba(184, 133, 122, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.ll-pdf-badge svg {
    width: 12px;
    height: 12px;
}

.upload-progress {
    margin-top: 12px;
}

.upload-progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.upload-progress-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.ai-extract-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background: var(--accent-primary);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.ai-spinner {
    animation: spin 1s linear infinite;
}

/* Legal Counsel AI — Typing Indicator */
.legal-typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}
.legal-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: legalTypingBounce 1.2s ease-in-out infinite;
}
.legal-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.legal-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes legalTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Legal Counsel AI — Streaming Cursor */
.legal-stream-bubble::after {
    content: '|';
    font-weight: 200;
    animation: legalCursorBlink 0.6s step-end infinite;
    margin-left: 1px;
}
.legal-stream-bubble.complete::after {
    display: none;
}
@keyframes legalCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   LEASE EXTRACTION REVIEW MODAL
   ========================================================================== */

.extraction-tab {
    animation: fadeIn 0.2s ease;
}

#extraction-confidence.high {
    background: rgba(139, 157, 131, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

#extraction-confidence.medium {
    background: rgba(156, 137, 121, 0.15);
    border: 1px solid var(--accent-warm);
    color: var(--accent-warm);
}

#extraction-confidence.low {
    background: rgba(184, 133, 122, 0.15);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
}

.provision-row {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
}

.provision-row:hover {
    border-color: var(--accent-primary);
}

.provision-row select {
    min-width: 160px;
}

.provision-row textarea {
    min-height: 60px;
    resize: vertical;
}

.provision-row .btn-icon {
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.provision-row .btn-icon:hover {
    color: var(--accent-danger);
    background: rgba(184, 133, 122, 0.1);
}

.extraction-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.extraction-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.extraction-loading p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

#review-extraction-modal .lg-stepper {
    margin-bottom: 20px;
    padding: 12px 16px;
}

#review-extraction-modal .lg-step {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

#review-extraction-modal .lg-step:hover {
    background: var(--bg-tertiary);
}

#review-extraction-modal .lg-step.active {
    background: var(--accent-primary);
    color: white;
}

#review-extraction-modal .lg-step.active .lg-step-num {
    background: rgba(255,255,255,0.2);
    color: white;
}

#review-extraction-modal .lg-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

#review-extraction-modal .lg-step-label {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── Extraction Confidence Badges ─────────────────────────── */

.ext-conf-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 8px;
    vertical-align: middle;
    margin-left: 4px;
}

.ext-conf-badge.ext-conf-na { background: rgba(100,100,100,0.1); color: var(--text-muted); }

.ext-conf-high {
    background: rgba(139, 157, 131, 0.15);
    color: var(--accent-primary);
}

.ext-conf-med {
    background: rgba(156, 137, 121, 0.15);
    color: var(--accent-warm);
}

.ext-conf-low {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}

.ext-validation-warnings ul {
    list-style: disc;
    line-height: 1.7;
}

.ext-validation-warnings li {
    margin-bottom: 2px;
}

/* ── Organization & Role-Based Visibility ─────────────────── */

/* Hide add/edit/delete buttons for viewers via CSS */
body.role-viewer .viewer-hidden {
    display: none !important;
}

/* Org role badge (sidebar + settings) */
.org-role-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.org-role-admin {
    background: var(--accent-primary);
    color: white;
}

.org-role-editor {
    background: var(--accent-warm);
    color: white;
}

.org-role-viewer {
    background: var(--border-medium);
    color: var(--text-secondary);
}

/* Org member list in settings */
.org-member-list {
    max-height: 300px;
    overflow-y: auto;
}

.org-member-row:last-child {
    border-bottom: none !important;
}

.org-invite-form input:focus,
.org-invite-form select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ── SharePoint Integration ─────────────────────────────── */

.sp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.sp-breadcrumb-link {
    color: var(--accent-primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

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

.sp-breadcrumb-sep {
    color: var(--text-muted);
    margin: 0 2px;
}

.sp-breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

.sp-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sp-file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.sp-file-item:hover {
    background: var(--bg-secondary);
}

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

.sp-file-item.sp-selected {
    background: rgba(139, 157, 131, 0.08);
    border-left: 3px solid var(--accent-primary);
    padding-left: 17px;
}

.sp-file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-file-icon svg {
    width: 20px;
    height: 20px;
}

.sp-file-icon.sp-folder {
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary);
}

.sp-file-icon.sp-pdf {
    background: rgba(184, 133, 122, 0.12);
    color: var(--accent-danger);
}

.sp-file-icon.sp-other {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.sp-file-info {
    flex: 1;
    min-width: 0;
}

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

.sp-file-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sp-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.sp-query-panel {
    border-top: 2px solid var(--accent-primary);
    padding: 20px;
    background: var(--bg-secondary);
}

.sp-query-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sp-query-input-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sp-query-input-row input {
    flex: 1;
}

.sp-query-input-row select {
    width: 180px;
    flex-shrink: 0;
}

.sp-query-response {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.sp-query-msg {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.sp-query-msg.sp-user {
    background: var(--accent-primary);
    color: white;
    margin-left: 40px;
    text-align: right;
}

.sp-query-msg.sp-assistant {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    margin-right: 40px;
}

.sp-context-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    font-size: 0.8125rem;
}

.sp-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}

.sp-toggle-label input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

.sp-toggle-count {
    background: var(--accent-primary);
    color: white;
    font-size: 0.6875rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sp-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.sp-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.sp-triage-notice {
    background: rgba(139, 157, 131, 0.1);
    border: 1px solid rgba(139, 157, 131, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sp-file-badge {
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sp-file-badge.pdf {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}

.sp-disconnect-btn {
    background: transparent;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sp-disconnect-btn:hover {
    background: var(--accent-danger);
    color: white;
}

/* ── LOI Generator ────────────────────────────────────────── */

.loi-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
}

.loi-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

/* Topic checkboxes grid */
.loi-topics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.loi-topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.loi-topic-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.loi-topic-item.required {
    border-left: 3px solid var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}

.loi-topic-item input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.loi-topic-label {
    flex: 1;
    line-height: 1.3;
}

.loi-topic-required {
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Score gauge */
.loi-score-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.loi-score-circle {
    position: relative;
    width: 140px;
    height: 140px;
}

.loi-score-circle svg {
    transform: rotate(-90deg);
}

.loi-score-circle .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loi-score-circle .score-number {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Fraunces', serif;
    line-height: 1;
}

.loi-score-circle .score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.loi-score-dimensions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loi-score-dim {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.loi-score-dim-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.loi-score-dim-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.loi-score-dim-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.loi-score-dim-val {
    width: 30px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

/* Progress indicator */
.loi-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(139, 157, 131, 0.08);
    border: 1px solid rgba(139, 157, 131, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.loi-progress-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loi-progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.loi-progress-phase {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Upload dropzone */
.loi-upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.loi-upload-zone:hover,
.loi-upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}

.loi-upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.loi-upload-zone h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.loi-upload-zone p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Suggestion cards */
.loi-suggestion {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.loi-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.loi-suggestion-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.loi-suggestion-impact {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.loi-suggestion-impact.high { background: rgba(184, 133, 122, 0.15); color: var(--accent-danger); }
.loi-suggestion-impact.medium { background: rgba(156, 137, 121, 0.15); color: var(--accent-warm); }
.loi-suggestion-impact.low { background: rgba(139, 157, 131, 0.15); color: var(--accent-primary); }

.loi-suggestion-category {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.loi-suggestion-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.loi-suggestion-current,
.loi-suggestion-recommended {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 6px;
}

.loi-suggestion-current {
    background: rgba(184, 133, 122, 0.08);
    border-left: 3px solid var(--accent-danger);
}

.loi-suggestion-recommended {
    background: rgba(139, 157, 131, 0.08);
    border-left: 3px solid var(--accent-primary);
}

.loi-suggestion-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Market research panel */
.loi-market-stat {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-primary);
}

.loi-market-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.loi-market-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.loi-market-stat-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.loi-market-stat.warm { border-left-color: var(--accent-warm); }
.loi-market-stat.warm .loi-market-stat-value { color: var(--accent-warm); }

/* LOI Preview styling */
.loi-preview-content {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
}

.loi-preview-content h2 {
    text-align: center;
    font-family: 'Fraunces', serif;
    margin-bottom: 4px;
}

.loi-preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.loi-preview-content td {
    padding: 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.loi-preview-content tr:nth-child(even) td {
    background: var(--bg-tertiary);
}

/* History status badges */
.loi-status { font-size: 0.75rem; }
.loi-status.draft { background: var(--bg-tertiary); color: var(--text-muted); }
.loi-status.approved { background: rgba(139, 157, 131, 0.15); color: var(--accent-primary); }
.loi-status.sent { background: rgba(156, 137, 121, 0.15); color: var(--accent-warm); }
.loi-status.uploaded { background: rgba(100, 149, 237, 0.15); color: #4682b4; }

/* ── Lease Draft (AI Drafting + Negotiation) ──────────────── */

/* LOI banner when transitioning from approved LOI */
.ld-loi-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(139,157,131,0.12), rgba(156,137,121,0.08));
    border: 1px solid rgba(139,157,131,0.25);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.ld-loi-banner svg { flex-shrink: 0; color: var(--accent-primary); }
.ld-loi-banner strong { color: var(--text-primary); }

/* Round history bar */
.ld-round-history {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}
.ld-round-chips { display: flex; align-items: center; gap: 6px; }
.ld-round-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.ld-round-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.ld-round-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.ld-round-chip .chip-score {
    font-size: 0.75rem;
    opacity: 0.8;
}
.ld-round-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Score card */
.ld-score-card { margin-bottom: 20px; }
.ld-score-container { padding: 8px 0; }

/* Step 5 two-column layout */
.ld-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ld-left { display: flex; flex-direction: column; gap: 20px; }
.ld-right { position: sticky; top: 100px; align-self: start; }

/* Negotiation card */
.ld-negotiation-card { margin-top: 0; }
.ld-neg-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
}
.ld-neg-tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}
.ld-neg-tab:hover { color: var(--text-primary); }
.ld-neg-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.ld-neg-panel { display: none; }
.ld-neg-panel.active { display: block; }

/* Redline upload dropzone */
.ld-redline-drop {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.ld-redline-drop:hover, .ld-redline-drop.dragover {
    border-color: var(--accent-primary);
    background: rgba(139,157,131,0.05);
}
.ld-redline-drop svg { color: var(--text-muted); margin-bottom: 8px; }
.ld-redline-drop p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.ld-redline-drop .drop-label { font-weight: 600; color: var(--text-secondary); }

.ld-redline-file {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.85rem;
}
.ld-redline-file.visible { display: flex; }
.ld-redline-file .file-name { flex: 1; font-weight: 600; }
.ld-redline-file .file-remove {
    background: none; border: none; color: var(--accent-danger);
    cursor: pointer; font-size: 0.85rem;
}

/* Progress indicator */
.ld-redline-progress {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(139,157,131,0.08);
    border-radius: var(--radius-sm);
    margin: 12px 0;
}
.ld-redline-progress.visible { display: flex; }
.ld-redline-progress .ld-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.ld-redline-progress .ld-progress-text {
    font-size: 0.85rem; color: var(--text-secondary);
}

/* Manual counter-term sections */
.ld-counter-sections { display: flex; flex-direction: column; gap: 16px; }
.ld-counter-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.ld-counter-section-header {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.ld-counter-section textarea {
    width: 100%;
    border: none;
    padding: 12px 14px;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 60px;
    background: var(--bg-primary);
    font-family: inherit;
}

/* Redline results */
.ld-redline-results { display: none; margin-top: 16px; }
.ld-redline-results.visible { display: block; }
.ld-redline-results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.ld-redline-results-header h4 { margin: 0; font-size: 1rem; }
.ld-redline-summary {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Per-change cards */
.ld-change-cards { display: flex; flex-direction: column; gap: 12px; }
.ld-change-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}
.ld-change-card.accept { border-left: 4px solid var(--accent-primary); }
.ld-change-card.reject { border-left: 4px solid var(--accent-danger); }
.ld-change-card.counter { border-left: 4px solid var(--accent-warm); }
.ld-change-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
}
.ld-change-card-title { font-size: 0.9rem; font-weight: 600; }
.ld-change-card-rec {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 12px;
}
.ld-change-card-rec.accept { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.ld-change-card-rec.reject { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.ld-change-card-rec.counter { background: rgba(156,137,121,0.15); color: var(--accent-warm); }

.ld-change-card-body { padding: 14px 16px; font-size: 0.85rem; }
.ld-change-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ld-change-original, .ld-change-proposed {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
}
.ld-change-original { background: rgba(184,133,122,0.08); border: 1px solid rgba(184,133,122,0.2); }
.ld-change-proposed { background: rgba(139,157,131,0.08); border: 1px solid rgba(139,157,131,0.2); }
.ld-change-diff-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.ld-change-explanation {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}
.ld-change-counter-lang {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(156,137,121,0.08);
    border: 1px solid rgba(156,137,121,0.2);
    border-radius: var(--radius-sm);
    font-style: italic;
    line-height: 1.5;
}
.ld-change-counter-lang::before {
    content: 'Suggested Counter:';
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    font-style: normal;
    margin-bottom: 4px;
    color: var(--accent-warm);
}

/* Decision buttons per change */
.ld-change-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}
.ld-change-actions .btn { font-size: 0.8rem; padding: 6px 16px; }
.ld-change-actions .btn.selected { box-shadow: 0 0 0 2px var(--accent-primary); }

/* Score impact pills */
.ld-score-impact {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 8px;
}
.ld-impact-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.ld-impact-pill.positive { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.ld-impact-pill.negative { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.ld-impact-pill.neutral { background: var(--bg-tertiary); color: var(--text-muted); }

/* Generate next round button */
.ld-next-round-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(139,157,131,0.1), rgba(156,137,121,0.06));
    border: 1px solid rgba(139,157,131,0.2);
    border-radius: var(--radius-md);
    margin-top: 16px;
}
.ld-next-round-bar.visible { display: flex; }
.ld-next-round-bar .ld-decisions-count { font-size: 0.85rem; color: var(--text-secondary); }

/* AI draft loading state */
.ld-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
}
.ld-generating .ld-gen-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.ld-generating .ld-gen-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.ld-generating .ld-gen-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Preview actions bar */
.ld-preview-actions {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 900px) {
    .ld-workspace { grid-template-columns: 1fr; }
    .ld-right { position: static; }
    .ld-change-diff { grid-template-columns: 1fr; }
}

/* ================================================================
   EMAIL INTEGRATION (em- prefix)
   ================================================================ */

/* ── Email Settings Card ──────────────────────────────────────── */
.em-settings-card .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.em-settings-card .form-group.full-width {
    grid-column: 1 / -1;
}

.em-settings-card textarea {
    min-height: 80px;
    resize: vertical;
}

/* ── Email Status Badges ──────────────────────────────────────── */
.em-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.em-status-badge.queued {
    background: var(--bg-tertiary, #E8E4E0);
    color: var(--text-muted, #8C8C8C);
}

.em-status-badge.sent {
    background: #E3F2FD;
    color: #1565C0;
}

.em-status-badge.delivered {
    background: rgba(139,157,131,0.15);
    color: var(--accent-primary, #8B9D83);
}

.em-status-badge.opened {
    background: #F3E5F5;
    color: #7B1FA2;
}

.em-status-badge.bounced {
    background: rgba(184,133,122,0.15);
    color: var(--accent-danger, #B8857A);
}

.em-status-badge.complained {
    background: #FFF3E0;
    color: #E65100;
}

/* ── Email Thread Modal ───────────────────────────────────────── */
.em-thread-modal .modal {
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.em-thread-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #E8E4E0);
}

.em-thread-header h2 {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.em-thread-header .em-thread-meta {
    font-size: 0.8rem;
    color: var(--text-muted, #8C8C8C);
}

/* ── Thread Timeline ──────────────────────────────────────────── */
.em-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.em-message-card {
    position: relative;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--border-color, #E8E4E0);
}

.em-message-card.outbound {
    background: rgba(139,157,131,0.06);
    border-left: 3px solid var(--accent-primary, #8B9D83);
}

.em-message-card.inbound {
    background: var(--bg-secondary, #FAF9F7);
    border-left: 3px solid var(--accent-warm, #9C8979);
}

.em-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.em-message-from {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #2C2C2C);
}

.em-message-time {
    font-size: 0.75rem;
    color: var(--text-muted, #8C8C8C);
}

.em-message-subject {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #6B6B6B);
    margin-bottom: 6px;
}

.em-message-body {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary, #2C2C2C);
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.em-message-body.expanded {
    max-height: none;
}

.em-message-toggle {
    font-size: 0.75rem;
    color: var(--accent-primary, #8B9D83);
    cursor: pointer;
    margin-top: 4px;
    border: none;
    background: none;
    padding: 0;
    font-weight: 600;
}

.em-message-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #E8E4E0);
}

/* ── Attachment Pill ──────────────────────────────────────────── */
.em-attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary, #E8E4E0);
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-muted, #8C8C8C);
}

.em-attachment-pill svg {
    width: 12px;
    height: 12px;
}

/* ── Email Send Button States ─────────────────────────────────── */
.em-sending {
    pointer-events: none;
    opacity: 0.7;
}

.em-sending::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* ── View Thread Button ───────────────────────────────────────── */
.em-thread-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--border-color, #E8E4E0);
    border-radius: 20px;
    background: transparent;
    font-size: 0.75rem;
    color: var(--accent-primary, #8B9D83);
    cursor: pointer;
    transition: all 0.2s;
}

.em-thread-btn:hover {
    background: rgba(139,157,131,0.08);
    border-color: var(--accent-primary, #8B9D83);
}

.em-thread-btn svg {
    width: 12px;
    height: 12px;
}

/* ── Empty State ──────────────────────────────────────────────── */
.em-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #8C8C8C);
}

.em-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .em-settings-card .form-grid {
        grid-template-columns: 1fr;
    }
    .em-thread-modal .modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
}

/* ── Tenant Default / Cure Workflow (cd-) ──────────────────── */

.cd-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cd-status-badge.notice-issued { background: rgba(245,180,60,0.15); color: #b8860b; }
.cd-status-badge.cure-period   { background: rgba(220,140,50,0.15); color: #c07020; }
.cd-status-badge.cured         { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.cd-status-badge.default       { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.cd-status-badge.escalated     { background: rgba(160,50,50,0.15); color: #a03232; }
.cd-status-badge.resolved      { background: var(--bg-tertiary); color: var(--text-muted); }

.cd-countdown {
    margin-top: 8px;
}
.cd-countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cd-countdown-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.cd-countdown-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.cd-countdown-fill.safe     { background: var(--accent-primary); }
.cd-countdown-fill.warning  { background: #d4a030; }
.cd-countdown-fill.critical { background: var(--accent-danger); }

.cd-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}
.cd-card.active-default  { border-left: 3px solid var(--accent-danger); }
.cd-card.active-cure     { border-left: 3px solid #d4a030; }
.cd-card.resolved        { border-left: 3px solid var(--text-muted); opacity: 0.7; }

.cd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cd-card-title {
    font-weight: 600;
    font-size: 0.9375rem;
}
.cd-card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.cd-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.cd-timeline {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid var(--border-light);
}
.cd-timeline-item {
    position: relative;
    padding: 6px 0 6px 16px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.cd-timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium);
}
.cd-timeline-item .cd-timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Todo Action Buttons ───────────────────────────────────── */

.todo-action-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s;
    white-space: nowrap;
}
.todo-action-btn:hover {
    background: var(--bg-tertiary);
}
.todo-action-btn.primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.todo-action-btn.primary:hover {
    filter: brightness(1.1);
}
.todo-action-btn.danger {
    background: transparent;
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}
.todo-action-btn.danger:hover {
    background: var(--accent-danger);
    color: white;
}

/* ── Lease Abstract Enhancement (abs-) ─────────────────────── */

.abs-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.abs-toolbar select {
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.abs-toolbar .btn {
    white-space: nowrap;
}

.abs-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}
.abs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}
.abs-card-header h4 {
    font-family: 'Fraunces', serif;
    font-size: 1.0625rem;
    margin: 0;
}

.abs-section {
    padding: 12px 20px;
}
.abs-section + .abs-section {
    border-top: 1px solid var(--border-light);
}
.abs-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.abs-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.abs-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.abs-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.abs-field-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    min-height: 1.4em;
}

.abs-editable {
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.abs-editable:hover {
    background: var(--bg-tertiary);
}
.abs-editable:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
    background: var(--bg-primary);
}

.abs-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(139,157,131,0.15);
    color: var(--accent-primary);
}

.abs-summary {
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================
   JOURNAL ENTRY STYLES (je- prefix)
   ============================================ */
.je-line-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.je-line-row select, .je-line-row input {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-primary);
}
.je-lines-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}
.je-balance-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 8px;
    padding: 12px 0;
    border-top: 2px solid var(--border-color);
    font-weight: 600;
    margin-top: 8px;
}
.je-balanced { color: var(--accent-primary); }
.je-unbalanced { color: var(--accent-danger); }

.je-entry-row {
    cursor: pointer;
    transition: background 0.15s;
}
.je-entry-row:hover { background: var(--bg-tertiary); }
.je-detail-row { display: none; }
.je-detail-row.je-show { display: table-row; }
.je-detail-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.je-detail-table td {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.je-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}
.je-type-payment { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.je-type-expense { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.je-type-manual  { background: rgba(156,137,121,0.15); color: var(--accent-warm); }
.je-type-bank-import { background: rgba(100,149,237,0.15); color: #6495ed; }
.je-type-adjustment { background: rgba(200,200,100,0.15); color: #999933; }
.je-type-asset { background: rgba(100,149,237,0.12); color: #4a76b8; }
.je-type-liability { background: rgba(184,133,122,0.12); color: var(--accent-danger); }
.je-type-equity { background: rgba(156,137,121,0.12); color: var(--accent-warm); }
.je-type-revenue { background: rgba(139,157,131,0.12); color: var(--accent-primary); }
.je-type-expense { background: rgba(184,133,122,0.12); color: var(--accent-danger); }

.je-coa-group { margin-bottom: 24px; }
.je-coa-group-header {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}
.je-coa-table {
    width: 100%;
    border-collapse: collapse;
}
.je-coa-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}
.je-coa-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

/* ============================================
   BANK IMPORT STYLES (bi- prefix)
   ============================================ */
.bi-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.bi-drop-zone:hover, .bi-drag-over {
    border-color: var(--accent-primary);
    background: rgba(139,157,131,0.05);
}
.bi-step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.bi-step {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}
.bi-step-active {
    background: var(--accent-primary);
    color: white;
}
.bi-step-done {
    background: rgba(139,157,131,0.2);
    color: var(--accent-primary);
}
.bi-column-mapper {
    display: grid;
    gap: 16px;
}
.bi-map-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: center;
}
.bi-map-row label {
    font-weight: 600;
    font-size: 0.875rem;
}
.bi-map-row select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}
.bi-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}
.bi-status-unmatched { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.bi-status-suggested { background: rgba(156,137,121,0.15); color: var(--accent-warm); }
.bi-status-confirmed { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.bi-status-ignored { background: var(--bg-tertiary); color: var(--text-muted); }
.bi-confidence {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(156,137,121,0.15);
    color: var(--accent-warm);
    margin-right: 4px;
}

/* ============================================
   TENANT SCORE STYLES (ts- prefix)
   ============================================ */
.ts-scorecard {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    padding: 12px 0;
}
.ts-gauge {
    position: relative;
    width: 120px;
    height: 75px;
    text-align: center;
}
.ts-gauge-svg { width: 100%; height: auto; }
.ts-score-value {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}
.ts-grade {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ts-breakdown {
    display: grid;
    gap: 6px;
}
.ts-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}
.ts-metric span:first-child { color: var(--text-secondary); }
.ts-metric span:last-child { font-weight: 600; }
.ts-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    color: white;
    margin-left: 6px;
}

/* ============================================
   OVERDUE STYLES (od- prefix)
   ============================================ */
.od-stat {
    text-align: center;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}
.od-stat-value { font-size: 1.5rem; font-weight: 700; font-family: var(--font-heading); }
.od-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.od-past-cure .od-stat-value { color: var(--accent-danger); }
.od-within-cure .od-stat-value { color: var(--accent-warm); }
.od-partial .od-stat-value { color: var(--text-secondary); }

.od-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 4px solid;
}
.od-past-cure { border-color: var(--accent-danger); background: rgba(184,133,122,0.06); }
.od-within-cure { border-color: var(--accent-warm); background: rgba(156,137,121,0.06); }
.od-partial { border-color: var(--text-muted); background: var(--bg-tertiary); }
.od-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.od-severity {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}
.od-sev-past-cure { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.od-sev-within-cure { background: rgba(156,137,121,0.15); color: var(--accent-warm); }
.od-sev-partial { background: var(--bg-tertiary); color: var(--text-muted); }
.od-item-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ── Provision Intelligence (pi-) ─────────────────────────── */

.pi-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
}

.pi-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.pi-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

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

.pi-tab-content {
    animation: pageFadeIn 0.2s ease;
}

/* AI Search toggle */
.pi-ai-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.pi-ai-toggle.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Relevance bar */
.pi-relevance-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.pi-relevance-track {
    flex: 1;
    max-width: 120px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.pi-relevance-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.pi-relevance-score {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 36px;
}

.pi-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(139,157,131,0.15);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-reasoning {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Conflict cards */
.pi-conflict-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    transition: box-shadow 0.2s;
}

.pi-conflict-card:hover {
    box-shadow: var(--shadow-sm);
}

.pi-conflict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pi-conflict-type {
    font-weight: 600;
    font-size: 0.9375rem;
}

.pi-severity {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-severity-high {
    background: rgba(184,133,122,0.15);
    color: var(--accent-danger);
}

.pi-severity-medium {
    background: rgba(156,137,121,0.15);
    color: var(--accent-warm);
}

.pi-severity-low {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.pi-conflict-parties {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.pi-conflict-side {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.pi-conflict-side-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pi-conflict-vs {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--accent-danger);
    font-size: 0.875rem;
    padding-top: 20px;
}

.pi-conflict-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pi-conflict-rec {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(139,157,131,0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

/* Comparison table */
.pi-comparison-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.pi-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.pi-comparison-table th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 10px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    z-index: 1;
}

.pi-comparison-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 140px;
}

.pi-comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    min-width: 180px;
    max-width: 280px;
    line-height: 1.5;
}

.pi-comparison-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    font-weight: 600;
    min-width: 140px;
    z-index: 1;
    white-space: nowrap;
}

.pi-comparison-table tr:hover td {
    background: var(--bg-tertiary);
}

.pi-comparison-table tr:hover td:first-child {
    background: var(--bg-tertiary);
}

.pi-cell-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Consent traffic lights */
.pi-consent-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
}

.pi-consent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pi-consent-tenant {
    font-weight: 600;
    font-size: 0.9375rem;
}

.pi-consent-light {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}

.pi-consent-green { background: #6B9E6B; }
.pi-consent-yellow { background: #D4A843; }
.pi-consent-red { background: var(--accent-danger); }

.pi-consent-level {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

.pi-consent-level-required {
    background: rgba(184,133,122,0.15);
    color: var(--accent-danger);
}

.pi-consent-level-conditional {
    background: rgba(212,168,67,0.15);
    color: #B8962E;
}

.pi-consent-level-not-required {
    background: rgba(107,158,107,0.15);
    color: #6B9E6B;
}

.pi-consent-provisions {
    margin-top: 10px;
}

.pi-consent-prov-item {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.pi-consent-prov-type {
    font-weight: 600;
    margin-bottom: 2px;
}

/* Draft section */
.pi-draft-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.pi-draft-section-header {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    font-weight: 600;
    font-family: 'Fraunces', serif;
    border-bottom: 1px solid var(--border-color);
}

.pi-draft-section-body {
    padding: 16px;
    line-height: 1.7;
    font-size: 0.9375rem;
}

.pi-draft-section-body p {
    margin-bottom: 8px;
}

.pi-draft-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Loading spinner for AI operations */
.pi-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
}

.pi-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── E-Signature (es-) ──────────────────────────────────────── */

.es-status-card .card-body { padding: 20px 24px; }

.es-tracker-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
}

.es-tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
}

.es-tracker-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.es-tracker-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
    transition: color 0.3s;
}

.es-tracker-line {
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--border-color);
    transition: background 0.3s;
}

.es-tracker-step.completed .es-tracker-circle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.es-tracker-step.completed .es-tracker-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.es-tracker-step.completed .es-tracker-line {
    background: var(--accent-primary);
}

.es-tracker-step.active .es-tracker-circle {
    background: white;
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 157, 131, 0.15);
}

.es-tracker-step.active .es-tracker-label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Send card */
.es-send-card .card-body { padding: 20px 24px; }

.es-info-box {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(139, 157, 131, 0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 16px;
}

.es-modal-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.es-modal-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.es-modal-row .label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.es-modal-row .value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.es-legal-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    border-left: 3px solid var(--accent-warm);
}

/* Status badges for signature states */
.status-badge.sent {
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary);
}

.status-badge.executed {
    background: rgba(139, 157, 131, 0.18);
    color: #5C7254;
    font-weight: 600;
}

/* ============================================================================
   DEAL MODULE — Pipeline (dp-), Create Wizard (dc-), Detail (dd-)
   ============================================================================ */

/* ── Deal Pipeline Board ─────────────────────────────────────── */
.dp-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 400px;
}

.dp-column {
    flex: 0 0 260px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

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

.dp-column-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.dp-column-count {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.dp-column-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dp-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-card-address {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.dp-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.dp-card-price {
    font-weight: 600;
    color: var(--accent-primary);
}

.dp-card-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dp-card-type.acquisition {
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary);
}

.dp-card-type.disposition {
    background: rgba(156, 137, 121, 0.12);
    color: var(--accent-warm);
}

.dp-card-cap {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.dp-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* ── Deal Pipeline Table ─────────────────────────────────────── */
.dp-table-wrap {
    overflow-x: auto;
}

.dp-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.dp-table-wrap th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}

.dp-table-wrap td {
    padding: 12px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.dp-table-wrap tr {
    cursor: pointer;
    transition: background 0.15s;
}

.dp-table-wrap tbody tr:hover {
    background: rgba(139, 157, 131, 0.04);
}

.dp-filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ── Deal Create Wizard (dc-) ────────────────────────────────── */
.dc-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.dc-step {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    padding: 4px 0;
}

.dc-step.active,
.dc-step.completed {
    opacity: 1;
}

.dc-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dc-step.active .dc-step-circle {
    background: var(--accent-primary);
    color: white;
}

.dc-step.completed .dc-step-circle {
    background: var(--accent-primary);
    color: white;
}

.dc-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.dc-step.active .dc-step-label {
    color: var(--text-primary);
}

.dc-step.completed .dc-step-label {
    color: var(--accent-primary);
}

.dc-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
    min-width: 16px;
    max-width: 50px;
    transition: background 0.2s;
}

.dc-step-line.completed {
    background: var(--accent-primary);
}

.dc-step-panel {
    display: none;
}

.dc-step-panel.active {
    display: block;
    animation: dcFadeIn 0.3s ease;
}

@keyframes dcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dc-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 0;
}

/* Type selector cards */
.dc-type-cards {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.dc-type-card {
    flex: 1;
    padding: 24px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dc-type-card:hover {
    border-color: var(--accent-primary);
}

.dc-type-card.selected {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}

.dc-type-card strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dc-type-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dc-type-card.small {
    padding: 16px;
}

.dc-type-card.small strong {
    font-size: 0.85rem;
}

.dc-type-card svg {
    color: var(--text-muted);
    transition: color 0.2s;
}

.dc-type-card.selected svg {
    color: var(--accent-primary);
}

.dc-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dc-divider::before,
.dc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.dc-computed-field {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-primary);
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* ── Deal Detail (dd-) ───────────────────────────────────────── */

/* Lifecycle progress bar */
.dd-lifecycle {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.dd-lifecycle-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.dd-lifecycle-step.active {
    opacity: 1;
}

.dd-lifecycle-step.completed {
    opacity: 1;
}

.dd-lifecycle-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dd-lifecycle-step.active .dd-lifecycle-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 157, 131, 0.2);
}

.dd-lifecycle-step.completed .dd-lifecycle-dot {
    background: var(--accent-primary);
}

.dd-lifecycle-dot svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
}

.dd-lifecycle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.dd-lifecycle-step.active .dd-lifecycle-label {
    color: var(--text-primary);
}

.dd-lifecycle-step.completed .dd-lifecycle-label {
    color: var(--accent-primary);
}

.dd-lifecycle-line {
    flex: 1;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
    min-width: 16px;
    transition: background 0.2s;
}

.dd-lifecycle-line.completed {
    background: var(--accent-primary);
}

/* Tabs */
.dd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
}

.dd-tab {
    padding: 10px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.dd-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.dd-tab-content {
    min-height: 300px;
}

/* LOI/PSA Content display */
.dd-loi-section {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.dd-loi-section-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dd-loi-section-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Score display (reuses loi-score pattern) */
.dd-score-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.dd-score-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.dd-score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Fraunces', serif;
    color: white;
    flex-shrink: 0;
}

.dd-score-circle.high { background: var(--accent-primary); }
.dd-score-circle.mid { background: var(--accent-warm); }
.dd-score-circle.low { background: var(--accent-danger); }

.dd-score-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1rem;
}

.dd-score-explanation {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dd-score-dimensions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dd-score-dim {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.dd-score-dim-label {
    width: 160px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.dd-score-dim-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.dd-score-dim-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.dd-score-dim-val {
    width: 30px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

/* Market Analysis */
.dd-market-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.dd-market-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.dd-comps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.dd-comps-table th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid var(--border-light);
}

.dd-comps-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
}

/* Milestones timeline */
.dd-milestones {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 24px;
}

.dd-milestones::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.dd-milestone {
    position: relative;
    padding: 12px 0 12px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dd-milestone-dot {
    position: absolute;
    left: -24px;
    top: 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border-light);
    border: 3px solid var(--bg-primary);
    z-index: 1;
}

.dd-milestone.completed .dd-milestone-dot {
    background: var(--accent-primary);
}

.dd-milestone.overdue .dd-milestone-dot {
    background: var(--accent-danger);
}

.dd-milestone.upcoming .dd-milestone-dot {
    background: var(--accent-warm);
}

.dd-milestone-content {
    flex: 1;
}

.dd-milestone-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dd-milestone-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dd-milestone-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-top: 4px;
}

.dd-milestone-status.completed {
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary);
}

.dd-milestone-status.overdue {
    background: rgba(184, 133, 122, 0.12);
    color: var(--accent-danger);
}

.dd-milestone-status.upcoming {
    background: rgba(156, 137, 121, 0.12);
    color: var(--accent-warm);
}

/* Closing statement */
.dd-closing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 20px;
}

.dd-closing-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
}

.dd-closing-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

.dd-closing-table .total-row {
    font-weight: 700;
    background: var(--bg-tertiary);
}

.dd-closing-table .credit { color: var(--accent-primary); }
.dd-closing-table .debit { color: var(--accent-danger); }

/* Redline changes (deal-specific) */
.dd-redline-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.dd-redline-section {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.dd-redline-original,
.dd-redline-proposed {
    font-size: 0.8rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    line-height: 1.5;
}

.dd-redline-original {
    background: rgba(184, 133, 122, 0.06);
    border-left: 3px solid var(--accent-danger);
}

.dd-redline-proposed {
    background: rgba(139, 157, 131, 0.06);
    border-left: 3px solid var(--accent-primary);
}

.dd-redline-explanation {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.dd-redline-actions {
    display: flex;
    gap: 8px;
}

.dd-redline-btn {
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.dd-redline-btn:hover {
    border-color: var(--accent-primary);
}

.dd-redline-btn.selected {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.dd-redline-btn.reject.selected {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

.dd-redline-btn.counter.selected {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
}

/* Expenses in deal detail */
.dd-expense-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.dd-expense-total {
    font-weight: 700;
    font-size: 0.95rem;
    padding-top: 12px;
    text-align: right;
    color: var(--accent-primary);
}

/* Status badges for deals */
.status-badge.loi-draft { background: rgba(139,157,131,0.1); color: var(--accent-primary); }
.status-badge.loi-negotiating { background: rgba(156,137,121,0.12); color: var(--accent-warm); }
.status-badge.loi-agreed { background: rgba(139,157,131,0.18); color: #5C7254; }
.status-badge.psa-draft { background: rgba(139,157,131,0.1); color: var(--accent-primary); }
.status-badge.psa-negotiating { background: rgba(156,137,121,0.12); color: var(--accent-warm); }
.status-badge.under-contract { background: rgba(79,144,204,0.12); color: #4F90CC; }
.status-badge.closing { background: rgba(184,133,122,0.12); color: var(--accent-danger); }
.status-badge.deal-completed { background: rgba(139,157,131,0.18); color: #5C7254; font-weight: 600; }
.status-badge.withdrawn { background: var(--bg-tertiary); color: var(--text-muted); }
.status-badge.dead { background: var(--bg-tertiary); color: var(--text-muted); text-decoration: line-through; }

/* ── Due Diligence Review (ddr-) ─────────────────────────────── */

.ddr-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.ddr-upload-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ddr-type-select {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    min-width: 160px;
}

.ddr-doc-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ddr-doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    gap: 10px;
}

.ddr-doc-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary);
    white-space: nowrap;
}

.ddr-analyze-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px 0;
    flex-wrap: wrap;
}

.ddr-analyze-bar .btn {
    min-width: 160px;
}

/* Metrics grid */
.ddr-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ddr-metric {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.ddr-metric-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ddr-metric-value {
    display: block;
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tables */
.ddr-table-wrap {
    overflow-x: auto;
    margin: 12px 0;
}

.ddr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.ddr-table th {
    text-align: left;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.ddr-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* Insight blocks */
.ddr-insight {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 10px 0;
}

.ddr-insight strong {
    color: var(--text-primary);
}

.ddr-insight ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.ddr-insight li {
    margin-bottom: 4px;
}

/* Liability cards */
.ddr-liability-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 14px;
    border-left: 3px solid var(--border-color);
}

.ddr-risk-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ddr-risk-low {
    background: rgba(139, 157, 131, 0.15);
    color: var(--accent-primary);
}

.ddr-risk-medium {
    background: rgba(156, 137, 121, 0.15);
    color: var(--accent-warm);
}

.ddr-risk-high {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}

.ddr-total-liability {
    background: rgba(184, 133, 122, 0.08);
    border: 1px solid rgba(184, 133, 122, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--accent-danger);
    margin-bottom: 14px;
    font-size: 0.9rem;
}

/* Ideal scenario */
.ddr-ideal-scenario {
    border-color: var(--accent-primary);
    border-width: 2px;
}

/* LOI comparison flags */
.ddr-reneg-flag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}

.ddr-reneg-row {
    background: rgba(184, 133, 122, 0.04);
}

.ddr-reneg-row:hover {
    background: rgba(184, 133, 122, 0.08) !important;
}

/* ═══════════════════════════════════════════════════════════════
   STACKING PLANS — stk-* prefix
   ═══════════════════════════════════════════════════════════════ */

.stk-property-select {
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 260px;
}

.stk-property-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.12);
}

.stk-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

/* Color Toggle Switch */
.stk-color-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.stk-toggle-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
}

.stk-color-toggle input {
    display: none;
}

.stk-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--accent-primary);
    border-radius: 11px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.stk-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.stk-color-toggle input:checked + .stk-toggle-slider {
    background: var(--accent-warm);
}

.stk-color-toggle input:checked + .stk-toggle-slider::after {
    transform: translateX(18px);
}

/* Legend */
.stk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.stk-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
}

.stk-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Stacking Plan Container */
.stk-plan {
    display: flex;
    flex-direction: column;
}

.stk-roof {
    height: 8px;
    background: var(--sidebar-bg, #4A4540);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Floor Row */
.stk-floor {
    display: grid;
    grid-template-columns: 100px 1fr 80px;
    align-items: stretch;
    border-left: 2px solid var(--border-primary);
    border-right: 2px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    min-height: 56px;
}

.stk-floor:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-bottom: 2px solid var(--border-primary);
}

.stk-floor-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
}

.stk-floor-bar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 4px;
}

.stk-floor-sf {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
}

/* Tenant Block */
.stk-tenant-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    overflow: hidden;
    min-width: 0;
}

.stk-tenant-block:hover {
    filter: brightness(1.1);
    transform: scaleY(1.02);
    z-index: 1;
}

.stk-block-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: 'DM Sans', sans-serif;
}

.stk-block-sf {
    font-size: 0.625rem;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

/* Vacant Block */
.stk-vacant-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 6px;
    background: #D4CFC6;
    overflow: hidden;
    min-width: 0;
}

.stk-vacant-block .stk-block-label {
    color: var(--text-muted);
    text-shadow: none;
    font-weight: 500;
}

.stk-vacant-block .stk-block-sf {
    color: var(--text-muted);
    text-shadow: none;
}

/* Tooltip */
.stk-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    pointer-events: none;
    min-width: 200px;
    max-width: 280px;
}

.stk-tooltip-row {
    font-size: 0.8125rem;
    color: var(--text-primary);
    padding: 2px 0;
    font-family: 'DM Sans', sans-serif;
}

.stk-tooltip-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 4px;
}

/* Unassigned tenants */
.stk-unassigned {
    margin-top: 16px;
    padding: 16px;
    background: rgba(201, 168, 108, 0.06);
    border: 1px dashed var(--accent-warm);
    border-radius: var(--radius-sm);
}

/* Building Config Modal */
.stk-config-input {
    padding: 6px 10px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    color: var(--text-primary);
    width: 100%;
}

.stk-config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.stk-assign-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light, var(--border-primary));
}

.stk-assign-row:last-child {
    border-bottom: none;
}

.stk-assign-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

.stk-assign-row select {
    min-width: 130px;
}

/* ── Conflict Alert (cfa-) ────────────────────── */

.cfa-gate-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(184,133,122,0.15);
    color: var(--accent-danger);
    vertical-align: middle;
    margin-left: 8px;
}

.cfa-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(184,133,122,0.08);
    border: 1px solid rgba(184,133,122,0.25);
    margin-bottom: 16px;
    color: var(--accent-danger);
}

.cfa-alert-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-danger);
    margin-bottom: 2px;
}

.cfa-severity-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cfa-conflict-list {
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
}

.cfa-conflict-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    transition: box-shadow 0.2s;
}

.cfa-conflict-card:hover {
    box-shadow: var(--shadow-sm);
}

.cfa-conflict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cfa-conflict-type {
    font-weight: 600;
    font-size: 0.9375rem;
}

.cfa-conflict-parties {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.cfa-conflict-side {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.cfa-conflict-side-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cfa-conflict-vs {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--accent-danger);
    font-size: 0.875rem;
    padding-top: 20px;
}

.cfa-conflict-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cfa-conflict-rec {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(139,157,131,0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.cfa-ack-checkbox-row {
    margin-top: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(156,137,121,0.4);
    border-radius: var(--radius-sm);
    background: rgba(156,137,121,0.06);
}

.cfa-ack-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.cfa-ack-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-danger);
    flex-shrink: 0;
}

.cfa-inline-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(184,133,122,0.08);
    border: 1px solid rgba(184,133,122,0.25);
    color: var(--accent-danger);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 12px;
}

.cfa-inline-banner:hover {
    background: rgba(184,133,122,0.14);
}

.cfa-inline-count {
    font-weight: 700;
}

/* ═══════════════════════════════════════
   Enterprise Security (sec-*) Styles
   ═══════════════════════════════════════ */

.sec-mfa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.sec-section-title {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sec-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.sec-enrolled-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(139, 157, 131, 0.1);
    border: 1px solid rgba(139, 157, 131, 0.25);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 0.85rem;
    margin-top: 8px;
}

.sec-qr-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 16px 0;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.sec-qr-image img {
    width: 200px;
    height: 200px;
}

.sec-manual-entry {
    text-align: center;
    margin-top: 8px;
}

.sec-secret-code {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    word-break: break-all;
    user-select: all;
}

.sec-recovery-warning {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(180, 156, 100, 0.1);
    border: 1px solid rgba(180, 156, 100, 0.3);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.sec-recovery-warning strong {
    display: block;
    margin-bottom: 4px;
    color: #8B7340;
}

.sec-recovery-warning p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.sec-recovery-codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sec-recovery-code {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', monospace;
    font-size: 0.9rem;
    text-align: center;
    letter-spacing: 0.08em;
}

.sec-mfa-instruction {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

#mfa-challenge-form input[type="text"] {
    font-size: 1.8rem;
    text-align: center;
    letter-spacing: 0.5em;
    padding: 12px;
}

.sec-sso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sec-sso-divider::before,
.sec-sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.sec-sso-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sec-sso-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.04);
}

.sec-ack-checkbox-row {
    margin-top: 8px;
}

/* ============================================================================
   MARKET COMPS (mc-) — Anonymized Deal Benchmarks
   ============================================================================ */

.mc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.mc-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.mc-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.mc-filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-body);
}

/* Stats table */
.mc-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.mc-stats-table th.mc-metric-header {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.mc-stats-table .mc-metric-row td {
    padding: 12px 16px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.mc-stats-table .mc-metric-row:last-child td {
    border-bottom: none;
}

/* Comp cards grid */
.mc-comps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.mc-comp-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mc-comp-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mc-comp-header {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.mc-comp-location {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.mc-comp-terms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.mc-term {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mc-term-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

.mc-term-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mc-comp-footer {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Threshold notice */
.mc-threshold-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: rgba(156, 137, 121, 0.08);
    border: 1px solid var(--accent-warm);
    border-radius: var(--radius-md);
    color: var(--accent-warm);
    font-size: 0.875rem;
}

/* Cross-industry insight card */
.mc-insight-card {
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 157, 131, 0.06), rgba(156, 137, 121, 0.06));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.mc-insight-card h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .mc-filter-bar {
        flex-direction: column;
    }
    .mc-comps-grid {
        grid-template-columns: 1fr;
    }
    .mc-comp-terms {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Governing Documents (gd-)
   ============================================================ */

.gd-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.gd-doc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gd-doc-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.gd-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.gd-party-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    color: var(--text-secondary);
}

.gd-party-tenant {
    background: var(--accent-primary)12;
    color: var(--accent-primary);
}

.gd-tenant-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 5px;
    border-radius: 6px;
    background: var(--accent-primary);
    color: #fff;
    margin-left: 2px;
}

.gd-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.gd-doc-card:hover .gd-delete-btn {
    opacity: 1;
}

.gd-delete-btn:hover {
    color: var(--accent-danger);
}

.gd-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.gd-summary-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.gd-summary-text {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.gd-restriction-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.gd-restriction-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.gd-restriction-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--border-light);
    background: var(--bg-secondary);
}

.gd-restriction-item.gd-severity-high {
    border-left-color: var(--accent-danger);
    background: rgba(184, 133, 122, 0.06);
}

.gd-restriction-item.gd-severity-medium {
    border-left-color: #C4994C;
    background: rgba(196, 153, 76, 0.06);
}

.gd-restriction-item.gd-severity-low {
    border-left-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}

@media (max-width: 768px) {
    .gd-doc-grid {
        grid-template-columns: 1fr;
    }
}

/* ── GL Integration ─────────────────────────────────────────── */
.gl-source-btn.btn-primary { background: var(--accent-primary); color: white; }
.gl-source-btn { transition: all 0.2s; }

#gl-import-preview table { font-size: 0.8125rem; }
#gl-import-preview th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; }
.gl-map-select { font-size: 0.8125rem; padding: 6px 8px; }

#gl-mapping-section .form-group { margin-bottom: 0; }
#gl-mapping-section label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* Location Plans */
.lp-floor-container { position: relative; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-primary); }
.lp-floor-plate { position: relative; width: 100%; min-height: 300px; }
.lp-space { position: absolute; border: 2px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.75rem; font-weight: 600; overflow: hidden; padding: 4px; }
.lp-space:hover { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(139, 157, 131, 0.3); z-index: 10; }
.lp-space.lp-occupied { background: rgba(139, 157, 131, 0.12); border-color: var(--accent-primary); }
.lp-space.lp-vacant { background: rgba(184, 133, 122, 0.08); border-color: var(--accent-danger); border-style: dashed; }
.lp-space-label { pointer-events: none; line-height: 1.2; }
.lp-space-label .lp-tenant-name { font-weight: 700; font-size: 0.75rem; color: var(--text-primary); }
.lp-space-label .lp-unit-info { font-size: 0.625rem; color: var(--text-muted); margin-top: 2px; }
.lp-toolbar { display: flex; gap: 8px; padding: 12px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); align-items: center; }
.lp-toolbar label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.lp-floor-tabs { display: flex; gap: 4px; padding: 12px 16px 0; }
.lp-floor-tab { padding: 6px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 0.8125rem; font-weight: 600; background: var(--bg-secondary); border: 1px solid var(--border-color); border-bottom: none; cursor: pointer; transition: all 0.2s; }
.lp-floor-tab.active { background: var(--bg-primary); color: var(--accent-primary); }
.lp-legend { display: flex; gap: 16px; padding: 8px 16px; font-size: 0.6875rem; color: var(--text-muted); }
.lp-legend-item { display: flex; align-items: center; gap: 4px; }
.lp-legend-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-color); }

@media (max-width: 768px) {
    .lp-space { font-size: 0.625rem; }
    .lp-toolbar { flex-wrap: wrap; }
}

/* ── Help Page ─────────────────────────────────────────────── */
.help-search-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.help-search-wrap svg { width: 18px; height: 18px; stroke: var(--text-muted); flex-shrink: 0; }
#help-search { width: 280px; padding: 8px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); font-size: 0.875rem; background: var(--bg-primary); color: var(--text-primary); }
#help-search:focus { outline: none; border-color: var(--accent-primary); }
#help-search-count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

#help-toc { margin-bottom: 32px; padding: 20px; background: var(--bg-secondary); border-radius: var(--radius-md); }
#help-toc a { display: block; padding: 6px 0; color: var(--accent-primary); text-decoration: none; font-size: 0.9rem; }
#help-toc a:hover { text-decoration: underline; }

.help-section { margin-bottom: 40px; scroll-margin-top: 80px; }
.help-section h2 { font-family: 'Fraunces', serif; font-size: 1.4rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-primary); }
.help-subsection { margin-bottom: 24px; }
.help-subsection h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
.help-subsection h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; }

.help-section p { margin-bottom: 10px; line-height: 1.6; color: var(--text-secondary); }
.help-section ul, .help-section ol { margin: 8px 0 16px 20px; color: var(--text-secondary); }
.help-section li { margin-bottom: 4px; line-height: 1.5; }
.help-section strong { color: var(--text-primary); }
.help-section code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.help-section table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
.help-section th { text-align: left; padding: 10px 12px; background: var(--bg-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--border-light); }
.help-section td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; }

.help-section blockquote { margin: 12px 0; padding: 12px 16px; border-left: 3px solid var(--accent-primary); background: var(--bg-secondary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.help-section blockquote p { margin-bottom: 0; }

.help-highlight { background: #FFF176; padding: 1px 2px; border-radius: 2px; }

/* ── Batch Progress Panel ─────────────────────────────────────────── */
.batch-progress-panel { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 16px; margin-top: 16px; }
.batch-progress-bar { height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.batch-progress-fill { height: 100%; background: var(--accent-primary); border-radius: 4px; transition: width 0.3s ease; }
.batch-progress-text { display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; color: var(--text-secondary); }
.batch-progress-phase { font-weight: 600; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }

/* ── SP Bulk Import Button ─────────────────────────────────────────── */
.sp-import-btn { display: none; }
.sp-import-btn.sp-connected { display: inline-flex; }

/* ── CAM Reconciliation ────────────────────────────────────── */
.cam-stats-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.cam-stat { flex: 1; }
.cam-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.cam-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.cam-detail-section {
    margin: 20px 0;
}
.cam-detail-section h4 {
    font-family: var(--font-heading);
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.cam-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px 24px;
    margin-bottom: 16px;
}
.cam-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cam-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.cam-detail-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.cam-summary-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 20px;
}
.cam-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.cam-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

@media (max-width: 768px) {
    .cam-stats-bar { flex-wrap: wrap; gap: 12px; }
    .cam-stat { min-width: 120px; }
    .cam-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Consolidated Financials (cf-) ─────────────────────────── */
.cf-filter-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.cf-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}
.cf-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cf-filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}
.cf-segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.cf-segment-card {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
.cf-segment-metric {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.875rem;
}
.cf-entity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.cf-entity-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-light);
}
.cf-entity-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}
.cf-entity-table tr:hover {
    background: var(--bg-secondary);
}
@media (max-width: 768px) {
    .cf-filter-bar { flex-direction: column; }
    .cf-segment-grid { grid-template-columns: 1fr; }
}

/* ── Work Orders (wo-) ──────────────────────────────────────── */
.wo-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.wo-filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}
.wo-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wo-filter-group label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.wo-filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 0.85rem;
}
.wo-view-toggle {
    margin-left: auto;
    display: flex;
    gap: 4px;
}
.wo-view-toggle button {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.wo-view-toggle button.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.wo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.wo-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.wo-card:hover {
    box-shadow: var(--shadow-md);
}
.wo-priority-stripe {
    width: 4px;
    min-height: 100%;
    flex-shrink: 0;
}
.wo-priority-stripe.urgent { background: #c0392b; }
.wo-priority-stripe.high   { background: var(--accent-danger); }
.wo-priority-stripe.medium { background: #d4a853; }
.wo-priority-stripe.low    { background: var(--accent-primary); }
.wo-card-inner {
    display: flex;
}
.wo-card-content {
    flex: 1;
    padding: 14px 16px;
}
.wo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.wo-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.wo-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.wo-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
}
.wo-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.wo-badge.open       { background: #dbeafe; color: #1e40af; }
.wo-badge.assigned   { background: #fef3c7; color: #92400e; }
.wo-badge.in-progress { background: #d1fae5; color: #065f46; }
.wo-badge.on-hold    { background: #e5e7eb; color: #4b5563; }
.wo-badge.completed  { background: #d1fae5; color: #065f46; }
.wo-badge.cancelled  { background: #fee2e2; color: #991b1b; }
.wo-badge.priority-urgent { background: #fee2e2; color: #991b1b; }
.wo-badge.priority-high   { background: #fed7d7; color: #9b2c2c; }
.wo-badge.priority-medium { background: #fef3c7; color: #92400e; }
.wo-badge.priority-low    { background: #d1fae5; color: #065f46; }
.wo-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.wo-detail-field {
    margin-bottom: 14px;
}
.wo-detail-field label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.wo-detail-field .value,
.wo-detail-field select,
.wo-detail-field input,
.wo-detail-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    background: var(--bg-primary);
}
.wo-detail-field textarea {
    min-height: 80px;
    resize: vertical;
}
.wo-invoice-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.wo-invoice-section h4 {
    margin-bottom: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wo-invoice-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.wo-timeline {
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}
.wo-timeline h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.wo-timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
}
.wo-timeline-item:last-child { border-bottom: none; }
.wo-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-top: 5px;
    flex-shrink: 0;
}
.wo-timeline-date {
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
}
@media (max-width: 768px) {
    .wo-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .wo-filter-bar { flex-direction: column; }
    .wo-card-grid { grid-template-columns: 1fr; }
    .wo-detail-grid { grid-template-columns: 1fr; }
    .wo-invoice-row { grid-template-columns: 1fr; }
}

/* ── Fixed Assets (fa-) ──────────────────────────────────── */
.fa-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.fa-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-align: center;
}
.fa-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.fa-stat-value {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}
.fa-method-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-primary-light, rgba(139,157,131,0.12));
    color: var(--accent-primary);
}
.fa-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.fa-status-badge.active { background: rgba(139,157,131,0.12); color: var(--accent-primary); }
.fa-status-badge.pending { background: rgba(156,137,121,0.12); color: var(--accent-warm); }
.fa-status-badge.overdue { background: rgba(184,133,122,0.12); color: var(--accent-danger); }
.fa-status-badge.vacant { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.fa-nbv-row td { padding: 0 12px 8px !important; border: none !important; }
.fa-nbv-bar {
    height: 4px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    overflow: hidden;
}
.fa-nbv-fill {
    height: 100%;
    background: var(--accent-warm);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.fa-schedule-table th,
.fa-schedule-table td {
    padding: 8px 12px;
}
@media (max-width: 768px) {
    .fa-stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tenant Portal Invite Badge ──────────────────────────── */
.ptl-invite-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ptl-invite-active {
    background: rgba(139, 157, 131, 0.15);
    color: #5a7a50;
}
.ptl-invite-pending {
    background: rgba(156, 137, 121, 0.15);
    color: #7a6555;
}

/* AI Context Bar */
.ai-ctx-bar {
    display: flex; gap: 16px; flex-wrap: wrap; align-items: end;
    margin-bottom: 24px; padding: 16px 20px;
    background: var(--bg-secondary); border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
.ai-ctx-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1; }
.ai-ctx-field label {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); font-weight: 600;
}
.ai-ctx-field select {
    padding: 8px 12px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.875rem;
    background: var(--bg-primary); color: var(--text-primary);
}

/* Document Hub */
.dh-drop-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 200px; margin-bottom: 24px; padding: 40px;
    border: 2px dashed var(--border-light); border-radius: var(--radius-lg);
    background: var(--bg-secondary); cursor: pointer; transition: all 0.2s;
    text-align: center;
}
.dh-drop-zone:hover, .dh-drop-zone.dragover {
    border-color: var(--accent-primary); background: rgba(139, 157, 131, 0.06);
}
.dh-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.dh-badge-lease { background: rgba(139, 157, 131, 0.15); color: var(--accent-primary); }
.dh-badge-loi { background: rgba(156, 137, 121, 0.15); color: var(--accent-warm); }
.dh-badge-gov { background: rgba(100, 140, 180, 0.15); color: #4a7a9b; }
.dh-badge-unknown { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.dh-badge-mgmt { background: rgba(156, 137, 121, 0.12); color: #7a6b5d; }
.dh-badge-vendor { background: rgba(120, 130, 140, 0.12); color: #5a6a7a; }
.dh-badge-lease-adj { background: rgba(139, 157, 131, 0.08); color: #6b8063; border: 1px solid rgba(139, 157, 131, 0.25); }
.dh-auto-match-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--accent-primary); font-weight: 500; }
.dh-confidence-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dh-confidence-high { background: var(--accent-primary); }
.dh-confidence-medium { background: var(--accent-warm); }
.dh-confidence-low { background: var(--accent-danger); }
.dh-status-queued { color: var(--text-muted); }
.dh-status-classifying { color: var(--accent-warm); }
.dh-status-ready { color: var(--accent-primary); }
.dh-status-processing { color: var(--accent-warm); }
.dh-status-complete { color: var(--accent-primary); font-weight: 600; }
.dh-status-error { color: var(--accent-danger); }

/* Background job status badges */
.dh-job-status-badge {
    display: inline-block;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.dh-job-status-badge.processing { background: rgba(156,137,121,0.15); color: var(--accent-warm); }
.dh-job-status-badge.complete   { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.dh-job-status-badge.error      { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.dh-job-status-badge.queued     { background: rgba(100,100,100,0.08); color: var(--text-muted); }

.dh-context-select {
    padding: 4px 8px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.8rem;
    background: var(--bg-primary); color: var(--text-primary);
    width: 100%;
}
.dh-override-select {
    display: block; padding: 2px 6px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.75rem; margin-top: 4px;
    background: var(--bg-primary); color: var(--text-muted);
}
.dh-review-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.dh-review-field label {
    display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px;
}
.dh-review-field input, .dh-review-field select, .dh-review-field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.9rem;
    background: var(--bg-primary); color: var(--text-primary);
}
.dh-review-field textarea { min-height: 60px; resize: vertical; }
.dh-review-services {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.dh-review-services label {
    display: flex; align-items: center; gap: 4px; font-size: 0.85rem;
    color: var(--text-primary); cursor: pointer;
}
.dh-review-full-width { grid-column: 1 / -1; }

/* ============================================================================
   Macro Conditions Panel — collapsible FRED data panel in deal/LOI analysis
   ============================================================================ */
.macro-panel {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    margin-top: 16px;
    overflow: hidden;
}
.macro-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--bg-primary);
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
    user-select: none;
}
.macro-panel-header:hover { background: var(--bg-hover, #F5F3F0); }
.macro-panel.macro-panel-open .macro-panel-header {
    border-bottom-color: var(--border-light);
}
.macro-panel-title {
    font-family: 'Fraunces', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.macro-panel-title span.macro-icon {
    font-size: 1rem;
}
.macro-panel-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 12px;
}
.macro-panel-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.macro-panel.macro-panel-open .macro-panel-chevron {
    transform: rotate(180deg);
}
.macro-panel-body {
    display: none;
    padding: 16px;
}
.macro-panel.macro-panel-open .macro-panel-body {
    display: block;
}
.macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.macro-stat {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.macro-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.macro-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.macro-stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.macro-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.macro-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.macro-tag-high {
    background: rgba(184, 133, 122, 0.12);
    color: var(--accent-danger, #B8857A);
    border-color: rgba(184, 133, 122, 0.25);
}
.macro-tag-elevated {
    background: rgba(156, 137, 121, 0.12);
    color: var(--accent-warm, #9C8979);
    border-color: rgba(156, 137, 121, 0.25);
}
.macro-tag-low {
    background: rgba(139, 157, 131, 0.12);
    color: var(--accent-primary, #8B9D83);
    border-color: rgba(139, 157, 131, 0.25);
}
.macro-implications {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-primary, #8B9D83);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.macro-impl-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.macro-impl-item {
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}
.macro-impl-item + .macro-impl-item {
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 8px;
}
.macro-source-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: right;
    font-style: italic;
}

/* ── Lease Negotiation Deal Flow (lnd-) ──────────────────────── */
.lnd-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
    min-height: 400px;
}
.lnd-column {
    flex: 0 0 220px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}
.lnd-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.8125rem;
}
.lnd-column-title { color: var(--text-primary); }
.lnd-column-count {
    background: var(--accent-primary);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
}
.lnd-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lnd-empty {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
    padding: 20px 0;
}
.lnd-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.lnd-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: var(--accent-primary);
}
.lnd-card.high { border-left: 3px solid var(--accent-danger); }
.lnd-card.medium { border-left: 3px solid var(--accent-warm); }
.lnd-card.low { border-left: 3px solid var(--border-color); }
.lnd-card-tenant {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.lnd-card-property {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.lnd-card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.lnd-card-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lnd-priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.lnd-priority-dot.high { background: var(--accent-danger); }
.lnd-priority-dot.medium { background: var(--accent-warm); }
.lnd-priority-dot.low { background: var(--border-color); }
.lnd-priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}
.lnd-priority-badge.high { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.lnd-priority-badge.medium { background: rgba(156,137,121,0.15); color: var(--accent-warm); }
.lnd-priority-badge.low { background: var(--bg-secondary); color: var(--text-muted); }
.lnd-table-wrap { width: 100%; }
.lnd-round-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: var(--bg-secondary);
}
.lnd-round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.lnd-round-label {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--accent-primary);
}
.lnd-round-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: pre-wrap;
}
.lnd-round-notes {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: pre-wrap;
}

/* ── Location Plan View (lp-plan-) ──────────────────────────── */
.lp-plan-view {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.lp-plan-image-wrap {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: crosshair;
}
.lp-plan-image {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}
.lp-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: transform 0.1s;
    z-index: 2;
}
.lp-pin:hover { transform: translate(-50%,-50%) scale(1.1); }
.lp-pin-label { pointer-events: none; }
.lp-pin-sidebar {
    flex: 0 0 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 420px;
    overflow-y: auto;
}
.lp-pin-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.12s;
}
.lp-pin-item:hover, .lp-pin-item.active {
    background: var(--accent-primary);
    color: white;
}
.lp-pin-item.active .lp-pin-dot { outline: 2px solid white; }
.lp-pin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Space Optimizer — Tenant Targeting (tt-) ───────────────────── */
.tt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}
.tt-conflict-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(184,133,122,0.12);
    border: 1px solid var(--accent-danger);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--accent-danger);
    font-size: 0.875rem;
}
.tt-snapshot {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.tt-snapshot-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tt-snapshot-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.tt-snapshot-opportunity {
    flex: 1 0 100%;
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}
.tt-rec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tt-rec-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 4px solid var(--accent-primary);
}
.tt-rec-card.caution { border-left-color: var(--accent-warm); }
.tt-rec-card.blocked { border-left-color: var(--accent-danger); opacity: 0.85; }
.tt-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.tt-rec-rank {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.tt-rec-category {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.tt-rec-subs {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.tt-score-badge {
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tt-rec-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.tt-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tt-metric-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.tt-metric-value {
    font-size: 0.875rem;
    font-weight: 600;
}
.tt-conflict-clear { color: var(--accent-primary); }
.tt-conflict-caution { color: var(--accent-warm); }
.tt-conflict-blocked { color: var(--accent-danger); }
.tt-conflict-note {
    background: rgba(156,137,121,0.1);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.8125rem;
    color: var(--accent-warm);
    margin-bottom: 8px;
}
.tt-rec-reasoning {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}
.tt-suggested {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.tt-suggested-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 2px;
}
.tt-tenant-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Data Migration: Rent Roll Import (dm-rr-) ──────────────── */
.dm-rr-desc { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 16px; }
.dm-rr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dm-rr-field { display: flex; flex-direction: column; }
.dm-rr-btn { margin-top: 4px; }
.dm-rr-btn-row { display: flex; gap: 8px; margin-top: 16px; }
.dm-rr-step-title { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 12px; }
.dm-rr-mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; align-items: center; }
.dm-rr-mapping-grid .form-label { margin-bottom: 0; font-size: 0.8125rem; }
.dm-rr-mapping-grid .form-label .dm-rr-required { color: var(--accent-danger); font-weight: 600; }
.dm-rr-stats { margin-bottom: 16px; }
.dm-rr-warnings { margin-bottom: 12px; }
.dm-rr-warnings:empty { display: none; }
.dm-rr-warnings .dm-rr-warn-item { font-size: 0.8rem; color: var(--accent-warm); padding: 2px 0; }
.dm-rr-errors:empty { display: none; }
.dm-rr-errors .dm-rr-err-item { font-size: 0.8rem; color: var(--accent-danger); padding: 2px 0; }
.dm-rr-error:empty { display: none; }
.dm-rr-error { color: var(--accent-danger); font-size: 0.8125rem; margin-top: 8px; }

/* ── Super-Admin UI (adm-) ───────────────────────────────────── */
.adm-score-pill {
    display: inline-block;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
}

/* ═══════════════════════════════════════════════
   USAGE ANALYTICS (ua-)
   ═══════════════════════════════════════════════ */
.ua-hours-callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.ua-hours-main { flex: 1; }
.ua-hours-number {
    font-family: 'Fraunces', serif;
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}
.ua-hours-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 6px;
}
.ua-hours-detail {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
    max-width: 560px;
}
.ua-hours-equiv { text-align: right; flex-shrink: 0; }
.ua-hours-equiv-number {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-warm);
}
.ua-hours-equiv-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.ua-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.ua-breakdown-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color 0.15s;
}
.ua-breakdown-item:hover { border-color: var(--accent-primary); }
.ua-breakdown-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-primary);
}
.ua-breakdown-icon svg { width: 18px; height: 18px; }
.ua-breakdown-body { flex: 1; min-width: 0; }
.ua-breakdown-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Fraunces', serif;
}
.ua-breakdown-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 3px;
}
.ua-breakdown-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.ua-breakdown-hrs {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-top: 4px;
}
.ua-activity-feed { display: flex; flex-direction: column; }
.ua-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.ua-activity-item:last-child { border-bottom: none; }
.ua-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-top: 5px;
    flex-shrink: 0;
}
.ua-activity-dot.warm  { background: var(--accent-warm); }
.ua-activity-dot.danger { background: var(--accent-danger); }
.ua-activity-dot.muted  { background: var(--text-muted); }
.ua-activity-text { font-size: 0.875rem; color: var(--text-primary); flex: 1; line-height: 1.45; }
.ua-activity-time { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

/* ── Form Library (ft-) ────────────────────────────────────── */
.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.ft-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s;
}
.ft-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.ft-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.ft-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.ft-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ft-type-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent-primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ft-type-badge.loi      { background: var(--accent-warm); }
.ft-type-badge.psa      { background: #7B9BC0; }
.ft-type-badge.notice   { background: var(--accent-danger); }
.ft-type-badge.governing-doc { background: #8B7BA8; }
.ft-type-badge.vendor   { background: #6B9E8E; }
.ft-sector-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.ft-default-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
}
.ft-card-description {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.ft-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}
.ft-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.ft-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ft-upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(139,157,131,0.04);
}
.ft-upload-zone p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
.ft-template-selector-group label { font-weight: 500; }
.ft-template-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
    margin-bottom: 6px;
}
.ft-selected-badge {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(139,157,131,0.12);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Lease Chunks / Clause Q&A (lc-) ──────────────────────── */
.lc-ingest-section { }

.lc-progress-track {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.lc-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.lc-progress-msg {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.lc-query-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.lc-query-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}
.lc-query-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.lc-query-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.lc-chunk-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.lc-chunk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.lc-chunk-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
}
.lc-chunk-similarity {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 7px;
    border-radius: 10px;
}
.lc-chunk-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

.lc-searching, .lc-no-results, .lc-error {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
}
.lc-error { color: var(--accent-danger); }

/* ── Roster Import (ri-) ─────────────────────────────────────── */
.ri-upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-secondary);
}
.ri-upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(139,157,131,0.06);
}
.ri-mapping-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.ri-mapping-label {
    width: 190px;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.ri-mapping-select {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}
.ri-required { color: var(--accent-danger); }
.ri-progress-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.ri-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 99px;
    transition: width 0.3s ease;
}
.ri-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.ri-summary-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.ri-summary-num {
    display: block;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}
.ri-results-log {
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.78rem;
    font-family: 'DM Mono', monospace, monospace;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.ri-log-info  { color: var(--text-secondary); margin-bottom: 2px; }
.ri-log-error { color: var(--accent-danger);   margin-bottom: 2px; }

/* ============================================================
   Lease Abstract Tabs  (la- prefix)
   ============================================================ */
.la-tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.la-tab-btn {
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.la-tab-btn:hover { color: var(--text-primary); }
.la-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.la-tab-panel { display: none; }
.la-tab-panel.active { display: block; }
.la-section {
    margin-bottom: 20px;
}
.la-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}
.la-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
}
.la-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 20px;
}
.la-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.la-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.la-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 400;
}
.la-value-empty { color: var(--text-muted); font-style: italic; }
.la-key-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}
.la-key-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 24px;
}
.la-key-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.la-key-label {
    font-size: 0.69rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.la-key-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}
.la-key-value-empty { color: var(--text-muted); font-style: italic; font-size: 0.875rem; }
.la-badge-yes {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(139, 157, 131, 0.15);
    color: var(--accent-primary);
}
.la-badge-no {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(184, 133, 122, 0.12);
    color: var(--accent-danger);
}
.la-provision-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    background: var(--bg-primary);
}
.la-prov-type {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    margin-bottom: 4px;
}
.la-prov-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 4px; }
.la-prov-summary { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 6px; }
.la-prov-verbatim {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    border-left: 3px solid var(--border-medium);
    padding-left: 10px;
    margin-top: 4px;
}
.la-conf-high { color: var(--accent-primary); font-size: 0.68rem; font-weight: 600; }
.la-conf-med  { color: var(--accent-warm);    font-size: 0.68rem; font-weight: 600; }
.la-conf-low  { color: var(--accent-danger);  font-size: 0.68rem; font-weight: 600; }

/* ============================================================
   Insurance Certs  (ic- prefix)
   ============================================================ */
.ic-stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.ic-filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
.ic-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ic-filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ic-filter-group select,
.ic-filter-group input {
    padding: 7px 10px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 140px;
}
.ic-status-active      { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.ic-status-expiring    { background: rgba(180,144,80,0.15);  color: #b49050; }
.ic-status-expired     { background: rgba(184,133,122,0.15); color: var(--accent-danger); }
.ic-status-missing     { background: rgba(100,100,100,0.1);  color: var(--text-muted); }
.ic-status-noncompliant{ background: rgba(184,133,122,0.2);  color: var(--accent-danger); }
.ic-compliance-warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-danger);
    background: rgba(184,133,122,0.1);
    padding: 2px 8px;
    border-radius: 99px;
}
.ic-compliance-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(139,157,131,0.1);
    padding: 2px 8px;
    border-radius: 99px;
}

/* ── Lease Abstract Tabs (la-) ──────────────────────────────────────── */
.la-tabs-wrapper {
    margin-bottom: 20px;
}
.la-tab-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
    padding-bottom: 2px;
}
.la-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.la-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.la-tab-active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}
.la-tab-panel { display: none; }
.la-tab-panel-active { display: block; }

.la-fields { display: flex; flex-direction: column; gap: 0; }
.la-section-head {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}
.la-field {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}
.la-field:last-child { border-bottom: none; }
.la-label {
    flex: 0 0 200px;
    color: var(--text-muted);
    font-size: 0.775rem;
}
.la-value {
    flex: 1;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.la-ai-notes {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}
.la-clause {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    cursor: pointer;
}
.la-clause-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
}
.la-clause-label {
    flex: 1;
    font-weight: 600;
    font-size: 0.8125rem;
}
.la-clause-page {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.la-clause-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.la-clause-body {
    display: none;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-light);
    white-space: pre-wrap;
}
.la-clause-open .la-clause-chevron { transform: rotate(180deg); }
.la-clause-open .la-clause-body { display: block; }
.la-empty {
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 20px 0;
}

/* ── Onboarding Overlay ─────────────────────────────────────── */
#onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ob-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 48px 44px 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
}
.ob-logo {
    width: 56px;
    height: 56px;
    background: var(--accent-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.ob-logo svg {
    width: 26px;
    height: 26px;
    stroke: white;
}
.ob-title {
    font-family: 'Fraunces', serif;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.ob-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.55;
}
.ob-field {
    margin-bottom: 20px;
}
.ob-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
}
.ob-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--surface-secondary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.ob-input:focus { border-color: var(--accent-primary); }
.ob-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ob-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid var(--border-medium);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}
.ob-chip input[type="checkbox"] { display: none; }
.ob-chip:has(input:checked) {
    border-color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    color: var(--text-primary);
}
.ob-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
}
.ob-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 8px 0;
    font-family: 'DM Sans', sans-serif;
}
.ob-skip:hover { color: var(--text-secondary); }
.ob-next { min-width: 140px; }
.ob-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}
.ob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-medium);
    transition: background 0.2s;
}
.ob-dot.active { background: var(--accent-primary); }

/* ============================================================
   LEASE NEGOTIATOR — Tenant Provision Conflict Panel (ln-)
   Surfaces existing-tenant provisions that may conflict with a
   proposed deal during LOI drafting and lease negotiation.
   ============================================================ */
.ln-conflicts-card { border: 1px solid var(--border-light); }
.ln-conflicts-card.ln-conflicts-clean {
    border-color: rgba(139, 157, 131, 0.35);
    background: rgba(139, 157, 131, 0.04);
}
.ln-conflicts-clean-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.ln-conflicts-clean-row strong { font-size: 0.95rem; color: var(--text-primary); }
.ln-conflicts-sub {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.ln-conflicts-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 8px;
}
.ln-conflicts-summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ln-conflicts-intro {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
}
.ln-conflicts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ln-conflict-item {
    border: 1px solid var(--border-light);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: var(--bg-primary);
}
.ln-conflict-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.ln-conflict-type {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.ln-conflict-conf {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}
.ln-conflict-summary {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.ln-conflict-detail {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.ln-sev {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
}
.ln-sev-high {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}
.ln-sev-medium {
    background: rgba(156, 137, 121, 0.18);
    color: var(--accent-warm);
}
.ln-sev-low {
    background: rgba(139, 157, 131, 0.15);
    color: var(--accent-primary);
}
.ln-sev-bg-high { border-left-color: var(--accent-danger); }
.ln-sev-bg-medium { border-left-color: var(--accent-warm); }
.ln-sev-bg-low { border-left-color: var(--accent-primary); }

/* ============================================================
   PRECEDENT COMPARISON — Portfolio precedent panel (pc-)
   Surfaces deltas between the proposed deal and recent similar
   in-portfolio executed deals.
   ============================================================ */
.pc-card { border: 1px solid var(--border-light); }
.pc-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 8px;
}
.pc-fallback-pill {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.pc-fallback-pill.pc-fb-portfolio {
    background: rgba(139, 157, 131, 0.15);
    color: var(--accent-primary);
}
.pc-fallback-pill.pc-fb-cross {
    background: rgba(156, 137, 121, 0.18);
    color: var(--accent-warm);
}
.pc-fallback-pill.pc-fb-none {
    background: rgba(184, 133, 122, 0.15);
    color: var(--accent-danger);
}
.pc-intro {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 14px;
}
.pc-headline {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}
.pc-headline strong { color: var(--text-primary); }
.pc-table-wrap { overflow-x: auto; }
.pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.pc-table th, .pc-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: top;
}
.pc-table th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}
.pc-precedent-row td:first-child { font-weight: 600; color: var(--text-primary); }
.pc-delta-up { color: var(--accent-primary); font-weight: 600; }
.pc-delta-down { color: var(--accent-danger); font-weight: 600; }
.pc-delta-flat { color: var(--text-muted); }
.pc-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.pc-empty strong { color: var(--text-secondary); display: block; margin-bottom: 4px; }
.pc-meta {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================================
   LOI REDLINE — Counter-LOI impact analysis (lr-)
   The institutional moment in the LOI workflow: tenant counter
   priced in NPV per delta with give/take rollup.
   ============================================================ */
.lr-grid {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(0, 1.4fr);
    gap: 24px;
}
@media (max-width: 1100px) {
    .lr-grid { grid-template-columns: 1fr; }
}
.lr-input-col, .lr-result-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lr-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 8px;
}
.lr-check input { width: 14px; height: 14px; accent-color: var(--accent-primary); }

.lr-counter-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 14px;
}
.lr-counter-tab {
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.lr-counter-tab:hover { color: var(--text-secondary); }
.lr-counter-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.lr-counter-panel { display: none; }
.lr-counter-panel.active { display: block; }

.lr-pdf-drop {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color 0.15s, background 0.15s;
}
.lr-pdf-drop:hover {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.04);
}
.lr-pdf-drop p { margin: 12px 0 0; font-size: 0.85rem; }

.lr-result-empty {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
    min-height: 360px;
}
.lr-result-empty h3 {
    font-family: 'Fraunces', serif;
    color: var(--text-primary);
    font-size: 1.3rem;
    margin: 16px 0 8px;
}
.lr-result-empty p { font-size: 0.9rem; line-height: 1.6; max-width: 480px; margin: 0 auto; }

.lr-verdict-card {
    border: 2px solid var(--border-light);
    background: var(--bg-secondary);
}
.lr-verdict-card.lr-verdict-pos {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.06);
}
.lr-verdict-card.lr-verdict-neg {
    border-color: var(--accent-danger);
    background: rgba(184, 133, 122, 0.06);
}
.lr-verdict-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.lr-verdict-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.lr-verdict-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Fraunces', serif;
}
.lr-headline {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.lr-warning {
    background: rgba(156, 137, 121, 0.1);
    border-left: 3px solid var(--accent-warm);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--accent-warm);
    font-size: 0.85rem;
}

.lr-table-wrap { overflow-x: auto; }
.lr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.lr-table th, .lr-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}
.lr-table th {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}
.lr-delta-row.lr-row-high {
    background: rgba(184, 133, 122, 0.04);
}
.lr-rationale {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
}
.lr-arrow-up { color: var(--accent-primary); font-weight: 700; font-size: 1.1rem; }
.lr-arrow-down { color: var(--accent-danger); font-weight: 700; font-size: 1.1rem; }
.lr-npv-pos { color: var(--accent-primary); font-weight: 600; }
.lr-npv-neg { color: var(--accent-danger); font-weight: 600; }
.lr-hold-flag {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(184, 133, 122, 0.18);
    color: var(--accent-danger);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}
.lr-rec {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
.lr-rec-accept { background: rgba(139, 157, 131, 0.15); color: var(--accent-primary); }
.lr-rec-negotiate { background: rgba(156, 137, 121, 0.18); color: var(--accent-warm); }
.lr-rec-hold { background: rgba(74, 69, 64, 0.12); color: var(--text-primary); }
.lr-rec-reject { background: rgba(184, 133, 122, 0.18); color: var(--accent-danger); }
.lr-meta {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================================
   CRM — Prospect activity timeline + kanban LOI button (crm-)
   ============================================================ */
.crm-act-form {
    display: grid;
    grid-template-columns: 110px 130px 1fr auto;
    gap: 8px;
    margin-bottom: 14px;
}
.crm-act-type, .crm-act-date {
    font-size: 0.85rem;
    padding: 6px 10px;
}
.crm-act-desc {
    font-size: 0.85rem;
    padding: 6px 10px;
}
@media (max-width: 720px) {
    .crm-act-form { grid-template-columns: 1fr; }
}
.crm-activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.crm-activity-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 24px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}
.crm-activity-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border-left: 3px solid var(--border-medium);
}
.crm-activity-item.crm-act-call    { border-left-color: var(--accent-primary); }
.crm-activity-item.crm-act-email   { border-left-color: var(--accent-warm); }
.crm-activity-item.crm-act-tour    { border-left-color: var(--accent-primary); }
.crm-activity-item.crm-act-meeting { border-left-color: var(--accent-primary); }
.crm-activity-item.crm-act-proposal{ border-left-color: var(--accent-warm); }
.crm-activity-item.crm-act-note    { border-left-color: var(--border-medium); }
.crm-act-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.crm-act-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
}
.crm-act-badge-call    { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.crm-act-badge-email   { background: rgba(156,137,121,0.18); color: var(--accent-warm); }
.crm-act-badge-tour    { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.crm-act-badge-meeting { background: rgba(139,157,131,0.15); color: var(--accent-primary); }
.crm-act-badge-proposal{ background: rgba(156,137,121,0.18); color: var(--accent-warm); }
.crm-act-badge-note    { background: var(--bg-primary); color: var(--text-secondary); }
.crm-act-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.crm-act-desc {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.crm-loi-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 5px 8px;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    background: rgba(139, 157, 131, 0.08);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.crm-loi-btn:hover {
    background: rgba(139, 157, 131, 0.18);
}

/* ============================================================
   COMP POOL GOVERNANCE — Settings panel + parameters page (cg-)
   ============================================================ */
.cg-settings-card { border: 1px solid var(--border-light); }
.cg-status-panel { padding: 4px 0; }
.cg-status-loading { color: var(--text-muted); font-size: 0.9rem; padding: 12px 0; }
.cg-status-error { color: var(--accent-danger); font-size: 0.9rem; padding: 12px 0; }
.cg-status {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    line-height: 1.55;
}
.cg-status-in     { background: rgba(139,157,131,0.08); border-color: rgba(139,157,131,0.35); }
.cg-status-pending{ background: rgba(156,137,121,0.10); border-color: rgba(156,137,121,0.35); }
.cg-status-out    { background: rgba(184,133,122,0.10); border-color: rgba(184,133,122,0.35); }

.cg-params-intro {
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}
.cg-params-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.cg-params-card.cg-params-current {
    border-color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.05);
}
.cg-params-card-head {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px; margin-bottom: 10px;
}
.cg-params-card-head h3 {
    margin: 0; font-family: 'Fraunces', serif; font-size: 1.05rem;
}
.cg-params-dates { font-size: 0.78rem; color: var(--text-muted); }
.cg-params-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-bottom: 12px;
}
@media (max-width: 720px) { .cg-params-grid { grid-template-columns: 1fr; } }
.cg-params-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); font-weight: 600; margin-bottom: 2px;
}
.cg-params-value { font-size: 0.95rem; color: var(--text-primary); }
.cg-params-section { margin-top: 12px; }
.cg-params-list {
    margin: 4px 0 0 18px; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5;
}
.cg-params-notes {
    margin-top: 12px; padding: 10px 12px;
    background: var(--bg-primary); border-left: 3px solid var(--border-medium);
    font-size: 0.85rem; color: var(--text-secondary); font-style: italic; line-height: 1.5;
}
.cg-params-history-heading {
    font-family: 'Fraunces', serif; font-size: 1.15rem;
    margin: 28px 0 12px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light); color: var(--text-primary);
}
@media print {
    .cg-params-card-head h3 { font-size: 14pt; }
    .cg-params-card { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECOVERY TERMS REVIEW (rec-) — lease document modal, Recovery Terms tab
   ═══════════════════════════════════════════════════════════════════════════ */
.rec-panel { display: flex; flex-direction: column; gap: 16px; grid-column: 1 / -1; }
.rec-muted { color: var(--text-muted); font-size: 0.8125rem; }
.rec-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rec-title { font-family: 'Fraunces', serif; font-size: 1.05rem; color: var(--text-primary); margin-bottom: 2px; }
.rec-banner {
    padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.8125rem;
    background: var(--bg-tertiary); border-left: 3px solid var(--accent-primary); color: var(--text-secondary);
}
.rec-banner-warn { border-left-color: var(--accent-warm); background: rgba(156, 137, 121, 0.10); }
.rec-banner-danger { border-left-color: var(--accent-danger); background: rgba(184, 133, 122, 0.10); }
.rec-pool {
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 14px 16px; background: var(--bg-secondary); display: flex; flex-direction: column; gap: 10px;
}
.rec-pool-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rec-pool-name { font-weight: 600; color: var(--text-primary); margin-right: 8px; }
.rec-method {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-primary);
    background: rgba(139, 157, 131, 0.12); padding: 2px 8px; border-radius: 8px;
}
.rec-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.rec-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.rec-table td { padding: 8px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.rec-term { color: var(--text-secondary); width: 30%; }
.rec-source { font-size: 0.75rem; color: var(--text-muted); width: 34%; }
.rec-actions { white-space: nowrap; text-align: right; }
.rec-actions .btn + .btn { margin-left: 6px; }
.rec-excerpt { margin-top: 4px; }
.rec-excerpt summary { cursor: pointer; color: var(--accent-primary); font-size: 0.72rem; user-select: none; }
.rec-excerpt blockquote {
    margin: 6px 0 0; padding: 8px 10px; border-left: 2px solid var(--accent-primary);
    background: var(--bg-tertiary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary); font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap;
}
.rec-history { margin: 6px 0 0 16px; padding: 0; font-size: 0.75rem; color: var(--text-secondary); }
.rec-override-tag {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px;
    border-radius: 8px; background: rgba(156, 137, 121, 0.16); color: var(--accent-warm); margin-left: 4px;
}
.rec-edit-row td { background: var(--bg-tertiary); }
.rec-edit { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rec-edit-field { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.rec-edit-field label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.rec-edit-reason { flex: 1; min-width: 240px; }
.rec-edit-actions { display: flex; gap: 6px; }
.rec-input { padding: 6px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); font-size: 0.8125rem; background: var(--bg-primary); color: var(--text-primary); }
.rec-unresolved summary { cursor: pointer; font-size: 0.8125rem; color: var(--text-secondary); user-select: none; }
.rec-unresolved ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.8125rem; }
.rec-unresolved li .btn { margin-left: 6px; }
.rec-pool-foot { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 720px) {
    .rec-toolbar, .rec-pool-head { flex-direction: column; align-items: flex-start; }
    .rec-term, .rec-source { width: auto; }
}
