/* ===== Theme Variables ===== */
:root {
    --color-primary: #2D8A6E;
    --color-primary-hover: #257A60;
    --color-on-primary: #FFFFFF;
    --color-primary-container: #EAF5EC;
    --color-secondary: #9A7B3C;

    --color-bg: #FAFAFA;
    --color-text: #09090B;
    --color-muted: #71717A;
    --color-surface: #FFFFFF;
    --color-surface-variant: #F4F4F5;
    --color-border: #E4E4E7;
    --color-divider: #F4F4F5;
    --color-outline: #D4D4D8;

    --color-nav-bg: rgba(255, 255, 255, 0.85);
    --color-nav-text: #09090B;
    --color-nav-brand: #2D8A6E;
    --color-nav-active: #2D8A6E;
    --color-footer-bg: #F4F4F5;
    --color-footer-text: #71717A;
    --color-thead-bg: #F4F4F5;
    --color-thead-text: #71717A;
    --color-row-even: #FAFAFA;
    --color-row-hover: #F4F4F5;
    --color-row-highlight: #F4F4F5;

    /* Pastel card tints */
    --pastel-pink: #FCECF0;
    --pastel-blue: #EAF2FC;
    --pastel-green: #F0FDF4;
    --pastel-purple: #F1ECFA;
    --pastel-amber: #FDF5E6;
    --pastel-mint: #F0FDF4;

    /* Solid accent colors (no harsh gradients) */
    --color-accent-primary: #2D8A6E;
    --color-accent-gold: #9A7B3C;
    --color-accent-blue: #5B8DB8;

    --border-radius-card: 14px;
    --border-radius-badge: 20px;
    --border-radius-btn: 8px;
    --shadow-card: none;
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.04);
    --shadow-nav: none;

    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-heading: 'Manrope', system-ui, -apple-system, sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #5ABFA0;
        --color-primary-hover: #4DAF92;
        --color-on-primary: #0A2E20;
        --color-primary-container: #1A3D2E;
        --color-secondary: #C9A85C;

        --color-bg: #09090B;
        --color-text: #FAFAFA;
        --color-muted: #A1A1AA;
        --color-surface: #111113;
        --color-surface-variant: #18181B;
        --color-border: #27272A;
        --color-divider: #18181B;
        --color-outline: #3F3F46;

        --color-nav-bg: rgba(17, 17, 19, 0.85);
        --color-nav-text: #FAFAFA;
        --color-nav-brand: #5ABFA0;
        --color-nav-active: #5ABFA0;
        --color-footer-bg: #111113;
        --color-footer-text: #A1A1AA;
        --color-thead-bg: #18181B;
        --color-thead-text: #A1A1AA;
        --color-row-even: #111113;
        --color-row-hover: rgba(90, 191, 160, 0.06);
        --color-row-highlight: rgba(90, 191, 160, 0.1);

        /* Pastel tints (darkened for dark mode) */
        --pastel-pink: #2A1E22;
        --pastel-blue: #1E2430;
        --pastel-green: #18181B;
        --pastel-purple: #24202C;
        --pastel-amber: #2A2618;
        --pastel-mint: #18181B;

        --shadow-card: none;
        --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.15);
        --shadow-nav: none;
    }
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    color-scheme: light dark;
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.9375rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 182px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

@media (prefers-color-scheme: dark) {
    body::before {
        opacity: 0.04;
    }
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s var(--ease-out-expo);
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    font-weight: 800;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    font-weight: 800;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

ul {
    list-style: none;
}

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

/* ===== Navigation ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--color-nav-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    min-height: 56px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-nav);
}

.nav-brand {
    color: var(--color-nav-brand);
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    padding: 0.5rem 0;
    letter-spacing: -0.02em;
}

.nav-brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-nav-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.35rem;
    line-height: 1;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
}

.nav-links a {
    color: var(--color-nav-text);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all .12s ease;
}

.nav-links a:hover {
    background-color: var(--color-surface-variant);
    color: var(--color-text);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--color-nav-active);
    background-color: transparent;
    font-weight: 600;
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px 2px 0 0;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero h1 .brand-accent {
    color: var(--color-primary);
}

.hero p {
    color: var(--color-muted);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.section-header h2 {
    margin: 0;
}

.section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ===== Cards ===== */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-card);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s var(--ease-out-expo), border-color 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo);
}

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

@media (prefers-color-scheme: dark) {
    .card:hover {
        border-color: rgba(90, 191, 160, 0.15);
    }
}

.card-accent {
    border-left: 4px solid var(--color-primary);
    background-color: var(--pastel-mint);
}

/* Pastel card tint variants */
.card-pink { background-color: var(--pastel-pink); }
.card-blue { background-color: var(--pastel-blue); }
.card-green { background-color: var(--pastel-green); }
.card-purple { background-color: var(--pastel-purple); }
.card-amber { background-color: var(--pastel-amber); }
.card-mint { background-color: var(--pastel-mint); }

/* ===== Grid Layout ===== */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-btn);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1px;
    line-height: 1.4;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s var(--ease-out-expo);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 2px 8px rgba(45, 138, 110, 0.15);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-outline);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    background-color: rgba(45, 138, 110, 0.06);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--color-text);
    background-color: var(--color-surface-variant);
}

/* ===== Muted Text ===== */
.muted {
    color: var(--color-muted);
}

/* ===== Family Name ===== */
.family-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ===== Announcements ===== */
.announcement {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-divider);
}

.announcement:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.announcement p {
    margin-bottom: 0.25rem;
}

/* ===== Quick Links ===== */
.quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.quick-links li {
    padding: 0;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border-radius: 18px;
    background: var(--pastel-mint);
    border: 1px solid var(--color-border);
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.quick-link-card:hover {
    text-decoration: none;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(45, 138, 110, 0.15);
}

.quick-link-icon {
    font-size: 1.5rem;
    line-height: 1;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 3px 10px;
    border-radius: var(--border-radius-badge);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-width: 1px;
    border-style: solid;
    font-family: var(--font-heading);
}

/* Status badges */
.badge-upcoming,
.badge-reported {
    background-color: rgba(56, 189, 248, 0.12);
    color: #38BDF8;
    border-color: rgba(56, 189, 248, 0.25);
}

.badge-reminded,
.badge-in_progress {
    background-color: rgba(251, 146, 60, 0.12);
    color: #FB923C;
    border-color: rgba(251, 146, 60, 0.25);
}

.badge-confirmed,
.badge-submitted_to_fm {
    background-color: rgba(192, 132, 252, 0.12);
    color: #C084FC;
    border-color: rgba(192, 132, 252, 0.25);
}

.badge-completed,
.badge-resolved {
    background-color: rgba(74, 222, 128, 0.12);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.25);
}

.badge-missed,
.badge-urgent {
    background-color: rgba(248, 113, 113, 0.12);
    color: #F87171;
    border-color: rgba(248, 113, 113, 0.25);
}

/* Light mode overrides for badge text colors */
@media (prefers-color-scheme: light) {
    .badge-upcoming, .badge-reported { color: #0284C7; border-color: rgba(2, 132, 199, 0.25); background-color: rgba(56, 189, 248, 0.08); }
    .badge-reminded, .badge-in_progress { color: #C2410C; border-color: rgba(194, 65, 12, 0.25); background-color: rgba(251, 146, 60, 0.08); }
    .badge-confirmed, .badge-submitted_to_fm { color: #7C3AED; border-color: rgba(124, 58, 237, 0.25); background-color: rgba(192, 132, 252, 0.08); }
    .badge-completed, .badge-resolved { color: #16A34A; border-color: rgba(22, 163, 74, 0.25); background-color: rgba(74, 222, 128, 0.08); }
    .badge-missed, .badge-urgent { color: #DC2626; border-color: rgba(220, 38, 38, 0.25); background-color: rgba(248, 113, 113, 0.08); }
}

/* Severity badges */
.badge-severity-low {
    background-color: rgba(56, 189, 248, 0.12);
    color: #38BDF8;
    border-color: rgba(56, 189, 248, 0.25);
}

.badge-severity-medium {
    background-color: rgba(251, 146, 60, 0.12);
    color: #FB923C;
    border-color: rgba(251, 146, 60, 0.25);
}

.badge-severity-high,
.badge-severity-urgent {
    background-color: rgba(248, 113, 113, 0.12);
    color: #F87171;
    border-color: rgba(248, 113, 113, 0.25);
}

@media (prefers-color-scheme: light) {
    .badge-severity-low { color: #0284C7; border-color: rgba(2, 132, 199, 0.25); background-color: rgba(56, 189, 248, 0.08); }
    .badge-severity-medium { color: #C2410C; border-color: rgba(194, 65, 12, 0.25); background-color: rgba(251, 146, 60, 0.08); }
    .badge-severity-high, .badge-severity-urgent { color: #DC2626; border-color: rgba(220, 38, 38, 0.25); background-color: rgba(248, 113, 113, 0.08); }
}

/* Location badge */
.badge-location {
    background-color: var(--pastel-mint);
    color: var(--color-primary);
    border-color: rgba(45, 138, 110, 0.15);
}

/* Organization badge */
.badge-org {
    background-color: rgba(29, 78, 216, 0.08);
    color: #3B82F6;
    border-color: rgba(59, 130, 246, 0.2);
}

@media (prefers-color-scheme: light) {
    .badge-org {
        color: #1D4ED8;
        border-color: rgba(29, 78, 216, 0.2);
    }
}

/* Room badge */
.badge-room {
    background-color: var(--color-surface-variant);
    color: var(--color-muted);
    border-color: var(--color-border);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
    border: 1px solid var(--color-border);
}

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

thead {
    background-color: var(--color-thead-bg);
    color: var(--color-thead-text);
}

th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

tbody tr:nth-child(even) {
    background-color: var(--color-row-even);
}

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

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

.row-highlight {
    background-color: var(--color-row-highlight) !important;
    font-weight: 500;
    border-left: 4px solid var(--color-primary);
}

.row-muted {
    opacity: 0.55;
}

/* ===== Calendar Grid (Web) ===== */
.calendar-container {
    margin-bottom: 1.5rem;
}

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

.calendar-nav h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.calendar-nav button {
    background: var(--color-surface-variant);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.calendar-nav button:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    overflow: hidden;
    background: var(--color-surface);
}

.calendar-grid .cal-header {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
    background: var(--color-surface-variant);
    border-bottom: 1px solid var(--color-border);
}

.calendar-grid .cal-day {
    padding: 0.4rem 0.25rem;
    min-height: 70px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    position: relative;
    cursor: default;
    transition: background-color 0.15s ease;
}

.calendar-grid .cal-day:nth-child(7n) {
    border-right: none;
}

.calendar-grid .cal-day:hover {
    background-color: var(--color-row-hover);
}

.calendar-grid .cal-day.other-month {
    color: var(--color-muted);
    opacity: 0.35;
}

.calendar-grid .cal-day.today {
    background: var(--pastel-mint);
}

.calendar-grid .cal-day .day-num {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.calendar-grid .cal-day.today .day-num {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.calendar-grid .cal-day .event-dots {
    display: flex;
    gap: 3px;
    justify-content: center;
    flex-wrap: wrap;
}

.calendar-grid .cal-day .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

.calendar-grid .cal-day .event-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    line-height: 1.2;
}

/* ===== Events ===== */
.month-heading {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-heading:first-of-type {
    margin-top: 0.5rem;
}

.event-card {
    padding: 0.85rem 1rem;
}

.event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.event-title {
    margin-bottom: 0;
    font-weight: 600;
}

.event-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.event-date {
    font-weight: 600;
    color: var(--color-text);
}

/* ===== Issues ===== */
.issue-card {
    padding: 0.85rem 1rem;
}

.issue-header {
    margin-bottom: 0.5rem;
}

.issue-title {
    margin-bottom: 0;
    font-weight: 600;
}

.issue-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.issue-date {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.issue-resolved {
    opacity: 0.6;
}

.issue-description {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.5rem;
    line-height: 1.5;
}

/* ===== Status Summary ===== */
.status-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-card {
    flex: 1;
    text-align: center;
    padding: 1rem 0.75rem;
}

.summary-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.summary-urgent {
    border-left: 4px solid #DC2626;
}

.summary-urgent .summary-number {
    color: #DC2626;
}

.summary-high {
    border-left: 4px solid #F59E0B;
}

.summary-high .summary-number {
    color: #F59E0B;
}

.summary-resolved {
    border-left: 4px solid var(--primary);
}

.summary-resolved .summary-number {
    color: var(--primary);
}

/* ===== Contact Section ===== */
.contact-section {
    margin-top: 1.5rem;
}

.contact-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem;
}

.contact-avatar {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.contact-role {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
}

.contact-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contact-methods a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(45, 138, 110, 0.06);
    border: 1px solid rgba(45, 138, 110, 0.15);
    text-decoration: none;
    transition: all 0.2s ease;
}

.contact-methods a:hover {
    text-decoration: none;
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    text-align: center;
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    letter-spacing: 0.1px;
}

.footer a {
    color: var(--color-primary);
    font-weight: 500;
}

/* ===== View Toggle ===== */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--color-surface-variant);
    border-radius: 14px;
    padding: 3px;
    margin-bottom: 1rem;
    width: fit-content;
}

.view-toggle button {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle button.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ===== Lucide Icon Defaults ===== */
[data-lucide] {
    width: 1em;
    height: 1em;
    stroke-width: 1.75;
    vertical-align: -0.125em;
    display: inline-block;
    flex-shrink: 0;
}

/* ===== Tabular Numbers ===== */
.widget-value,
.summary-number,
.family-name,
.event-date {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* ===== Uppercase Labels ===== */
.widget-icon-header,
.summary-label {
    letter-spacing: 0.05em;
}

/* ===== Widget System ===== */
.widget {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-card);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s var(--ease-out-expo), border-color 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo);
    text-decoration: none;
    color: var(--color-text);
    display: block;
    position: relative;
    overflow: hidden;
}

.widget::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out-expo);
    background: radial-gradient(
        320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(90, 191, 160, 0.06),
        transparent 60%
    );
    pointer-events: none;
}

.widget:hover::after {
    opacity: 1;
}

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

@media (prefers-color-scheme: dark) {
    .widget:hover {
        border-color: rgba(90, 191, 160, 0.15);
    }
    .widget::after {
        background: radial-gradient(
            320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(90, 191, 160, 0.08),
            transparent 60%
        );
    }
}

.widget-icon-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
}

.widget-icon-header span:first-child {
    font-size: 1.1rem;
}

.widget-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.widget-meta {
    font-size: 12.5px;
    color: var(--color-muted);
}

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

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

/* ===== Dashboard Header ===== */
.dashboard-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border);
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0;
}

.dashboard-header .date {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

/* ===== Alert Banner ===== */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-banner-urgent {
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #F87171;
    animation: pulse-alert 2s ease-in-out infinite;
}

@media (prefers-color-scheme: light) {
    .alert-banner-urgent {
        background-color: rgba(220, 38, 38, 0.06);
        border-color: rgba(220, 38, 38, 0.2);
        color: #DC2626;
    }
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.alert-banner a {
    margin-left: auto;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ===== Event Timeline ===== */
.event-timeline {
    margin-bottom: 1.5rem;
}

.event-timeline-item {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-divider);
    font-size: 0.9rem;
}

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

.event-timeline-date {
    flex-shrink: 0;
    width: 80px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-primary);
    text-transform: uppercase;
    padding-top: 0.1rem;
}

.event-timeline-content {
    flex: 1;
    min-width: 0;
}

.event-timeline-title {
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.event-timeline-meta {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ===== Cleaning Timeline ===== */
.cleaning-timeline {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.cleaning-timeline-item {
    position: relative;
    padding: 0.75rem 0 0.75rem 1rem;
}

.cleaning-timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    z-index: 1;
}

.cleaning-timeline-item.current-week::before {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(45, 138, 110, 0.4);
}

.cleaning-timeline-item.current-week {
    background: var(--color-row-highlight);
    border-radius: var(--border-radius-card);
    margin-left: -0.5rem;
    padding-left: 1.5rem;
}

.cleaning-timeline-item.past-week {
    opacity: 0.5;
}

.cleaning-timeline-family {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.cleaning-timeline-date {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0.25rem;
}

/* ===== Card Entrance Animations ===== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    opacity: 0;
}

.animate-in.visible {
    animation: fadeSlideUp 0.5s var(--ease-out-expo) forwards;
}

.animate-in.visible:nth-child(1) { animation-delay: 0s; }
.animate-in.visible:nth-child(2) { animation-delay: 0.06s; }
.animate-in.visible:nth-child(3) { animation-delay: 0.12s; }
.animate-in.visible:nth-child(4) { animation-delay: 0.18s; }
.animate-in.visible:nth-child(5) { animation-delay: 0.24s; }
.animate-in.visible:nth-child(6) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .animate-in {
        opacity: 1;
    }
    .animate-in.visible {
        animation: none;
    }
}

/* ===== Calendar Day Popovers ===== */
.cal-day.has-events {
    cursor: pointer;
}

.cal-popover {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-size: 0.8rem;
    text-align: left;
}

@media (prefers-color-scheme: dark) {
    .cal-popover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

.cal-popover-item {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--color-divider);
}

.cal-popover-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cal-popover-title {
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.cal-popover-time {
    color: var(--color-muted);
    font-size: 0.75rem;
}

/* ===== Severity Borders ===== */
.severity-urgent {
    border-left: 4px solid #DC2626;
}

.severity-high {
    border-left: 4px solid #F59E0B;
}

.severity-medium {
    border-left: 4px solid #FBBF24;
}

.severity-low {
    border-left: 4px solid #38BDF8;
}

/* ===== Collapsible Sections ===== */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0;
    user-select: none;
}

.collapsible-header h3 {
    margin: 0;
}

.collapsible-chevron {
    font-size: 0.85rem;
    transition: transform 0.25s ease;
    color: var(--color-muted);
}

.collapsible-header[aria-expanded="true"] .collapsible-chevron {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.collapsible-content.expanded {
    max-height: 2000px;
}

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-message {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.empty-state-hint {
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--color-surface-variant) 25%, var(--color-border) 50%, var(--color-surface-variant) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-lg {
    height: 2rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-sm {
    height: 0.75rem;
    width: 40%;
}

/* ===== Dashboard Section Headers ===== */
.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title span:first-child {
    font-size: 1rem;
}

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

.page-header h1 {
    font-size: clamp(28px, 4vw, 36px);
    letter-spacing: -0.04em;
    margin-bottom: 2px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--color-muted);
    margin: 0;
}

/* ===== New Calendar Grid ===== */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    transition: all .12s ease;
}

.cal-nav-btn:hover {
    background: var(--color-surface-variant);
    text-decoration: none;
    color: var(--color-text);
}

.cal-nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-nav-month {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
}

.cal-today-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    transition: all .12s ease;
}

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

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--color-surface);
    margin-bottom: 1.5rem;
}

.cal-head {
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    background: var(--color-surface-variant);
    border-bottom: 1px solid var(--color-border);
}

.cal-cell {
    padding: 6px 4px 8px;
    min-height: 80px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    position: relative;
    cursor: default;
    transition: background .12s ease;
}

.cal-cell:nth-child(7n+7) {
    border-right: none;
}

.cal-grid > .cal-cell:nth-last-child(-n+7) {
    border-bottom: none;
}

.cal-cell:hover {
    background: var(--color-surface-variant);
}

.cal-other {
    opacity: 0.3;
}

.cal-today {
    background: rgba(45, 138, 110, 0.04);
}

.cal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
}

.cal-today .cal-num {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
}

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cal-evt {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(45, 138, 110, 0.06);
    line-height: 1.4;
}

.cal-evt-more {
    color: var(--color-muted);
    background: none;
    font-size: 10px;
}

.cal-has-events {
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .cal-today {
        background: rgba(90, 191, 160, 0.06);
    }
    .cal-evt {
        background: rgba(90, 191, 160, 0.08);
    }
}

/* ===== Event List (AMM-style date boxes) ===== */
.ev-group {
    margin-bottom: 2rem;
}

.ev-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.ev-group-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ev-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    transition: all .2s ease;
}

.ev-item:hover {
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.ev-date-box {
    width: 52px;
    height: 52px;
    background: var(--color-surface-variant);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ev-date-mo {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    line-height: 1;
}

.ev-date-dy {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.ev-item-body {
    flex: 1;
    min-width: 0;
}

.ev-item-title {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.ev-item-meta {
    font-size: 12px;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ev-item-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-border);
    flex-shrink: 0;
}

/* ===== Schedule Stats ===== */
.sched-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.sched-stat {
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.sched-stat-val {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 4px;
}

.sched-stat-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
}

/* ===== Next Up Card ===== */
.sched-next {
    background: var(--color-surface);
    border: 1px solid var(--color-primary);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 1.25rem;
    position: relative;
}

.sched-next-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.sched-next-family {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.sched-next-meta {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sched-next-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== Schedule Timeline ===== */
.sched-timeline {
    position: relative;
    padding-left: 20px;
    margin-bottom: 1.5rem;
}

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

.sched-tl-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-left: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    margin-bottom: 8px;
    transition: all .2s ease;
}

.sched-tl-item:hover {
    border-color: var(--color-outline);
}

.sched-tl-dot {
    position: absolute;
    left: -27px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    z-index: 1;
}

.sched-tl-current .sched-tl-dot {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(45, 138, 110, 0.15);
}

.sched-tl-current {
    border-color: var(--color-primary);
    background: rgba(45, 138, 110, 0.03);
}

.sched-tl-past {
    opacity: 0.45;
}

.sched-tl-date {
    flex-shrink: 0;
    width: 70px;
    font-size: 12.5px;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
}

.sched-tl-day {
    font-weight: 700;
    color: var(--color-text);
    font-size: 13px;
}

.sched-tl-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.sched-tl-name {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

@media (prefers-color-scheme: dark) {
    .sched-tl-current {
        background: rgba(90, 191, 160, 0.04);
    }
    .sched-tl-current .sched-tl-dot {
        box-shadow: 0 0 0 4px rgba(90, 191, 160, 0.15);
    }
}

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

    .nav-links {
        flex-direction: column;
        width: 100%;
        padding-bottom: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding-bottom 0.3s ease;
    }

    .nav-links.open {
        max-height: 200px;
        padding-bottom: 0.5rem;
    }

    .nav-links a {
        padding: 0.65rem 0.6rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .container {
        padding: 1rem 0.75rem;
    }

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

    th, td {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }

    table {
        font-size: 0.85rem;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .contact-methods {
        justify-content: center;
    }

    .calendar-grid .cal-day {
        min-height: 50px;
        padding: 0.25rem 0.15rem;
    }

    .calendar-grid .cal-day .day-num {
        font-size: 0.75rem;
    }

    .calendar-grid .cal-day .event-label {
        display: none;
    }

    .status-summary {
        flex-direction: column;
    }

    .cal-cell {
        min-height: 50px;
        padding: 4px 2px 6px;
    }

    .cal-num {
        font-size: 11px;
        width: 24px;
        height: 24px;
    }

    .cal-evt {
        display: none;
    }

    .ev-item {
        gap: 12px;
        padding: 12px;
    }

    .ev-date-box {
        width: 44px;
        height: 44px;
    }

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

    .sched-stats {
        gap: 8px;
    }

    .sched-stat {
        padding: 12px 8px;
    }

    .sched-stat-val {
        font-size: 22px;
    }

    .sched-next {
        padding: 16px;
    }

    .sched-next-family {
        font-size: 18px;
    }

    .sched-tl-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px;
    }

    .sched-tl-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sched-tl-date {
        flex-direction: row;
        gap: 6px;
        width: auto;
    }
}
