/* ===== Desert Sage Tasks - Styles ===== */

:root {
    --sage: #7C9473;
    --sage-light: #A3B899;
    --sage-dark: #5A7051;
    --sand: #F5F0E8;
    --sand-dark: #E8DFD0;
    --terracotta: #C75B39;
    --terracotta-light: #E07A5A;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --red: #DC2626;
    --green: #16A34A;
    --yellow: #D97706;
    --blue: #2563EB;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--sand);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--sage-dark); text-decoration: none; }
a:hover { color: var(--sage); }

/* ===== Navbar ===== */
.navbar {
    background: var(--sage-dark);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-brand a {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
}

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

.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.15s;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ===== Global Search ===== */
.nav-search {
    position: relative;
    margin-left: auto;
    margin-right: 1rem;
}

.nav-search input {
    width: 200px;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.15s;
}

.nav-search input::placeholder {
    color: rgba(255,255,255,0.6);
}

.nav-search input:focus {
    outline: none;
    background: white;
    color: var(--gray-800);
    width: 280px;
    border-color: white;
}

.nav-search input:focus::placeholder {
    color: var(--gray-400);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 320px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.25rem;
}

.search-dropdown.hidden { display: none; }

.search-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.search-section-title {
    padding: 0.25rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
}

.search-item {
    display: block;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: var(--gray-800);
}

.search-item:hover { background: var(--gray-50); color: var(--gray-800); }

.search-item-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-item-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

.search-item .badge {
    margin-right: 0.35rem;
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
}

.search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--gray-400);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}

.nav-user a { color: rgba(255,255,255,0.75); }
.nav-user a:hover { color: white; }

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

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

.page-header h1 { font-size: 1.5rem; color: var(--gray-900); }

.back-link {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: block;
    margin-bottom: 0.25rem;
}

.subtitle { color: var(--gray-500); font-size: 0.9rem; margin-top: 0.25rem; }

.header-actions { display: flex; gap: 0.5rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary { background: var(--sage); color: white; }
.btn-primary:hover { background: var(--sage-dark); color: white; }
.btn-secondary { background: white; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); color: var(--gray-700); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #15803D; color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #B91C1C; color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 1.2rem; padding: 0.2rem; }
.btn-icon:hover { color: var(--red); }

.inline-form { display: inline; }

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

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number { font-size: 2rem; font-weight: 700; color: var(--sage-dark); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

.stat-card-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-link:active {
    transform: translateY(0);
}

.stat-card-link .stat-number { color: var(--sage-dark); }
.stat-card-link .stat-label { color: var(--gray-500); }

/* ===== Dashboard ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-section {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sync-status {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: var(--radius);
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

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

.kpi-card {
    background: linear-gradient(135deg, #ffffff 0%, #F6F4EF 100%);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: inherit;
}

.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-900);
}

.role-dashboard {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.role-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

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

.section-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.link-muted {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.task-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.rail-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.rail-date {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.rail-title {
    font-weight: 600;
    color: var(--gray-800);
}

.rail-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.role-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.queue-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

.queue-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.queue-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.ops-panel {
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.ops-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.ops-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    color: var(--gray-700);
}

.ops-item.overdue {
    color: var(--terracotta);
    font-weight: 600;
}

/* ===== Task Action Bar ===== */
.task-action-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    bottom: 0;
    z-index: 50;
}

/* ===== Filter Chips ===== */
.filters-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.chip-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: white;
    border: 1px solid var(--gray-200);
    font-size: 0.75rem;
    color: var(--gray-600);
}

.chip-link:hover {
    border-color: var(--sage);
    color: var(--sage-dark);
}

/* ===== Task Cards ===== */
.task-list { display: flex; flex-direction: column; gap: 0.75rem; }

.task-card {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    transition: box-shadow 0.15s;
}

.task-card:hover { box-shadow: var(--shadow); }

.task-card.priority-high { border-left: 3px solid var(--terracotta); }
.task-card.status-completed { opacity: 0.65; }

.task-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }

.task-title {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    margin-bottom: 0.25rem;
}

.task-number {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sage-dark);
    background: var(--sand);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.task-number-header {
    display: inline-block;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sage-dark);
    background: var(--sand);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
}

.task-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    flex-wrap: wrap;
}

.task-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.unassigned { color: var(--terracotta-light); font-style: italic; }
.no-due-date { color: var(--gray-400); font-style: italic; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-cleaning { background: #DBEAFE; color: #1E40AF; }
.badge-maintenance { background: #FEF3C7; color: #92400E; }
.badge-inspection { background: #E0E7FF; color: #3730A3; }
.badge-restocking { background: #D1FAE5; color: #065F46; }

.badge-pending { background: var(--gray-100); color: var(--gray-600); }
.badge-assigned { background: #FEF3C7; color: #92400E; }
.badge-in_progress { background: #DBEAFE; color: #1E40AF; }
.badge-completed { background: #D1FAE5; color: #065F46; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }

.badge-high { background: #FEE2E2; color: #991B1B; }
.badge-normal { background: var(--gray-100); color: var(--gray-600); }
.badge-low { background: var(--gray-100); color: var(--gray-400); }

.badge-role { background: var(--sand); color: var(--gray-600); }
.badge-admin { background: var(--sage-light); color: white; }
.badge-auto { background: #E0E7FF; color: #3730A3; }

/* ===== Forms ===== */
.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-group input, .form-group select, .form-group textarea, .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(124, 148, 115, 0.15);
}

.form-row { margin-bottom: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

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

.checkbox-label input { width: auto; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ===== Filters ===== */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters-bar select, .filters-bar input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: white;
}

/* ===== Detail Pages ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.detail-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.detail-card h2, .detail-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }

.detail-badges { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.detail-section { margin-bottom: 1rem; }
.detail-section h3 { color: var(--gray-600); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.detail-section p { white-space: pre-line; }

.detail-list { font-size: 0.9rem; }
.detail-list dt { color: var(--gray-500); font-size: 0.8rem; margin-top: 0.75rem; }
.detail-list dd { font-weight: 500; }

.status-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.completed-banner {
    background: #D1FAE5;
    color: #065F46;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
}

/* ===== Checklist ===== */
.checklist { margin-bottom: 1rem; }

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.checklist-toggle {
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: white;
    transition: all 0.15s;
}

.checklist-toggle.checked {
    background: var(--green);
    border-color: var(--green);
}

.checklist-text { flex: 1; font-size: 0.9rem; }
.checklist-text.completed { text-decoration: line-through; color: var(--gray-400); }

.add-checklist-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.add-checklist-form input { flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 0.85rem; }

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

/* ===== Team ===== */
.team-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.team-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sage-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.team-info { flex: 1; }
.team-info h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.team-contact { font-size: 0.8rem; color: var(--gray-500); }
.team-contact span { display: block; }
.team-tasks { font-size: 0.8rem; color: var(--sage-dark); font-weight: 500; margin-top: 0.25rem; }
.team-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

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

.property-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.15s;
    display: block;
}

.property-card:hover { box-shadow: var(--shadow-md); }

.property-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--sand-dark);
}

.property-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sage-light);
}

.property-info { padding: 1rem; }
.property-info h3 { font-size: 1rem; color: var(--gray-800); }
.property-address { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; }
.property-details { display: flex; gap: 0.75rem; font-size: 0.8rem; color: var(--gray-500); margin-top: 0.5rem; }

/* ===== Calendar ===== */
.calendar-nav { display: flex; align-items: center; gap: 1rem; }
.calendar-title { font-size: 1.1rem; font-weight: 600; min-width: 160px; text-align: center; }

.calendar-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-cleaning { background: #3B82F6; }
.dot-maintenance { background: #D97706; }
.dot-inspection { background: #6366F1; }
.dot-restocking { background: #16A34A; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.cal-header {
    background: var(--sage-dark);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cal-day {
    background: white;
    min-height: 90px;
    padding: 0.35rem;
    cursor: pointer;
    transition: background 0.15s;
}

.cal-day:hover { background: var(--sand); }
.cal-empty { background: var(--gray-50); cursor: default; }
.cal-today { background: #FFFBEB; }

.cal-day-num { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); }

.cal-events { margin-top: 0.25rem; }

.cal-event {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    margin-bottom: 2px;
    border-radius: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cal-event-cleaning { background: #DBEAFE; color: #1E40AF; }
.cal-event-maintenance { background: #FEF3C7; color: #92400E; }
.cal-event-inspection { background: #E0E7FF; color: #3730A3; }
.cal-event-restocking { background: #D1FAE5; color: #065F46; }

.cal-status-completed { opacity: 0.5; }

.calendar-day-detail {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.calendar-day-detail h3 { margin-bottom: 1rem; }

/* ===== Login ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage-light) 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 1rem; }

.login-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-card h1 { color: var(--sage-dark); margin-bottom: 0.25rem; }
.login-card .subtitle { color: var(--gray-500); margin-bottom: 1.5rem; }
.login-card .form-group { text-align: left; }

/* ===== Empty State ===== */
.empty-state { color: var(--gray-400); font-size: 0.9rem; }

.empty-state-large {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}

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

.error-page { text-align: center; padding: 4rem 1rem; }
.error-page h1 { font-size: 2rem; color: var(--gray-300); margin-bottom: 0.5rem; }
.error-page p { color: var(--gray-500); margin-bottom: 1.5rem; }

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--sage-dark);
        flex-direction: column;
        padding: 0.5rem;
        margin-left: 0;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open { display: flex; }

    .nav-links a { padding: 0.75rem 1rem; }

    .nav-search {
        order: -1;
        width: 100%;
        padding: 0.5rem 1rem;
        margin: 0;
    }

    .nav-search input {
        width: 100%;
    }

    .nav-search input:focus {
        width: 100%;
    }

    .search-dropdown {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }

    .nav-user {
        margin-left: 0;
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    .container { padding: 1rem; }

    .page-header { flex-direction: column; }

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

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

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

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .filters-bar { flex-direction: column; }
    .filters-bar select, .filters-bar input { width: 100%; }

    .team-card { flex-direction: column; text-align: center; }
    .team-actions { justify-content: center; }

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

    .cal-day { min-height: 60px; }
    .cal-event { font-size: 0.6rem; }

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

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .stat-card { padding: 0.75rem; }
    .stat-number { font-size: 1.5rem; }
}

/* ===== Notifications ===== */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
}

.bell-icon { font-size: 1.1rem; }

.notification-badge {
    position: absolute;
    top: -2px;
    right: 0;
    background: var(--terracotta);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
}

/* Chat unread badge */
.chat-badge {
    display: inline-block;
    background: var(--terracotta);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.notification-dropdown {
    position: absolute;
    top: 56px;
    right: 1rem;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.hidden { display: none; }

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-800);
}

.notification-header a { font-size: 0.8rem; font-weight: normal; }

.notification-list {
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover { background: var(--gray-50); }
.notification-item.unread { background: #FFFBEB; }

.notification-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.25rem; }
.notification-message { font-size: 0.8rem; color: var(--gray-500); }
.notification-time { font-size: 0.7rem; color: var(--gray-400); margin-top: 0.25rem; }

.notification-empty { padding: 2rem; text-align: center; color: var(--gray-400); }

/* ===== Cleaner Management ===== */
.cleaner-section { margin-bottom: 1rem; }
.cleaner-section h4 { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.5rem; }

.cleaner-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
}

.cleaner-item.primary { background: #D1FAE5; }

.priority-badge {
    width: 20px;
    height: 20px;
    background: var(--sage);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cleaner-name { flex: 1; font-size: 0.9rem; }

.add-cleaner-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.add-cleaner-form select { flex: 1; padding: 0.4rem 0.5rem; font-size: 0.85rem; }

.backup-list { margin-bottom: 0.5rem; }

.maintenance-item.primary { background: #FEF3C7; }
.priority-badge.maintenance-badge { background: var(--yellow); }

/* ===== Handoff Section ===== */
.handoff-section {
    border: 1px dashed var(--yellow);
    background: #FFFBEB;
}

.handoff-section h3 { color: var(--yellow); }

.help-text { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 0.75rem; }

.decline-form textarea {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.btn-warning { background: var(--yellow); color: white; }
.btn-warning:hover { background: #B45309; color: white; }

.handoff-history { display: flex; flex-direction: column; gap: 0.5rem; }

.handoff-item {
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.handoff-action { margin-right: 0.5rem; }
.badge-declined { background: #FEE2E2; color: #991B1B; }
.badge-claimed { background: #D1FAE5; color: #065F46; }
.badge-reassigned { background: #DBEAFE; color: #1E40AF; }

.handoff-time { display: block; font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }
.handoff-reason { font-style: italic; color: var(--gray-500); margin-top: 0.25rem; padding-left: 0.5rem; border-left: 2px solid var(--gray-200); }

/* ===== Time Window Display ===== */
.task-window { font-size: 0.8rem; color: var(--sage-dark); font-weight: 500; }

.time-window .window-line { margin-bottom: 0.25rem; }
.time-window .window-line strong { color: var(--gray-600); }

/* ===== Maintenance Page ===== */
.maintenance-layout { margin-top: 1rem; }

.maintenance-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    align-items: start;
}

.maintenance-tasks h2, .availability-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.availability-section {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.availability-list { display: flex; flex-direction: column; gap: 0.5rem; }

.availability-window {
    padding: 0.75rem;
    background: var(--sand);
    border-radius: var(--radius);
    border-left: 3px solid var(--sage);
}

.window-property { font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.window-dates { font-size: 0.85rem; color: var(--sage-dark); }
.window-days { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; }

@media (max-width: 768px) {
    .maintenance-grid { grid-template-columns: 1fr; }
    .notification-dropdown { width: calc(100% - 2rem); right: 1rem; left: 1rem; }
}

/* ===== Mobile Enhancements ===== */
@media (max-width: 768px) {
    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-rail {
        grid-template-columns: 1fr;
    }

    .task-action-bar {
        position: fixed;
        left: 1rem;
        right: 1rem;
        bottom: calc(70px + env(safe-area-inset-bottom, 0));
    }

    .role-dashboard {
        gap: 1rem;
    }

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

    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.25rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
    }

    .btn-icon {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Touch-friendly form inputs */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Touch-friendly task cards */
    .task-card {
        padding: 1rem;
    }

    .task-title {
        font-size: 1rem;
    }

    /* Improved task actions */
    .task-actions {
        flex-wrap: wrap;
    }

    .task-actions .btn {
        flex: 1 0 auto;
    }

    /* Swipe-friendly checklist items */
    .checklist-item {
        padding: 0.75rem 0;
    }

    .checklist-toggle {
        width: 28px;
        height: 28px;
    }

    /* Better mobile nav */
    .nav-links a {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .nav-user {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-user a {
        padding: 0.5rem 1rem;
    }

    /* Full-width cards on mobile */
    .detail-sidebar {
        order: -1;
    }

    .detail-sidebar .detail-card {
        margin-bottom: 0.75rem;
    }

    /* Collapsible sections */
    .cleaner-section h4 {
        cursor: pointer;
        padding: 0.5rem 0;
    }

    /* Better touch targets for cleaner items */
    .cleaner-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Quick action floating button */
    .fab {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--sage);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 90;
        border: none;
        cursor: pointer;
    }

    .fab:hover {
        background: var(--sage-dark);
        transform: scale(1.05);
    }
}

/* ===== iOS Safe Area Support ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
    }

    .container {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    .fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ===== Pull to Refresh Visual ===== */
.pull-indicator {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--sage);
    color: white;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 50;
}

.pull-indicator.visible {
    opacity: 1;
}

/* ===== Loading States ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--gray-800);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.3s ease-out;
    pointer-events: auto;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-warning { background: var(--yellow); }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.toast-info { background: var(--blue); }

/* ===== Sync Indicator ===== */
.sync-indicator {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 999;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.sync-indicator.has-pending {
    opacity: 1;
    pointer-events: auto;
    background: var(--yellow);
    animation: pulse 2s infinite;
    cursor: pointer;
}

.sync-indicator.syncing {
    background: var(--blue);
    animation: syncSpin 1s linear infinite;
}

.sync-indicator.syncing::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes syncSpin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (max-width: 768px) {
    .sync-indicator {
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
    }

    .toast-container {
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
    }
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 0.75rem;
}

/* ===== Offline Indicator ===== */
.offline-banner {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--terracotta);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    z-index: 99;
    display: none;
}

.offline-banner.visible {
    display: block;
}

/* ===== FYI Banner (Admin Announcements) ===== */
.fyi-banner {
    background: linear-gradient(90deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: fyi-pulse 3s ease-in-out infinite;
    border-bottom: 1px solid #F59E0B;
}

.fyi-icon {
    font-size: 1.1rem;
}

.fyi-message {
    max-width: 800px;
}

@keyframes fyi-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ===== Improved Accessibility ===== */
:focus-visible {
    outline: 3px solid var(--sage);
    outline-offset: 2px;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 1rem;
    background: var(--sage-dark);
    color: white;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .badge {
        border: 1px solid currentColor;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Photo Gallery ===== */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-50);
}

.photo-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.photo-item .photo-info {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
}

.photo-item .photo-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-700);
}

.photo-item .photo-meta {
    display: block;
    color: var(--gray-400);
}

.photo-item .btn-icon {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-upload-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.photo-upload-form input[type="file"] {
    flex: 1;
    font-size: 0.85rem;
}

/* ===== Notes Editing ===== */
.notes-edit-form textarea {
    font-size: 0.9rem;
}

.task-notes-display {
    white-space: pre-line;
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ===== PWA Install Banner ===== */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    animation: slideUpBanner 0.3s ease-out;
}

.install-banner.visible {
    display: flex;
}

@keyframes slideUpBanner {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.install-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
    min-width: 0;
}

.install-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.install-text span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.install-dismiss {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.install-dismiss:hover {
    color: var(--gray-600);
}

/* ===== PWA Install Modal ===== */
.pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.pwa-modal.closing {
    animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

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

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    text-align: right;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.install-step:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--sage);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0 0 0.25rem 0;
}

.step-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: var(--radius);
    text-align: center;
    line-height: 32px;
    font-size: 1.25rem;
    margin-right: 0.5rem;
}

.step-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add padding to container for bottom nav */
    .container {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
    }

    /* Adjust install banner position */
    .install-banner {
        bottom: calc(80px + env(safe-area-inset-bottom, 0));
    }

    /* Hide top nav links on mobile when logged in */
    .nav-links > a:not(.nav-search):not(.nav-user) {
        display: none;
    }

    .nav-links.open > a {
        display: block;
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    min-height: 56px;
    color: var(--gray-500);
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--sage-dark);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--sage);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.bottom-nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bottom-nav-badge {
    position: absolute;
    top: 0.25rem;
    right: 50%;
    transform: translateX(12px);
    background: var(--terracotta);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .nav-toggle,
    .btn,
    .notification-dropdown,
    .fab,
    .mobile-bottom-nav,
    .install-banner {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .task-card {
        break-inside: avoid;
        border: 1px solid #000;
    }

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