/* CSS Design System imported directly from rogerio.melfi.com.br + Duolingo Gamification */
:root {
    color-scheme: light dark;
    --fg: #1d1d1f;
    --bg: #fdfbf7;
    --muted: #6e6e73;
    --accent: #0a2559;
    --border: #e8e1d3;
    --card-bg: #f3ede2;
    --card-hover: #eae2d3;
    --header-bg: rgba(253, 251, 247, 0.72);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Gamification Accent Tokens */
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.2);

    --orange-flame: #f97316;
    --orange-glow: rgba(249, 115, 22, 0.25);

    --danger: #ef4444;
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --box-shadow-site: 0 8px 24px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --fg: #f3ede2;
        --bg: #0b1220;
        --muted: #9aa3b5;
        --accent: #8fb0e8;
        --border: #22304a;
        --card-bg: #131b2e;
        --card-hover: #1c2740;
        --header-bg: rgba(11, 18, 32, 0.72);

        --box-shadow-site: 0 10px 30px rgba(0, 0, 0, 0.4);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    padding-bottom: 85px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

button, input, textarea, select {
    font-family: inherit;
}

.flex-align {
    display: flex;
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Layout Structure matching .wrap */
.app-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header matching header.site from rogerio.melfi.com.br */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.5rem;
    margin: 0 -1.5rem 2rem -1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-icon {
    font-size: 1.4rem;
    margin-right: 0.5rem;
}

.app-title {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--fg);
    display: block;
    line-height: 1.1;
}

.app-subtitle {
    font-size: 0.72rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Duolingo Streak Pill Badge */
.streak-badge {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    gap: 0.35rem;
    font-weight: 700;
    color: var(--orange-flame);
}

.flame-icon {
    font-size: 1.15rem;
    animation: flamePulse 1.8s infinite ease-in-out;
}

@keyframes flamePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--orange-flame)); }
    50% { transform: scale(1.18); filter: drop-shadow(0 0 8px var(--orange-flame)); }
}

.streak-count {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 800;
}

.streak-label {
    font-size: 0.68rem;
    opacity: 0.85;
}

.day-badge {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    gap: 0.2rem;
    margin-left: 0.5rem;
}

.day-number {
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 800;
}

.logout-btn {
    color: var(--muted);
    padding: 0.4rem;
    border-radius: 50%;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Card Component matching site cards & post-cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow-site);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Hero Streak Card */
.streak-hero-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.badge-phase {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.hero-text h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.hero-subtext {
    font-size: 0.95rem;
    color: var(--muted);
}

.streak-flame-box {
    text-align: center;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-md);
}

.flame-pulse {
    font-size: 2rem;
}

.streak-num {
    display: block;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--orange-flame);
    line-height: 1;
}

.streak-text {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Progress Bar */
.progress-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.progress-header {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.progress-bar-track {
    background: rgba(0, 0, 0, 0.08);
    height: 10px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary) 0%, #34d399 100%);
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.phase-ticks {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.phase-ticks .tick.active {
    color: var(--primary);
    font-weight: 700;
}

/* Checklist Items */
.checklist-header {
    margin-bottom: 1.25rem;
}

.checklist-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.section-desc {
    font-size: 0.88rem;
    color: var(--muted);
}

.badge-completion {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.badge-completion.complete {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.habit-category {
    margin-bottom: 1.5rem;
}

.category-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.habit-item {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.habit-item:hover {
    border-color: var(--accent);
}

.habit-item input[type="checkbox"] {
    display: none;
}

.habit-custom-check {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: transparent;
    margin-right: 0.85rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.habit-item.checked {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--primary);
}

.habit-item.checked .habit-custom-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.habit-info {
    display: flex;
    flex-direction: column;
}

.habit-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg);
}

.habit-item.checked .habit-name {
    text-decoration: line-through;
    color: var(--muted);
}

.habit-detail {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.badge-tag {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-tag.highlight {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange-flame);
    border-color: rgba(249, 115, 22, 0.3);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
    color: var(--fg);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group textarea {
    border-radius: var(--radius-md);
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
}

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

.btn-primary.full-width {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    font-weight: 700;
}

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

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

.btn-secondary:hover {
    background: var(--card-hover);
}

/* Quick Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-title {
    font-size: 0.78rem;
    color: var(--muted);
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: var(--font-sans);
    font-size: 1.45rem;
    font-weight: 800;
    display: block;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 0.65rem 0;
    z-index: 1000;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-icon {
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.nav-item.active {
    color: var(--accent);
    font-weight: 800;
}

/* Login Page Styles */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--box-shadow-site);
    text-align: center;
}

.login-logo-circle {
    font-size: 3.2rem;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Metrics & Comparison Styles */
.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-box {
    text-align: center;
    padding: 1.1rem;
}

.box-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.box-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.box-comparison small {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
}

.box-comparison span, .box-comparison strong {
    font-size: 1.1rem;
}

.box-comparison strong {
    color: var(--primary);
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.35rem;
}

.stat-arrow {
    color: var(--muted);
    font-size: 0.9rem;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .grid-2col { grid-template-columns: 1fr; }
}

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

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

.data-table th {
    color: var(--muted);
    font-weight: 700;
}

.badge-day {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

/* Medications List Styles */
.medications-grid {
    display: grid;
    gap: 1.25rem;
}

.med-card {
    border-left: 4px solid var(--primary);
}

.badge-time {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.35rem;
}

.badge-time.cedo { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-time.horario_confirmado { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.badge-time.noite { background: rgba(168, 85, 247, 0.15); color: #9333ea; }

.med-icon { font-size: 1.8rem; }

.med-info-row {
    margin-top: 0.65rem;
    font-size: 0.9rem;
}

.info-label {
    color: var(--muted);
    font-weight: 700;
    display: block;
    margin-bottom: 0.1rem;
}

.info-value {
    color: var(--fg);
}

.info-value.text-highlight {
    color: var(--accent);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.med-stock-footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.stock-counter label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-right: 0.5rem;
    font-weight: 700;
}

.stock-input {
    width: 75px !important;
    padding: 0.3rem 0.5rem !important;
    text-align: center;
}

.stock-counter .unit {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: 0.35rem;
}

/* Date Navigator Toolbar */
.date-navigator-card {
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.date-picker-box {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

.date-input {
    background: transparent !important;
    border: none !important;
    color: var(--fg) !important;
    font-size: 0.9rem !important;
    padding: 0.2rem !important;
    width: auto !important;
    cursor: pointer;
    font-weight: 700;
}

.mb-3 { margin-bottom: 1rem; }
.style-mt { margin-top: 1.25rem; }

/* PWA Toast Banner Styling */
.pwa-toast {
    position: fixed;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 520px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
}

.pwa-toast.hidden {
    display: none !important;
}

.pwa-toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
}

.pwa-toast-content strong {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--fg);
    line-height: 1.2;
}

.pwa-toast-content p {
    color: var(--muted);
    font-size: 0.78rem;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pwa-toast-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-install {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.btn-dismiss {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    transition: color 0.2s;
}

.btn-dismiss:hover {
    color: var(--fg);
}

/* Alert Cards Alignment & Styling */
.alert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.25rem;
}

.alert-card.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-card.info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex: 1;
}

.alert-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.alert-header strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--fg);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.alert-header p {
    font-size: 0.84rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

.alert-card .btn-sm {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .alert-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .alert-card .btn-sm {
        align-self: flex-end;
    }
}

/* Sinuous Duolingo Trail Path Styling */
.phase-trail-banner {
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.phase-trail-legend {
    gap: 0.75rem;
}

.legend-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--bg);
    border: 1px solid var(--border);
    opacity: 0.7;
    transition: all 0.2s;
}

.legend-item.current {
    opacity: 1;
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.legend-item strong {
    display: block;
    font-size: 0.85rem;
    color: var(--fg);
}

.legend-item small {
    font-size: 0.72rem;
    color: var(--muted);
}

.trail-container {
    position: relative;
    max-width: 480px;
    margin: 0 auto 3rem auto;
    padding: 1rem 0;
}

.trail-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.2rem;
    position: relative;
    transition: transform 0.3s ease;
}

/* Sinuous Snake Path Horizontal Offsets */
.offset-0  { transform: translateX(0px); }
.offset-1  { transform: translateX(55px); }
.offset-2  { transform: translateX(110px); }
.offset--1 { transform: translateX(-55px); }
.offset--2 { transform: translateX(-110px); }

@media (max-width: 500px) {
    .offset-1  { transform: translateX(35px); }
    .offset-2  { transform: translateX(70px); }
    .offset--1 { transform: translateX(-35px); }
    .offset--2 { transform: translateX(-70px); }
}

/* 3D Duolingo Pressable Node Button */
.trail-node-btn {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 var(--border), 0 10px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.trail-node-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--border);
}

.trail-node-btn.checkpoint-node {
    width: 82px;
    height: 82px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #fbbf24;
    box-shadow: 0 7px 0 #b45309, 0 12px 25px rgba(245, 158, 11, 0.3);
}

.trail-node-btn.state-today {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-card-hover) 100%);
    border-color: var(--orange-flame);
    box-shadow: 0 6px 0 #c2410c, 0 0 20px var(--orange-glow);
    animation: todayPulse 2s infinite ease-in-out;
}

@keyframes todayPulse {
    0%, 100% { box-shadow: 0 6px 0 #c2410c, 0 0 10px var(--orange-glow); }
    50% { box-shadow: 0 6px 0 #c2410c, 0 0 25px var(--orange-flame); }
}

.trail-node-btn.state-completed {
    background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
    border-color: #34d399;
    box-shadow: 0 6px 0 #047857, 0 8px 20px var(--primary-glow);
}

.trail-node-btn.state-completed .node-icon {
    color: #fff;
}

/* SVG Progress Ring overlay */
.node-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 3.5;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3.8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.node-content {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.node-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.node-day-num {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--fg);
}

.state-completed .node-day-num {
    color: #fff;
}

.today-pointer {
    position: absolute;
    top: -24px;
    background: var(--orange-flame);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.node-label {
    margin-top: 0.45rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 700;
}

.node-pct {
    display: block;
    font-size: 0.68rem;
    color: var(--primary);
}

/* Checkpoint Banner Divider */
.trail-checkpoint-divider {
    margin: 2rem 0 1.5rem 0;
    text-align: center;
}

.checkpoint-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #d97706;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Exams History View Styling */
.conclusions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.conclusion-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.conclusion-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.conclusion-item.type-success { border-left: 4px solid var(--primary); }
.conclusion-item.type-danger  { border-left: 4px solid var(--danger); }
.conclusion-item.type-warning { border-left: 4px solid var(--warning); }
.conclusion-item.type-info    { border-left: 4px solid var(--accent); }

.conclusion-item strong {
    font-size: 0.95rem;
    color: var(--fg);
}

.conclusion-item p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.35;
}

.badge-status {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-status.success { background: rgba(16, 185, 129, 0.12); color: var(--primary); }
.badge-status.danger  { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge-status.warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-status.info    { background: rgba(59, 130, 246, 0.12); color: var(--accent); }

.badge-year {
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.year-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.exam-category-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
}

.exam-cat-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.exam-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exam-items-list li {
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.exam-items-list li strong {
    color: var(--fg);
    display: inline-block;
    margin-right: 0.25rem;
}

.exam-items-list li span {
    color: var(--muted);
}

/* Alarms / Reminders List */
.alarm-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alarm-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.6rem;
}

.alarm-item.inactive {
    opacity: 0.5;
}

.alarm-time {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    min-width: 3.2rem;
}

.alarm-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.alarm-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

