:root {
    --primary: #4a2c7a;
    --primary-light: #6b4a9e;
    --primary-dark: #3a1c6a;
    --cream: #faf8f3;
    --cream-dark: #f0ece3;
    --accent: #c75d38;
    --accent-light: #e07a55;
    --gold: #b8926a;
    --gold-light: #d4b896;
    --ink: #2c2c2c;
    --ink-light: #5a5a5a;
    --ink-muted: #8a8a7a;
    --success: #28a745;
    --success-light: #e8f5eb;
    --border: #d4cfc2;
    --shadow: rgba(74, 44, 122, 0.08);
    --shadow-hover: rgba(74, 44, 122, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    min-height: 100vh;
    position: relative;
}

/* Subtle paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.9;
}

.logo .book-icon {
    width: 40px;
    height: 40px;
}

.logo .book-icon svg {
    width: 100%;
    height: 100%;
}

.logo .wordmark {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: -0.01em;
}

.logo .wordmark span {
    font-weight: 400;
    opacity: 0.7;
}

.header-meta {
    color: var(--cream);
    opacity: 0.7;
    font-size: 0.85rem;
    font-weight: 300;
}

/* User Account Area */
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-link {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.auth-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-link.primary {
    background: var(--gold);
    color: var(--ink);
}

.auth-link.primary:hover {
    background: var(--gold-light);
}

/* User Menu (logged in state) */
.user-menu {
    position: relative;
    display: none;
}

.user-menu.active {
    display: block;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
}

.user-name {
    color: var(--cream);
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    color: var(--cream);
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--cream);
}

.dropdown-header-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
}

.dropdown-header-email {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-top: 2px;
}

.dropdown-menu {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--cream);
}

.dropdown-item svg {
    opacity: 0.6;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.dropdown-item.danger {
    color: var(--accent);
}

.dropdown-item.danger:hover {
    background: #fef2f0;
}

/* Auth Modal */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0);
}

.auth-modal-header {
    padding: 24px 24px 0;
    text-align: center;
}

.auth-modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-modal-header p {
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--cream);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.auth-modal-close:hover {
    background: var(--cream-dark);
}

.auth-modal-body {
    padding: 24px;
}

.auth-modal-hint {
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* My Lesson Plans Modal */
.plans-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    padding: 20px;
}

.plans-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.plans-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.plans-modal-overlay.active .plans-modal {
    transform: translateY(0);
}

.plans-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.plans-modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--primary);
    margin: 0;
}

.plans-new-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Source Sans 3', sans-serif;
    transition: background 0.2s;
}

.plans-new-btn:hover {
    background: var(--primary-light);
}

.plans-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.plans-search svg {
    color: var(--ink-muted);
    flex-shrink: 0;
}

.plans-search input {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--ink);
    width: 100%;
    outline: none;
    font-family: 'Source Sans 3', sans-serif;
}

.plans-search input::placeholder {
    color: var(--ink-muted);
}

.plans-modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.plans-loading,
.plans-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--ink-muted);
}

.plans-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.plans-empty svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.plans-empty p {
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 4px;
}

.plans-empty span {
    font-size: 0.9rem;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-card {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.plan-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.plan-card-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.3;
    flex: 1;
}

.plan-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.plan-card-btn {
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.plan-card-btn:hover {
    background: var(--cream-dark);
    color: var(--primary);
}

.plan-card-btn.delete {
    color: var(--accent);
}

.plan-card-btn.delete:hover {
    background: #fef2f0;
}

.plan-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.plan-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-card-meta svg {
    opacity: 0.6;
}

/* Save Notification */
.save-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ink);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.save-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.save-notification.success {
    background: var(--success);
}

.save-notification.error {
    background: var(--accent);
}

/* Draft Restore Prompt */
.draft-restore-prompt {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: white;
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(74, 44, 122, 0.2);
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    width: 440px;
    border: 2px solid var(--primary-light);
}

.draft-restore-prompt.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.draft-restore-content p {
    margin: 0 0 8px 0;
    color: var(--ink);
    font-size: 1.1rem;
}

.draft-restore-content .draft-info {
    font-size: 1rem;
    color: var(--ink-muted);
    margin-bottom: 20px;
}

.draft-restore-actions {
    display: flex;
    gap: 12px;
}

.draft-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.draft-btn.restore {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(74, 44, 122, 0.3);
}

.draft-btn.restore:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 44, 122, 0.35);
}

.draft-btn.dismiss {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

/* Save Button in Header */
.save-btn {
    background: var(--gold);
    border: none;
    color: var(--ink);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Source Sans 3', sans-serif;
}

.save-btn:hover {
    background: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-btn.saved {
    background: var(--success-light);
    color: var(--success);
}

.save-btn.saved:hover {
    background: var(--success-light);
    transform: none;
    box-shadow: none;
}

/* Progress Container */
.progress-container {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 28px 40px;
    position: relative;
    z-index: 1;
}

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

.progress-nav {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 20px;
}

.progress-bar-line {
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.progress-bar-fill {
    position: absolute;
    top: 20px;
    left: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    z-index: 2;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 3;
    cursor: pointer;
    padding: 0 4px;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-nav-item:hover .progress-step {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
    border-color: var(--primary-light);
    color: var(--primary);
}

.progress-step.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(74, 44, 122, 0.3);
}

.progress-step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-label {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--ink-muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.progress-nav-item:hover .progress-label {
    color: var(--primary);
}

.progress-label.active {
    color: var(--primary);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px var(--shadow), 0 1px 3px rgba(0,0,0,0.04);
    padding: 48px;
    animation: fadeSlideIn 0.4s ease;
}

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

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.tab-intro {
    color: var(--ink-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent);
    border-radius: 2px;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--ink);
    margin-bottom: 8px;
}

.label-hint {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-muted);
    display: block;
    margin-top: 4px;
}

#lessonPlanForm input[type="text"],
#lessonPlanForm input[type="date"],
#lessonPlanForm input[type="time"],
#lessonPlanForm input[type="number"],
#lessonPlanForm textarea,
#lessonPlanForm select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: var(--ink);
    background: white;
    transition: all 0.2s ease;
}

#lessonPlanForm input:focus,
#lessonPlanForm textarea:focus,
#lessonPlanForm select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(74, 44, 122, 0.08);
}

#lessonPlanForm input.has-value,
#lessonPlanForm textarea.has-value,
#lessonPlanForm select.has-value {
    border-color: var(--success);
    background: var(--success-light);
}

#lessonPlanForm input::placeholder,
#lessonPlanForm textarea::placeholder {
    color: var(--ink-muted);
    font-weight: 300;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

textarea.small {
    min-height: 90px;
}

textarea.large {
    min-height: 180px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a5a5a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

/* Section Divider */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 36px 0;
}

/* Activity Cards */
.activities-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.activity-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.activity-card-header {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.activity-card-header-left {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex: 1;
}

.activity-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    opacity: 0.8;
    line-height: 1;
    padding-bottom: 4px;
}

.activity-header-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-header-field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    color: var(--gold-light);
}

.activity-header-field input,
.activity-header-field select {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.activity-header-field input::placeholder {
    color: rgba(255,255,255,0.5);
}

.activity-header-field input[type="time"] {
    width: 100px;
}

.activity-header-field select {
    min-width: 140px;
}

.activity-header-field select option {
    color: var(--ink);
    background: white;
}

.activity-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.activity-field textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--cream);
    transition: border-color 0.2s, background 0.2s;
}

.activity-field textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
}

.activity-field textarea::placeholder {
    color: var(--ink-muted);
}

.remove-activity-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-activity-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.add-row-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    cursor: pointer;
    border-radius: 10px;
    margin-top: 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.add-row-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* Reflection Grid */
.reflection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.reflection-grid .form-group {
    display: flex;
    flex-direction: column;
}

.reflection-grid .form-group label {
    min-height: 60px;
    height: 60px;
    margin-bottom: 8px;
}

.reflection-grid textarea {
    min-height: 140px;
}

/* Navigation Buttons */
.nav-buttons {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 60px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.nav-btn {
    padding: 16px 36px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.prev {
    background: white;
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.nav-btn.prev:hover {
    background: var(--cream-dark);
    border-color: var(--ink-muted);
}

.nav-btn.next {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(74, 44, 122, 0.25);
}

.nav-btn.next:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(74, 44, 122, 0.3);
}

.nav-btn.submit {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(74, 44, 122, 0.25);
}

.nav-btn.submit:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(74, 44, 122, 0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn.hidden {
    visibility: hidden;
}

/* Welcome Page */
.welcome-container {
    text-align: center;
    padding: 20px 0;
}

.welcome-container h2 {
    font-size: 2.25rem;
    margin-bottom: 12px;
}

.welcome-intro {
    color: var(--ink-light);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.welcome-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.welcome-btn {
    padding: 18px 36px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.welcome-btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(74, 44, 122, 0.3);
}

.welcome-btn.primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 44, 122, 0.35);
}

.welcome-btn.secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

.sample-dropdown {
    position: relative;
}

.sample-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    z-index: 100;
    overflow: hidden;
    border: 1px solid var(--border);
}

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

.sample-dropdown-item {
    display: block;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--ink);
}

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

.sample-dropdown-item:hover {
    background: var(--cream);
}

.sample-dropdown-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.sample-dropdown-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.sample-preview {
    text-align: left;
    background: var(--cream);
    border-radius: 16px;
    padding: 32px;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.sample-preview h3 {
    margin-top: 0;
    font-size: 1.3rem;
}

.sample-preview h3::before {
    display: none;
}

.sample-preview > p {
    color: var(--ink-muted);
    margin-bottom: 28px;
}

.sample-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.sample-info-item {
    background: white;
    padding: 16px;
    border-radius: 10px;
    border-left: 3px solid var(--primary);
}

.sample-info-item strong {
    display: block;
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.sample-activities {
    margin-top: 28px;
}

.sample-activities h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.sample-activity {
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.sample-activity-phase {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.sample-activity-time {
    color: var(--ink-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
}

.sample-activity span:last-child {
    flex: 1;
    color: var(--ink);
}

/* Preview Pages */
.preview-container {
    max-width: 100%;
}

.preview-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 28px 32px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.preview-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.preview-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    letter-spacing: -0.01em;
}

.preview-header p {
    margin: 8px 0 0;
    font-size: 0.9rem;
    opacity: 0.85;
    position: relative;
}

.preview-section {
    margin-bottom: 20px;
}

h2.preview-section-title {
    font-family: 'Playfair Display', serif;
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.preview-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-table th,
.preview-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
}

.preview-th {
    background: var(--primary);
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.preview-th-sub {
    background: var(--cream-dark);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 12px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.preview-label {
    background: var(--cream);
    font-weight: 600;
    color: var(--ink);
    width: 150px;
    font-size: 0.85rem;
}

.preview-table td {
    border-bottom: 1px solid var(--border);
    white-space: pre-line;
}

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

.info-table td {
    padding: 12px 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: var(--cream);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.info-grid-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-grid-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-grid-value {
    font-size: 0.95rem;
    color: var(--ink);
}

.activities-stacked {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.activity-block-header {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.activity-time {
    font-weight: 600;
    min-width: 50px;
}

.activity-phase {
    font-weight: 500;
}

.activity-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.activity-detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.4;
}

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

.activity-detail-table .activity-label {
    background: var(--cream-dark);
    width: 90px;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.85rem;
}

.activity-detail-table .activity-value {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.print-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.print-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(74, 44, 122, 0.25);
}

.print-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.edit-btn {
    background: white;
    color: var(--ink);
    border: 1.5px solid var(--border);
    padding: 12px 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: var(--cream-dark);
    border-color: var(--ink-muted);
}

.print-actions .nav-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.page-break {
    page-break-before: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        padding: 16px 20px;
    }

    .header-meta {
        display: none;
    }

    /* User area mobile */
    .auth-links {
        gap: 4px;
    }

    .auth-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .user-name {
        display: none;
    }

    .user-menu-trigger {
        padding: 4px;
        border-radius: 50%;
    }

    .user-menu-arrow {
        display: none;
    }

    .save-btn {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }

    .save-btn svg {
        width: 20px;
        height: 20px;
    }

    .user-dropdown {
        right: -8px;
        min-width: 220px;
    }

    .progress-container {
        padding: 20px;
    }

    .progress-nav {
        padding: 0;
    }

    .progress-nav-item {
        justify-content: flex-start;
    }

    .progress-step {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .progress-label {
        font-size: 0.6rem;
        margin-top: 6px;
    }

    .progress-bar-line,
    .progress-bar-fill {
        top: 16px;
        left: 40px;
        right: 40px;
    }

    .main-content {
        padding: 20px;
    }

    .tab-content {
        padding: 28px 24px;
        border-radius: 12px;
    }

    .tab-content h2 {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .nav-buttons {
        padding: 0 20px 40px;
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-btn.hidden {
        display: none;
    }

    .welcome-actions {
        flex-direction: column;
        padding: 0 20px;
    }

    .welcome-btn {
        width: 100%;
        justify-content: center;
    }

    .print-actions {
        flex-direction: column;
    }

    .print-btn,
    .edit-btn {
        width: 100%;
        justify-content: center;
    }

    /* Logo */
    .logo .wordmark {
        font-size: 1.1rem;
    }

    .logo .book-icon {
        width: 32px;
        height: 32px;
    }

    /* Welcome page */
    .welcome-container h2 {
        font-size: 1.75rem;
    }

    .sample-info {
        grid-template-columns: 1fr;
    }

    .sample-activities h4 {
        font-size: 0.9rem;
    }

    /* Activity cards */
    .activity-card-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .activity-card-header-left {
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .activity-header-field {
        flex: 1;
        min-width: 100px;
    }

    .remove-activity-btn {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .activity-card-header {
        position: relative;
        padding-right: 50px;
    }

    /* Preview tables */
    .preview-table {
        font-size: 0.8rem;
    }

    .preview-container {
        padding: 16px;
    }

    .preview-header h1 {
        font-size: 1.3rem;
    }

    .info-table td,
    .info-table th {
        display: block;
        width: 100%;
    }

    .preview-label {
        width: 100%;
        border-bottom: none;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-block-header {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .activity-details {
        padding: 10px;
        font-size: 0.85rem;
    }

    .activity-label {
        font-size: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .progress-label {
        display: none;
    }

    .progress-step {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .progress-bar-line,
    .progress-bar-fill {
        top: 14px;
        left: 20px;
        right: 20px;
    }

    .tab-content {
        padding: 20px 16px;
    }

    .activity-header-field {
        min-width: 80px;
    }

    .activity-header-field select {
        min-width: 120px;
        font-size: 0.85rem;
    }
}
