:root {
    /* Theme: Light mode with Warm palette */
    --bg-main: #FFF5F0;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFF0E8;

    --primary: #E17055;
    --primary-hover: #D65A3D;
    --primary-light: rgba(225, 112, 85, 0.1);

    --secondary: #FAB1A0;
    --accent: #00CEC9;
    --accent-light: rgba(0, 206, 201, 0.1);

    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;

    --border: #FFE0D3;
    --border-strong: #FFCCB5;

    --alert: #FF7675;
    --alert-light: rgba(255, 118, 117, 0.1);
    --warning: #FDCB6E;
    --warning-light: rgba(253, 203, 110, 0.2);
    --success: #00B894;
    --success-light: rgba(0, 184, 148, 0.1);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 8px rgba(225, 112, 85, 0.05);
    --shadow-md: 0 8px 24px rgba(225, 112, 85, 0.1);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: 250ms ease;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.mb-2 {
    margin-bottom: 0.5rem;
}

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

.mb-6 {
    margin-bottom: 1.5rem;
}

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

.spacer {
    flex: 1;
}

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

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

.text-warning {
    color: var(--warning);
    color: #D35400;
    /* darker for readability on light */
}

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

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    color: var(--primary);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.brand span {
    color: var(--primary);
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background-color: var(--bg-elevated);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-light);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--bg-surface);
}

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

.btn-success:hover {
    background-color: #00A181;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    position: relative;
}

.view-section {
    display: none;
    animation: fadeIn var(--transition);
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.alert {
    background-color: var(--alert-light);
    color: var(--alert);
}

.stat-icon.warning {
    background-color: var(--warning-light);
    color: #D35400;
}

.stat-icon.info {
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard Panels */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-panel {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background-color: #FAFAFA;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* List Items (Dashboard/Tasks) */
.task-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    transition: var(--transition);
    gap: 16px;
}

.task-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.task-item.status-overdue {
    border-left: 4px solid var(--alert);
}

.task-item.status-upcoming {
    border-left: 4px solid var(--warning);
}

.task-item.status-good {
    border-left: 4px solid var(--success);
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.task-badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-category {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.badge-alert {
    background: var(--alert-light);
    color: var(--alert);
}

.badge-warning {
    background: var(--warning-light);
    color: #D35400;
}

.task-actions {
    display: flex;
    gap: 8px;
}

/* Seasonal Checklist */
.seasonal-list {
    padding: 16px 20px;
}

.season-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.season-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.season-item i {
    color: var(--accent);
    margin-top: 2px;
}

/* Cards Grid (All Tasks, Templates) */
.filters {
    display: flex;
    gap: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus,
.select-input:focus {
    border-color: var(--primary);
}

.select-input {
    padding: 10px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    background-color: var(--bg-surface);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.card-body {
    flex: 1;
}

.detail-row {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* History Table */
.history-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background-color: #FAFAFA;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.95rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.photo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
}

.photo-thumb:hover {
    border-color: var(--primary);
}

/* Schedule Timeline */
.schedule-timeline {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-left: 20px;
    border-left: 2px solid var(--border);
    margin-left: 20px;
}

.timeline-month {
    position: relative;
}

.month-label {
    position: absolute;
    left: -40px;
    top: -5px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.timeline-items {
    padding-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 52, 54, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

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

.modal {
    background: var(--bg-surface);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.modal-lg {
    max-width: 800px;
}

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

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input,
.input-group textarea,
.input-group select {
    background: var(--bg-main);
    border: 1px solid var(--border-strong);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.photo-preview img {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}