/* ============================================================
   Lomio — Vacation Property Management — Light Theme
   Based on Vespa Resource Planning design system
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeSlideIn {
        from { opacity: 0; transform: translateY(6px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeOut {
        from { opacity: 1; }
        to { opacity: 0; transform: translateY(-4px); }
    }
    @keyframes alertSlideIn {
        from { opacity: 0; transform: translateX(-8px); }
        to { opacity: 1; transform: translateX(0); }
    }
    .main-content { animation: fadeSlideIn 0.25s ease-out; }
    .alert { animation: alertSlideIn 0.3s ease-out; }
    .stat-card { animation: fadeSlideIn 0.35s ease-out both; }
    .stat-card:nth-child(2) { animation-delay: 50ms; }
    .stat-card:nth-child(3) { animation-delay: 100ms; }
    .stat-card:nth-child(4) { animation-delay: 150ms; }
}

:root {
    /* Surfaces — warm light */
    --bg-body: #f5f3f0;
    --bg-surface: #ffffff;
    --bg-nav: #1a3a3a;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f0ede8;
    --bg-table-alt: #faf8f5;

    /* Accent — teal */
    --accent: #2d6a6a;
    --accent-hover: #1a5252;
    --accent-light: #3a8a8a;

    /* Text */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;

    /* Borders */
    --border: #e2e0dc;
    --border-light: #d1cfc9;

    /* Semantic colors */
    --success: #22c55e;
    --success-bg: #dcfce7;
    --warning: #d69e2e;
    --warning-bg: #fefce8;
    --error: #e53e3e;
    --error-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    /* Role colors */
    --color-owner: #2d8a6a;
    --color-tenant: #2b6cb0;
    --color-maintenance: #c05621;

    /* Layout */
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --transition: 150ms ease;
    --nav-height: 56px;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* --- Navbar (stays dark like Vespa) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.nav-brand:hover {
    color: #fff;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.nav-brand:hover .nav-logo {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(45, 106, 106, 0.5);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--accent-light);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.nav-logout {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.nav-logout:hover {
    color: var(--error);
}

/* --- Property Switcher in Nav --- */
.nav-property-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.nav-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-dropdown-arrow {
    font-size: 0.65rem;
    opacity: 0.6;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: var(--bg-nav);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem 0;
    z-index: 1100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown-item-danger {
    color: var(--error) !important;
}
.dropdown-item-danger:hover {
    background: rgba(229, 62, 62, 0.15) !important;
    color: var(--error) !important;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding-left: 1.15rem;
}

.dropdown-item.active {
    color: var(--accent-light);
    font-weight: 600;
}

/* Role badge in nav */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-owner {
    background: rgba(45, 138, 106, 0.2);
    color: #68d7a8;
}

.role-tenant {
    background: rgba(43, 108, 176, 0.2);
    color: #63b3ed;
}

.role-maintenance {
    background: rgba(192, 86, 33, 0.2);
    color: #f6ad55;
}

/* --- Mobile Nav --- */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem;
}

@media (max-width: 900px) {
    .nav-mobile-toggle {
        display: block;
    }

    .nav-links,
    .nav-right,
    .nav-property-switch {
        display: none;
    }

    .mobile-open .nav-links,
    .mobile-open .nav-right,
    .mobile-open .nav-property-switch {
        display: flex;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        padding: 0.5rem 0;
        gap: 0;
        order: 4;
    }

    .nav-property-switch {
        width: 100%;
        padding: 0.5rem 0;
        order: 3;
    }

    .nav-link {
        width: 100%;
        padding: 0.6rem 1rem;
        border-radius: 0;
    }

    .nav-right {
        width: 100%;
        padding: 0.5rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        order: 5;
    }

    .navbar {
        height: auto;
        min-height: var(--nav-height);
    }

    .nav-dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}

/* --- Main Content --- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 1.5rem) 1.5rem 3rem;
}

/* --- Messages / Alerts --- */
.messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    border-left: 4px solid;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success);
    color: #166534;
}

.alert-error {
    background: var(--error-bg);
    border-color: var(--error);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #854d0e;
}

.alert-info {
    background: var(--info-bg);
    border-color: var(--info);
    color: #1e40af;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.25rem;
    line-height: 1;
}

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

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

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.page-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* --- Cards / Panels --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-header h2,
.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition);
    position: relative;
}

tbody tr:nth-child(even) {
    background: var(--bg-table-alt);
}

tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Hover accent line */
tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--accent);
    transition: width 150ms ease;
    pointer-events: none;
}

tbody tr:hover::after {
    width: 3px;
}

td.num, th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.filter-bar label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
    min-width: 160px;
}

.filter-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(45, 106, 106, 0.15);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group .helptext {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(45, 106, 106, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 0.4rem;
    accent-color: var(--accent);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 600px;
    box-shadow: var(--shadow);
}

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

.errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.errorlist li {
    color: var(--error);
    font-size: 0.8rem;
}

/* Non-field errors */
.form-errors {
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #991b1b;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform 80ms ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45, 106, 106, 0.35);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: #991b1b;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(45, 106, 106, 0.12);
    color: var(--accent);
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.badge-warning {
    background: rgba(214, 158, 46, 0.12);
    color: #854d0e;
}

.badge-danger {
    background: rgba(229, 62, 62, 0.12);
    color: #991b1b;
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
}

.badge-muted {
    background: rgba(113, 128, 150, 0.12);
    color: var(--text-muted);
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    background: var(--error);
    color: #fff;
    margin-left: 0.35rem;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.stat-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Detail Sections --- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.info-row {
    display: flex;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.info-row + .info-row {
    border-top: 1px solid var(--border);
}

.info-label {
    flex: 0 0 140px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    flex: 1;
    color: var(--text-primary);
}

/* --- Confirm / Delete --- */
.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.confirm-box p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* --- Login Page --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-body);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-logo .nav-logo {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
}

.login-logo .nav-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* --- Section headers --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

/* --- Activity list --- */
.activity-list {
    list-style: none;
    padding: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 100px;
}

/* --- Utility --- */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--error); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-small { font-size: 0.8rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition);
}

.pagination a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* --- Focus Visible --- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(45, 106, 106, 0.3);
}

/* --- FullCalendar overrides --- */
.fc {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.fc .fc-toolbar-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.fc .fc-button {
    background: var(--accent);
    border: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

.fc .fc-button:hover {
    background: var(--accent-hover);
}

.fc .fc-button-active {
    background: var(--accent-hover);
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(45, 106, 106, 0.06);
}

/* --- Receipts --- */
.receipt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.receipt-card {
    overflow: hidden;
}

.receipt-thumb {
    display: block;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-hover);
}

.receipt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.receipt-thumb:hover img {
    transform: scale(1.05);
}

.text-small {
    font-size: 0.82rem;
}

/* --- Print --- */
@media print {
    .navbar,
    .nav-mobile-toggle,
    .btn,
    .filter-bar,
    .messages {
        display: none !important;
    }

    .main-content {
        padding: 0;
        max-width: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    table, th, td {
        border: 1px solid #ccc;
    }
}
