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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 40%);
    color: #1f2937;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
}

/* ─── Palette ─────────────────────────────────────────────────── */
:root {
    --purple: #7C3AED;
    --purple-dark: #6D28D9;
    --purple-light: #EDE9FE;
    --purple-bg: #F5F3FF;
    --orange: #F59E0B;
    --orange-light: #FEF3C7;
    --green: #10B981;
    --green-light: #D1FAE5;
    --blue: #3B82F6;
    --blue-light: #DBEAFE;
    --pink: #EC4899;
    --pink-light: #FCE7F3;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --card: #FFFFFF;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 240px;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--card);
    border-right: 1px solid var(--gray-100);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
    padding: 0 12px;
}

.sidebar-logo span:first-child {
    color: var(--gray-800);
}

.sidebar-logo span:last-child {
    color: var(--orange);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    transition: all 0.15s;
    cursor: default;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-700);
}

.nav-item.active {
    background: var(--purple-light);
    color: var(--purple);
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 12px 14px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 14px 4px;
}

.sidebar-footer {
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.nav-item.logout {
    color: var(--gray-400);
}

.nav-item.logout:hover {
    color: #EF4444;
    background: #FEF2F2;
}

/* ════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 36px 48px;
    max-width: calc(100vw - var(--sidebar-width));
}

/* ─── Top Header ─────────────────────────────────────────────── */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.welcome {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    display: none;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-700);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}
.sidebar-toggle:hover {
    background: var(--gray-100);
}

.welcome h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.welcome p {
    font-size: 0.88rem;
    color: var(--gray-400);
    margin-top: 2px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-50);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.notif-btn:hover {
    background: var(--gray-100);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    background: var(--gray-50);
    transition: background 0.15s;
    cursor: default;
}

.user-badge:hover {
    background: var(--gray-100);
}

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

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.user-dropdown {
    color: var(--gray-400);
    font-size: 0.7rem;
}

/* ─── Section Headers ────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
}

.section-header .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--purple-light);
    color: var(--purple);
}

/* ════════════════════════════════════════════════════════════════
   PLANT SECTION
   ════════════════════════════════════════════════════════════════ */
.plant-section {
    background: linear-gradient(135deg, var(--purple-bg), #FDF2F8, #FFFBEB);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 32px;
}

.plant-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.plant-svg-container {
    width: 130px;
    height: 150px;
    flex-shrink: 0;
}

.plant-svg-container svg {
    width: 100%;
    height: 100%;
}

.plant-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.plant-health-label {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 10px;
}

.plant-stage-name {
    display: inline-block;
    background: var(--purple);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.plant-stage-name.wilted {
    background: var(--gray-400);
}

.plant-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    flex: 1;
}

.plant-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.plant-stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.plant-stat-icon.purple {
    background: var(--purple-light);
}
.plant-stat-icon.orange {
    background: var(--orange-light);
}
.plant-stat-icon.green {
    background: var(--green-light);
}

.plant-stat-item strong {
    color: var(--gray-800);
    display: block;
    font-size: 0.95rem;
}

.plant-message {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════════
   STATS CARDS (with circular progress)
   ════════════════════════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s, transform 0.15s;
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.stat-circle-container {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.stat-circle-bg {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 4;
}

.stat-circle-progress {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
}

.stat-circle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
}

.stat-info h4 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
}

.stat-change {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}

.stat-change.up { color: var(--green); }
.stat-change.down { color: #EF4444; }

.card-purple .stat-circle-progress { stroke: var(--purple); }
.card-blue .stat-circle-progress { stroke: var(--blue); }
.card-orange .stat-circle-progress { stroke: var(--orange); }
.card-pink .stat-circle-progress { stroke: var(--pink); }

/* ════════════════════════════════════════════════════════════════
   TWO-COLUMN LAYOUT
   ════════════════════════════════════════════════════════════════ */
.columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* ════════════════════════════════════════════════════════════════
   CHARTS
   ════════════════════════════════════════════════════════════════ */
.chart-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-card.full {
    margin-bottom: 24px;
}

.chart-card h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

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

.chart-container.tall {
    height: 200px;
}

.no-data {
    display: none;
    text-align: center;
    color: var(--gray-400);
    padding: 32px;
    font-style: italic;
    font-size: 0.9rem;
}

.no-data.visible {
    display: block;
}

/* ════════════════════════════════════════════════════════════════
   SESSIONS TABLE
   ════════════════════════════════════════════════════════════════ */
.table-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.table-card h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 10px 12px;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-100);
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-50);
    font-size: 0.85rem;
    color: var(--gray-700);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--gray-50);
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-badge.muscu {
    background: var(--purple-light);
    color: var(--purple);
}

.type-badge.cardio {
    background: var(--orange-light);
    color: var(--orange);
}

/* ════════════════════════════════════════════════════════════════
   PRs SECTION
   ════════════════════════════════════════════════════════════════ */
.prs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.pr-card {
    background: var(--purple-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 4px solid var(--purple);
}

.pr-card .pr-name {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.pr-card .pr-value {
    font-size: 1rem;
    color: var(--purple);
    font-weight: 700;
}

.pr-card .pr-date {
    color: var(--gray-400);
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════════ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #FAF5FF 0%, #FDF2F8 50%, #FFFBEB 100%);
    padding: 20px;
    font-family: 'Inter', -apple-system, sans-serif;
}

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

.login-card {
    background: var(--card);
    border-radius: 20px;
    padding: 44px 36px 36px;
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
    text-align: center;
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-logo span:first-child { color: var(--gray-800); }
.login-logo span:last-child { color: var(--orange); }

.login-card h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 4px;
    margin-top: 12px;
}

.login-subtitle {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: var(--gray-50);
}

.form-group input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: var(--card);
}

.form-group input::placeholder {
    color: var(--gray-300);
}

.login-error {
    color: #EF4444;
    font-size: 0.82rem;
    margin-top: 10px;
    min-height: 1.2em;
    text-align: center;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--purple);
    color: white;
}

.btn-primary:hover {
    background: var(--purple-dark);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

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

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-400);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .columns-2 {
        grid-template-columns: 1fr;
    }
    .plant-section {
        flex-direction: column;
        text-align: center;
    }
    .plant-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 20px 16px 32px;
        max-width: 100%;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .plant-section {
        padding: 20px;
    }
    .plant-left {
        flex-direction: column;
    }
    .top-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .login-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    .welcome h1 {
        font-size: 1.2rem;
    }
}

/* ════════════════════════════════════════════════
   Withings Dashboard Widgets
   ════════════════════════════════════════════════ */
.withings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.withings-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
}

.withings-info.warning {
    background: #FEF3C7;
    color: #92400E;
}

.withings-info.connected {
    background: #D1FAE5;
    color: #065F46;
}

.withings-icon {
    font-size: 1.1rem;
}

.withings-connect-btn,
.withings-sync-btn,
.withings-disconnect-btn {
    padding: 4px 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

.withings-connect-btn {
    background: var(--primary);
    color: #fff;
}

.withings-sync-btn {
    background: var(--blue);
    color: #fff;
}

.withings-disconnect-btn {
    background: transparent;
    color: #EF4444;
    font-size: 0.9rem;
    padding: 2px 6px;
}

.withings-placeholder {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-400);
}

.withings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.withings-card {
    background: var(--card-bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: box-shadow 0.2s;
}

.withings-card:hover {
    box-shadow: var(--shadow-md);
}

.withings-card-header {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.withings-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.withings-card-value small {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-500);
}

.withings-card-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.withings-card-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 99px;
    margin-top: 8px;
    overflow: hidden;
}

.withings-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--blue));
    border-radius: 99px;
    transition: width 0.5s ease;
}

.withings-card-footer {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 6px;
}

@media (max-width: 600px) {
    .withings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .withings-card-value {
        font-size: 1.1rem;
    }
}

/* ════════════════════════════════════════════════════════════════
   VIEW SYSTEM
   ════════════════════════════════════════════════════════════════ */
.view-section {
    display: none;
}
.view-section.active {
    display: block;
}

/* ════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: var(--card);
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}
.btn-primary {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}
.btn-primary:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}
.btn-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.btn-del:hover {
    background: #FEF2F2;
    color: #EF4444;
}
.logout-btn {
    margin-top: 16px;
    color: var(--gray-400);
    border-color: var(--gray-200);
}
.logout-btn:hover {
    background: #FEF2F2;
    color: #EF4444;
    border-color: #FECACA;
}

/* ════════════════════════════════════════════════════════════════
   VIEW TOOLBAR / FILTERS
   ════════════════════════════════════════════════════════════════ */
.view-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-group label {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-weight: 500;
}
.filter-group select,
.filter-input {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--card);
    color: var(--gray-700);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.filter-group select:focus,
.filter-input:focus {
    border-color: var(--purple);
}
.sessions-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--gray-500);
    padding: 10px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}
.sessions-stats-bar strong {
    color: var(--gray-800);
}

/* ════════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.modal label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}
.modal input,
.modal select,
.modal textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--card);
    color: var(--gray-700);
    outline: none;
    transition: border-color 0.15s;
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    border-color: var(--purple);
}
.modal textarea {
    resize: vertical;
    min-height: 80px;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ════════════════════════════════════════════════════════════════
   STATS SUMMARY (vue statistiques)
   ════════════════════════════════════════════════════════════════ */
.stats-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stats-summary-cards .stat-card {
    padding: 16px 18px;
    display: block;
}
.stats-summary-cards .stat-card h4 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

/* ════════════════════════════════════════════════════════════════
   GOALS / OBJECTIFS
   ════════════════════════════════════════════════════════════════ */
.goal-item {
    margin-bottom: 16px;
}
.goal-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.goal-header span:last-child {
    font-weight: 600;
    color: var(--purple);
}
.goal-bar-bg {
    height: 10px;
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
}
.goal-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--orange));
    border-radius: 10px;
    transition: width 0.5s ease;
}
.goal-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.goal-form-row label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-600);
}
.goal-form-row input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--card);
    color: var(--gray-700);
    outline: none;
}
.goal-form-row input:focus {
    border-color: var(--purple);
}

/* ════════════════════════════════════════════════════════════════
   PROFIL
   ════════════════════════════════════════════════════════════════ */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding: 20px;
    background: linear-gradient(135deg, var(--purple-bg), #FDF2F8);
    border-radius: var(--radius);
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-800);
}
.profile-header p {
    color: var(--gray-500);
    font-size: 0.88rem;
}

/* ════════════════════════════════════════════════════════════════
   THEME TOGGLE
   ════════════════════════════════════════════════════════════════ */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-700);
    font-weight: 500;
}
.toggle-label input {
    display: none;
}
.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--gray-200);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}
.toggle-slider::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-label input:checked + .toggle-slider {
    background: var(--purple);
}
.toggle-label input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* ════════════════════════════════════════════════════════════════
   FORM STYLES
   ════════════════════════════════════════════════════════════════ */
.chart-card form label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}
.chart-card form input {
    display: block;
    width: 100%;
    max-width: 400px;
    margin-top: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--card);
    color: var(--gray-700);
    outline: none;
    transition: border-color 0.15s;
}
.chart-card form input:focus {
    border-color: var(--purple);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLETS
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .stats-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .columns-2 {
        grid-template-columns: 1fr;
    }
    .plant-section {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .plant-stats {
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
        box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px 16px 40px;
        max-width: 100vw;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card {
        padding: 14px 12px;
        gap: 10px;
    }
    .stat-number {
        font-size: 1.2rem;
    }
    .stats-summary-cards {
        grid-template-columns: 1fr;
    }
    .columns-2 {
        grid-template-columns: 1fr;
    }
    .view-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-wrap: wrap;
    }
    .modal {
        width: 95%;
        padding: 20px;
    }
    .top-header {
        margin-bottom: 20px;
    }
    .welcome h1 {
        font-size: 1.2rem;
    }
    .welcome p {
        font-size: 0.78rem;
    }
    .chart-card {
        padding: 16px;
    }
    .chart-card h2 {
        font-size: 0.85rem;
    }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 500px;
    }
    .goal-form-row {
        grid-template-columns: 1fr;
    }
    .plant-section {
        padding: 16px;
    }
    .plant-left {
        flex-direction: column;
        text-align: center;
    }
    .user-name {
        display: none;
    }
    .user-dropdown {
        display: none;
    }
}

/* ════════════════════════════════════════════════════════════════
   DARK THEME
   ════════════════════════════════════════════════════════════════ */
body.dark-theme {
    --card: #1e1e32;
    --gray-50: #1a1a2e;
    --gray-100: #252540;
    --gray-200: #303050;
    --gray-300: #404060;
    --gray-400: #606080;
    --gray-500: #8080a0;
    --gray-600: #a0a0c0;
    --gray-700: #c0c0d0;
    --gray-800: #e0e0e0;
    --purple-bg: rgba(124, 58, 237, 0.1);
    --purple-light: rgba(124, 58, 237, 0.15);
    --orange-light: rgba(245, 158, 11, 0.15);
    --green-light: rgba(16, 185, 129, 0.15);
    --blue-light: rgba(59, 130, 246, 0.15);
    --pink-light: rgba(236, 72, 153, 0.15);
    background: linear-gradient(180deg, #0f0f1e 0%, #1a1a2e 40%);
    color: #e0e0e0;
}

body.dark-theme .sidebar {
    background: var(--card);
    border-right-color: var(--gray-100);
}

body.dark-theme .stat-card,
body.dark-theme .chart-card,
body.dark-theme .modal {
    background: var(--card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-theme .nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-200);
}

body.dark-theme .nav-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

body.dark-theme .notif-btn,
body.dark-theme .user-badge {
    background: var(--gray-50);
}

body.dark-theme .filter-group select,
body.dark-theme .filter-input,
body.dark-theme .modal input,
body.dark-theme .modal select,
body.dark-theme .modal textarea,
body.dark-theme .chart-card form input,
body.dark-theme .goal-form-row input {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-200);
}

body.dark-theme .sessions-stats-bar {
    background: var(--gray-50);
    color: var(--gray-400);
}

body.dark-theme .sessions-stats-bar strong {
    color: var(--gray-200);
}

body.dark-theme .table-container table {
    color: var(--gray-300);
}

body.dark-theme .plant-section {
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.05), rgba(245,158,11,0.05));
}

body.dark-theme .profile-header {
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(236,72,153,0.08));
}

body.dark-theme .welcome h1,
body.dark-theme .welcome p,
body.dark-theme .stat-info h4,
body.dark-theme .stat-number,
body.dark-theme .chart-card h2,
body.dark-theme .stat-change,
body.dark-theme .plant-info h3,
body.dark-theme .plant-stat-item strong,
body.dark-theme .profile-header h2 {
    color: var(--gray-200);
}

body.dark-theme .welcome p,
body.dark-theme .plant-health-label,
body.dark-theme .plant-message,
body.dark-theme .plant-stat-item,
body.dark-theme .stat-info h4,
body.dark-theme .profile-header p {
    color: var(--gray-400);
}
