/* RentTracker Theme - Extracted from theme 2.html */
/* Navy + Emerald fintech look with 5% fluid gutters and rounded radii */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Poppins:wght@500;600&display=swap');

:root {
    --primary-blue: #0A2540;
    --secondary-blue: #1A365D;
    --action-green: #10B981;
    --light-green: #ECFDF5;
    --bg-light: #F8FAFC;
    --text-dark: #1E293B;
    --text-light: #64748B;
    --border-color: #E2E8F0;
    --white: #FFFFFF;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--action-green);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-blue);
}

/* Navigation */
.site-nav {
    background-color: var(--primary-blue);
    padding: 16px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Poppins', sans-serif;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo svg {
    fill: var(--action-green);
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: #E2E8F0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--action-green);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 60px 5% 80px 5%;
    position: relative;
}

.hero-section.compact {
    padding: 40px 5%;
}

.hero-text {
    color: white;
    max-width: 700px;
}

.hero-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-text p {
    font-size: 1.1rem;
    color: #CBD5E1;
    line-height: 1.6;
}

/* Main Content Container */
.main-content {
    padding: 40px 5%;
    flex-grow: 1;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    padding: 24px;
    transition: box-shadow 0.3s, transform 0.2s;
    /* Allow card to shrink inside flex/grid parents so wide tables can scroll
       inside .table-wrapper instead of stretching the whole page. */
    min-width: 0;
    max-width: 100%;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    /* On narrow screens, allow the title and filter cluster to stack instead
       of forcing the card (and the page) to grow horizontally. */
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--primary-blue);
    min-width: 0;
}

.card-body {
    color: var(--text-dark);
    min-width: 0;
    max-width: 100%;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* KPI / Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-card .stat-change {
    font-size: 0.8rem;
    margin-top: 8px;
}

.stat-card .stat-change.positive {
    color: var(--action-green);
}

.stat-card .stat-change.negative {
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--action-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-action {
    background-color: var(--action-green);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.95rem;
}

tbody tr:hover {
    background: var(--bg-light);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Shared responsive wrapper for any wide list/data table. Pages that have
   many columns (invoices, payments, receipts, leases, etc.) wrap their
   <table class="data-table"> in <div class="table-wrapper">; without these
   rules the table can push the card and the whole page wider than the
   viewport. */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Action button column should stay on one line so buttons never stack
   awkwardly mid-row; allow it to shrink to its content. */
.actions-cell {
    white-space: nowrap;
    text-align: right;
}

.actions-cell .btn,
.actions-cell form {
    display: inline-block;
    vertical-align: middle;
}

.actions-cell .btn + .btn,
.actions-cell .btn + form,
.actions-cell form + .btn,
.actions-cell form + form {
    margin-left: 6px;
}

/* Badges / Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--light-green);
    color: var(--action-green);
}

.badge-warning {
    background: #FEF3C7;
    color: var(--warning);
}

.badge-danger {
    background: #FEE2E2;
    color: var(--danger);
}

.badge-info {
    background: #DBEAFE;
    color: var(--info);
}

.badge-neutral {
    background: var(--bg-light);
    color: var(--text-light);
}

/* Summary Row (from payment summary) */
.summary-box {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px dashed var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--action-green);
}

/* Selection Cards / Tiles */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.selection-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.selection-card:hover {
    border-color: var(--action-green);
}

.selection-card.selected {
    border-color: var(--action-green);
    background-color: var(--light-green);
}

.selection-card h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--primary-blue);
}

.selection-card p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Loading / Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-green);
    border-top: 4px solid var(--action-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 24px 5%;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    background: var(--white);
    border-top: 1px solid var(--border-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-success { color: var(--action-green); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: slideIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

/* Mobile Menu Button (hidden by default) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
}
