* {
    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;
    --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;
}

.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;
    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);
}

/* 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);
}

/* 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-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;
    }
}

/* ============================================
   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);
}

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

/* Tenant contact card grid */
.ten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

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

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

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

.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: 16px;
    padding: 10px 20px;
    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);
}

.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: 14px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.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: 10px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.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;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

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

.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;
}

/* 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: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(4px);
}

.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); }
}

/* ============================================================
   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;
}
