:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;

    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg);
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.main-nav {
    background: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary);
    background: #eff6ff;
}

.nav-link.active {
    color: var(--primary);
    background: #dbeafe;
}

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

section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

section.active {
    display: block;
}

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

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.25rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

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

/* Forms & Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input,
select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

.schedule-row {
    display: flex;
    align-items: flex-end;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
}

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

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

.btn-danger:hover {
    opacity: 0.9;
}

/* Dashboard Specifics */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Grids & Lists */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.day-row {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.day-name {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
}

.day-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.option-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

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

.child-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.child-name-tag {
    font-weight: 600;
}

.status-badge {
    background: #dbeafe;
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Trip Summary */
.trip-summary {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary);
}

.summary-list {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Notes & Labels */
.summary-name,
.child-name-item {
    position: relative;
    cursor: help;
}

.has-note {
    color: var(--primary);
    text-decoration: underline dotted;
}

.note-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    width: 200px;
    z-index: 100;
    margin-bottom: 8px;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.note-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.summary-name:hover .note-popup,
.child-name-item:hover .note-popup {
    display: block;
}

.option-group.full-width {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.notes-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Overview Controls */
.overview-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Stop List & Cards */
.stop-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stop-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
}

.stop-header {
    background: #f1f5f9;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.stop-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.stop-index {
    background: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.stop-details {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-group {
    padding: 0.75rem;
    border-radius: 8px;
}

.action-group.enter {
    background: #ecfdf5;
    border-left: 4px solid var(--success);
}

.action-group.exit {
    background: #fef2f2;
    border-left: 4px solid var(--danger);
}

.action-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.action-group.enter .action-label {
    color: #065f46;
}

.action-group.exit .action-label {
    color: #991b1b;
}

.action-names {
    font-weight: 600;
    color: var(--text-main);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .nav-link {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .main-nav {
        gap: 0.5rem;
        padding: 1rem;
    }

    .day-options {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.5rem;
    }

    .overview-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .note-popup {
        width: 160px;
        left: 0;
        transform: none;
    }

    .note-popup::after {
        left: 20px;
    }
}