@import url("../shared/common.css");

:root {
    --bg-app: var(--bg-main);
    --bg-sidebar: var(--bg-sidebar);
    --bg-card: var(--bg-card);
    --bg-card-hover: var(--bg-card-hover);
    --border-color: var(--border-color);
    --border-hover: var(--border-glow);
    
    --text-main: var(--text-primary);
    --text-muted: var(--text-secondary);
    --text-dim: var(--text-muted);
    
    --color-move: #f43f5e;
    --color-move-bg: rgba(244, 63, 94, 0.06);
    
    --color-exercise: var(--success);
    --color-exercise-bg: var(--success-glow);
    
    --color-stand: #0ea5e9;
    --color-stand-bg: rgba(14, 165, 233, 0.06);

    --color-steps: #14b8a6;
    --color-sleep: var(--accent);
    --color-heart: #ec4899;
    --color-nutrition: var(--warning);
    
    --sleep-deep: #1e3a8a;
    --sleep-rem: #a855f7;
    --sleep-core: #3b82f6;
    --sleep-awake: #eab308;
    
    --sidebar-width: 280px;
    --radius-lg: var(--radius-md);
    --radius-md: var(--radius-sm);
    --transition-smooth: var(--transition);
    
    --bg-subtle: var(--bg-main);
    --track-stroke: var(--border-color);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ff1744 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--color-move);
    -webkit-text-fill-color: initial;
    background: none;
}

/* Profile Card inside Sidebar */
.profile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-main);
}

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

.profile-name {
    font-size: 1.2rem;
    font-weight: 600;
}

.profile-status {
    font-size: 0.8rem;
    color: var(--color-exercise);
    font-weight: 500;
}

/* User metrics grid in profile */
.profile-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.profile-metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.metric-date {
    font-size: 0.6rem;
    color: var(--text-dim);
}

/* Navigation Menu */
.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition-smooth);
    margin-bottom: 0.5rem;
    outline: none;
}

.nav-item:hover, .nav-item:focus {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-main);
    background: linear-gradient(90deg, rgba(255, 23, 68, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-left: 3px solid var(--color-move);
}

.sidebar-footer {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: calc(100% - var(--sidebar-width));
}

/* Header styling */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-title-container h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Date Picker styling */
.date-controls-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 0.25rem;
}

.btn-arrow {
    background: none;
    border: none;
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-arrow:hover {
    background: var(--border-color);
}

.date-picker-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
}

.calendar-icon {
    color: var(--color-sleep);
    font-size: 1.1rem;
}

.date-select-dropdown {
    background: none;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding-right: 0.5rem;
}

.date-select-dropdown option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

/* View switching logic */
.content-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

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

/* Grid Layout for Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.full-width-card {
    grid-column: span 2;
}

/* Dashboard Cards (Glassmorphism) */
.dashboard-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

.dashboard-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-header i {
    font-size: 1.3rem;
}

/* Icon Colors */
.icon-red { color: var(--color-move); }
.icon-green { color: var(--color-exercise); }
.icon-blue { color: var(--color-sleep); }
.icon-pink { color: var(--color-heart); }
.icon-purple { color: var(--color-nutrition); }

/* Activity Rings layout */
.rings-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.rings-svg-wrapper {
    position: relative;
}

.activity-rings-svg {
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--track-stroke);
}

.ring-active {
    fill: none;
    stroke-dasharray: 565.48; /* Calculated dynamically or set explicitly */
    stroke-dashoffset: 565.48; /* Starting full empty */
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Set specific circle lengths (2*pi*r) */
#svg-ring-move {
    stroke-dasharray: 565.48; /* r=90 */
    stroke: var(--color-move);
    filter: drop-shadow(0 0 4px var(--color-move-bg));
}

#svg-ring-exercise {
    stroke-dasharray: 439.82; /* r=70 */
    stroke: var(--color-exercise);
    filter: drop-shadow(0 0 4px var(--color-exercise-bg));
}

#svg-ring-stand {
    stroke-dasharray: 314.16; /* r=50 */
    stroke: var(--color-stand);
    filter: drop-shadow(0 0 4px var(--color-stand-bg));
}

/* Legend details */
.rings-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
    max-width: 250px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-item .bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-item.move .bullet { background-color: var(--color-move); }
.legend-item.exercise .bullet { background-color: var(--color-exercise); }
.legend-item.stand .bullet { background-color: var(--color-stand); }

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

.legend-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-value {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Steps and progress styling */
.card-body-metrics {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-progress-wrapper {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.step-main-metric {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.metric-huge {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--color-exercise);
    line-height: 1;
}

.metric-huge-label {
    color: var(--text-muted);
    font-weight: 500;
}

.progress-bar-container {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-exercise) 0%, var(--color-steps) 100%);
    border-radius: 5px;
    transition: width 1s ease-out;
}

.progress-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sub-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sub-metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sub-metric-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sub-metric-item i {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-distance {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-steps);
}

.icon-cycling {
    background: rgba(0, 229, 255, 0.1);
    color: var(--color-stand);
}

.sub-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.sub-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Sleep Analysis layouts */
.sleep-summary-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sleep-big-metric {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.sleep-value-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-sleep);
    display: block;
}

.sleep-label-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.sleep-stages-chart-wrapper {
    margin-top: 1rem;
}

.stages-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.sleep-stages-bar {
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    background: var(--bg-subtle);
    margin-bottom: 1rem;
}

.sleep-stage-segment {
    height: 100%;
    transition: width 1s ease-out;
}

.sleep-stage-segment.deep { background-color: var(--sleep-deep); }
.sleep-stage-segment.rem { background-color: var(--sleep-rem); }
.sleep-stage-segment.core { background-color: var(--sleep-core); }
.sleep-stage-segment.awake { background-color: var(--sleep-awake); }
.sleep-stage-segment.unspecified { background-color: var(--text-dim); }

.sleep-stages-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 1rem;
}

.stage-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stage-dot.deep { background-color: var(--sleep-deep); }
.stage-dot.rem { background-color: var(--sleep-rem); }
.stage-dot.core { background-color: var(--sleep-core); }
.stage-dot.awake { background-color: var(--sleep-awake); }
.stage-dot.unspecified { background-color: var(--text-dim); }

/* Heart Rate styling */
.heart-stats-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.heart-main-metric {
    background: rgba(236, 72, 153, 0.05);
    border: 1px solid rgba(236, 72, 153, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    flex-shrink: 0;
    min-width: 140px;
}

.heart-pulse-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-heart);
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
}

.heart-minmax-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    flex-grow: 1;
}

.hr-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hr-val-small {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.heart-graph-placeholder {
    height: 140px;
    width: 100%;
}

/* Nutrition and Diet styling */
.nutrition-summary-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.calorie-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cal-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--color-nutrition);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.03);
}

.cal-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.cal-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cal-source-badge {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.macro-trackers-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.macro-progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.macro-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.macro-name {
    font-weight: 600;
    color: var(--text-main);
}

.macro-vals {
    color: var(--text-muted);
}

.macro-bar-container {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.macro-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.bar-protein { background-color: var(--color-move); }
.bar-carbs { background-color: var(--color-stand); }
.bar-fat { background-color: var(--color-nutrition); }

/* Meals list tables */
.meals-list-wrapper {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.meals-list-wrapper h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.table-scroll-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

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

.meals-table th, .meals-table td {
    padding: 0.9rem 1.25rem;
}

.meals-table th {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.meals-table tr {
    border-bottom: 1px solid var(--border-color);
}

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

.meals-table tr:hover td {
    background-color: var(--bg-subtle);
}

.meal-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.meal-badge.Breakfast {
    background: rgba(255, 23, 68, 0.1);
    color: var(--color-move);
}

.meal-badge.Lunch {
    background: rgba(0, 229, 255, 0.1);
    color: var(--color-stand);
}

.meal-badge.Dinner {
    background: rgba(0, 230, 118, 0.1);
    color: var(--color-exercise);
}

.meal-badge.Snack {
    background: rgba(168, 85, 247, 0.1);
    color: var(--color-nutrition);
}

/* Empty states */
.card-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-dim);
}

.card-empty-state i {
    font-size: 3rem;
}

.card-empty-state p {
    font-size: 1rem;
    font-weight: 500;
}

/* VIEW 2: Trends and History cards */
.trends-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.mini-metric-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.mini-icon.icon-steps {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-steps);
}

.mini-icon.icon-sleep {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-sleep);
}

.mini-icon.icon-weight {
    background-color: rgba(236, 72, 153, 0.1);
    color: var(--color-heart);
}

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

.mini-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mini-val {
    font-size: 1.4rem;
    font-weight: 700;
}

.trends-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.chart-card {
    min-height: 380px;
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tanita Body Composition Card */
.card-body-tanita {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tanita-main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.tanita-metric-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tanita-metric-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tanita-metric-header i {
    font-size: 1.15rem;
    color: var(--color-heart);
}

.tanita-metric-header i.text-blue {
    color: var(--color-stand);
}

.tanita-metric-header i.text-red {
    color: var(--color-move);
}

.tanita-metric-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tanita-sub-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    align-items: center;
}

.tanita-sub-label {
    color: var(--text-muted);
}

.tanita-sub-val {
    font-weight: 700;
    color: var(--text-main);
}

.tanita-physique-evaluation {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.physique-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.physique-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.physique-value {
    background: linear-gradient(135deg, var(--color-move) 0%, var(--color-nutrition) 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.tanita-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .tanita-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Analysis & Glossary layout */
.analysis-glossary-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.75rem;
    margin-top: 1.75rem;
}

.analysis-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.analysis-list li i {
    font-size: 1.25rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.analysis-list li i.icon-success { color: var(--color-exercise); }
.analysis-list li i.icon-warning { color: var(--color-steps); }
.analysis-list li i.icon-danger { color: var(--color-move); }
.analysis-list li i.icon-info { color: var(--color-stand); }

.glossary-details {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.glossary-details summary {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-smooth);
}

.glossary-details summary:hover {
    background: var(--border-color);
}

.glossary-details p {
    padding: 0 1.25rem 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

@media (max-width: 1024px) {
    .analysis-glossary-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tanita-main-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Breakpoints */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width-card {
        grid-column: span 1;
    }

    .trends-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
    }
    
    .main-content {
        width: 100%;
        padding: 1.5rem;
    }
    
    .trends-summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-controls-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .nutrition-summary-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: center;
    }
    
    .macro-trackers-list {
        width: 100%;
    }

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


