/*
 * ════════════════════════════════════════════════════════════════
 *  TeleWeCure Dashboard — Component Stylesheet
 *  File:    tw-dashboard.css
 *  Place:   public/css/tw-dashboard.css
 *
 *  REQUIRES: tw-tokens.css must be loaded BEFORE this file.
 *
 *  CONTAINS: All layout and component styles for every stage
 *            of the patient dashboard. Stage-specific pages
 *            do NOT need their own <style> blocks — this file
 *            covers all shared components.
 *
 *  SECTIONS:
 *    1.  Global Reset & Body
 *    2.  Top Navbar
 *    3.  Sidebar
 *    4.  Sidebar Overlay (mobile)
 *    5.  Main Content Wrapper
 *    6.  Hero Banner Strip
 *    7.  Status Badge
 *    8.  Journey Progress Tracker
 *    9.  Page Grid (two-column layout)
 *    10. Hero Action Card
 *    11. Dana Static Card (right column)
 *    12. Teaser Cards
 *    13. Info Card
 *    14. Settings Card & Items
 *    15. Dana Floating Widget
 *    16. Full-Width Action Card (Stage 3 modifier)
 *    17. Form Shell Placeholder (Stage 3)
 *    18. Utility Classes
 *    19. Animations
 *    20. Responsive Rules
 *
 *  Last updated: 2026-02-28
 *  Verified against: user_stage2.html, user_stage3.html
 * ════════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════════
   1. GLOBAL RESET & BODY
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Minimum touch target for accessibility */
button, a, [role="button"] {
    min-height: 44px;
    min-width: 44px;
}

a {
    text-decoration: none;
    color: inherit;
}


/* ═══════════════════════════════════════════════════════════════
   2. TOP NAVBAR
═══════════════════════════════════════════════════════════════ */
.tw-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.25rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.tw-navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.tw-navbar__brand img {
    height: 38px;
    width: auto;
}
.tw-navbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.tw-navbar__icon-btn {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition);
    position: relative;
}
.tw-navbar__icon-btn:hover {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-mist);
}
.tw-navbar__badge {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}
.tw-navbar__avatar {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: 10px;
    background: var(--green-light);
    border: 2px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--green-dark);
    cursor: pointer;
    transition: all var(--transition);
}
.tw-navbar__avatar:hover { box-shadow: var(--shadow-green); }

/* Hamburger — hidden desktop, shown mobile */
.tw-navbar__hamburger {
    display: flex;
    width: 40px; height: 40px; min-width: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.tw-navbar__hamburger:hover { border-color: var(--green); color: var(--green); }


/* ═══════════════════════════════════════════════════════════════
   3. SIDEBAR
═══════════════════════════════════════════════════════════════ */
.tw-sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--navbar-h));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 900;
    transition: transform var(--transition);
	/* ── Scrollbar: Firefox ── */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
/* ── Sidebar scrollbar: hidden by default, visible on hover ── */
.tw-sidebar::-webkit-scrollbar {
    width: 4px;
}
.tw-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.tw-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 100px;
}
.tw-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(105, 167, 78, 0.35);
}
.tw-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 117, 55, 0.6);
}
.tw-sidebar:hover {
    scrollbar-color: rgba(105, 167, 78, 0.35) transparent;
}
html[data-theme="dark"] .tw-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(105, 167, 78, 0.25);
}
html[data-theme="dark"] .tw-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(105, 167, 78, 0.5);
}
html[data-theme="dark"] .tw-sidebar:hover {
    scrollbar-color: rgba(105, 167, 78, 0.25) transparent;
}
.tw-sidebar__section { padding: 1.25rem 1rem 0.5rem; }
.tw-sidebar__section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 0.5rem;
    margin-bottom: 0.4rem;
}
.tw-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    min-height: 44px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.tw-sidebar__item:hover { background: var(--green-mist); color: var(--green-dark); }
.tw-sidebar__item.active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.tw-sidebar__item i { font-size: 1.05rem; width: 20px; text-align: center; }
.tw-sidebar__item.locked { opacity: 0.45; cursor: not-allowed; }
.tw-sidebar__item.locked:hover { background: none; color: var(--text-secondary); }
.tw-sidebar__lock { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.tw-sidebar__divider { height: 1px; background: var(--border); margin: 0.75rem 1rem; }
.tw-sidebar__bottom { margin-top: auto; padding: 1rem; border-top: 1px solid var(--border); }


/* ═══════════════════════════════════════════════════════════════
   4. SIDEBAR OVERLAY (mobile backdrop)
═══════════════════════════════════════════════════════════════ */
.tw-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,1,1,0.4);
    z-index: 1090;
}
.tw-sidebar-overlay.is-visible { display: block; }


/* ═══════════════════════════════════════════════════════════════
   5. MAIN CONTENT WRAPPER
═══════════════════════════════════════════════════════════════ */
.tw-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--navbar-h);
    min-height: calc(100vh - var(--navbar-h));
    padding: 2rem 2rem 3rem;
	overflow-x: hidden;
}


/* ═══════════════════════════════════════════════════════════════
   6. HERO BANNER STRIP
═══════════════════════════════════════════════════════════════ */
.tw-hero-strip {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 120px;
    margin-bottom: 2rem;
    background: var(--green-light);
    border: 1.5px solid rgba(105,167,78,0.25);
    box-shadow: var(--shadow-sm);
}
.tw-hero-strip__content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1.25rem;
    justify-content: space-between;
}
.tw-hero-strip__greeting { flex: 1; }
.tw-hero-strip__greeting h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-dark);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.tw-hero-strip__greeting p { font-size: 0.9rem; color: var(--text-secondary); }

/* Hero badge variants */
.tw-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.tw-hero-badge--warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}
.tw-hero-badge--success {
    background-color: var(--green-light);
    color: var(--green-dark);
    border: 1px solid rgba(105,167,78,0.35);
}
.tw-hero-badge--muted {
    background-color: #f0f0f0;
    color: #6c757d;
    border: 1px solid #dee2e6;
}


/* ═══════════════════════════════════════════════════════════════
   7. STATUS BADGE
═══════════════════════════════════════════════════════════════ */
.tw-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.45);
    color: var(--white);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}
.tw-status-badge__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-warning);
    box-shadow: 0 0 6px rgba(240,192,64,0.8);
}


/* ═══════════════════════════════════════════════════════════════
   8. JOURNEY PROGRESS TRACKER
═══════════════════════════════════════════════════════════════ */
.tw-journey {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.tw-journey__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.tw-journey__title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.tw-journey__stage-count { font-size: 0.8rem; font-weight: 600; color: var(--green); }
.tw-journey__track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.tw-journey__track::-webkit-scrollbar { display: none; }
.tw-journey__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}
.tw-journey__step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    width: calc(100% - 32px);
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.tw-journey__step.done:not(:last-child)::after,
.tw-journey__step.active:not(:last-child)::after { background: var(--green-light); }
.tw-journey__dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: all var(--transition);
}
.tw-journey__step.done .tw-journey__dot {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
}
.tw-journey__step.active .tw-journey__dot {
    background: var(--green);
    border-color: var(--green-dark);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(105,167,78,0.2);
}
.tw-journey__step.locked .tw-journey__dot { opacity: 0.35; }
.tw-journey__step-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    max-width: 52px;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    min-height: 2.4em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.tw-journey__step.active .tw-journey__step-label { color: var(--green-dark); font-weight: 700; }


/* ═══════════════════════════════════════════════════════════════
   9. PAGE GRID
═══════════════════════════════════════════════════════════════ */
.tw-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}
.tw-col-main { display: flex; flex-direction: column; gap: 1.5rem; }
.tw-col-side  { display: flex; flex-direction: column; gap: 1.5rem; }


/* ═══════════════════════════════════════════════════════════════
   10. HERO ACTION CARD
═══════════════════════════════════════════════════════════════ */
.tw-action-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease both;
	text-align: center;
}
.tw-action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--green-dark));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tw-action-card__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tw-action-card__title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
.tw-action-card__desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 520px;
}
.tw-btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.25rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-green);
    min-height: 52px;
    text-decoration: none;
}
.tw-btn-hero:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-green-lg);
    color: var(--white);
}
.tw-btn-hero:active { transform: translateY(0); }
.tw-btn-hero i { font-size: 1.2rem; }
.tw-action-checklist {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.tw-action-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.tw-action-check-item i { color: var(--green); font-size: 1rem; }

/* ⚠️ DEPRECATED — Do NOT use .tw-dana-card in new stage files.
   The Dana Chat Widget (dana-chat-widget.html) replaces this component.
   CSS lives in: public/css/dana-chat-widget.css
   JS lives in:  public/js/dana-chat-widget.js
   These styles are kept only for backward compatibility with
   user_stage4.html and older files built before the widget existed. */
/* ═══════════════════════════════════════════════════════════════
   11. DANA STATIC CARD (right column, desktop)
═══════════════════════════════════════════════════════════════ */
.tw-dana-card {
    background: var(--white);
    border: 3px solid var(--green);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s 0.1s ease both;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    min-height: 0;
}
.tw-dana-card::before {
    content: '';
    position: absolute;
    top: 0; left: 1.5rem; right: 1.5rem;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    border-radius: 0 0 4px 4px;
    opacity: 0.5;
}
.tw-dana-card__avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}
.tw-dana-card__avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    border: 4px solid var(--green);
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(105,167,78,0.30);
    display: block;
    background: var(--green-light);
}
.tw-dana-card__pulse {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 14px; height: 14px;
    background: var(--color-success);
    border-radius: 50%;
    border: 2px solid var(--white);
}
.tw-dana-card__pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(34,197,94,0.35);
    animation: pulse-ring 2s ease-out infinite;
}
.tw-dana-card__name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.tw-dana-card__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.tw-dana-card__actions { display: flex; gap: 0.6rem; width: 100%; }
.tw-dana-btn {
    flex: 1;
    min-height: 48px;
    padding: 0.6rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border: 2px solid var(--green);
    transition: all var(--transition);
}
.tw-dana-btn i { font-size: 1.3rem; }
.tw-dana-btn--primary { background: var(--green); color: var(--white); box-shadow: 0 3px 12px rgba(105,167,78,0.28); }
.tw-dana-btn--primary:hover { background: var(--green-dark); transform: translateY(-2px); }
.tw-dana-btn--secondary { background: var(--white); color: var(--green); }
.tw-dana-btn--secondary:hover { background: var(--green); color: var(--white); transform: translateY(-2px); }


/* ═══════════════════════════════════════════════════════════════
   12. TEASER CARDS
═══════════════════════════════════════════════════════════════ */
.tw-teaser-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    animation: fadeInUp 0.5s 0.2s ease both;
}
.tw-teaser-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1.5px dashed var(--border);
    padding: 1.5rem 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.tw-teaser-card--s3 {
    border-color: rgba(105,167,78,0.4);
    background: linear-gradient(135deg, var(--white) 60%, var(--green-mist) 100%);
}
.tw-teaser-card--s4 { border-color: rgba(105,167,78,0.2); background: var(--white); }
.tw-teaser-card:hover { box-shadow: var(--shadow-md); }
.tw-teaser-card__lock {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 28px; height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.tw-teaser-card--s3 .tw-teaser-card__lock { background: var(--green-light); color: var(--green-dark); }
.tw-teaser-card--s4 .tw-teaser-card__lock { background: #f0f0f0; color: #aaa; }
.tw-teaser-card__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.85rem;
}
.tw-teaser-card--s3 .tw-teaser-card__icon { background: var(--green-light); color: var(--green-dark); }
.tw-teaser-card--s4 .tw-teaser-card__icon { background: #f5f5f5; color: #bbb; }
.tw-teaser-card__stage {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}
.tw-teaser-card--s3 .tw-teaser-card__stage { color: var(--green); }
.tw-teaser-card--s4 .tw-teaser-card__stage { color: var(--text-muted); }
.tw-teaser-card__title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; line-height: 1.3; }
.tw-teaser-card--s4 .tw-teaser-card__title { color: var(--text-secondary); }
.tw-teaser-card__desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1rem; }
.tw-teaser-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    border: none;
    cursor: default;
    pointer-events: none;
}
.tw-teaser-card--s3 .tw-teaser-card__cta { background: var(--green-light); color: var(--green-dark); }
.tw-teaser-card--s4 .tw-teaser-card__cta { background: #f0f0f0; color: #bbb; }

/* B7: upcoming-appointment slot card — an ACTIVE (not locked) card, so a solid
   green-accent border rather than the dashed preview look. */
.tw-teaser-card--appointment {
    border-style: solid;
    border-color: rgba(105,167,78,0.4);
    background: linear-gradient(135deg, var(--white) 60%, var(--green-mist) 100%);
}
.tw-teaser-card--appointment .tw-teaser-card__icon { background: var(--green-light); color: var(--green-dark); }
.tw-teaser-card--appointment .tw-teaser-card__meta { color: var(--green); }
.tw-teaser-card--appointment .tw-teaser-card__when {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.75rem 0 0;
}
.tw-teaser-card--appointment .tw-teaser-card__when-time { color: var(--green-dark); }

/* B7: treatment-cycle phase slot card — an ACTIVE card (solid green-accent),
   like the appointment card. Shows the running period's week/day and the
   weekly-check-in status. */
.tw-teaser-card--phase {
    border-style: solid;
    border-color: rgba(105,167,78,0.4);
    background: linear-gradient(135deg, var(--white) 60%, var(--green-mist) 100%);
}
.tw-teaser-card--phase .tw-teaser-card__icon { background: var(--green-light); color: var(--green-dark); }
.tw-teaser-card--phase .tw-teaser-card__meta { color: var(--green); }
.tw-teaser-card--phase .tw-teaser-card__when {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.75rem 0 0;
}


/* ═══════════════════════════════════════════════════════════════
   13. INFO CARD
═══════════════════════════════════════════════════════════════ */
.tw-info-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s 0.15s ease both;
}
.tw-info-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.tw-info-card__header-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-dark);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.tw-info-card__header-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.tw-info-card__body { padding: 1rem 1.25rem; }
.tw-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.tw-info-row:last-child { border-bottom: none; }
.tw-info-row__label { color: var(--text-muted); font-weight: 500; }
.tw-info-row__value { color: var(--text); font-weight: 600; }
.tw-info-card__footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; }


/* ═══════════════════════════════════════════════════════════════
   14. SETTINGS CARD & ITEMS
═══════════════════════════════════════════════════════════════ */
.tw-settings-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s 0.25s ease both;
}
.tw-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    transition: background var(--transition);
    cursor: pointer;
    min-height: 52px;
}
.tw-settings-item:last-child { border-bottom: none; }
.tw-settings-item:hover { background: var(--green-mist); }
.tw-settings-item__left { display: flex; align-items: center; gap: 0.75rem; }
.tw-settings-item__icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.tw-settings-item__icon--green { background: var(--green-light); color: var(--green-dark); }
.tw-settings-item__icon--grey  { background: #f0f0f0; color: #888; }
.tw-settings-item__icon--red   { background: var(--color-danger-bg); color: var(--color-danger); }
.tw-settings-item__label { font-weight: 600; color: var(--text); }
.tw-settings-item__sub   { font-size: 0.75rem; color: var(--text-muted); }
.tw-settings-item__chevron { color: var(--text-muted); font-size: 0.85rem; }
.tw-settings-item--danger .tw-settings-item__label { color: var(--color-danger); }
.tw-settings-item--danger:hover { background: var(--color-danger-bg); }


/* ═══════════════════════════════════════════════════════════════
   15. DANA FLOATING WIDGET
   All --dana-* scoped tokens removed. Uses global tokens only.
═══════════════════════════════════════════════════════════════ */
.dana-widget {
    position: fixed;
    bottom: 3.5rem;
    right: 2rem;
    z-index: 1050;
}
.dana-widget__card {
    position: relative;
    background: var(--white);
    border: 3px solid var(--green);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.75rem 1.5rem;
    width: 320px;
    text-align: center;
    box-shadow: var(--shadow-dana-card);
    font-family: var(--font-body);
    transition: opacity var(--transition-dana), transform var(--transition-dana), visibility var(--transition-dana);
    transform-origin: bottom right;
}
.dana-widget__card::before {
    content: '';
    position: absolute;
    top: 0; left: 1.5rem; right: 1.5rem;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    border-radius: 0 0 4px 4px;
    opacity: 0.6;
}
.dana-widget__minimize-btn {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    width: 28px; height: 28px;
    min-width: 28px; min-height: 28px;
    border: 1px solid rgba(105,167,78,0.35);
    border-radius: 6px;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-dana), color var(--transition-dana);
    padding: 0;
}
.dana-widget__minimize-btn:hover { background: var(--green); color: var(--white); }
.dana-widget__avatar-wrap { position: relative; display: inline-block; margin-bottom: 1rem; }
.dana-widget__avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    border: 4px solid var(--green);
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(105,167,78,0.30);
    display: block;
    background: var(--green-light);
}
.dana-widget__avatar--lg { width: 80px; height: 80px; }
.dana-widget__pulse {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 14px; height: 14px;
    background: var(--color-success);
    border-radius: 50%;
    border: 2px solid var(--white);
}
.dana-widget__pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(34,197,94,0.4);
    animation: dana-pulse-ring 2s ease-out infinite;
}
.dana-widget__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0 0 0.5rem; }
.dana-widget__subtitle { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.55; margin: 0 0 1.4rem; }
.dana-widget__actions { display: flex; gap: 0.75rem; justify-content: center; }
.dana-widget__actions--sheet { flex-direction: column; margin-top: 1rem; }
.dana-widget__btn {
    flex: 1;
    min-height: 48px;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 2px solid var(--green);
    transition: all var(--transition-dana);
}
.dana-widget__btn--full { flex: unset; width: 100%; flex-direction: row; gap: 0.6rem; padding: 0.9rem 1.25rem; }
.dana-widget__btn-icon { font-size: 1.4rem; line-height: 1; }
.dana-widget__btn--primary { background: var(--green); color: var(--white); box-shadow: 0 4px 14px rgba(105,167,78,0.30); }
.dana-widget__btn--primary:hover { background: var(--green-dark); transform: translateY(-2px); }
.dana-widget__btn--secondary { background: var(--white); color: var(--green); }
.dana-widget__btn--secondary:hover { background: var(--green); color: var(--white); transform: translateY(-2px); }

/* Bubble (minimized state) */
.dana-widget__bubble-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-right: 128px;
}
.dana-widget--minimized .dana-widget__bubble-wrap { display: flex; }
.dana-widget--expanded  .dana-widget__bubble-wrap { display: none; }
.dana-widget__bubble-label {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--green-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}
.dana-widget__bubble {
    width: 64px; height: 64px; min-width: 44px;
    border-radius: 50%;
    border: 3px solid var(--green);
    background: var(--white);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 18px rgba(105,167,78,0.35);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-dana), box-shadow var(--transition-dana);
}
.dana-widget__bubble:hover { transform: scale(1.08); box-shadow: var(--shadow-dana-hover); }
.dana-widget__bubble-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
    background: var(--green-light);
}
.dana-widget__bubble-pulse {
    position: absolute;
    top: 2px; right: 2px;
    width: 12px; height: 12px;
    background: var(--color-success);
    border-radius: 50%;
    border: 2px solid var(--white);
}
.dana-widget__bubble-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(34,197,94,0.4);
    animation: dana-pulse-ring 2s ease-out infinite;
}
.dana-widget__bubble-tooltip {
    position: absolute;
    right: calc(100% + 0.6rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.dana-widget__bubble-tooltip::after {
    content: '';
    position: absolute;
    left: 100%; top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--text);
}
.dana-widget__bubble:hover .dana-widget__bubble-tooltip { opacity: 1; }

/* Mobile bottom sheet */
.dana-widget__sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 3px solid var(--green);
    border-radius: 20px 20px 0 0;
    padding: 1rem 1.5rem 2rem;
    z-index: 1060;
    transform: translateY(100%);
    transition: transform var(--transition-dana);
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.dana-widget__sheet.is-open { transform: translateY(0); }
.dana-widget__sheet-handle {
    width: 40px; height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}
.dana-widget__sheet-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 36px; height: 36px; min-width: 36px;
    border: 1px solid rgba(105,167,78,0.3);
    border-radius: 8px;
    background: transparent;
    color: var(--green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background var(--transition-dana);
}
.dana-widget__sheet-close:hover { background: var(--green); color: var(--white); }
.dana-widget__sheet-body { width: 100%; max-width: 380px; margin: 0 auto; }
.dana-widget__backdrop {
    position: fixed; inset: 0;
    background: rgba(2,1,1,0.45);
    z-index: 1055;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-dana);
}
.dana-widget__backdrop.is-visible { opacity: 1; pointer-events: all; }

/* Expand / minimize states */
.dana-widget--minimized .dana-widget__card {
    opacity: 0;
    transform: scale(0.85) translateY(8px);
    visibility: hidden;
    pointer-events: none;
}
.dana-widget--expanded .dana-widget__card {
    opacity: 1;
    transform: scale(1) translateY(0);
    visibility: visible;
    pointer-events: all;
}


/* ═══════════════════════════════════════════════════════════════
   16. FULL-WIDTH ACTION CARD MODIFIER (Stage 3)
═══════════════════════════════════════════════════════════════ */
.tw-action-card--fullwidth {
    width: 100%;
    max-width: 100%;
    grid-column: 1 / -1;
	overflow: hidden;
    word-wrap: break-word;
}
.tw-action-card--fullwidth .tw-action-card__desc {
    max-width: 100%;
}


/* ═══════════════════════════════════════════════════════════════
   17. FORM SHELL PLACEHOLDER (Stage 3)
═══════════════════════════════════════════════════════════════ */
.tw-form-shell {
    margin-top: 1.5rem;
    min-height: 220px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--green-mist);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tw-form-shell__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}
.tw-form-shell__placeholder i {
    font-size: 2.5rem;
    color: var(--green);
    opacity: 0.5;
}


/* ═══════════════════════════════════════════════════════════════
   18. UTILITY CLASSES
═══════════════════════════════════════════════════════════════ */
.tw-btn-sm {
    flex: 1;
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
}
.tw-btn-sm:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-mist); }
.tw-btn-sm i { font-size: 0.9rem; }


/* ═══════════════════════════════════════════════════════════════
   19. ANIMATIONS
═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-ring {
    0%   { transform: scale(0.9); opacity: 1; }
    70%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(0.9); opacity: 0; }
}

@keyframes dana-pulse-ring {
    0%   { transform: scale(0.9); opacity: 1; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(0.9); opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════════
   20. RESPONSIVE RULES
   Breakpoint reference (px values only — no CSS vars in @media):
     1199px = small desktop
      991px = tablet
      767px = mobile
      480px = compact mobile
═══════════════════════════════════════════════════════════════ */

@media (max-width: 1199px) {
    .tw-grid { grid-template-columns: 1fr 300px; }
}

@media (max-width: 991px) {
    :root { --sidebar-w: 0px; }

    .tw-sidebar {
        transform: translateX(-260px);
        width: 260px;
        z-index: 1100;
        box-shadow: var(--shadow-md);
    }
    .tw-sidebar.is-open { transform: translateX(0); z-index: 1500}
    .tw-navbar__hamburger { display: flex; }
    .tw-main { margin-left: 0; padding: 1.25rem 1.25rem 3rem; }
    .tw-grid { grid-template-columns: 1fr; }
    .tw-col-side { order: -1; }
    .tw-dana-card { display: flex; }
    .dana-widget { bottom: 3.5rem; right: 1.25rem; }
    .dana-widget__card { width: 280px; }
    .dana-widget__bubble-wrap { margin-right: calc((280px - 64px) / 2); }
}

@media (max-width: 767px) {
    .tw-hero-strip { height: auto; min-height: 90px; padding: 1rem 0; }
    .tw-hero-strip__greeting h1 { font-size: 1.25rem; }
    .tw-teaser-grid { grid-template-columns: 1fr; }
    .dana-widget__card { display: block; }
    .dana-widget__bubble-wrap { display: flex !important; margin-right: 0; }
    .dana-widget__sheet { display: flex; }
    .tw-journey__step-label { display: none; }
}

@media (max-width: 480px) {
    .tw-main { padding: 1rem 1rem 3rem; }
    .tw-action-card { padding: 1.5rem; }
    .tw-btn-hero { font-size: 0.95rem; padding: 0.8rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* ── 21. DESKTOP SIDEBAR COLLAPSE ─────────────────────────────── */
.tw-navbar__hamburger {
    display: flex !important; 
}

.tw-main {
    transition: margin-left var(--transition);
}

body.desktop-sidebar-collapsed .tw-sidebar {
    transform: translateX(-100%);
}

@media (min-width: 992px) {
    body.desktop-sidebar-collapsed .tw-main {
        margin-left: 0 !important;
    }
}
/* ── BOTTOM ROW: Teasers + Dana side by side (Stage 3, Stage 4) ── */
.tw-bottom-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: stretch;
}
.tw-bottom-row__teasers {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.tw-bottom-row__dana {
    display: flex;
    flex-direction: column;
}
.tw-bottom-row__dana .tw-dana-card {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 991px) {
    .tw-bottom-row { grid-template-columns: 1fr; }
}


/* Ensure Dana widget pops over the overlay */
.tw-bottom-row__dana {
    position: relative;
    z-index: 1050 !important; 
}
/* ── TeleWeCure Branded Tooltips ──────────────────────── */
.tooltip {
    --bs-tooltip-bg: #4A7537; /* TeleWeCure Dark Green */
    --bs-tooltip-color: #ffffff;
    --bs-tooltip-border-radius: 0.5rem;
}

.tooltip .tooltip-inner {
    background-color: #4A7537 !important;
    color: #ffffff !important;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 0.5rem;
}
.tooltip .tooltip-arrow::before {
    border-top-color: #4A7537 !important;
}
/* ════════════════════════════════════════════════════════════════
 * TeleWeCure — Bug Fix Block
 * Add to the BOTTOM of public/css/tw-dashboard.css
 *
 * Fixes:
 *   1. Sidebar hamburger — sidebar width collapses to 0px on mobile
 *   2. Tooltip colour — already correct in CSS, needs JS init fix
 *      (see tw-dashboard.js fix below)
 *   3. Spotlight overlay — z-index conflict with navbar
 * ════════════════════════════════════════════════════════════════ */


/* ── FIX 1: Sidebar mobile width ─────────────────────────────────
   Root cause: @media (max-width: 991px) sets --sidebar-w: 0px,
   which collapses the sidebar element to zero width even when
   .is-open is applied.
   Fix: Override sidebar width explicitly at mobile breakpoint.
   The 260px matches the translateX(-260px) already in the CSS.
─────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .tw-sidebar {
        width: 260px !important;
    }
}


/* ── FIX 3: Spotlight overlay z-index ───────────────────────────
   Root cause: .tw-dana-focus-overlay at z-index 1040 sits BELOW
   the navbar (z-index 1000 — wait, navbar is BELOW overlay so
   that's fine), but sits BELOW .tw-sidebar.is-open (z-index 1100)
   on mobile. More critically the overlay needs to cover the
   sidebar on mobile when active, and the navbar should remain
   accessible above the overlay.
   Fix: Raise overlay above sidebar, keep navbar above overlay
   so user can still close via navbar if needed. Dana widget
   (.tw-bottom-row__dana) stays at z-index 1050 — sits above overlay.
─────────────────────────────────────────────────────────────── */
.tw-dana-focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1099 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    pointer-events: none;
}
.tw-dana-focus-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.tw-bottom-row__dana { position: relative; z-index: 1100 !important; }

.tooltip {
    z-index: 1200 !important;
}