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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* CONTAINER */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* TABS */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 1024px) {
    .tab-grid {
        grid-template-columns: 450px 1fr;
    }
}

/* CARDS */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-card {
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header h2 {
    margin: 0;
}

/* FORMS */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* BUTTONS */
.btn, .btn-small {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-edit:hover {
    background: #5568d3;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
}

.btn-close:hover {
    color: #333;
}

/* PROPERTY CARDS */
.property-card, .tenant-card, .payment-card, .walkthrough-card {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.property-card:hover, .tenant-card:hover, .payment-card:hover, .walkthrough-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.property-header, .tenant-header, .payment-header, .walkthrough-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.property-address {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.property-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

.property-details {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.95rem;
}

.property-description {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.feature-tag {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #666;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* TENANT CARDS */
.tenant-card h3 {
    margin-bottom: 5px;
    color: #333;
}

.tenant-info {
    margin: 15px 0;
}

.tenant-info p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

/* PAYMENT CARDS */
.payment-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #28a745;
}

.payment-details {
    margin: 15px 0;
}

.payment-details p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

/* WALKTHROUGH CARDS */
.walkthrough-card h4 {
    margin-bottom: 5px;
    color: #333;
}

.walkthrough-details {
    margin: 15px 0;
}

.walkthrough-details p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-available {
    background: #d4edda;
    color: #155724;
}

.badge-occupied {
    background: #fff3cd;
    color: #856404;
}

.badge-maintenance {
    background: #f8d7da;
    color: #721c24;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

.badge-scheduled {
    background: #cce5ff;
    color: #004085;
}

.badge-completed {
    background: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* LATE PAYMENTS */
.late-payments-card {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.late-payments-card h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.late-payment-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.late-payment-item strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* TENANT DETAILS */
.tenant-details {
    max-height: 60vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.detail-section p {
    margin: 8px 0;
    color: #555;
}

/* TABLES */
.users-table, .simple-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.users-table th,
.users-table td,
.simple-table th,
.simple-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.users-table th,
.simple-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #333;
}

.users-table tr:hover,
.simple-table tr:hover {
    background: #f8f8f8;
}

/* TEXT UTILITIES */
.text-muted {
    color: #999;
    font-size: 0.9rem;
}

.text-success {
    color: #28a745;
    font-weight: 600;
}

.text-danger {
    color: #dc3545;
    font-weight: 600;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 1.1rem;
}

/* TOASTS */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-user {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .tab-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        position: static;
        max-height: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .property-header, .tenant-header, .payment-header, .walkthrough-header {
        flex-direction: column;
        gap: 10px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
