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

:root {
    --sand: #f5f1eb;
    --sand-light: #faf9f7;
    --teal: #2C7A7B;
    --teal-dark: #236B6C;
    --airbnb: #E57474;
    --airbnb-light: #FAE8E8;
    --vrbo: #5B9BD5;
    --vrbo-light: #E8F4FC;
    --cleaning: #C8A951;
    --cleaning-light: #FBF8E8;
    --overlap: #8B5CF6;
    --overlap-light: #F3EDFE;
    --success: #48BB78;
    --danger: #E53E3E;
    --text-dark: #2D3748;
    --text-muted: #718096;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--sand);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

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

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo .tagline {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.last-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.cache-warning {
    color: #C05621;
    font-weight: 500;
    display: block;
    margin-top: 0.25rem;
}

.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.airbnb { background-color: var(--airbnb); }
.legend-color.vrbo { background-color: var(--vrbo); }
.legend-color.cleaning { background-color: var(--cleaning); }
.legend-color.overlap {
    background: linear-gradient(135deg, var(--overlap) 50%, var(--airbnb) 50%);
}
.legend-color.today {
    background-color: var(--teal);
    border: 2px solid var(--teal-dark);
}

.calendar-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
}

.calendar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--sand-light);
    border-bottom: 1px solid #E2E8F0;
}

.calendar-day-header {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #E2E8F0;
}

.calendar-day {
    background: var(--white);
    min-height: 80px;
    padding: 0.5rem;
    position: relative;
}

.calendar-day.other-month {
    background: var(--sand-light);
}

.calendar-day.other-month .day-number {
    color: #A0AEC0;
}

.calendar-day.today .day-number {
    background: var(--teal);
    color: var(--white);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.1s;
}

.event-pill:hover {
    transform: scale(1.02);
}

.event-pill.airbnb {
    background: var(--airbnb-light);
    color: #C53030;
    border-left: 3px solid var(--airbnb);
}

.event-pill.vrbo {
    background: var(--vrbo-light);
    color: #2B6CB0;
    border-left: 3px solid var(--vrbo);
}

.event-pill.cleaning {
    background: var(--cleaning-light);
    color: #8B6914;
    border-left: 3px solid var(--cleaning);
}

.event-pill.overlap {
    background: var(--overlap-light);
    color: #6B21A8;
    border-left: 3px solid var(--overlap);
}

.event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

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

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

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--teal);
}

.modal-content p {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

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

.event-note {
    background: var(--sand-light);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.site-footer {
    background: var(--teal-dark);
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

.site-footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.site-footer .footer-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

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

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.flash-success {
    background: #C6F6D5;
    color: #22543D;
    border: 1px solid #9AE6B4;
}

.flash-error {
    background: #FED7D7;
    color: #822727;
    border: 1px solid #FEB2B2;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-card h2 {
    color: var(--teal);
    margin-bottom: 0.5rem;
}

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

.login-form .form-group {
    text-align: left;
    margin-bottom: 1rem;
}

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

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.1);
}

.back-link {
    margin-top: 1.5rem;
}

.back-link a {
    color: var(--teal);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link a:hover {
    text-decoration: underline;
}

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

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

.admin-section h3 {
    color: var(--teal);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.admin-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-section .setting-note {
    font-style: italic;
    font-size: 0.85rem;
}

.cleaning-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

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

.cleaning-section h3 {
    color: var(--teal);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.cleaning-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cleaning-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--sand-light);
    border-radius: var(--radius-sm);
    gap: 1rem;
}

.cleaning-item.past {
    opacity: 0.7;
}

.cleaning-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cleaning-info strong {
    color: var(--text-dark);
}

.cleaning-info .cleaning-title {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cleaning-info .cleaning-note {
    font-size: 0.85rem;
    color: var(--teal);
    font-style: italic;
}

.cleaning-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.inline-form {
    display: inline;
}

.empty-message {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(44, 122, 123, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: #E2E8F0;
    color: var(--text-dark);
}

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

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

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

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

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

.btn-edit:hover {
    background: #2B6CB0;
}

.cleaning-form {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.year {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .main-nav {
        justify-content: center;
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.8rem;
    }

    .event-pill {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .legend {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .legend-item {
        font-size: 0.8rem;
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }

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

    .cleaning-sections {
        grid-template-columns: 1fr;
    }

    .cleaning-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cleaning-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .calendar-header h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 1rem 0;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .calendar-day {
        min-height: 50px;
    }

    .event-pill {
        display: none;
    }

    .event-pill:first-child {
        display: block;
    }
}