/* Rent Manager System - Professional Styles */

:root {
    --primary-color: #1e40af;
    --primary-hover: #1d4ed8;
    --secondary-color: #374151;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --income-color: #059669;
    --expense-color: #dc2626;
    --profit-color: #7c3aed;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --navbar-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.75rem;
}

.nav-brand h1 {
    font-size: 1.125rem;
    color: white;
    font-weight: 700;
    margin: 0;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: auto;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.profile-btn {
    color: white !important;
    background: rgba(30, 64, 175, 0.8) !important;
    padding: 0.5rem 0.875rem !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 0.875rem !important;
}

.profile-btn:hover {
    background: rgba(30, 64, 175, 1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.logout-btn {
    color: white !important;
    background: rgba(220, 53, 69, 0.8) !important;
    padding: 0.5rem 0.875rem !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-size: 0.875rem !important;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    position: relative;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 0.7rem;
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.2s ease;
}

.dropdown.open .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--navbar-bg);
    min-width: 200px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-menu li a:hover,
.dropdown-menu li a.active {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

main.container {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.375rem 0.5rem;
    font-size: 1rem;
    min-width: auto;
    line-height: 1;
}

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

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

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

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

.error-text {
    color: var(--danger-color);
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    line-height: 1;
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

.stat-income {
    border-left: 4px solid var(--income-color);
}

.stat-expense {
    border-left: 4px solid var(--expense-color);
}

.stat-profit {
    border-left: 4px solid var(--profit-color);
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.property-card, .detail-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.card-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1rem;
}

.card-body p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.card-body strong {
    color: var(--text-primary);
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-color);
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.data-table thead {
    background: var(--bg-color);
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tfoot {
    background: var(--bg-color);
    font-weight: 600;
}

.data-table tfoot td {
    border-top: 2px solid var(--border-color);
    border-bottom: none;
}

.amount {
    text-align: right;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--secondary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
}

.badge-danger {
    background: var(--danger-color);
}

.badge-warning {
    background: var(--warning-color);
}

.badge-secondary {
    background: var(--secondary-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* Dashboard Tiles */
.dashboard-tile {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.dashboard-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

.tile-icon {
    font-size: 3rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.tile-content {
    padding: 1.5rem;
}

.tile-content h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tile-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tile-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.alert-list {
    list-style: none;
}

.alert-list li {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--warning-color);
}

.clickable-alert {
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.clickable-alert:hover {
    background: #fee2e2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.success-state {
    text-align: center;
    padding: 2rem;
    color: var(--success-color);
    font-size: 1.1rem;
}

.quick-actions {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.quick-actions h3 {
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Detail Pages */
.detail-card {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.detail-card h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item strong {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.detail-item span {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.detail-notes {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.detail-notes p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-box h4 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.stat-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 1rem;
}

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

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

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

/* Filter Bar */
.filter-bar {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-form select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--card-bg);
    cursor: pointer;
}

/* Summary Box */
.summary-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-box h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Highlight */
.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* Ledger */
.ledger-table .amount-col {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.ledger-table .income {
    color: var(--income-color);
}

.ledger-table .expense {
    color: var(--expense-color);
}

.ledger-table .balance {
    font-weight: 700;
}

.ledger-table .total-row {
    font-weight: 700;
    background: var(--bg-color);
}

/* Tax Report */
.tax-summary {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tax-summary h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.tax-grid {
    display: grid;
    gap: 1rem;
}

.tax-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.tax-item label {
    color: var(--text-secondary);
    font-weight: 600;
}

.tax-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.tax-value.income {
    color: var(--income-color);
}

.tax-value.expense {
    color: var(--expense-color);
}

.highlight-box {
    background: var(--primary-color);
    color: white;
}

.highlight-box label,
.highlight-box .tax-value {
    color: white;
}

.monthly-breakdown {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.monthly-breakdown h3 {
    margin-bottom: 1.5rem;
}

.tax-notes {
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--warning-color);
    margin-bottom: 2rem;
}

.tax-notes h3 {
    color: #92400e;
    margin-bottom: 1rem;
}

.tax-notes ul {
    margin-left: 1.5rem;
    color: #78350f;
}

.tax-notes li {
    margin-bottom: 0.5rem;
}

/* Print Actions */
.print-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Danger Zone */
.danger-zone {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
}

footer .footer-links {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

footer .footer-links a {
    color: var(--primary-color);
    text-decoration: none;
}

footer .footer-links a:hover {
    text-decoration: underline;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: white;
}

.cookie-text p {
    margin: 0.5rem 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.cookie-text a {
    color: #60a5fa;
    text-decoration: none;
}

.cookie-text a:hover {
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-actions .btn {
    white-space: nowrap;
}

.btn-link {
    background: transparent;
    color: #60a5fa;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-decoration: underline;
}

/* Cookie Settings Modal */
.cookie-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content .close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-content .close:hover {
    color: var(--text-primary);
}

.cookie-category {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cookie-category h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cookie-category input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* GDPR Pages */
.gdpr-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.gdpr-page h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.gdpr-page .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.gdpr-page .updated-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.gdpr-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.gdpr-section h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.gdpr-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.gdpr-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.gdpr-section ul {
    margin: 1rem 0 1rem 2rem;
}

.gdpr-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.gdpr-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Cookie Table */
.cookie-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.cookie-table th,
.cookie-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.cookie-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-table code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* GDPR Dashboard */
.gdpr-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gdpr-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.gdpr-card h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gdpr-card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.gdpr-card .btn {
    margin-top: 0.5rem;
}

.danger-card {
    border-color: var(--danger-color);
    border-width: 2px;
}

.danger-card h2 {
    color: var(--danger-color);
}

.warning-text {
    color: var(--danger-color);
    font-weight: 600;
    padding: 1rem;
    background: #fee;
    border-radius: 8px;
    margin: 1rem 0;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
    margin: 1rem 0;
}

.user-info p {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.gdpr-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gdpr-links li {
    margin-bottom: 0.75rem;
}

.gdpr-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.gdpr-links a:hover {
    text-decoration: underline;
}

.cookie-controls {
    margin: 1.5rem 0;
}

.form-text {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.gdpr-notice {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2rem;
    border-left: 4px solid var(--primary-color);
}

.gdpr-notice h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.gdpr-notice ul {
    margin: 1rem 0 1rem 2rem;
}

.gdpr-notice li {
    margin-bottom: 0.5rem;
}


/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 45px; /* Adjusted for smaller navbar height */
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--navbar-bg);
        padding: 0;
        gap: 0;
        height: 0;
        overflow: hidden;
        transition: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
    }

    /* Test: Show menu when hamburger is active */
    .hamburger.active + .nav-menu {
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        max-height: 70vh !important;
        padding: 1rem 0 !important;
        overflow-y: auto !important;
    }

    .nav-menu.active {
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
        max-height: 70vh !important;
        padding: 1rem 0 !important;
        overflow-y: auto !important;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: block !important;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu li a {
        display: block;
        padding: 1rem;
        width: 100%;
        border-radius: 0;
        text-align: left;
        font-size: 1rem;
        line-height: 1.4;
    }

    .nav-menu li a:hover,
    .nav-menu li a.active {
        background: rgba(255, 255, 255, 0.2);
        transform: none;
    }

    .user-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-left: 0;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .logout-btn {
        text-align: center;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Mobile Dropdown Styles */
    .nav-menu .dropdown-menu {
        display: none;
    }

    .nav-menu.active .dropdown-menu {
        display: block !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    /* Mobile dropdown toggle functionality */
    .nav-menu.active .dropdown.open .dropdown-menu {
        display: block !important;
    }
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-left: 1rem;
        border-left: 3px solid rgba(255, 255, 255, 0.3);
    }

    .dropdown-menu li a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        background: rgba(255, 255, 255, 0.05);
    }

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

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

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

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Contract Cards */
.contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.contract-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s;
}

.contract-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contract-header {
    background: var(--navbar-bg);
    color: white;
    padding: 1rem;
}

.contract-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contract-meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

.contract-content {
    padding: 1rem;
}

.contract-details {
    margin-bottom: 1rem;
}

.contract-details .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.contract-details .detail-item:last-child {
    border-bottom: none;
}

.contract-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: #fef3c7; color: #d97706; }
.status-active { background: #d1fae5; color: #065f46; }
.status-terminated { background: #fee2e2; color: #dc2626; }
.status-expired { background: #e2e8f0; color: #475569; }

/* Deposit Statuses */
.status-pending { background: #fef3c7; color: #d97706; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-returned { background: #dbeafe; color: #1e40af; }
.status-partially_returned { background: #ffedd5; color: #c2410c; }
.status-forfeited { background: #fee2e2; color: #dc2626; }

/* Tenant Selection for Contracts */
.tenant-selection {
    max-width: 1000px;
    margin: 0 auto;
}

.tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tenant-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.tenant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tenant-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tenant-property {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tenant-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tenant-detail {
    display: flex;
    justify-content: space-between;
}

.tenant-detail strong {
    color: var(--text-primary);
}

.btn-select {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-select:hover {
    background: var(--primary-hover);
    color: white;
    text-decoration: none;
}

/* Mobile Table Cards */
@media screen and (max-width: 768px) {
    .data-table {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody, 
    .data-table tr, 
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 1rem;
        background: var(--card-bg);
        border-radius: 0.75rem;
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color);
        padding: 1rem;
    }

    .data-table td {
        text-align: right;
        padding: 0.5rem 0;
        position: relative;
        padding-left: 50%;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-left: 0;
        margin-top: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    /* Add labels using data-label attribute if available, 
       otherwise we rely on the flex layout to push content to the right.
       Ideally, we would add data-label attributes to all td elements in templates.
       For now, we'll use a generic approach or rely on the user to update templates if they want specific labels.
       However, without data-label, it's hard to know what the value represents.
       
       Let's try to use nth-of-type to add pseudo-labels for specific known tables if possible, 
       but that's brittle.
       
       Better approach: Just stack them nicely.
    */
    
    .data-table td {
        text-align: left;
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    /* If we want to show headers, we need to modify templates to include data-label.
       Since I cannot modify all templates easily in one go without knowing all of them,
       I will use a layout that works well without labels or assumes the content is self-explanatory.
       
       Actually, the request is "switched to card layouts".
       A simple stack is often enough.
    */

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        margin-bottom: 0.25rem;
    }
    
    /* Specific adjustments for action buttons container */
    .data-table td:last-child {
        flex-direction: row;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    /* Hide tfoot on mobile as it breaks the card layout usually */
    .data-table tfoot {
        display: none;
    }
}

/* Additional Mobile Styles for Transaction History */
@media screen and (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: var(--card-bg);
    }
    
    .table td {
        border-top: none;
    }
    
    /* Ensure badges wrap nicely */
    .badge {
        white-space: normal;
        text-align: left;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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