/*
 * Apartment Booking System - Styling
 * Premium responsive dark-theme design system.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Colors */
    --bg-primary: #0b0f19;
    --bg-secondary: #151c2c;
    --bg-card: rgba(22, 28, 45, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);

    /* Flat Status Colors */
    --status-vacant: #ffffff;
    --status-vacant-bg: rgba(255, 255, 255, 0.05);
    --status-vacant-border: rgba(255, 255, 255, 0.2);
    --status-vacant-text: #f8fafc;

    --status-booked: #22c55e;
    --status-booked-bg: rgba(34, 197, 94, 0.15);
    --status-booked-border: #22c55e;
    --status-booked-text: #4ade80;

    --status-blocked: #eab308;
    --status-blocked-bg: rgba(234, 179, 8, 0.15);
    --status-blocked-border: #eab308;
    --status-blocked-text: #facc15;

    --status-paid: #3b82f6;
    --status-paid-bg: rgba(59, 130, 246, 0.15);
    --status-paid-border: #3b82f6;
    --status-paid-text: #60a5fa;

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #f87171;

    /* Fonts & Radii */
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-glass: 8px;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Header & Navbar */
.app-header {
    background-color: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(var(--blur-glass));
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-item {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-logout {
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Main Container */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Auth Screens */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 1.5rem;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-glass));
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

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

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

.form-control {
    width: 100%;
    background-color: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Alert messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
    border-color: rgba(34, 197, 94, 0.2);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.vacant {
    color: var(--status-vacant-text);
}

.stat-value.booked {
    color: var(--status-booked-text);
}

.stat-value.blocked {
    color: var(--status-blocked-text);
}

.stat-value.paid {
    color: var(--status-paid-text);
}

/* Main Section Split Layout */
.section-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .section-layout {
        grid-template-columns: 1fr;
    }
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Site Lists */
.site-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.site-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.site-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.site-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Apartment Grid Screen */
.status-legends {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.legend-color.vacant {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

.legend-color.booked {
    background-color: var(--status-booked-bg);
    border-color: var(--status-booked-border);
}

.legend-color.blocked {
    background-color: var(--status-blocked-bg);
    border-color: var(--status-blocked-border);
}

.legend-color.paid {
    background-color: var(--status-paid-bg);
    border-color: var(--status-paid-border);
}

/* Flats Grid */
.flats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.flat-box {
    aspect-ratio: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
    text-align: center;
    position: relative;
    border: 1px solid transparent;
    padding: 0.25rem;
}

.flat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Custom styles for Flat box statuses */
.flat-box.vacant {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #0b0f19;
}

.flat-box.booked {
    background-color: var(--status-booked-bg);
    border-color: var(--status-booked-border);
    color: var(--status-booked-text);
}

.flat-box.blocked {
    background-color: var(--status-blocked-bg);
    border-color: var(--status-blocked-border);
    color: var(--status-blocked-text);
}

.flat-box.paid {
    background-color: var(--status-paid-bg);
    border-color: var(--status-paid-border);
    color: var(--status-paid-text);
}

.flat-box .flat-desc {
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.8;
    text-transform: uppercase;
}

.flat-box .timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 4px;
    border-radius: 3px;
    color: #facc15;
    margin-top: 10px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-backdrop.show .modal-content {
    transform: translateY(0);
}

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

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

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

.status-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.status-option-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.status-option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-option-btn.active {
    border-width: 2px;
}

.status-option-btn.vacant.active {
    border-color: #ffffff;
    background-color: #ffffff;
    color: #0b0f19;
}

.status-option-btn.booked.active {
    border-color: var(--status-booked-border);
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
}

.status-option-btn.blocked.active {
    border-color: var(--status-blocked-border);
    background-color: var(--status-blocked-bg);
    color: var(--status-blocked-text);
}

.status-option-btn.paid.active {
    border-color: var(--status-paid-border);
    background-color: var(--status-paid-bg);
    color: var(--status-paid-text);
}

/* Customers Page */
.customer-search {
    margin-bottom: 1.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    text-align: left;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Payment Timeline UI */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -29px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    z-index: 10;
}

.timeline-item.paid .timeline-dot {
    border-color: var(--status-booked-border);
    background-color: var(--status-booked-border);
}

.timeline-item.pending .timeline-dot {
    border-color: var(--status-blocked-border);
    background-color: var(--bg-secondary);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.paid {
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
}

.badge.pending {
    background-color: var(--status-blocked-bg);
    color: var(--status-blocked-text);
}

.badge.flat {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Utility Layouts */
.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

/* App Sidebar Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-primary);
    width: calc(100% - 260px);
}

.mobile-topbar {
    display: none;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-brand {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background-color: var(--primary-light);
    color: #818cf8;
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.sidebar-user-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sidebar-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Tasks UI styling */
.task-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.task-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.task-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.task-filter-btn:hover {
    color: var(--text-primary);
}

.task-filter-btn.active {
    background-color: var(--primary-light);
    color: #818cf8;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.task-card.completed {
    opacity: 0.6;
}

.task-check-wrapper {
    margin-top: 2px;
}

.task-checkbox-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
}

.task-card.completed .task-checkbox {
    background-color: var(--status-booked-border);
    border-color: var(--status-booked-border);
    color: white;
}

.task-checkbox:hover {
    border-color: var(--primary);
}

.task-body {
    flex: 1;
}

.task-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.task-badge.due {
    background-color: rgba(234, 179, 8, 0.1);
    color: #facc15;
}

.task-badge.due.overdue {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.task-badge.flat-tag {
    background-color: var(--primary-light);
    color: #818cf8;
}

/* Calendar Styles */
.calendar-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-responsive {
    width: 100%;
    overflow-x: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 700px;
}

.calendar-weekday {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    background-color: var(--bg-primary);
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.calendar-day.other-month {
    background-color: rgba(0, 0, 0, 0.15);
    opacity: 0.4;
}

.calendar-day.today {
    background-color: rgba(79, 70, 229, 0.05);
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
}

.calendar-day-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    align-self: flex-start;
}

.calendar-day.today .calendar-day-number {
    color: #818cf8;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    flex: 1;
}

.calendar-event {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-left: 3px solid transparent;
}

.calendar-event.payment {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.calendar-event.payment.paid {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-left-color: #22c55e;
}

.calendar-event.task-pending {
    background-color: rgba(234, 179, 8, 0.12);
    color: #facc15;
    border-left-color: #eab308;
}

.calendar-event.task-completed {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-left-color: var(--text-muted);
    text-decoration: line-through;
}

.calendar-event.blocked-expiry {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-left-color: #ef4444;
}

/* Sidebar Responsive Logic */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 900px) {
    .task-layout {
        grid-template-columns: 1fr;
    }
}

/* Hide number input spinners globally */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Premium Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.pagination-link.active {
    color: #ffffff;
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
}