@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #475569;
    --primary-dark: #334155;
    --secondary-color: #0F766E;
    --background-color: #FAFAFA;
    --card-background: #FFFFFF;
    --text-dark: #1E293B;
    --text-medium: #475569;
    --text-light: #64748B;
    --border-color: #E2E8F0;
    --header-bg: #334155;
    --accent-bg: #F1F5F9;
    --success-bg: #ECFDF5;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--header-bg) 0%, #374151 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fcfcfc, #b0c3f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header .subtitle {
    font-size: 1.25rem;
    color: #D1D5DB;
    margin-bottom: 2rem;
}

/* New header layout for right-aligned metadata */
.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}
.header-left { flex: 1; }
.header-meta { text-align: right; }
.header-meta-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    min-width: 280px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.meta-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.meta-item + .meta-item { margin-top: 0.5rem; }
.meta-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #BFDBFE;
    white-space: nowrap;
}
.meta-value {
    font-weight: 700;
    color: #F3F4F6;
}
.property-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #374151;
}

.stat-item {
    text-align: center;
}

.stat-item .label {
    font-size: 0.875rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fcfdfd;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.nav-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tab:hover {
    color: var(--primary-color);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.card-content {
    padding: 2rem;
}

/* Timeline Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Fix for Due Date column - prevent text wrapping */
th:nth-child(3), td:nth-child(3) {
    white-space: nowrap;
    min-width: 120px;
}

tbody tr:hover {
    background: #F9FAFB;
}

.section-header {
    background: #F3F4F6;
    font-weight: 700;
    color: var(--text-dark);
}

.date-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--accent-bg);
    color: var(--primary-dark);
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Document Grid */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.document-category {
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.category-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.document-list {
    padding: 1rem;
}

.document-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.document-item:hover {
    background: #F9FAFB;
}

.document-icon {
    width: 2rem;
    height: 2rem;
    background: var(--accent-bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.document-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.document-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Contact Cards */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.contact-card h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.contact-person {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-person:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.contact-person h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.contact-info {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.5;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Notes Section */
.notes-section {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

.notes-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.notes-section ul {
    padding-left: 1.5rem;
}

.notes-section li {
    margin-bottom: 0.5rem;
    color: var(--text-medium);
}

/* Lease Viewer Styles */
.lease-viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #f8f9fa;
    z-index: 2000;
    overflow: hidden;
}

.lease-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.lease-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: #5a6268;
}

.header-title h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb i {
    font-size: 12px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: #0056b3;
}

.main-container {
    display: flex;
    height: calc(100vh - 80px);
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.search-container {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 35px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.tenant-navigation {
    padding: 0;
}

.tenant-item {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.tenant-item:hover {
    background: #f8f9fa;
}

.tenant-item.active {
    background: #e3f2fd;
    border-left: 4px solid #007bff;
}

.tenant-item h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.tenant-item p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.content-area {
    flex: 1;
    background: white;
    overflow-y: auto;
}

.lease-content {
    padding: 30px;
    max-width: 900px;
}

.welcome-screen {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.welcome-screen h2 {
    margin: 0 0 10px 0;
    color: #495057;
}

.welcome-screen p {
    margin: 0;
    font-size: 16px;
}

.lease-abstract {
    max-width: 100%;
}

.lease-header {
    margin-bottom: 30px;
}

.lease-title {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
}

.lease-subtitle {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

.lease-body {
    line-height: 1.6;
}

.lease-body h1,
.lease-body h2,
.lease-body h3,
.lease-body h4 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

.lease-body h1 {
    font-size: 24px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.lease-body h2 {
    font-size: 20px;
}

.lease-body h3 {
    font-size: 18px;
}

.lease-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

.lease-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.lease-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.lease-table tr:last-child td {
    border-bottom: none;
}

.lease-table tr:nth-child(even) {
    background: #f8f9fa;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.loading-spinner i {
    font-size: 32px;
    color: #007bff;
    margin-bottom: 15px;
}

.loading-spinner p {
    margin: 0;
    color: #495057;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #dc3545;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .property-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-tabs {
        flex-wrap: wrap;
    }

    .document-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Responsive behavior for new header layout */
    .header-row { flex-direction: column; align-items: flex-start; }
    .header-meta { text-align: left; width: 100%; }
    .header-meta-box { min-width: 0; width: 100%; }
}