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

:root {
    --primary: #4a6fa5;
    --primary-dark: #3a5a8a;
    --accent: #e8913a;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #777777;
    --border: #e0e0e0;
    --success: #4caf50;
    --radius: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header & Nav */
header {
    background:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 7px,
            rgba(255, 255, 255, 0.07) 7px,
            rgba(255, 255, 255, 0.07) 8px
        ),
        linear-gradient(135deg, #3a5a8a 0%, #4a6fa5 40%, #5a82b5 70%, #4a6fa5 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.nav-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Patrick Hand', cursive;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.brand-icon {
    font-size: 1.4rem;
    margin-right: 2px;
    vertical-align: -1px;
    opacity: 0.85;
}

.brand-short { display: none; }

@media (max-width: 480px) {
    .brand-full { display: none; }
    .brand-short { display: inline; }
}

.nav-back {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 12px 8px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-back:active {
    opacity: 0.7;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:active {
    opacity: 0.7;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 200;
    overflow: hidden;
}

.nav-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
}

.nav-dropdown-menu a:active {
    background: var(--bg);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

/* Main Content */
main {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Avatars */
.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar--card {
    width: 64px;
    height: 64px;
    margin-right: 12px;
}

.avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f0fe;
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 700;
}

.avatar--card.avatar--placeholder {
    font-size: 1.5rem;
}

.child-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.child-header h1 {
    margin-bottom: 0;
}

.child-header .subtitle {
    margin-bottom: 0;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.avatar-upload-form {
    position: absolute;
    bottom: -2px;
    right: -2px;
}

.avatar-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.avatar-upload-btn::after {
    content: '\270E';
    font-size: 0.85rem;
}

.avatar-upload-btn input[type="file"] {
    display: none;
}

/* Child Cards (Dashboard) */
.card-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.child-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s;
}

.child-card:active {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.child-card--girl {
    border-left: 4px solid #e8a0bf;
    background: linear-gradient(135deg, #fff5f9 0%, #ffffff 40%);
}

.child-card--girl .grade {
    color: #c2627a;
}

.child-card--girl .age-badge {
    color: #c2627a;
    background: #fce4ec;
}

.child-card--girl .progress-fill--standards {
    background: #e8a0bf;
}

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

.child-card h2 {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.child-card .grade {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.age-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 10px;
}

.last-active {
    font-size: 0.7rem;
    color: var(--text-light);
}

.subject-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.subject-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-light);
}

.subject-chip--done {
    background: #e8f5e9;
    color: var(--success);
}

.subject-chip-name {
    font-weight: 600;
}

.subject-chip-pct {
    font-weight: 400;
}

/* Dual Progress Bars */
.dual-progress {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.child-progress {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 72px;
    flex-shrink: 0;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill--year {
    background: var(--accent);
}

.progress-fill--standards {
    background: var(--success);
}

.progress-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 100px;
    text-align: right;
    flex-shrink: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    min-height: 44px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* Grade Toggle */
.grade-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.grade-toggle .filter-btn {
    font-size: 0.85rem;
    padding: 6px 14px;
}

.preview-label {
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
    margin-left: 4px;
}

.preview-banner {
    font-size: 0.8rem;
    color: var(--accent);
    background: #fff3e0;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
}

/* Subject Dropdown */
.subject-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    min-height: 44px;
    margin-bottom: 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.subject-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

/* Subject Filter Pills */
.subject-filter, .filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
    min-height: 44px;
    display: flex;
    align-items: center;
}

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

/* Subject Note */
.subject-note {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 12px;
}

/* Checklist */
.checklist {
    display: flex;
    flex-direction: column;
}

.category-heading {
    font-size: 0.95rem;
    color: var(--primary-dark);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    min-height: 44px;
}

.checklist-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--success);
}

.check-code {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-shrink: 0;
    min-width: 60px;
}

.check-desc {
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
}

/* Priority emphasis */
.checklist-item--priority {
    background: #fffbf0;
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.priority-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: #fff3e0;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
}

/* Pin Button & Checklist Row */
.checklist-row {
    display: flex;
    align-items: flex-start;
}

.checklist-row .checklist-item {
    flex: 1;
    min-width: 0;
}

.pin-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 12px 6px;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border);
}

.pin-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--border);
    stroke-width: 2;
}

.pin-btn.pinned svg {
    fill: var(--primary);
    stroke: var(--primary);
}

.pin-btn:active {
    opacity: 0.6;
}

/* Lesson Plan */
.lesson-plan-group {
    margin-bottom: 24px;
}

.lesson-plan-child {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.avatar--inline {
    width: 28px;
    height: 28px;
}

/* Notice / Warning */
.notice {
    background: #fff3e0;
    border-left: 4px solid var(--accent);
    color: var(--text);
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 16px 0;
}

.notice a {
    color: var(--primary);
    font-weight: 600;
}

/* Forms */
.link-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-full {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    min-height: 44px;
    font-family: inherit;
}

.input-full:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    min-height: 44px;
    font-family: inherit;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
    font-family: inherit;
}

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

.btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:active {
    background: var(--border);
}

/* Link List */
.link-list {
    list-style: none;
}

.link-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.link-url {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    word-break: break-word;
}

.link-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}


/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 40px 16px;
    font-size: 1rem;
}

/* Todo Section */
.todo-section {
    margin-top: 12px;
}

.todo-list {
    display: flex;
    flex-direction: column;
}

.todo-text {
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
}

.todo-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
}

/* Completed collapse — todos and standards */
.checklist-item.completed {
    padding-top: 6px;
    padding-bottom: 6px;
    min-height: 32px;
    opacity: 0.55;
}

.checklist-item.completed .check-desc,
.checklist-item.completed .todo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

.checklist-item.completed .priority-badge {
    display: none;
}

/* Completed group (details/summary) */
.completed-group {
    margin-top: 8px;
}

.completed-summary {
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px 4px;
    font-weight: 600;
}

.clear-done-form {
    text-align: right;
    padding: 6px 4px;
}

.btn-clear-done {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
}

.btn-clear-done:active {
    background: var(--border);
}

/* Utility for child view buttons */
#tab-links .btn {
    display: block;
    margin-bottom: 10px;
}

/* Resources Page */
.section-heading {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.section-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.resource-list {
    list-style: none;
    margin-bottom: 16px;
}

.resource-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
}

.resource-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.resource-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.4;
}

.resource-new-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: var(--success);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.resource-tags {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 6px;
}

/* Resource controls (show hidden toggle) */
.resource-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.show-hidden-toggle {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.show-hidden-toggle input {
    accent-color: var(--primary);
}

/* Star & hide action buttons */
.resource-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.resource-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 0;
}

.resource-btn:active {
    background: var(--bg);
}

.resource-btn-star {
    color: #f5a623;
}

.resource-btn-hide {
    color: #999;
    font-size: 0.85rem;
}

/* Starred resource highlight */
.resource-starred {
    border-left: 3px solid #f5a623;
    background: linear-gradient(135deg, #fffdf5 0%, #ffffff 30%);
}

/* Hidden resources */
.resource-hidden {
    display: none;
}

body.show-hidden-resources .resource-hidden {
    display: block;
    opacity: 0.45;
    border-left: 3px solid #ccc;
}

/* Offset link/desc for action buttons */
.resource-item .resource-link,
.resource-item .resource-desc {
    padding-right: 76px;
}

/* Timeline Section */
.timeline-section {
    margin-top: 24px;
}

.timeline-heading {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.timeline {
    position: relative;
    padding-left: 20px;
}

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

.timeline-event {
    position: relative;
    margin-bottom: 6px;
    padding-left: 16px;
}

.timeline-event--past {
    opacity: 0.45;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-light);
    border: 2px solid var(--bg);
    z-index: 1;
}

.timeline-dot--testing { background: #e53935; }
.timeline-dot--sports { background: #43a047; }
.timeline-dot--enrollment { background: #1e88e5; }
.timeline-dot--convention { background: #8e24aa; }
.timeline-dot--deadline { background: #fb8c00; }
.timeline-dot--other { background: #9e9e9e; }

.timeline-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.timeline-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.timeline-category--testing { background: #e53935; }
.timeline-category--sports { background: #43a047; }
.timeline-category--enrollment { background: #1e88e5; }
.timeline-category--convention { background: #8e24aa; }
.timeline-category--deadline { background: #fb8c00; }
.timeline-category--other { background: #9e9e9e; }

.timeline-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-delete:active {
    color: #e53935;
}

/* Shared / Public badge */
.shared-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: #8e24aa;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}

.timeline-share, .link-share-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 4px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-share:active, .link-share-btn:active {
    opacity: 0.6;
}

.timeline-event--shared .timeline-card {
    border-left: 3px solid #8e24aa;
    background: linear-gradient(135deg, #f9f0ff 0%, #ffffff 30%);
}

.link-item--shared {
    border-left: 3px solid #8e24aa;
    background: linear-gradient(135deg, #f9f0ff 0%, #ffffff 30%);
}

.link-share-btn {
    display: inline-flex;
    margin-left: 6px;
    vertical-align: middle;
}

.timeline-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.timeline-notes {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Today marker */
.timeline-today {
    position: relative;
    margin: 10px 0;
    padding-left: 16px;
}

.timeline-today::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    width: 18px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 1;
}

.timeline-today-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: #fff3e0;
    padding: 3px 10px;
    border-radius: 10px;
}

/* Add event form */
.timeline-add-details {
    margin-top: 12px;
}

.timeline-add-toggle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    padding: 8px 0;
}

.timeline-add-form .form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-add-form .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Standards Browser */
.standards-group {
    margin-bottom: 8px;
}

.standards-group > .category-heading {
    cursor: pointer;
    list-style: none;
    padding: 12px 8px;
    border-bottom: none;
}

.standards-group > .category-heading::before {
    content: '\25B6';
    font-size: 0.7rem;
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.15s;
}

.standards-group[open] > .category-heading::before {
    transform: rotate(90deg);
}

.standards-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-light);
}

.subcategory-heading {
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 8px 0 4px;
    font-weight: 600;
}

.checklist-item--readonly {
    cursor: default;
    padding-left: 8px;
}

/* ===== Auth Pages ===== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand .brand-icon {
    font-size: 2rem;
}

.auth-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 8px;
}

.auth-divider {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.auth-link {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 4px;
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.btn-full {
    width: 100%;
}

/* ===== Flash Messages ===== */
.flash-messages {
    margin-bottom: 16px;
}

.flash {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.flash--error {
    background: #fce4ec;
    color: #c62828;
    border-left: 4px solid #e53935;
}

.flash--info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1e88e5;
}

.flash--success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

/* ===== Settings Page ===== */
.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.settings-card h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.invite-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.invite-code-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.invite-code {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary-dark);
    background: #e8f0fe;
    padding: 4px 12px;
    border-radius: 6px;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-copy:active {
    background: var(--primary-dark);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-danger {
    background: #e53935;
    color: white;
}

.btn-danger:active {
    background: #c62828;
}

.members-list {
    list-style: none;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.member-name {
    font-weight: 600;
}

.member-email {
    font-size: 0.8rem;
    color: var(--text-light);
}

.student-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.student-settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.student-settings-item:last-child {
    border-bottom: none;
}

.student-settings-detail {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
}

.student-settings-actions {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.inline-edit {
    position: relative;
}

.inline-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    margin-top: 8px;
    background: var(--bg);
    border-radius: 8px;
}

.inline-form {
    display: inline;
}

.add-child-details {
    margin-top: 12px;
}

/* Family Switcher */
.family-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.family-switch-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.family-switch-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-family-switcher {
    padding: 4px 16px 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-family-switcher a {
    padding: 8px 0 !important;
    font-size: 0.85rem !important;
    border-bottom: none !important;
}

.nav-family-switcher a.active {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.join-family-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.join-family-form .input-full {
    flex: 1;
}

/* Admin Panel */
.admin-section {
    margin: 1.5rem 0;
}

.admin-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.admin-card {
    background: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.admin-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.admin-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

.admin-card-members {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.admin-member {
    display: inline-block;
    margin-right: 0.5rem;
}

.admin-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: #1976d2;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
}

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

.btn-sm {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 5px;
}

.btn-danger {
    background: #e53935;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-danger:active {
    background: #c62828;
}

/* Version / Changelog */
.version-card {
    text-align: center;
}

.version-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.changelog-content {
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    max-height: 300px;
    overflow-y: auto;
    font-family: inherit;
}

/* Impersonate Banner */
.impersonate-banner {
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.85rem;
}

.impersonate-stop-btn {
    background: white;
    color: #ff9800;
    border: none;
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 8px;
}
