
/* ===== app.css ===== */
:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafb;
    --text: #15242b;
    --muted: #6b7b83;
    --border: #e3e9ec;
    --accent: #0f766e;
    --accent-soft: #dff5f1;
    --success: #16855b;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --sidebar: #102d2a;
    --sidebar-text: #d8ebe8;
    --sidebar-muted: #8eb6b0;
    --shadow: 0 20px 60px rgba(19, 52, 49, .08);
}

[data-theme="dark"] {
    --bg: #0d171b;
    --surface: #142328;
    --surface-soft: #182b31;
    --text: #edf7f5;
    --muted: #9bb0b5;
    --border: #284047;
    --accent: #5fd2c3;
    --accent-soft: #173a37;
    --danger-bg: #351b1b;
    --sidebar: #091312;
    --sidebar-text: #dff7f3;
    --sidebar-muted: #7fa8a2;
    --shadow: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: var(--sidebar);
    color: var(--sidebar-text);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px;
}

.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 2px; color: var(--sidebar-muted); }

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #2dd4bf, #0f766e);
    color: white;
    font-weight: 900;
}

.sidebar-nav {
    display: grid;
    gap: 7px;
}

.sidebar-nav a,
.sidebar-nav button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 13px;
    padding: 12px 14px;
    background: transparent;
    color: var(--sidebar-text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, .1);
}

.sidebar-nav button:disabled {
    color: var(--sidebar-muted);
    cursor: default;
}

.sidebar-nav small {
    margin-left: auto;
    font-size: .68rem;
    opacity: .75;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .07);
}

.profile-chip strong, .profile-chip small { display: block; }
.profile-chip small { color: var(--sidebar-muted); margin-top: 2px; }

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.logout-button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: 10px;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
}

.app-main { min-width: 0; }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px clamp(18px, 4vw, 42px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.topbar-title strong, .topbar-title small { display: block; }
.topbar-title small { margin-top: 3px; color: var(--muted); }

.theme-toggle,
.mobile-menu {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 9px 12px;
    cursor: pointer;
}

.theme-toggle { margin-left: auto; }
.mobile-menu { display: none; }

.page-container {
    width: min(1280px, calc(100% - 36px));
    margin: 30px auto 60px;
}

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
        var(--surface);
    box-shadow: var(--shadow);
}

.eyebrow {
    color: var(--accent);
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.welcome-panel h1 {
    margin: 10px 0 8px;
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.05;
}

.welcome-panel p { margin: 0; color: var(--muted); }

.health-score {
    min-width: 190px;
    padding: 18px;
    border-radius: 18px;
    background: var(--accent-soft);
}

.health-score small, .health-score strong, .health-score span { display: block; }
.health-score strong { margin: 4px 0 8px; font-size: 1.55rem; }
.health-score span { color: var(--success); font-size: .82rem; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.metric-card {
    min-height: 205px;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
}

.metric-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--surface-soft);
    font-size: 1.25rem;
}

.metric-content small, .metric-content strong, .metric-content span { display: block; }
.metric-content small { color: var(--muted); }
.metric-content strong { margin: 6px 0; font-size: 1.55rem; }
.metric-content span { color: var(--muted); font-size: .82rem; line-height: 1.45; }

.sparkline {
    height: 48px;
    margin-top: auto;
    color: var(--accent);
}

.sparkline svg { width: 100%; height: 100%; }
.empty-sparkline { color: var(--muted); font-size: .75rem; }

.progress,
.pain-scale {
    height: 8px;
    margin-top: auto;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-soft);
}

.progress span,
.pain-scale span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2dd4bf, var(--accent));
}

.pain-scale span {
    background: linear-gradient(90deg, #facc15, #ef4444);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 18px;
    margin-top: 18px;
}

.panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header small { color: var(--muted); }
.panel-header h2 { margin: 4px 0 0; }

.status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
}

.daily-list { display: grid; gap: 10px; }

.daily-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: 14px;
    background: var(--surface-soft);
}

.daily-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
}

.daily-item strong, .daily-item span { display: block; }
.daily-item span { margin-top: 3px; color: var(--muted); font-size: .82rem; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-actions a {
    min-height: 112px;
    display: grid;
    place-items: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.quick-actions a:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.quick-actions a span { font-size: 1.35rem; }
.quick-actions a small { color: var(--muted); }
.status-pill-link { text-decoration: none; }

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
}

.guest-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px clamp(20px, 5vw, 72px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand { color: var(--text); font-weight: 800; text-decoration: none; }

.container {
    width: min(1080px, calc(100% - 32px));
    margin: 42px auto;
}

.auth-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 480px);
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card h1 { margin: 14px 0 8px; font-size: clamp(2rem, 6vw, 3rem); }
.auth-card > p { color: var(--muted); line-height: 1.6; }

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 700;
}

.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.form-stack label { display: grid; gap: 7px; font-weight: 700; }

.form-stack input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
}

.form-stack input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.form-stack small { color: var(--muted); font-weight: 400; }

.button {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    padding: 13px 18px;
    font-weight: 800;
    cursor: pointer;
}

.button-block { width: 100%; }

@media (max-width: 1080px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        width: 270px;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .25);
    }

    .sidebar.open { transform: translateX(0); }
    .mobile-menu { display: inline-grid; place-items: center; }
}

@media (max-width: 620px) {
    .page-container { width: min(100% - 24px, 1280px); margin-top: 18px; }
    .welcome-panel { align-items: flex-start; flex-direction: column; }
    .health-score { width: 100%; }
    .metric-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .app-topbar { padding-inline: 12px; }
    .topbar-title small { display: none; }
}


/* RC1 A2 Rev1: Bugünün özeti plan butonu */
.dashboard-plan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent);
    color: #06211f;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, filter .18s ease;
}
.dashboard-plan-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}
.dashboard-plan-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
    outline-offset: 3px;
}
@media (max-width: 640px) {
    .panel-header { align-items: flex-start; }
    .dashboard-plan-button { width: 100%; margin-top: 10px; }
}

/* ===== treatment.css ===== */
.module-heading{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:22px}.module-heading h1{margin:8px 0;font-size:clamp(2rem,5vw,3.4rem)}.module-heading p{margin:0;color:var(--muted)}.module-actions{display:flex;gap:10px;flex-wrap:wrap}.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}.button-secondary{border:1px solid var(--border);background:var(--surface);color:var(--text)}.alert-success{color:var(--success);background:color-mix(in srgb,var(--success) 10%,var(--surface));border:1px solid color-mix(in srgb,var(--success) 22%,transparent)}.empty-state{padding:60px 24px;border:1px dashed var(--border);border-radius:24px;background:var(--surface);text-align:center}.empty-state-icon{width:74px;height:74px;display:grid;place-items:center;margin:0 auto 18px;border-radius:22px;background:var(--accent-soft);font-size:2rem}.empty-state p{color:var(--muted)}.treatment-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.treatment-card{padding:20px;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}.treatment-card.is-passive{opacity:.58}.treatment-card-top{display:flex;justify-content:space-between;align-items:center}.treatment-symbol{width:48px;height:48px;display:grid;place-items:center;border-radius:15px;background:var(--surface-soft);font-size:1.45rem}.treatment-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px}.treatment-meta>span{padding:11px;border-radius:13px;background:var(--surface-soft)}.treatment-meta small,.treatment-meta strong{display:block}.text-action{margin-top:16px;border:0;background:transparent;color:var(--accent);font-weight:800;cursor:pointer}.form-panel{overflow:hidden;border:1px solid var(--border);border-radius:24px;background:var(--surface)}.form-section{display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;padding:28px;border-bottom:1px solid var(--border)}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-grid label{display:grid;gap:7px;font-weight:700}.form-grid input,.form-grid select,.form-grid textarea{width:100%;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:12px 13px}.form-wide{grid-column:1/-1}.day-picker{grid-column:2;display:flex;gap:8px;flex-wrap:wrap;border:0;padding:0}.day-picker label input{position:absolute;opacity:0}.day-picker label span{display:grid;place-items:center;min-width:48px;height:42px;border:1px solid var(--border);border-radius:12px}.day-picker label input:checked+span{background:var(--accent);color:#fff}.form-submit{display:flex;justify-content:flex-end;gap:10px;padding:22px 28px}.today-treatment-list{display:grid;gap:12px}.today-treatment-item{display:grid;grid-template-columns:74px 48px minmax(0,1fr) auto auto;align-items:center;gap:16px;padding:16px;border:1px solid var(--border);border-radius:18px;background:var(--surface)}.status-taken{border-left:5px solid var(--success)}.treatment-time{color:var(--accent);font-weight:900}.today-treatment-main strong,.today-treatment-main span{display:block}.today-treatment-main span{color:var(--muted)}.state{display:inline-flex;padding:7px 10px;border-radius:999px;font-size:.78rem;font-weight:800}.state-success{color:var(--success);background:color-mix(in srgb,var(--success) 12%,var(--surface))}.state-pending{color:var(--accent);background:var(--accent-soft)}.state-muted{color:var(--muted);background:var(--surface-soft)}.today-treatment-actions{display:flex;gap:6px;flex-wrap:wrap}.small-action{border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);padding:8px 10px}.success-action{border-color:var(--success);color:var(--success)}@media(max-width:900px){.treatment-grid{grid-template-columns:1fr 1fr}.today-treatment-item{grid-template-columns:62px 42px 1fr}.today-treatment-status,.today-treatment-actions{grid-column:3}}@media(max-width:700px){.module-heading{flex-direction:column}.treatment-grid{grid-template-columns:1fr}.form-section{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.form-wide,.day-picker{grid-column:1}.today-treatment-item{grid-template-columns:56px 1fr}.today-treatment-symbol{display:none}.today-treatment-status,.today-treatment-actions{grid-column:2}}

/* ===== treatment-multi-schedule.css ===== */
.treatment-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.schedule-layout {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 18px;
}

.schedule-list {
    display: grid;
    gap: 10px;
}

.schedule-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 15px;
    background: var(--surface-soft);
}

.schedule-clock {
    color: var(--accent);
    font-size: 1.35rem;
    font-weight: 900;
}

.schedule-info strong,
.schedule-info span {
    display: block;
}

.schedule-info span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .86rem;
}

.schedule-days {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.schedule-days small {
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
}

.schedule-empty {
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 15px;
    color: var(--muted);
    text-align: center;
}

.compact-form {
    display: grid;
    gap: 15px;
}

.compact-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.compact-form input,
.compact-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 13px;
}

.compact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.schedule-day-picker {
    grid-column: auto;
    margin: 0;
}

.danger-action {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

@media (max-width: 960px) {
    .schedule-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .schedule-row {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .schedule-row form {
        grid-column: 2;
    }

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

/* ===== glucose.css ===== */
.glucose-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.glucose-summary-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.glucose-summary-card small,
.glucose-summary-card strong,
.glucose-summary-card span {
    display: block;
}

.glucose-summary-card small,
.glucose-summary-card span {
    color: var(--muted);
}

.glucose-summary-card strong {
    margin: 8px 0 4px;
    font-size: 2rem;
}

.glucose-history-panel {
    margin-top: 18px;
}

.glucose-table-wrap {
    overflow-x: auto;
}

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

.glucose-table th,
.glucose-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.glucose-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.glucose-table td strong,
.glucose-table td small {
    display: block;
}

.glucose-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.glucose-value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 12px;
    font-weight: 900;
}

.glucose-value small {
    margin: 0 !important;
    font-size: .7rem;
}

.glucose-value.normal {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
}

.glucose-value.low {
    color: #b7791f;
    background: color-mix(in srgb, #b7791f 10%, var(--surface));
}

.glucose-value.high {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.input-with-unit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.input-with-unit b {
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--muted);
}

.glucose-empty {
    margin-top: 18px;
}

@media (max-width: 900px) {
    .glucose-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .glucose-summary-grid {
        grid-template-columns: 1fr;
    }

    .glucose-table th:nth-child(4),
    .glucose-table td:nth-child(4) {
        display: none;
    }
}

/* ===== data-management.css ===== */
.glucose-filter-form{display:grid;grid-template-columns:1fr 1fr 160px auto;gap:12px;align-items:end}
.glucose-filter-form label{display:grid;gap:7px;font-weight:700}
.glucose-filter-form input,.glucose-filter-form select{width:100%;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:11px 12px}
.filter-actions,.row-actions{display:flex;gap:8px;align-items:center}
.pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:18px}
.pagination a{border:1px solid var(--border);border-radius:11px;padding:9px 12px;color:var(--text);text-decoration:none}
@media(max-width:850px){.glucose-filter-form{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.glucose-filter-form{grid-template-columns:1fr}.pagination{flex-wrap:wrap;justify-content:center}}

/* ===== weight.css ===== */
.weight-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.weight-summary-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.weight-summary-card small,
.weight-summary-card strong,
.weight-summary-card span {
    display: block;
}

.weight-summary-card small,
.weight-summary-card span {
    color: var(--muted);
}

.weight-summary-card strong {
    margin: 8px 0 4px;
    font-size: 2rem;
}

.good-change {
    color: var(--success);
}

.weight-filter-panel {
    margin-bottom: 18px;
}

.weight-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 180px auto;
    align-items: end;
    gap: 12px;
}

.weight-filter-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.weight-filter-form input,
.weight-filter-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 11px 12px;
}

.weight-table-wrap {
    overflow-x: auto;
}

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

.weight-table th,
.weight-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.weight-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.weight-table td strong,
.weight-table td small {
    display: block;
}

.weight-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.weight-value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 900;
}

.weight-value small {
    margin: 0 !important;
    font-size: .7rem;
}

@media (max-width: 900px) {
    .weight-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 560px) {
    .weight-summary-grid,
    .weight-filter-form {
        grid-template-columns: 1fr;
    }

    .weight-table th:nth-child(4),
    .weight-table td:nth-child(4),
    .weight-table th:nth-child(5),
    .weight-table td:nth-child(5) {
        display: none;
    }
}

/* ===== smart-weight.css ===== */
.smart-weight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.smart-weight-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.smart-weight-card small,
.smart-weight-card strong,
.smart-weight-card span {
    display: block;
}

.smart-weight-card small,
.smart-weight-card span {
    color: var(--muted);
}

.smart-weight-card strong {
    margin: 8px 0 4px;
    font-size: 1.9rem;
}

@media (max-width: 900px) {
    .smart-weight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .smart-weight-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== water.css ===== */
.water-hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    margin-bottom: 18px;
}

.water-progress-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
}

.water-circle {
    --progress: 0;
    width: 160px;
    height: 160px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
        conic-gradient(
            var(--accent) calc(var(--progress) * 1%),
            var(--surface-soft) 0
        );
}

.water-circle div {
    text-align: center;
}

.water-circle strong,
.water-circle small {
    display: block;
}

.water-circle strong {
    font-size: 2rem;
}

.water-circle small {
    color: var(--muted);
}

.water-progress-info small,
.water-progress-info h2,
.water-progress-info p {
    display: block;
}

.water-progress-info > small {
    color: var(--muted);
}

.water-progress-info h2 {
    margin: 8px 0;
    font-size: 2rem;
}

.water-progress-info p {
    color: var(--muted);
}

.quick-water-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.quick-water-grid button {
    width: 100%;
    min-height: 86px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
}

.quick-water-grid button span {
    font-size: 1.3rem;
}

.water-chart-panel {
    margin-bottom: 18px;
}

.water-bars {
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    overflow-x: auto;
    padding-top: 16px;
}

.water-bar-item {
    min-width: 68px;
    display: grid;
    gap: 6px;
    text-align: center;
}

.water-bar-track {
    height: 150px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface-soft);
}

.water-bar-track span {
    width: 100%;
    min-height: 8px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg, #5eead4, var(--accent));
}

.water-bar-item strong {
    font-size: .82rem;
}

.water-bar-item small {
    color: var(--muted);
}

.water-filter-panel {
    margin-bottom: 18px;
}

.water-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 180px auto;
    align-items: end;
    gap: 12px;
}

.water-filter-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.water-filter-form input,
.water-filter-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 11px 12px;
}

.water-table-wrap {
    overflow-x: auto;
}

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

.water-table th,
.water-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.water-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
}

.water-table td strong,
.water-table td small {
    display: block;
}

.water-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.water-value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 900;
}

.water-value small {
    margin: 0 !important;
    font-size: .7rem;
}

@media (max-width: 980px) {
    .water-hero {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .water-progress-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

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

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

/* ===== exercise.css ===== */
.exercise-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.exercise-summary-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.exercise-summary-card small,
.exercise-summary-card strong,
.exercise-summary-card span {
    display: block;
}

.exercise-summary-card small,
.exercise-summary-card span {
    color: var(--muted);
}

.exercise-summary-card strong {
    margin: 8px 0 4px;
    font-size: 2rem;
}

.exercise-filter-panel {
    margin-bottom: 18px;
}

.exercise-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 180px auto;
    align-items: end;
    gap: 12px;
}

.exercise-filter-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.exercise-filter-form input,
.exercise-filter-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    padding: 11px 12px;
}

.exercise-list {
    display: grid;
    gap: 12px;
}

.exercise-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 90px 110px auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.exercise-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--surface-soft);
    font-size: 1.4rem;
}

.exercise-card-main strong,
.exercise-card-main span,
.exercise-card-main small,
.exercise-card-metric strong,
.exercise-card-metric span,
.exercise-card-pain small,
.exercise-card-pain strong {
    display: block;
}

.exercise-card-main span,
.exercise-card-main small,
.exercise-card-metric span,
.exercise-card-pain small {
    color: var(--muted);
}

.exercise-card-main span,
.exercise-card-main small {
    margin-top: 4px;
}

.exercise-card-metric strong {
    font-size: 1.5rem;
}

.exercise-card-pain strong {
    margin-top: 4px;
}

@media (max-width: 980px) {
    .exercise-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .exercise-card {
        grid-template-columns: 52px minmax(0, 1fr) 80px;
    }

    .exercise-card-pain,
    .exercise-card .row-actions {
        grid-column: 2 / -1;
    }
}

@media (max-width: 600px) {
    .exercise-summary-grid,
    .exercise-filter-form {
        grid-template-columns: 1fr;
    }

    .exercise-card {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .exercise-card-metric,
    .exercise-card-pain,
    .exercise-card .row-actions {
        grid-column: 2;
    }
}

/* ===== exercise-routines.css ===== */
.routine-section {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
}

.routine-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.routine-group {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-soft);
}

.routine-group h3 {
    margin: 0 0 12px;
}

.routine-template-list {
    display: grid;
    gap: 8px;
}

.routine-template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.routine-template-card strong,
.routine-template-card span {
    display: block;
}

.routine-template-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .82rem;
}

.routine-template-card b {
    color: var(--accent);
    white-space: nowrap;
}

.time-select-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-label input {
    width: auto !important;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .routine-groups {
        grid-template-columns: 1fr;
    }
}

/* ===== daily-plan.css ===== */
.daily-plan-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
}

.daily-plan-hero small,
.daily-plan-hero h2,
.daily-plan-hero p {
    display: block;
}

.daily-plan-hero small,
.daily-plan-hero p {
    color: var(--muted);
}

.daily-plan-hero h2 {
    margin: 8px 0;
}

.daily-plan-ring {
    --progress: 0;
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
        conic-gradient(
            var(--accent) calc(var(--progress) * 1%),
            var(--surface-soft) 0
        );
}

.daily-plan-ring strong {
    font-size: 1.35rem;
}

.daily-plan-groups {
    display: grid;
    gap: 16px;
}

.daily-plan-group {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
}

.daily-plan-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.daily-plan-group-header h2 {
    margin: 0;
}

.daily-plan-group-header span {
    color: var(--muted);
    font-size: .82rem;
}

.daily-plan-list {
    display: grid;
    gap: 10px;
}

.daily-plan-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-soft);
}

.daily-plan-item.status-completed {
    border-color: color-mix(in srgb, var(--success) 40%, var(--border));
    opacity: .82;
}

.daily-plan-item.status-skipped {
    opacity: .58;
}

.daily-plan-check {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
    font-size: 1.2rem;
    font-weight: 900;
}

.status-completed .daily-plan-check {
    background: color-mix(in srgb, var(--success) 15%, var(--surface));
    color: var(--success);
}

.daily-plan-item-main strong,
.daily-plan-item-main span {
    display: block;
}

.daily-plan-item-main span {
    margin-top: 5px;
    color: var(--muted);
    font-size: .84rem;
}

.daily-plan-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .daily-plan-hero {
        align-items: flex-start;
    }

    .daily-plan-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .daily-plan-actions {
        grid-column: 2;
    }
}

/* ===== daily-plan-v2.css ===== */
.daily-plan-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.daily-plan-top h1 {
    margin: 7px 0 4px;
    font-size: clamp(2rem, 5vw, 3rem);
}

.daily-plan-top p {
    margin: 0;
    color: var(--muted);
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.date-navigation a {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.date-navigation .today-link {
    padding: 0 13px;
}

.daily-plan-summary {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.daily-plan-summary > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.daily-plan-summary strong {
    font-size: 1.8rem;
}

.daily-plan-summary span,
.daily-plan-summary small {
    color: var(--muted);
}

.summary-progress {
    display: grid;
    gap: 7px;
}

.compact-plan {
    display: grid;
    gap: 14px;
}

.compact-plan-group {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.compact-plan-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.compact-plan-group > header h2 {
    margin: 0;
    font-size: 1.02rem;
}

.compact-plan-group > header span {
    min-width: 28px;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    font-size: .75rem;
}

.compact-plan-list {
    display: grid;
}

.compact-plan-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.compact-plan-item:last-child {
    border-bottom: 0;
}

.compact-plan-item.is-completed {
    background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

.compact-plan-item.is-skipped {
    opacity: .52;
}

.plan-check {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.is-completed .plan-check {
    border-color: var(--success);
    background: var(--success);
}

.compact-plan-main strong,
.compact-plan-main span {
    display: block;
}

.compact-plan-main strong {
    font-size: .92rem;
}

.compact-plan-main span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .76rem;
}

.is-completed .compact-plan-main strong {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.skip-link {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: .75rem;
}

.skip-link:hover {
    color: var(--text);
}

@media (max-width: 640px) {
    .daily-plan-top {
        flex-direction: column;
    }

    .daily-plan-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .compact-plan-item {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        padding-inline: 11px;
    }
}

/* ===== reports.css ===== */
.report-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px;border:1px solid var(--border);border-radius:24px;background:linear-gradient(135deg,var(--surface),var(--accent-soft));margin-bottom:18px}.report-hero h1{margin:12px 0 8px}.report-hero p{margin:0;color:var(--muted);max-width:720px}.report-filter{display:flex;align-items:end;gap:14px;flex-wrap:wrap;padding:18px;border:1px solid var(--border);border-radius:18px;background:var(--surface);margin-bottom:18px}.report-filter label{display:grid;gap:6px;font-weight:700}.report-filter input{padding:11px 12px;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text)}.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.report-card{padding:22px;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:var(--shadow)}.report-card header{display:flex;align-items:center;gap:12px}.report-card header>span{font-size:1.7rem}.report-card h2{margin:0;font-size:1.05rem}.report-card header small,.report-values span,.report-disclaimer,.compliance-row p{color:var(--muted)}.report-values{display:grid;gap:7px;margin:18px 0}.report-values strong{font-size:1.8rem}.report-values strong small{font-size:.8rem;color:var(--muted)}.report-chart{height:120px;display:grid;place-items:center;color:var(--accent);border-radius:14px;background:var(--accent-soft);overflow:hidden}.report-chart svg{width:100%;height:100%}.report-chart span{font-size:.85rem;color:var(--muted);padding:10px;text-align:center}.report-card-wide{grid-column:1/-1}.compliance-row{display:flex;align-items:center;gap:18px;margin-top:20px}.compliance-score{display:grid;place-items:center;width:90px;height:90px;border-radius:50%;font-size:1.6rem;font-weight:900;background:var(--accent-soft);color:var(--accent)}.compliance-row p{margin:5px 0}.report-disclaimer{text-align:center;font-size:.85rem;margin:22px 0 0}.nav-group{border-bottom:1px solid color-mix(in srgb,var(--border) 55%,transparent)}.nav-group summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;cursor:pointer;font-weight:800;color:var(--muted)}.nav-group summary::-webkit-details-marker{display:none}.nav-group summary::after{content:'⌄';transition:transform .2s}.nav-group[open] summary::after{transform:rotate(180deg)}.nav-group-links{display:grid;padding:0 0 8px}.nav-group-links a{padding-left:22px!important}.nav-group-active summary{color:var(--accent)}
@media(max-width:760px){.report-hero{align-items:flex-start;flex-direction:column}.report-grid{grid-template-columns:1fr}.report-card-wide{grid-column:auto}.report-print-button{width:100%}}
@media print{.sidebar,.app-topbar,.report-filter,.report-print-button{display:none!important}.app-shell{display:block!important}.app-main{width:100%!important}.page-container{width:100%!important;margin:0!important}.report-card{break-inside:avoid;box-shadow:none}.report-hero{padding:12px}.report-grid{gap:10px}}

.report-presets{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:-4px 0 18px}.report-presets>span{color:var(--muted);font-size:.85rem;font-weight:700}.report-presets a{padding:8px 11px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text);text-decoration:none;font-size:.82rem;font-weight:800}.report-presets a:hover{border-color:var(--accent);color:var(--accent)}.report-period-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.report-period-summary>div{padding:15px 17px;border:1px solid var(--border);border-radius:15px;background:var(--surface)}.report-period-summary small,.report-period-summary strong{display:block}.report-period-summary small{color:var(--muted);margin-bottom:5px}.report-period-summary strong{font-size:.95rem}@media(max-width:760px){.report-period-summary{grid-template-columns:1fr}}@media print{.report-presets{display:none!important}.report-period-summary{grid-template-columns:repeat(3,1fr)}body{background:#fff!important;color:#111!important}.report-card,.report-hero,.report-period-summary>div{background:#fff!important;color:#111!important;border-color:#bbb!important}.report-chart{background:#f5f5f5!important}.report-disclaimer{color:#444!important}}

/* RC1 A3: doctor report */
.report-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.button-secondary{background:transparent!important;color:var(--text)!important;border:1px solid var(--border)!important;text-decoration:none}.doctor-report-toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:18px}.doctor-report{max-width:980px;margin:0 auto;padding:34px;border:1px solid var(--border);border-radius:22px;background:var(--surface);box-shadow:var(--shadow)}.doctor-report-header{display:flex;justify-content:space-between;gap:24px;padding-bottom:22px;border-bottom:2px solid var(--border)}.doctor-report-header h1{margin:10px 0 6px;font-size:1.75rem}.doctor-report-header p{margin:0;color:var(--muted)}.doctor-report-date{text-align:right}.doctor-report-date small,.doctor-report-date strong{display:block}.doctor-profile-grid,.doctor-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:20px}.doctor-profile-grid>div,.doctor-summary-card{padding:16px;border:1px solid var(--border);border-radius:14px}.doctor-profile-grid small,.doctor-profile-grid strong,.doctor-summary-card small,.doctor-summary-card strong,.doctor-summary-card span{display:block}.doctor-profile-grid small,.doctor-summary-card small,.doctor-summary-card span{color:var(--muted)}.doctor-summary-card strong{font-size:1.35rem;margin:6px 0}.doctor-summary-card span{font-size:.88rem}.doctor-summary-wide{grid-column:1/-1}.doctor-notes{margin-top:26px}.doctor-notes h2{font-size:1rem}.doctor-notes div{height:30px;border-bottom:1px solid var(--border)}.doctor-report footer{margin-top:24px;padding-top:16px;border-top:1px solid var(--border);font-size:.78rem;color:var(--muted)}
@media(max-width:760px){.report-actions,.doctor-report-toolbar{width:100%;flex-direction:column;align-items:stretch}.doctor-report{padding:20px}.doctor-report-header{flex-direction:column}.doctor-report-date{text-align:left}.doctor-profile-grid,.doctor-summary-grid{grid-template-columns:1fr}.doctor-summary-wide{grid-column:auto}}
@media print{.doctor-report-toolbar{display:none!important}.doctor-report{max-width:none;padding:0;border:0;box-shadow:none}.doctor-report-header,.doctor-profile-grid>div,.doctor-summary-card,.doctor-notes div,.doctor-report footer{border-color:#aaa!important}.doctor-profile-grid,.doctor-summary-grid{grid-template-columns:repeat(2,1fr)}.doctor-summary-wide{grid-column:1/-1}.doctor-report{background:#fff!important;color:#111!important}.doctor-report small,.doctor-report span,.doctor-report p,.doctor-report footer{color:#444!important}@page{size:A4;margin:14mm}}

/* v1.4.0 Professional doctor report */
.professional-report-header{align-items:flex-start}.professional-report-identity{display:flex;align-items:center;gap:1rem}.professional-report-qr{width:92px;height:92px;padding:5px;background:#fff;border:1px solid #d9e4e6;border-radius:10px}.professional-report-section{margin-top:1.2rem;padding:1.15rem;border:1px solid var(--border,#dce7e8);border-radius:14px;background:var(--surface,#fff);break-inside:avoid}.professional-report-section h2{margin:0 0 .8rem;font-size:1.05rem}.professional-summary-list,.professional-document-list{margin:0;padding-left:1.2rem}.professional-summary-list li{margin:.45rem 0;line-height:1.5}.professional-report-grid-two{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.professional-document-list li{margin:.7rem 0}.professional-document-list span{display:block;font-size:.82rem;opacity:.72;margin-top:.15rem}.professional-document-list p{margin:.3rem 0 0;line-height:1.45}.professional-table-wrap{overflow-x:auto}.professional-report-table{width:100%;border-collapse:collapse;font-size:.9rem}.professional-report-table th,.professional-report-table td{padding:.65rem;border-bottom:1px solid var(--border,#dce7e8);text-align:left;vertical-align:top}.professional-report-table th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}.professional-empty{margin:0;opacity:.72}.professional-doctor-report footer{display:flex;justify-content:space-between;gap:1rem}.professional-page-number{white-space:nowrap}@media(max-width:800px){.professional-report-grid-two{grid-template-columns:1fr}.professional-report-identity{flex-direction:column;align-items:flex-end}.professional-report-qr{width:78px;height:78px}}@media print{@page{size:A4;margin:12mm}.doctor-report-toolbar,.report-share-panel,.shared-report-topbar{display:none!important}.professional-doctor-report{box-shadow:none!important;border:0!important;padding:0!important}.professional-report-section{box-shadow:none!important;background:#fff!important;color:#111!important;border-color:#bbb!important}.professional-report-qr{width:26mm;height:26mm}.professional-report-table{font-size:8.5pt}.professional-report-table th,.professional-report-table td{padding:4pt}.professional-report-grid-two{grid-template-columns:1fr 1fr}.professional-page-number:after{content:" · PDF"}}

/* ===== dashboard-a4.css ===== */
.dashboard-welcome { margin-bottom: 18px; }
.score-panel { display:grid; grid-template-columns:auto minmax(240px,1fr) minmax(310px,1.15fr); gap:24px; align-items:center; padding:24px; margin-bottom:20px; border:1px solid var(--border); border-radius:22px; background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 12%,var(--surface)),var(--surface)); box-shadow:var(--shadow); }
.score-ring { --score:0; width:132px; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--accent) calc(var(--score) * 1%), color-mix(in srgb,var(--muted) 18%,transparent) 0); position:relative; }
.score-ring::before { content:""; position:absolute; inset:11px; border-radius:50%; background:var(--surface); }
.score-ring div { position:relative; text-align:center; display:grid; }
.score-ring strong { font-size:2.15rem; line-height:1; }
.score-ring span,.score-copy p,.score-components small { color:var(--muted); }
.score-copy h2 { margin:5px 0 7px; }
.score-copy p { margin:0; line-height:1.55; }
.score-components { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.score-components div { padding:12px 9px; border:1px solid var(--border); border-radius:14px; background:color-mix(in srgb,var(--surface) 92%,transparent); text-align:center; display:grid; gap:4px; }
.score-components span { font-size:.75rem; color:var(--muted); }
.score-components strong { font-size:.86rem; }
.score-components small { font-size:.72rem; }
.metric-link { color:inherit; text-decoration:none; transition:transform .18s ease,border-color .18s ease; }
.metric-link:hover { transform:translateY(-2px); border-color:var(--accent); }
.dashboard-a4-columns { grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); }
.timeline-list { display:grid; gap:8px; }
.timeline-item { display:grid; grid-template-columns:58px 38px 1fr; gap:10px; align-items:center; padding:10px 8px; border-radius:12px; text-decoration:none; color:inherit; }
.timeline-item:hover { background:color-mix(in srgb,var(--accent) 8%,transparent); }
.timeline-item time { color:var(--muted); font-weight:800; font-size:.82rem; }
.timeline-dot { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:color-mix(in srgb,var(--accent) 13%,transparent); }
.timeline-item > span:last-child { display:grid; gap:2px; }
.timeline-item small { color:var(--muted); }
.timeline-item.is-complete { opacity:.68; }
.timeline-item.is-complete strong { text-decoration:line-through; }
.empty-dashboard-state { padding:28px 10px; display:grid; gap:6px; text-align:center; color:var(--muted); }
.empty-dashboard-state strong { color:var(--text); }
.panel-footer-link { display:inline-flex; margin-top:16px; color:var(--accent); font-weight:800; text-decoration:none; }
.big-percent { font-size:1.65rem; color:var(--accent); }
.treatment-progress { height:12px; border-radius:999px; overflow:hidden; background:color-mix(in srgb,var(--muted) 18%,transparent); margin:18px 0 22px; }
.treatment-progress span { display:block; height:100%; border-radius:inherit; background:var(--accent); }
.treatment-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.treatment-summary div { padding:16px 8px; border:1px solid var(--border); border-radius:14px; text-align:center; display:grid; gap:4px; }
.treatment-summary strong { font-size:1.35rem; }
.treatment-summary span { color:var(--muted); font-size:.8rem; }
.quick-entry-panel { margin-top:20px; }
.dashboard-quick-actions { grid-template-columns:repeat(4,1fr); }
@media(max-width:1100px){.score-panel{grid-template-columns:auto 1fr}.score-components{grid-column:1/-1}.dashboard-a4-columns{grid-template-columns:1fr}}
@media(max-width:720px){.score-panel{grid-template-columns:1fr;text-align:center}.score-ring{margin:auto}.score-components{grid-template-columns:repeat(2,1fr)}.dashboard-quick-actions{grid-template-columns:repeat(2,1fr)}}

/* ===== dashboard-a6.css ===== */
.dashboard-intelligence-grid{display:grid;grid-template-columns:1.35fr .85fr;gap:1.25rem;margin-top:1.25rem}.insight-list,.notification-list{display:grid;gap:.7rem}.insight-item,.notification-item{display:grid;align-items:center;text-decoration:none;color:inherit;border:1px solid var(--border-color,#dbe5e3);border-radius:14px;background:var(--card-bg,#fff);transition:.18s ease}.insight-item{grid-template-columns:42px 1fr auto;gap:.8rem;padding:.85rem}.insight-item:hover,.notification-item:hover{transform:translateY(-1px);border-color:#0f766e}.insight-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:rgba(15,118,110,.11);font-size:1.15rem}.insight-item strong,.insight-item small{display:block}.insight-item small{margin-top:.2rem;line-height:1.45;color:var(--muted-color,#64748b)}.medical-disclaimer{margin:.85rem 0 0;font-size:.78rem;color:var(--muted-color,#64748b);line-height:1.4}.notification-count{min-width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#0f766e;color:#fff;font-weight:700}.notification-item{grid-template-columns:10px 1fr auto;gap:.65rem;padding:.8rem .85rem;font-size:.9rem}.notification-dot{width:9px;height:9px;border-radius:50%;background:#3b82f6}.notification-item.level-warning .notification-dot{background:#f59e0b}.notification-item.level-success .notification-dot{background:#10b981}.weekly-panel{margin-top:1.25rem}.panel-header-link{font-size:.88rem;text-decoration:none;color:#0f766e;font-weight:700}.weekly-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.8rem}.weekly-summary-grid>div{padding:1rem;border:1px solid var(--border-color,#dbe5e3);border-radius:14px;background:var(--card-bg,#fff)}.weekly-summary-grid span,.weekly-summary-grid strong,.weekly-summary-grid small{display:block}.weekly-summary-grid span{font-size:1.2rem;margin-bottom:.5rem}.weekly-summary-grid strong{font-size:1.25rem}.weekly-summary-grid small{margin-top:.3rem;color:var(--muted-color,#64748b)}@media(max-width:1050px){.weekly-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.dashboard-intelligence-grid{grid-template-columns:1fr}.weekly-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:420px){.weekly-summary-grid{grid-template-columns:1fr}}

/* ===== health-center-a7.css ===== */
.topbar-actions{display:flex;align-items:center;gap:.55rem}.topbar-notification-link{width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px;text-decoration:none;background:var(--surface);color:inherit}.score-detail-link{align-self:center;margin-left:auto;color:#0f766e;font-weight:800;text-decoration:none;white-space:nowrap}.notification-count-link{text-decoration:none}.health-detail-hero{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:1.5rem;margin-top:1.25rem}.score-ring-large{width:150px;height:150px}.health-component-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1.25rem}.health-component-card{text-decoration:none;color:inherit}.health-component-head{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.75rem}.health-component-head>span{font-size:1.35rem}.health-component-head>b{color:#0f766e}.health-component-bar{height:10px;background:rgba(100,116,139,.16);border-radius:999px;overflow:hidden;margin:.9rem 0 .65rem}.health-component-bar span{display:block;height:100%;background:#0f766e;border-radius:inherit}.health-component-card small{color:var(--muted)}.notification-page-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;margin-top:1.25rem}.notification-list-large .notification-item{min-height:58px}.notification-list-large{margin-top:.25rem}@media(max-width:850px){.notification-page-grid,.health-component-grid{grid-template-columns:1fr}.health-detail-hero{grid-template-columns:1fr;text-align:center}.score-ring-large{margin-inline:auto}.score-detail-link{width:100%;margin:.75rem 0 0;text-align:center}.score-panel{flex-wrap:wrap}}

/* ===== reports-a5.css ===== */
.report-actions { flex-wrap: wrap; }
.report-chart svg { display: block; width: 100%; min-height: 180px; overflow: visible; }
.chart-grid { stroke: currentColor; opacity: .12; stroke-width: 1; }
.chart-axis-label { fill: currentColor; opacity: .65; font-size: 12px; }
.chart-area { fill: currentColor; opacity: .08; }
.chart-line { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: currentColor; stroke: var(--surface, #fff); stroke-width: 2; }
.chart-range { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: .82rem; opacity: .78; }
.chart-empty { display: grid; min-height: 150px; place-items: center; text-align: center; opacity: .7; }
@media (max-width: 640px) {
  .report-actions .button { width: 100%; text-align: center; }
  .report-chart svg { min-height: 150px; }
}
@media print {
  .chart-grid { opacity: .18; }
  .chart-area { opacity: .06; }
  .chart-range { color: #111; }
}

/* ===== theme-a8.css ===== */
/* Meriç Health OS Pro RC1 A8 — dark theme contrast and component normalization */

/* Native controls should follow the selected application theme. */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* Keep text and surfaces consistent in every module. */
[data-theme="dark"] body,
[data-theme="dark"] .app-main,
[data-theme="dark"] .page-container,
[data-theme="dark"] main {
    color: var(--text);
}

[data-theme="dark"] :is(
    .metric-card, .panel, .card, .module-card, .summary-card, .stat-card,
    .treatment-card, .today-treatment-item, .form-panel, .empty-state,
    .report-card, .report-hero, .report-period-summary > div,
    .doctor-report, .doctor-profile-grid > div, .doctor-summary-card,
    .insight-item, .notification-item, .weekly-summary-grid > div,
    .health-component-card, .health-detail-hero, .notification-page-grid > section,
    .data-card, .history-card, .goal-card, .routine-card, .exercise-card,
    .water-card, .weight-card, .glucose-card, .daily-plan-card,
    .modal-content, .dialog-content, .dropdown-menu
) {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] :is(
    .metric-card, .panel, .card, .module-card, .summary-card, .stat-card,
    .treatment-card, .today-treatment-item, .form-panel,
    .report-card, .doctor-report, .insight-item, .notification-item,
    .weekly-summary-grid > div, .health-component-card
) :is(h1,h2,h3,h4,h5,h6,strong,b,label,legend,th,td,dt,dd,p,span,li) {
    color: inherit;
}

[data-theme="dark"] :is(
    .muted, .text-muted, .help-text, .form-help, .field-help,
    .metric-label, .metric-card small, .panel small, .card small,
    .treatment-meta small, .today-treatment-main span,
    .doctor-report small, .doctor-report footer,
    .weekly-summary-grid small, .insight-item small,
    .health-component-card small, .module-heading p
) {
    color: var(--muted) !important;
}

/* Inputs were the main source of white fields with unreadable text. */
[data-theme="dark"] :is(input, select, textarea) {
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    caret-color: var(--accent);
}

[data-theme="dark"] :is(input, textarea)::placeholder {
    color: var(--muted) !important;
    opacity: .82;
}

[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
    background: var(--surface);
    color: var(--text);
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-soft) inset;
    transition: background-color 9999s ease-out 0s;
}

[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

/* Tables and list rows. */
[data-theme="dark"] table {
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] :is(thead, th) {
    background: var(--surface-soft) !important;
    color: var(--text) !important;
}

[data-theme="dark"] :is(td, th, tr) {
    border-color: var(--border) !important;
}

[data-theme="dark"] tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface)) !important;
}

/* Soft inner boxes and chart canvases. */
[data-theme="dark"] :is(
    .treatment-symbol, .treatment-meta > span, .metric-icon,
    .report-chart, .chart-wrap, .chart-area, .health-score,
    .state-muted, .form-section, .quick-action, .plan-item,
    .history-row, .data-row, .summary-row
) {
    background-color: var(--surface-soft) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Buttons and links retain enough contrast. */
[data-theme="dark"] :is(.button-secondary, .small-action, .theme-toggle, .mobile-menu, .topbar-notification-link) {
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] :is(a, .text-action, .panel-header-link, .score-detail-link) {
    color: var(--accent);
}

[data-theme="dark"] .button,
[data-theme="dark"] .button-primary,
[data-theme="dark"] button[type="submit"] {
    border-color: transparent;
}

/* Status pills need dark-theme backgrounds, not pale light-theme fills. */
[data-theme="dark"] .state-success,
[data-theme="dark"] .alert-success {
    background: color-mix(in srgb, var(--success) 18%, var(--surface)) !important;
}

[data-theme="dark"] :is(.alert-error, .danger-box, .error-box) {
    background: var(--danger-bg) !important;
    color: #ffb4ab !important;
    border-color: color-mix(in srgb, #ffb4ab 35%, transparent) !important;
}

/* Browser print/PDF must stay white regardless of active theme. */
@media print {
    [data-theme="dark"] body,
    [data-theme="dark"] .doctor-report,
    [data-theme="dark"] .report-card,
    [data-theme="dark"] .report-hero,
    [data-theme="dark"] .report-period-summary > div {
        background: #fff !important;
        color: #111 !important;
    }
}

/* ===== pwa-a9.css ===== */
.pwa-install-button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);padding:9px 12px;font:inherit;font-weight:750;cursor:pointer}.pwa-install-button:hover{border-color:var(--accent)}.network-status{position:sticky;top:0;z-index:80;padding:9px 16px;background:#8b2f2f;color:#fff;text-align:center;font-weight:800;font-size:.9rem}.topbar-actions{display:flex;align-items:center;gap:8px}@media(max-width:620px){.pwa-install-button .pwa-label{display:none}.pwa-install-button{padding:9px 11px}}
@media print{.pwa-install-button,.network-status{display:none!important}}

/* ===== accessibility-a10.css ===== */
/* Meriç Health OS Pro RC1 A10 — dark mode button contrast and accessibility polish */

/* Dashboard primary plan button must remain visibly actionable in both themes. */
.dashboard-plan-button,
.dashboard-plan-button:visited {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #06211f !important;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 22%, transparent);
}

.dashboard-plan-button span {
    color: currentColor !important;
    font-size: 1.1em;
    line-height: 1;
    transition: transform .18s ease;
}

.dashboard-plan-button:hover,
.dashboard-plan-button:focus-visible {
    background: color-mix(in srgb, var(--accent) 88%, white) !important;
    border-color: color-mix(in srgb, var(--accent) 88%, white) !important;
    color: #031817 !important;
    text-decoration: none;
}

.dashboard-plan-button:hover span,
.dashboard-plan-button:focus-visible span {
    transform: translateX(3px);
}

[data-theme="dark"] .dashboard-plan-button,
[data-theme="dark"] .dashboard-plan-button:visited {
    background: var(--accent) !important;
    border-color: color-mix(in srgb, var(--accent) 78%, white) !important;
    color: #021817 !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, white 12%, transparent),
                0 10px 24px color-mix(in srgb, var(--accent) 25%, transparent);
}

[data-theme="dark"] .dashboard-plan-button:hover,
[data-theme="dark"] .dashboard-plan-button:focus-visible {
    background: color-mix(in srgb, var(--accent) 82%, white) !important;
    color: #001211 !important;
}

/* Keep link-style controls readable after generic dark-theme link rules. */
[data-theme="dark"] :is(
    .dashboard-plan-button,
    .dashboard-plan-button span,
    .button-primary,
    .button-primary:visited,
    button[type="submit"]
) {
    color: #021817 !important;
}

/* Better focus visibility for keyboard and mobile keyboard users. */
:is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 58%, white);
    outline-offset: 3px;
}

/* Prevent low-contrast arrows and labels in footer/header links. */
[data-theme="dark"] :is(.panel-footer-link, .panel-header-link, .score-detail-link) {
    color: color-mix(in srgb, var(--accent) 82%, white) !important;
}

[data-theme="dark"] :is(.panel-footer-link, .panel-header-link, .score-detail-link):hover {
    color: white !important;
}

/* Mobile tap targets and button wrapping. */
@media (max-width: 640px) {
    .dashboard-plan-button {
        min-height: 46px;
        padding: 11px 16px;
    }

    .topbar-actions :is(a, button),
    .sidebar-nav a,
    .sidebar-nav summary {
        min-height: 44px;
    }
}

/* Respect reduced motion preference. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== report-share-a11.css ===== */
.report-share-panel{display:grid;gap:1rem;padding:1.25rem;margin:0 0 1.25rem;border:1px solid var(--border-color,#d9e2ec);border-radius:18px;background:var(--surface,#fff)}
.report-share-panel h2{margin:.35rem 0}.report-share-panel p{margin:0;color:var(--text-muted,#64748b)}
.report-share-controls{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:.75rem;align-items:center}
.report-share-controls input{width:100%;min-width:0;padding:.8rem 1rem;border:1px solid var(--border-color,#cbd5e1);border-radius:10px;background:var(--input-bg,#fff);color:var(--text-color,#172033)}
.report-share-status{min-height:1.25rem;font-weight:700;color:#15803d!important}
.shared-report-page{margin:0;background:#eef3f7;color:#172033;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.shared-report-topbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem 1.5rem;background:#123f47;color:#fff}.shared-report-topbar div{display:grid;gap:.2rem}.shared-report-topbar span{font-size:.85rem;opacity:.8}.shared-report-topbar button{border:0;border-radius:10px;padding:.75rem 1rem;font-weight:800;cursor:pointer}
.shared-report-container{max-width:1040px;margin:2rem auto;padding:0 1rem}.shared-report-error{max-width:620px;margin:12vh auto;padding:2rem;text-align:center;background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(15,23,42,.12)}.shared-report-error span{font-size:3rem}.shared-report-error h1{margin:.75rem 0}
@media(max-width:760px){.report-share-controls{grid-template-columns:1fr}.shared-report-topbar{align-items:flex-start;flex-direction:column}.shared-report-topbar button{width:100%}}
@media print{.report-share-panel,.shared-report-topbar{display:none!important}.shared-report-page{background:#fff}.shared-report-container{max-width:none;margin:0;padding:0}}

/* ===== ui-controls-a12.css ===== */
/* Meriç Health OS Pro RC1 A12
   Global button/link contrast normalization for light and dark themes. */

:root {
    --control-primary-bg: #0f766e;
    --control-primary-text: #ffffff;
    --control-primary-hover: #0b625c;
    --control-secondary-bg: #ffffff;
    --control-secondary-text: #15242b;
}

[data-theme="dark"] {
    --control-primary-bg: #5fd2c3;
    --control-primary-text: #04211e;
    --control-primary-hover: #83e2d6;
    --control-secondary-bg: #182b31;
    --control-secondary-text: #edf7f5;
}

/* Filled actions. Explicitly cover links and visited links so generic link
   theme rules cannot make their labels the same colour as the background. */
:is(a.button, a.button:visited, button.button, input.button,
    .button-primary, .button-primary:visited,
    button[type="submit"]:not(.logout-button)) {
    background: var(--control-primary-bg) !important;
    color: var(--control-primary-text) !important;
    border: 1px solid var(--control-primary-bg) !important;
    text-decoration: none !important;
    -webkit-text-fill-color: var(--control-primary-text);
}

:is(a.button, button.button, input.button,
    .button-primary, button[type="submit"]:not(.logout-button)):hover {
    background: var(--control-primary-hover) !important;
    border-color: var(--control-primary-hover) !important;
    color: var(--control-primary-text) !important;
    -webkit-text-fill-color: var(--control-primary-text);
    text-decoration: none !important;
}

:is(a.button, button.button, input.button,
    .button-primary, button[type="submit"]:not(.logout-button)):focus-visible {
    color: var(--control-primary-text) !important;
    -webkit-text-fill-color: var(--control-primary-text);
    outline: 3px solid color-mix(in srgb, var(--control-primary-bg) 48%, white) !important;
    outline-offset: 3px;
}

/* Outlined/secondary actions remain readable in both themes. */
:is(.button.button-secondary, a.button-secondary, a.button-secondary:visited,
    .small-action, .theme-toggle, .mobile-menu, .topbar-notification-link,
    .pwa-install-button) {
    background: var(--control-secondary-bg) !important;
    color: var(--control-secondary-text) !important;
    border: 1px solid var(--border) !important;
    -webkit-text-fill-color: var(--control-secondary-text);
    text-decoration: none !important;
}

:is(.button.button-secondary, a.button-secondary, .small-action,
    .theme-toggle, .mobile-menu, .topbar-notification-link,
    .pwa-install-button):hover {
    border-color: var(--accent) !important;
    color: var(--text) !important;
    -webkit-text-fill-color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface)) !important;
}

/* Hero/header action buttons such as “Dashboard'a dön”. */
.welcome-panel > :is(a.button, button.button),
.report-hero > :is(a.button, button.button) {
    min-width: 148px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Text/icon children must follow the button label colour. */
:is(.button, .button-primary, button[type="submit"]):not(.button-secondary) :is(span, strong, small, svg) {
    color: inherit !important;
    fill: currentColor;
}

/* Disabled controls remain distinguishable without disappearing. */
:is(.button, .button-primary, button[type="submit"]):disabled,
:is(.button, .button-primary)[aria-disabled="true"] {
    opacity: .56;
    cursor: not-allowed;
    filter: saturate(.55);
}

@media (max-width: 640px) {
    .welcome-panel > :is(a.button, button.button),
    .report-hero > :is(a.button, button.button) {
        width: 100%;
        min-height: 46px;
    }
}

@media print {
    .button, .button-primary, button[type="submit"] {
        box-shadow: none !important;
    }
}

/* ===== design-system-v1.css ===== */
/* Meriç Health OS Pro v1.1.0 — Design System v1 / Bölüm 1
   Ortak renk, tipografi, buton, kart, form, tablo ve menü standartları. */

:root {
    --ui-primary: #0f766e;
    --ui-primary-hover: #0b625c;
    --ui-primary-soft: #dff5f1;
    --ui-on-primary: #ffffff;
    --ui-bg: #f3f6f8;
    --ui-surface: #ffffff;
    --ui-surface-2: #f8fafb;
    --ui-text: #15242b;
    --ui-text-soft: #6b7b83;
    --ui-border: #dfe7ea;
    --ui-success: #16855b;
    --ui-warning: #b7791f;
    --ui-danger: #b42318;
    --ui-radius-sm: 10px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 20px;
    --ui-control-height: 44px;
    --ui-shadow-sm: 0 8px 24px rgba(19, 52, 49, .06);
    --ui-shadow-md: 0 18px 50px rgba(19, 52, 49, .09);
    --ui-transition: 160ms ease;
}

[data-theme="dark"] {
    --ui-primary: #5fd2c3;
    --ui-primary-hover: #83e2d6;
    --ui-primary-soft: #173a37;
    --ui-on-primary: #04211e;
    --ui-bg: #0d171b;
    --ui-surface: #142328;
    --ui-surface-2: #182b31;
    --ui-text: #edf7f5;
    --ui-text-soft: #9bb0b5;
    --ui-border: #284047;
    --ui-success: #63d69a;
    --ui-warning: #f4c76b;
    --ui-danger: #ff8f86;
    --ui-shadow-sm: none;
    --ui-shadow-md: none;
}

/* Eski değişkenleri tek tasarım sistemine bağla. */
:root,
[data-theme="dark"] {
    --bg: var(--ui-bg);
    --surface: var(--ui-surface);
    --surface-soft: var(--ui-surface-2);
    --text: var(--ui-text);
    --muted: var(--ui-text-soft);
    --border: var(--ui-border);
    --accent: var(--ui-primary);
    --accent-soft: var(--ui-primary-soft);
    --success: var(--ui-success);
    --danger: var(--ui-danger);
}

body {
    background: var(--ui-bg);
    color: var(--ui-text);
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

:is(h1, h2, h3, h4, h5, h6) {
    color: var(--ui-text);
    line-height: 1.18;
    letter-spacing: -.018em;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 2rem); }
h3 { font-size: 1.12rem; }
:is(p, li, td, dd) { color: var(--ui-text); }
:is(.muted, .text-muted, small, .help-text, .form-help, .field-help) { color: var(--ui-text-soft); }

/* Ortak sayfa genişliği ve dikey ritim. */
.page-container {
    width: min(1280px, calc(100% - 40px));
    margin: 28px auto 64px;
}

.page-container > * + * { margin-top: 18px; }

/* Kart sistemi: mevcut farklı sınıfları aynı görünüme çeker. */
:is(
    .panel, .card, .module-card, .metric-card, .summary-card, .stat-card,
    .treatment-card, .form-panel, .report-card, .doctor-report,
    .health-component-card, .notification-page-grid > section,
    .data-card, .history-card, .goal-card, .routine-card, .exercise-card,
    .water-card, .weight-card, .glucose-card, .daily-plan-card
) {
    background: var(--ui-surface);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

:is(.panel, .card, .module-card, .form-panel, .report-card) {
    padding: clamp(18px, 2.4vw, 28px);
}

/* Ortak buton sistemi. */
:is(
    .button, .button-primary, .button-secondary, .small-action,
    button[type="submit"]:not(.logout-button), .theme-toggle, .mobile-menu,
    .topbar-notification-link, .pwa-install-button
) {
    min-height: var(--ui-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--ui-radius-md);
    padding: 10px 16px;
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    transition: background-color var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition), transform var(--ui-transition);
}

:is(a.button, a.button:visited, .button-primary, .button-primary:visited,
    button[type="submit"]:not(.logout-button)) {
    background: var(--ui-primary) !important;
    color: var(--ui-on-primary) !important;
    border: 1px solid var(--ui-primary) !important;
    -webkit-text-fill-color: var(--ui-on-primary) !important;
}

:is(a.button, .button-primary, button[type="submit"]:not(.logout-button)):hover {
    background: var(--ui-primary-hover) !important;
    border-color: var(--ui-primary-hover) !important;
    color: var(--ui-on-primary) !important;
    -webkit-text-fill-color: var(--ui-on-primary) !important;
    transform: translateY(-1px);
}

:is(.button-secondary, a.button-secondary, a.button-secondary:visited, .small-action,
    .theme-toggle, .mobile-menu, .topbar-notification-link, .pwa-install-button) {
    background: var(--ui-surface-2) !important;
    color: var(--ui-text) !important;
    border: 1px solid var(--ui-border) !important;
    -webkit-text-fill-color: var(--ui-text) !important;
}

:is(.button-secondary, .small-action, .theme-toggle, .mobile-menu,
    .topbar-notification-link, .pwa-install-button):hover {
    background: color-mix(in srgb, var(--ui-primary) 10%, var(--ui-surface)) !important;
    border-color: var(--ui-primary) !important;
    color: var(--ui-text) !important;
}

:is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ui-primary) 48%, transparent) !important;
    outline-offset: 3px;
}

/* Form sistemi. */
:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    min-height: var(--ui-control-height);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface-2);
    color: var(--ui-text);
    padding: 10px 13px;
    transition: border-color var(--ui-transition), box-shadow var(--ui-transition), background-color var(--ui-transition);
}

textarea { min-height: 112px; resize: vertical; }

:is(input, select, textarea):hover { border-color: color-mix(in srgb, var(--ui-primary) 45%, var(--ui-border)); }
:is(input, select, textarea):focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary) 18%, transparent);
}

label, legend { color: var(--ui-text); font-weight: 700; }

/* Tablo sistemi. */
.table-wrap, .table-responsive { overflow-x: auto; border-radius: var(--ui-radius-lg); }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--ui-surface);
    color: var(--ui-text);
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ui-surface-2);
    color: var(--ui-text);
    font-size: .78rem;
    letter-spacing: .035em;
    text-transform: uppercase;
}

:is(th, td) { padding: 13px 15px; border-bottom: 1px solid var(--ui-border); text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--ui-primary) 6%, var(--ui-surface)); }

/* Badge/pill standardı. */
:is(.badge, .pill, .state-success, .state-muted, .status-badge, .treatment-type) {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    border: 1px solid var(--ui-border);
}

/* Sidebar aktif durumunu her temada okunur tut. */
.sidebar-nav :is(a, summary) { transition: background-color var(--ui-transition), color var(--ui-transition); }
.sidebar-nav a.active,
.sidebar-nav a[aria-current="page"] {
    background: color-mix(in srgb, var(--ui-primary) 18%, transparent) !important;
    color: #f5fffd !important;
    box-shadow: inset 3px 0 0 var(--ui-primary);
}

.sidebar-nav a.active :is(span, strong, small),
.sidebar-nav a[aria-current="page"] :is(span, strong, small) { color: inherit !important; }

.nav-group > summary {
    min-height: 42px;
    border-radius: var(--ui-radius-sm);
    cursor: pointer;
}

.nav-group[open] > summary,
.nav-group-active > summary {
    color: var(--ui-primary) !important;
}

/* Üst bar ve başlık panelleri. */
.app-topbar { min-height: 72px; }
.welcome-panel, .report-hero, .health-detail-hero {
    border-radius: 24px;
    box-shadow: var(--ui-shadow-md);
}

/* Mobil temel standardı. */
@media (max-width: 760px) {
    .page-container { width: min(100% - 24px, 1280px); margin-top: 18px; }
    .welcome-panel, .report-hero, .health-detail-hero { border-radius: 18px; padding: 20px; }
    :is(.button, .button-primary, .button-secondary, button[type="submit"]:not(.logout-button)) { min-height: 46px; }
    :is(th, td) { padding: 11px 12px; }
}

@media print {
    :root, [data-theme="dark"] {
        --ui-bg: #fff;
        --ui-surface: #fff;
        --ui-surface-2: #fff;
        --ui-text: #111;
        --ui-text-soft: #555;
        --ui-border: #d8d8d8;
    }
    body { background: #fff !important; color: #111 !important; }
}

/* ===== module-polish-v1.css ===== */
/* Meric Health OS Pro v1.1.0 UI/UX R2 — module page harmonisation */
:root {
  --module-gap: clamp(1rem, 2vw, 1.5rem);
  --module-card-min: 15rem;
  --module-control-h: 2.75rem;
}

.module-heading,
.daily-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--module-gap);
}
.module-heading > div:first-child,
.daily-plan-top > div:first-child { min-width: 0; }
.module-heading h1,
.daily-plan-top h1 { margin: .15rem 0 .35rem; line-height: 1.15; }
.module-heading p,
.daily-plan-top p { margin: 0; color: var(--text-muted, #667085); }
.module-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }

.panel,
.form-panel,
.treatment-card,
.exercise-card,
.glucose-summary-card,
.weight-summary-card,
.exercise-summary-card,
.water-progress-card {
  border: 1px solid var(--border, #d7e2e4);
  border-radius: var(--radius-lg, 18px);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(15, 23, 42, .06));
}
.panel,
.form-panel { padding: clamp(1rem, 2vw, 1.4rem); }
.panel + .panel { margin-top: var(--module-gap); }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border, #d7e2e4);
}
.panel-header h2, .panel-header h3 { margin: 0; }

.treatment-grid,
.glucose-summary-grid,
.weight-summary-grid,
.exercise-summary-grid,
.quick-water-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--module-card-min), 1fr));
  gap: var(--module-gap);
}
.treatment-card,
.exercise-card,
.glucose-summary-card,
.weight-summary-card,
.exercise-summary-card { padding: 1rem; }
.treatment-card { display: flex; flex-direction: column; gap: .9rem; min-height: 100%; }
.treatment-card-top,
.exercise-card-main {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
}
.treatment-symbol,
.exercise-card-icon,
.today-treatment-symbol {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: .8rem;
  background: color-mix(in srgb, var(--primary, #1f9d94) 14%, transparent);
  color: var(--primary, #1f9d94);
}
.treatment-meta { display: grid; gap: .35rem; color: var(--text-muted, #667085); }
.treatment-card-actions,
.row-actions,
.today-treatment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.treatment-card-actions { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--border, #d7e2e4); }
.treatment-card.is-passive { opacity: .72; }

.glucose-filter-form,
.weight-filter-form,
.water-filter-form,
.exercise-filter-form,
.health-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .9rem;
  align-items: end;
}
.glucose-filter-form > *,
.weight-filter-form > *,
.water-filter-form > *,
.exercise-filter-form > * { grid-column: span 3; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-wide { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; padding-top: .3rem; }
.form-submit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .65rem; padding-top: .5rem; }

.glucose-table-wrap,
.weight-table-wrap,
.water-table-wrap { overflow-x: auto; border: 1px solid var(--border, #d7e2e4); border-radius: var(--radius-md, 14px); }
.glucose-table,
.weight-table,
.water-table { width: 100%; min-width: 46rem; border-collapse: collapse; }
.glucose-table th,
.weight-table th,
.water-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  background: var(--surface-soft, #f5f8f9);
}
.glucose-table th, .glucose-table td,
.weight-table th, .weight-table td,
.water-table th, .water-table td { padding: .82rem .9rem; border-bottom: 1px solid var(--border, #d7e2e4); }
.glucose-table tbody tr:hover,
.weight-table tbody tr:hover,
.water-table tbody tr:hover { background: color-mix(in srgb, var(--primary, #1f9d94) 6%, transparent); }
.glucose-value, .weight-value, .water-value { font-weight: 750; font-variant-numeric: tabular-nums; }

.today-treatment-list,
.exercise-list,
.compact-plan-list { display: grid; gap: .75rem; }
.today-treatment-item,
.compact-plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border, #d7e2e4);
  border-radius: var(--radius-md, 14px);
  background: var(--surface, #fff);
}
.today-treatment-main,
.compact-plan-main { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.today-treatment-item.status-taken,
.compact-plan-item.is-completed { border-color: color-mix(in srgb, var(--success, #249867) 45%, var(--border, #d7e2e4)); background: color-mix(in srgb, var(--success, #249867) 8%, var(--surface, #fff)); }
.compact-plan-item.is-skipped { opacity: .68; }
.treatment-time { font-variant-numeric: tabular-nums; font-weight: 750; }

.water-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, .65fr); gap: var(--module-gap); align-items: stretch; }
.water-progress-card { padding: 1.2rem; }
.water-circle { margin-inline: auto; }
.water-bars { display: grid; gap: .7rem; }
.water-bar-item { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 4rem; gap: .7rem; align-items: center; }
.water-bar-track { height: .65rem; overflow: hidden; border-radius: 999px; background: var(--surface-soft, #eef3f4); }
.water-bar-track > * { height: 100%; border-radius: inherit; }

.daily-plan-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.date-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: 1rem; }
.compact-plan-group { margin-bottom: 1rem; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 1rem; }
.empty-state { text-align: center; padding: clamp(2rem, 6vw, 4rem) 1rem; }
.empty-state-icon { font-size: 2rem; margin-bottom: .65rem; }

html[data-theme="dark"] .panel,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .treatment-card,
html[data-theme="dark"] .exercise-card,
html[data-theme="dark"] .glucose-summary-card,
html[data-theme="dark"] .weight-summary-card,
html[data-theme="dark"] .exercise-summary-card,
html[data-theme="dark"] .water-progress-card,
html[data-theme="dark"] .today-treatment-item,
html[data-theme="dark"] .compact-plan-item {
  background: var(--surface, #102326);
  border-color: var(--border, #29454a);
  color: var(--text, #f3f7f7);
}
html[data-theme="dark"] .module-heading p,
html[data-theme="dark"] .daily-plan-top p,
html[data-theme="dark"] .treatment-meta { color: var(--text-muted, #a8b9bc); }
html[data-theme="dark"] .glucose-table th,
html[data-theme="dark"] .weight-table th,
html[data-theme="dark"] .water-table th { background: var(--surface-soft, #173034); color: var(--text, #f3f7f7); }

@media (max-width: 900px) {
  .water-hero { grid-template-columns: 1fr; }
  .glucose-filter-form > *,
  .weight-filter-form > *,
  .water-filter-form > *,
  .exercise-filter-form > * { grid-column: span 6; }
}
@media (max-width: 680px) {
  .module-heading,
  .daily-plan-top { flex-direction: column; }
  .module-actions { width: 100%; justify-content: flex-start; }
  .module-actions .button { flex: 1 1 10rem; }
  .form-grid { grid-template-columns: 1fr; }
  .glucose-filter-form > *,
  .weight-filter-form > *,
  .water-filter-form > *,
  .exercise-filter-form > * { grid-column: 1 / -1; }
  .today-treatment-item,
  .compact-plan-item { align-items: flex-start; flex-direction: column; }
  .today-treatment-actions,
  .row-actions { width: 100%; }
  .today-treatment-actions > *,
  .row-actions > * { flex: 1 1 auto; text-align: center; }
  .daily-plan-summary { grid-template-columns: 1fr; }
  .water-bar-item { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .water-bar-item > :last-child { grid-column: 2; }
}

/* ===== ui-polish-r3.css ===== */
/* Meriç Health OS Pro v1.1.0 UI/UX Revizyonu – Bölüm 3
   Dashboard, Rapor Merkezi ve Doktor Raporu ortak görünüm katmanı. */

:root {
  --ui-section-gap: clamp(1rem, 1.8vw, 1.5rem);
  --ui-card-padding: clamp(1rem, 1.8vw, 1.4rem);
  --ui-card-radius: 18px;
}

.page-container > section,
.page-container > article,
.page-container > form,
.page-container > div {
  scroll-margin-top: 5rem;
}

.dashboard-hero,
.report-hero,
.doctor-report-toolbar,
.report-share-panel {
  border: 1px solid var(--border, rgba(15, 118, 110, .2));
  border-radius: var(--ui-card-radius);
}

.dashboard-hero,
.report-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 2.2vw, 1.75rem);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary, #0f766e) 12%, var(--surface, #fff)), var(--surface, #fff));
}

.dashboard-hero h1,
.report-hero h1,
.doctor-report h1 {
  margin: .25rem 0 .45rem;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.dashboard-hero p,
.report-hero p,
.report-share-panel p {
  max-width: 68ch;
  margin: 0;
  color: var(--text-muted, #64748b);
}

.dashboard-grid,
.dashboard-intelligence-grid,
.report-grid,
.doctor-summary-grid {
  gap: var(--ui-section-gap);
}

.panel,
.metric-card,
.report-card,
.doctor-summary-card,
.report-period-summary,
.report-filter,
.report-share-panel {
  border-radius: var(--ui-card-radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.panel,
.report-card,
.report-share-panel,
.report-filter {
  padding: var(--ui-card-padding);
}

.panel-header,
.report-card > header {
  align-items: center;
  gap: .85rem;
}

.panel-header h2,
.report-card h2,
.report-share-panel h2 {
  margin: .1rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.25;
}

.panel-header small,
.report-card header small,
.report-period-summary small,
.doctor-summary-card small {
  color: var(--text-muted, #64748b);
}

.panel-header-link,
.panel-footer-link,
.report-presets a {
  color: var(--primary, #0f766e);
  font-weight: 700;
  text-decoration: none;
}

.panel-header-link:hover,
.panel-footer-link:hover,
.report-presets a:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.dashboard-quick-actions a,
.insight-item,
.notification-item {
  border: 1px solid var(--border, #dbe5e7);
  border-radius: 14px;
  background: var(--surface-raised, var(--surface, #fff));
}

.dashboard-quick-actions a:hover,
.insight-item:hover,
.notification-item:hover {
  border-color: color-mix(in srgb, var(--primary, #0f766e) 45%, var(--border, #dbe5e7));
  transform: translateY(-1px);
}

.report-actions,
.doctor-report-toolbar,
.report-share-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.report-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  align-items: end;
  gap: .85rem;
  margin-top: var(--ui-section-gap);
  background: var(--surface, #fff);
}

.report-filter label {
  display: grid;
  gap: .4rem;
  font-weight: 700;
}

.report-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin: .9rem 0 var(--ui-section-gap);
}

.report-presets a {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  padding: .35rem .7rem;
  border: 1px solid var(--border, #dbe5e7);
  border-radius: 999px;
  background: var(--surface, #fff);
}

.report-period-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: var(--surface, #fff);
}

.report-period-summary > div {
  display: grid;
  gap: .3rem;
  padding: 1rem 1.1rem;
}

.report-period-summary > div + div {
  border-left: 1px solid var(--border, #dbe5e7);
}

.report-values {
  display: grid;
  gap: .35rem;
}

.report-values > strong {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1;
}

.report-chart {
  min-height: 180px;
  margin-top: 1rem;
  border: 1px dashed color-mix(in srgb, var(--border, #dbe5e7) 85%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted, #f8fafc) 90%, transparent);
}

.doctor-report-toolbar {
  justify-content: space-between;
  padding: .8rem;
  background: var(--surface, #fff);
}

.report-share-panel {
  display: grid;
  gap: 1rem;
  margin: var(--ui-section-gap) 0;
  background: var(--surface, #fff);
}

.report-share-controls input {
  flex: 1 1 320px;
  min-width: 0;
}

.doctor-report {
  border: 1px solid var(--border, #dbe5e7);
  border-radius: 20px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.doctor-report-header,
.doctor-profile-grid,
.doctor-summary-grid,
.doctor-notes,
.doctor-report footer {
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

.doctor-report-header {
  padding-top: clamp(1.25rem, 3vw, 2rem);
}

.doctor-profile-grid > div,
.doctor-summary-card {
  border: 1px solid var(--border, #dbe5e7);
  background: var(--surface-raised, var(--surface, #fff));
}

[data-theme="dark"] .dashboard-hero,
[data-theme="dark"] .report-hero,
body.dark .dashboard-hero,
body.dark .report-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary, #5ad0c8) 16%, var(--surface, #102326)), var(--surface, #102326));
}

[data-theme="dark"] .panel,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .report-card,
[data-theme="dark"] .report-filter,
[data-theme="dark"] .report-period-summary,
[data-theme="dark"] .report-share-panel,
[data-theme="dark"] .doctor-report,
body.dark .panel,
body.dark .metric-card,
body.dark .report-card,
body.dark .report-filter,
body.dark .report-period-summary,
body.dark .report-share-panel,
body.dark .doctor-report {
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

[data-theme="dark"] .button,
body.dark .button {
  color: #062524;
}

[data-theme="dark"] .button.button-secondary,
body.dark .button.button-secondary {
  color: var(--text, #f4f7f8);
}

@media (max-width: 860px) {
  .dashboard-hero,
  .report-hero {
    flex-direction: column;
  }

  .report-filter {
    grid-template-columns: 1fr 1fr;
  }

  .report-filter .button {
    grid-column: 1 / -1;
  }

  .report-period-summary {
    grid-template-columns: 1fr;
  }

  .report-period-summary > div + div {
    border-left: 0;
    border-top: 1px solid var(--border, #dbe5e7);
  }
}

@media (max-width: 560px) {
  .report-filter {
    grid-template-columns: 1fr;
  }

  .report-actions,
  .doctor-report-toolbar,
  .report-share-controls {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .report-actions .button,
  .doctor-report-toolbar .button,
  .report-share-controls .button {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .report-share-panel,
  .doctor-report-toolbar,
  .app-topbar,
  .sidebar,
  .network-status {
    display: none !important;
  }

  .app-main,
  .page-container {
    margin: 0 !important;
    padding: 0 !important;
  }

  .doctor-report,
  .report-card,
  .report-period-summary {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* ===== health-archive-v1.css ===== */
.archive-header{align-items:flex-end}.archive-category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.archive-category-card{display:flex;min-height:132px;flex-direction:column;justify-content:center;gap:.35rem;padding:1.15rem;border:1px solid var(--border-color,var(--border));border-radius:var(--radius-lg,16px);background:var(--card-bg,var(--surface));color:var(--text-color,var(--text));text-decoration:none;box-shadow:var(--shadow-sm)}.archive-category-card>span{font-size:1.65rem}.archive-category-card small{color:var(--text-muted)}.archive-category-card:hover,.archive-category-card.active{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 22%,transparent)}.archive-filter-card{margin-bottom:1rem}.archive-filters{display:grid;grid-template-columns:220px minmax(220px,1fr) auto auto;gap:.8rem;align-items:end}.archive-document-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.archive-document-card{display:grid;grid-template-columns:auto minmax(0,1fr);gap:1rem}.archive-document-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;background:color-mix(in srgb,var(--primary) 13%,var(--card-bg));font-size:1.5rem}.archive-document-body h2{margin:.55rem 0 .35rem;font-size:1.05rem}.archive-meta,.archive-tags{color:var(--text-muted);font-size:.88rem}.archive-tags{color:var(--primary)}.archive-document-actions{grid-column:1/-1;display:flex;gap:.55rem;flex-wrap:wrap;border-top:1px solid var(--border-color,var(--border));padding-top:.8rem}.archive-document-actions form{margin:0}.archive-empty{text-align:center;padding:3rem 1rem}.archive-empty-icon{font-size:3rem}.archive-upload-card{max-width:860px}.archive-upload-form{display:grid;gap:1rem}.archive-file-drop{display:flex;min-height:170px;align-items:center;justify-content:center;flex-direction:column;gap:.35rem;border:2px dashed var(--border-color,var(--border));border-radius:16px;background:color-mix(in srgb,var(--primary) 4%,var(--card-bg));cursor:pointer;text-align:center}.archive-file-drop:hover{border-color:var(--primary)}.archive-file-drop input{max-width:320px;margin-top:.5rem}.archive-file-icon{font-size:2rem}.pagination{display:flex;gap:.4rem;justify-content:center;margin-top:1rem}.pagination a{padding:.55rem .75rem;border:1px solid var(--border-color,var(--border));border-radius:10px;text-decoration:none}.pagination a.active{background:var(--primary);color:var(--on-primary,#fff);border-color:var(--primary)}@media(max-width:1000px){.archive-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.archive-document-grid{grid-template-columns:1fr}}@media(max-width:700px){.archive-category-grid{grid-template-columns:1fr 1fr}.archive-category-card{min-height:112px}.archive-filters{grid-template-columns:1fr}.archive-filters .btn{width:100%}.archive-document-actions .btn,.archive-document-actions form{flex:1}.archive-document-actions form .btn{width:100%}}@media(max-width:430px){.archive-category-grid{grid-template-columns:1fr}}

.archive-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.archive-summary-grid .card{display:flex;flex-direction:column;gap:.35rem}.archive-summary-grid span{color:var(--text-muted);font-size:.85rem}.archive-summary-grid strong{font-size:1.35rem}.archive-document-icon{overflow:hidden;text-decoration:none;color:inherit}.archive-document-icon.has-thumb{background:var(--surface)}.archive-document-icon img{width:100%;height:100%;object-fit:cover}.archive-document-body h2 a{color:inherit;text-decoration:none}.archive-document-body h2 a:hover{color:var(--primary)}.archive-current-file{display:flex;flex-direction:column;gap:.35rem;padding:1rem;border:1px solid var(--border-color,var(--border));border-radius:14px;background:color-mix(in srgb,var(--primary) 4%,var(--card-bg))}.archive-current-file small{color:var(--text-muted)}.archive-detail-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr);gap:1rem;align-items:start}.archive-preview-card{padding:0;overflow:hidden}.archive-preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1rem;border-bottom:1px solid var(--border-color,var(--border))}.archive-preview-frame{display:block;width:100%;min-height:720px;border:0;background:#fff}.archive-preview-image{display:block;max-width:100%;max-height:780px;margin:auto;object-fit:contain}.archive-info-card{position:sticky;top:1rem}.archive-info-card h2{margin-top:0}.archive-info-list{display:grid;gap:0}.archive-info-list>div{padding:.8rem 0;border-bottom:1px solid var(--border-color,var(--border))}.archive-info-list dt{color:var(--text-muted);font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.archive-info-list dd{margin:.3rem 0 0;overflow-wrap:anywhere}.archive-detail-actions{display:grid;gap:.65rem;margin-top:1rem}.archive-detail-actions form,.archive-detail-actions .btn{width:100%}.archive-detail-actions form .btn{width:100%}@media(max-width:900px){.archive-detail-grid{grid-template-columns:1fr}.archive-info-card{position:static}.archive-preview-frame{min-height:560px}}@media(max-width:700px){.archive-summary-grid{grid-template-columns:1fr}.archive-preview-toolbar{align-items:stretch;flex-direction:column}.archive-preview-frame{min-height:460px}}

/* v1.2.0 R3 */
.archive-filters-advanced{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}.archive-check{display:flex!important;flex-direction:row!important;align-items:center;gap:.55rem;min-height:44px}.archive-check input{width:auto}.archive-filter-actions{display:flex;gap:.65rem;align-items:center}.archive-tag-cloud{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center;margin:1rem 0}.archive-tag-cloud a{padding:.45rem .7rem;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text)}.archive-tag-cloud small{opacity:.65}.archive-recent{margin:1rem 0}.archive-recent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.archive-recent-grid a{display:flex;gap:.75rem;align-items:center;padding:.8rem;border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);background:var(--surface-soft)}.archive-recent-grid a>span{font-size:1.4rem}.archive-recent-grid div{display:flex;flex-direction:column;min-width:0}.archive-recent-grid strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-recent-grid small{color:var(--text-muted)}.archive-view-switch{display:flex;justify-content:space-between;gap:1rem;align-items:center;margin:1rem 0}.archive-view-switch>div{display:flex;gap:.5rem}.archive-view-switch .active{outline:2px solid var(--primary)}.archive-document-card{position:relative}.archive-favorite-form{position:absolute;right:.7rem;top:.7rem;z-index:2}.archive-favorite-form button{border:0;background:var(--surface);font-size:1.45rem;cursor:pointer;border-radius:999px;width:2.25rem;height:2.25rem}.archive-timeline{position:relative;padding-left:1.5rem}.archive-timeline:before{content:"";position:absolute;left:.45rem;top:0;bottom:0;width:2px;background:var(--border)}.archive-timeline-year{margin:1.5rem 0 .75rem}.archive-timeline-item{display:grid;grid-template-columns:70px 1fr;gap:1rem;position:relative;margin-bottom:1rem}.archive-timeline-item:before{content:"";position:absolute;left:-1.35rem;top:1.1rem;width:.75rem;height:.75rem;border-radius:50%;background:var(--primary);border:3px solid var(--background)}.archive-timeline-item time{font-weight:700;color:var(--text-muted);padding-top:1rem}.archive-timeline-item .card{margin:0}.archive-timeline-title{display:flex;gap:.8rem;align-items:flex-start}.archive-timeline-title>span:first-child{font-size:1.5rem}.archive-timeline-title>span:last-child{margin-left:auto}.archive-timeline-title h3{margin:.25rem 0 0}
@media(max-width:980px){.archive-filters-advanced{grid-template-columns:repeat(2,minmax(0,1fr))}.archive-recent-grid{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.archive-filters-advanced,.archive-recent-grid{grid-template-columns:1fr}.archive-view-switch{align-items:flex-start;flex-direction:column}.archive-view-switch>div{width:100%;flex-direction:column}.archive-timeline-item{grid-template-columns:52px 1fr;gap:.65rem}.archive-filter-actions{grid-column:1/-1;flex-direction:column}.archive-filter-actions .btn{width:100%}}

/* v1.2.0 Sprint 5: belge detay deneyimi */
.archive-document-nav{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:0 0 1rem}.archive-document-nav a{display:flex;flex-direction:column;gap:.2rem;padding:.75rem 1rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);color:var(--text);text-decoration:none}.archive-document-nav a.next{text-align:right}.archive-document-nav small{color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.archive-preview-toolbar>div{display:flex;gap:.5rem;flex-wrap:wrap}.archive-image-button{display:block;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.archive-preview-unavailable{display:flex;min-height:420px;align-items:center;justify-content:center;flex-direction:column;gap:1rem;padding:2rem;text-align:center}.archive-preview-unavailable>span{font-size:4rem}.archive-detail-tags{display:flex;flex-wrap:wrap;gap:.45rem}.archive-detail-tags a{display:inline-flex;padding:.35rem .6rem;border:1px solid var(--border);border-radius:999px;background:var(--surface-soft);color:var(--primary);text-decoration:none}.archive-info-list dd a{color:var(--primary)}.archive-lightbox{width:min(96vw,1400px);max-width:none;height:min(94vh,1000px);padding:3rem 1rem 1rem;border:0;border-radius:18px;background:rgba(4,12,14,.96)}.archive-lightbox::backdrop{background:rgba(0,0,0,.78)}.archive-lightbox img{display:block;width:100%;height:100%;object-fit:contain}.archive-lightbox button{position:absolute;right:1rem;top:.6rem;width:2.5rem;height:2.5rem;border:0;border-radius:50%;background:var(--primary);color:var(--on-primary,#fff);font-size:1.6rem;cursor:pointer}@media(max-width:700px){.archive-document-nav{grid-template-columns:1fr}.archive-document-nav span{display:none}.archive-document-nav a.next{text-align:left}.archive-preview-toolbar>div{width:100%;flex-direction:column}.archive-preview-toolbar .btn{width:100%}}@media print{.archive-detail-header .page-actions,.archive-document-nav,.archive-info-card .archive-detail-actions,.archive-preview-toolbar{display:none!important}.archive-detail-grid{display:block}.archive-preview-card{border:0;box-shadow:none}.archive-preview-frame{min-height:900px}}

/* v1.2.0 Sprint 6: klasörler, istatistikler ve arşiv hareketleri */
.archive-folder-section{margin:1rem 0}.archive-folder-section>.section-heading{margin-bottom:.8rem}.archive-category-card em{margin-top:.15rem;color:var(--text-muted);font-size:.78rem;font-style:normal}.archive-category-card.active em,.archive-category-card:hover em{color:inherit;opacity:.78}.archive-activity-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.85fr);gap:1rem;margin:1rem 0}.archive-activity-grid>.card{margin:0}.archive-activity-grid .archive-recent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.archive-latest-list{display:grid;gap:.35rem}.archive-latest-list>a{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.7rem;align-items:center;padding:.65rem .25rem;border-bottom:1px solid var(--border);color:var(--text);text-decoration:none}.archive-latest-list>a:last-child{border-bottom:0}.archive-latest-list>a:hover strong{color:var(--primary)}.archive-latest-icon{display:grid;place-items:center;width:2.25rem;height:2.25rem;border-radius:10px;background:var(--surface-soft);font-size:1.15rem}.archive-latest-list div{display:flex;min-width:0;flex-direction:column}.archive-latest-list strong,.archive-latest-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-latest-list small,.archive-latest-list time{color:var(--text-muted);font-size:.78rem}.archive-latest-list time{white-space:nowrap}@media(max-width:1000px){.archive-activity-grid{grid-template-columns:1fr}}@media(max-width:700px){.archive-folder-section>.section-heading{align-items:stretch;flex-direction:column}.archive-folder-section>.section-heading .btn{width:100%}.archive-activity-grid .archive-recent-grid{grid-template-columns:1fr}.archive-latest-list>a{grid-template-columns:auto minmax(0,1fr)}.archive-latest-list time{grid-column:2}}


/* v1.2.0 Sprint 7: toplu seçim ve ZIP dışa aktarma */
.archive-view-actions{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}.archive-select-all{display:inline-flex;align-items:center;gap:.45rem;min-height:42px;padding:0 .75rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);color:var(--text);font-size:.88rem;font-weight:700}.archive-select-all input,.archive-document-select input{width:1.05rem;height:1.05rem;accent-color:var(--primary)}.archive-document-select{position:absolute;z-index:4;display:grid;place-items:center;width:2.25rem;height:2.25rem;border:1px solid var(--border);border-radius:999px;background:var(--surface);box-shadow:0 4px 14px rgba(0,0,0,.12);cursor:pointer}.archive-document-card>.archive-document-select{left:.7rem;top:.7rem}.archive-document-card.is-selected,.archive-timeline-item.is-selected>.card{outline:2px solid var(--primary);outline-offset:2px;background:color-mix(in srgb,var(--primary) 7%,var(--surface))}.archive-timeline-item{position:relative}.archive-timeline-item>.archive-document-select{left:58px;top:.72rem;transform:translateX(-50%)}.archive-bulk-bar{position:sticky;bottom:1rem;z-index:30;display:flex;align-items:center;gap:.75rem;margin:1rem 0;padding:.85rem 1rem;border:1px solid color-mix(in srgb,var(--primary) 52%,var(--border));border-radius:16px;background:color-mix(in srgb,var(--surface) 94%,transparent);box-shadow:0 16px 40px rgba(0,0,0,.2);backdrop-filter:blur(14px)}.archive-bulk-bar[hidden]{display:none}.archive-bulk-bar>div:first-child{display:flex;min-width:220px;flex:1;flex-direction:column}.archive-bulk-bar small{color:var(--text-muted)}.archive-bulk-bar .btn{white-space:nowrap}@media(max-width:760px){.archive-view-actions{width:100%;flex-direction:column;align-items:stretch}.archive-select-all,.archive-view-actions .btn{width:100%;justify-content:center}.archive-bulk-bar{align-items:stretch;flex-direction:column}.archive-bulk-bar .btn{width:100%}.archive-timeline-item>.archive-document-select{left:42px}}

/* ===== analytics-v130.css ===== */
.analytics-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:1.5rem;margin-bottom:1rem}.analytics-hero h1{margin:.45rem 0 .5rem;font-size:clamp(1.65rem,3vw,2.45rem)}.analytics-hero p{margin:0;max-width:760px;color:var(--text-soft,var(--muted,#64748b))}.analytics-periods{display:flex;gap:.55rem;flex-wrap:wrap;margin:1rem 0 1.25rem}.analytics-periods a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:.55rem .9rem;border:1px solid var(--border,#d9e5e3);border-radius:999px;background:var(--card,#fff);color:var(--text,#173333);font-weight:700;text-decoration:none}.analytics-periods a.active{background:var(--primary,#0f766e);border-color:var(--primary,#0f766e);color:#fff}.analytics-metric-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1rem}.analytics-metric-card{display:flex;gap:.8rem;align-items:flex-start;padding:1rem;border:1px solid var(--border,#d9e5e3);border-radius:18px;background:var(--card,#fff);box-shadow:0 10px 24px rgba(15,118,110,.06)}.analytics-metric-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:rgba(20,184,166,.12);font-size:1.25rem}.analytics-metric-card small{display:block;color:var(--text-soft,#64748b)}.analytics-metric-card strong{display:block;margin:.25rem 0;font-size:1.35rem;color:var(--text,#173333)}.analytics-metric-card strong span{font-size:.72rem;font-weight:700;color:var(--text-soft,#64748b)}.analytics-change{margin:0;font-size:.76rem}.analytics-change.is-positive{color:#15803d}.analytics-change.is-negative{color:#dc2626}.analytics-change.is-neutral{color:var(--text-soft,#64748b)}.analytics-insights,.analytics-context-card{margin-top:1rem;padding:1.1rem;border:1px solid var(--border,#d9e5e3);border-radius:20px;background:var(--card,#fff)}.section-heading{display:flex;justify-content:space-between;gap:1rem;align-items:end;margin-bottom:.85rem}.section-heading h2{margin:.15rem 0 0}.section-heading p{margin:0;color:var(--text-soft,#64748b)}.eyebrow{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em;color:var(--primary,#0f766e);font-weight:800}.analytics-insight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.analytics-insight{padding:.85rem;border-radius:14px;background:var(--surface-soft,#f5faf9);border-left:4px solid #64748b}.analytics-insight.is-positive{border-left-color:#16a34a}.analytics-insight.is-attention{border-left-color:#f59e0b}.analytics-insight strong{display:block;margin-bottom:.25rem}.analytics-insight p{margin:0;color:var(--text-soft,#64748b);line-height:1.45}.analytics-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}.analytics-chart-card{padding:1rem;border:1px solid var(--border,#d9e5e3);border-radius:20px;background:var(--card,#fff)}.analytics-chart-card header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.7rem}.analytics-chart-card h2{margin:.15rem 0 0;font-size:1.08rem}.analytics-chart-card header small,.analytics-chart-card header span{color:var(--text-soft,#64748b)}.analytics-chart-wide{grid-column:1/-1}.analytics-canvas-wrap{position:relative;min-height:290px}.analytics-canvas-wrap canvas{width:100%!important;height:290px!important}.analytics-empty,.analytics-library-error{position:absolute;inset:0;display:grid;place-items:center;text-align:center;color:var(--text-soft,#64748b);padding:1rem}.analytics-context-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}.analytics-context-grid>div{padding:.85rem;border-radius:14px;background:var(--surface-soft,#f5faf9)}.analytics-context-grid strong,.analytics-context-grid span{display:block}.analytics-context-grid span{margin-top:.25rem;color:var(--text-soft,#64748b);font-size:.82rem}[data-theme="dark"] .analytics-periods a,[data-theme="dark"] .analytics-metric-card,[data-theme="dark"] .analytics-insights,[data-theme="dark"] .analytics-context-card,[data-theme="dark"] .analytics-chart-card{background:var(--card,#102326);color:var(--text,#f4f7f8)}[data-theme="dark"] .analytics-insight,[data-theme="dark"] .analytics-context-grid>div{background:rgba(255,255,255,.035)}@media(max-width:1180px){.analytics-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.analytics-context-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.analytics-hero{display:block}.analytics-hero .button{margin-top:1rem;width:100%}.analytics-metric-grid,.analytics-insight-grid,.analytics-chart-grid,.analytics-context-grid{grid-template-columns:1fr}.analytics-chart-wide{grid-column:auto}.section-heading{display:block}.analytics-canvas-wrap,.analytics-canvas-wrap canvas{min-height:250px;height:250px!important}}

/* ===== security-v150.css ===== */
.security-page{display:grid;gap:1rem}.security-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.security-heading h1{margin:.15rem 0 .4rem}.security-heading p{margin:0}.security-safe-badge{display:inline-flex;align-items:center;white-space:nowrap;padding:.55rem .8rem;border-radius:999px;background:color-mix(in srgb,var(--success,#16835b) 14%,transparent);color:var(--success,#16835b);font-weight:800}.security-notice{padding:1rem 1.1rem;border:1px solid color-mix(in srgb,var(--primary,#0f766e) 34%,var(--border,#d9e3e3));border-radius:var(--radius-md,14px);background:color-mix(in srgb,var(--primary,#0f766e) 8%,var(--surface,#fff));color:var(--text,#142324)}.security-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.security-stat-card{display:grid;gap:.35rem;padding:1rem;border:1px solid var(--border,#d9e3e3);border-radius:var(--radius-lg,18px);background:var(--surface,#fff);box-shadow:var(--shadow-sm,0 6px 18px rgba(0,0,0,.05))}.security-stat-card span,.security-stat-card small{color:var(--text-soft,#667)}.security-stat-card strong{font-size:1.35rem;line-height:1.2}.security-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.security-definition-list{display:grid;gap:0;margin:0}.security-definition-list>div{display:grid;grid-template-columns:minmax(130px,.7fr) 1fr;gap:1rem;padding:.8rem 0;border-bottom:1px solid var(--border,#d9e3e3)}.security-definition-list>div:last-child{border-bottom:0}.security-definition-list dt{color:var(--text-soft,#667)}.security-definition-list dd{margin:0;font-weight:700;text-align:right}.security-roadmap{display:grid;gap:.8rem;margin:0;padding:0;list-style:none}.security-roadmap li{display:flex;align-items:flex-start;gap:.8rem;padding:.75rem;border:1px solid var(--border,#d9e3e3);border-radius:12px}.security-roadmap li>span{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:50%;background:var(--surface-soft,#eef6f5);font-weight:800}.security-roadmap li.is-current{border-color:color-mix(in srgb,var(--primary,#0f766e) 48%,var(--border,#d9e3e3));background:color-mix(in srgb,var(--primary,#0f766e) 7%,var(--surface,#fff))}.security-roadmap li.is-current>span{background:var(--primary,#0f766e);color:#fff}.security-roadmap strong,.security-roadmap small{display:block}.security-roadmap small{margin-top:.2rem;color:var(--text-soft,#667)}.security-status{display:inline-flex;align-items:center;padding:.3rem .6rem;border-radius:999px;font-weight:800;font-size:.82rem}.security-status.is-success{background:color-mix(in srgb,var(--success,#16835b) 14%,transparent);color:var(--success,#16835b)}.security-status.is-failed{background:color-mix(in srgb,var(--danger,#b42318) 13%,transparent);color:var(--danger,#b42318)}.security-status.is-neutral{background:var(--surface-soft,#eef6f5);color:var(--text-soft,#667)}.security-history-table td{vertical-align:middle}.security-table-status{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}.security-table-status>div{display:flex;justify-content:space-between;gap:1rem;padding:.75rem;border:1px solid var(--border,#d9e3e3);border-radius:12px;background:var(--surface-soft,#f5f8f8)}.security-table-status span{color:var(--text-soft,#667)}[data-theme="dark"] .security-safe-badge,.dark .security-safe-badge{color:#7ce0b8}[data-theme="dark"] .security-status.is-success,.dark .security-status.is-success{color:#7ce0b8}[data-theme="dark"] .security-status.is-failed,.dark .security-status.is-failed{color:#ff9b92}@media(max-width:1000px){.security-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.security-heading{flex-direction:column}.security-grid,.security-stat-grid,.security-table-status{grid-template-columns:1fr}.security-definition-list>div{grid-template-columns:1fr;gap:.25rem}.security-definition-list dd{text-align:left}.security-history-table{min-width:720px}}
.security-heading-actions{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.security-notice-warning{border-color:color-mix(in srgb,var(--warning,#d97706) 45%,var(--border,#d9e3e3));background:color-mix(in srgb,var(--warning,#d97706) 10%,var(--surface,#fff))}.password-security-grid{align-items:start}.security-password-form{display:grid;gap:1rem}.security-password-form label{display:grid;gap:.45rem}.security-password-form label>span{font-weight:750}.security-password-form input{width:100%}.password-rules{padding:1rem;border:1px solid var(--border,#d9e3e3);border-radius:14px;background:var(--surface-soft,#f5f8f8)}.password-rules ul{margin:.55rem 0 0;padding-left:1.2rem;color:var(--text-soft,#667)}.password-rules li+li{margin-top:.25rem}.password-history-list{display:grid;gap:.65rem;margin:0;padding:0;list-style:none}.password-history-list li{display:flex;justify-content:space-between;gap:1rem;padding:.8rem;border:1px solid var(--border,#d9e3e3);border-radius:12px;background:var(--surface-soft,#f5f8f8)}.password-history-list span{color:var(--text-soft,#667)}.password-session-note{margin-top:1rem}.security-password-form button:disabled{opacity:.55;cursor:not-allowed}@media(max-width:760px){.security-heading-actions{width:100%}.security-heading-actions .btn,.security-heading-actions .security-safe-badge{width:100%;justify-content:center}.password-history-list li{flex-direction:column;gap:.25rem}}
.password-input-wrap{position:relative;display:block}.password-input-wrap input{padding-right:5rem}.password-visibility-toggle{position:absolute;right:.45rem;top:50%;transform:translateY(-50%);border:0;background:transparent;color:var(--primary,#0f766e);font-weight:800;cursor:pointer;padding:.35rem .5rem;border-radius:8px}.password-visibility-toggle:hover,.password-visibility-toggle:focus-visible{background:color-mix(in srgb,var(--primary,#0f766e) 10%,transparent);outline:none}.password-strength{display:grid;gap:.45rem}.password-strength-track{height:8px;border-radius:999px;background:var(--border,#d9e3e3);overflow:hidden}.password-strength-track span{display:block;width:0;height:100%;border-radius:inherit;background:var(--danger,#b42318);transition:width .2s ease,background .2s ease}.password-strength[data-level="weak"] .password-strength-track span{background:var(--danger,#b42318)}.password-strength[data-level="medium"] .password-strength-track span{background:var(--warning,#d97706)}.password-strength[data-level="strong"] .password-strength-track span{background:var(--success,#16835b)}.password-strength>span{font-size:.9rem;color:var(--text-soft,#667)}.password-rules li{display:flex;align-items:flex-start;gap:.5rem;list-style:none}.password-rules ul{padding-left:0}.password-rule-icon{display:inline-grid;place-items:center;min-width:1.15rem;font-weight:900}.password-rules li.is-valid{color:var(--success,#16835b);font-weight:750}.password-rules li.is-valid .password-rule-icon{color:var(--success,#16835b)}.password-rules li.is-invalid{color:var(--text-soft,#667)}.password-rule-server{opacity:.9}.password-example{margin:.8rem 0 0;color:var(--text-soft,#667);font-size:.9rem}.password-example code{padding:.15rem .35rem;border-radius:6px;background:var(--surface,#fff);color:var(--text,#142324)}[data-theme="dark"] .password-rules li.is-valid,.dark .password-rules li.is-valid{color:#7ce0b8}

/* v1.5.4 — Cihaz ve Oturum Yönetimi */
.security-session-panel-heading {
    align-items: center;
    gap: 1rem;
}

.security-device-list {
    display: grid;
    gap: .9rem;
}

.security-device-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border, rgba(127, 148, 155, .25));
    border-radius: var(--radius-lg, 16px);
    background: var(--card, rgba(255, 255, 255, .02));
}

.security-device-card.is-current {
    border-color: var(--primary, #36c6bb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #36c6bb) 14%, transparent);
}

.security-device-card.is-revoked {
    opacity: .72;
}

.security-device-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary, #36c6bb) 13%, transparent);
    font-size: 1.45rem;
}

.security-device-main {
    min-width: 0;
}

.security-device-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    margin-bottom: .65rem;
}

.security-device-title-row h3 {
    margin: 0;
    font-size: 1rem;
}

.security-device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1.5rem;
    margin: 0;
}

.security-device-meta div {
    display: grid;
    gap: .12rem;
}

.security-device-meta dt {
    color: var(--text-soft, #94a6aa);
    font-size: .76rem;
}

.security-device-meta dd {
    margin: 0;
    font-size: .88rem;
    font-weight: 600;
}

.security-device-actions {
    display: flex;
    justify-content: flex-end;
}

.security-current-note {
    color: var(--success, #42c97a);
    font-size: .84rem;
    font-weight: 700;
}

.security-revoked-date {
    color: var(--text-soft, #94a6aa);
    font-size: .8rem;
}

.btn-outline-danger {
    color: var(--danger, #e45858) !important;
    border: 1px solid color-mix(in srgb, var(--danger, #e45858) 60%, transparent) !important;
    background: transparent !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
    color: #fff !important;
    background: var(--danger, #e45858) !important;
}

.security-session-explanation {
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .security-session-panel-heading {
        align-items: stretch;
    }

    .security-session-panel-heading form,
    .security-session-panel-heading .btn {
        width: 100%;
    }

    .security-device-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .security-device-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .security-device-actions form,
    .security-device-actions .btn {
        width: 100%;
    }
}

/* v1.5.5 Recovery Codes */
.recovery-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.recovery-date { font-size: 1.05rem !important; }
.recovery-codes-panel,
.recovery-generate-panel,
.recovery-info-panel { margin-top: 1.25rem; }
.recovery-warning {
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--warning, #d59b2d) 48%, transparent);
    border-radius: var(--radius-md, 14px);
    background: color-mix(in srgb, var(--warning, #d59b2d) 12%, var(--surface, #fff));
}
.recovery-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}
.recovery-code-grid code {
    display: block;
    padding: .85rem 1rem;
    border: 1px solid var(--border-color, rgba(128,128,128,.22));
    border-radius: 12px;
    background: var(--surface-muted, rgba(127,127,127,.08));
    color: var(--text-color, inherit);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    user-select: all;
}
.recovery-copy-status { min-height: 1.4em; margin: .75rem 0 0; color: var(--success, #2f9d68); font-weight: 700; }
.recovery-form { display: grid; gap: .85rem; max-width: 620px; }
.recovery-form input { width: 100%; }
.recovery-info-list { margin: .75rem 0 0; padding-left: 1.25rem; }
.recovery-info-list li + li { margin-top: .55rem; }
.security-notice.is-warning {
    border-color: color-mix(in srgb, var(--warning, #d59b2d) 45%, transparent);
    background: color-mix(in srgb, var(--warning, #d59b2d) 10%, var(--surface, #fff));
}
@media (max-width: 760px) {
    .recovery-stat-grid,
    .recovery-code-grid { grid-template-columns: 1fr; }
    .recovery-code-grid code { font-size: .92rem; }
}

/* v1.5.6 — 2FA */
.two-factor-auth-card{max-width:520px}.two-factor-divider{display:flex;align-items:center;gap:12px;color:var(--text-muted,#84979b);font-size:.82rem}.two-factor-divider:before,.two-factor-divider:after{content:"";height:1px;flex:1;background:var(--border,#294247)}.two-factor-cancel-form{margin-top:10px}.secret-code{display:block;overflow-wrap:anywhere;padding:18px;border:1px dashed var(--primary,#5ad0c8);border-radius:12px;background:rgba(90,208,200,.08);font-size:1.05rem;letter-spacing:.08em;margin:16px 0}.two-factor-uri-details{margin-top:16px}.two-factor-uri-details textarea{width:100%;margin-top:10px}.two-factor-status-card{max-width:820px}.two-factor-disable-form{max-width:520px;margin-top:24px;padding-top:22px;border-top:1px solid var(--border,#294247)}.security-warning{border-color:rgba(242,184,75,.45);background:rgba(242,184,75,.1)}.button-danger{background:var(--danger,#e45858)!important;color:#fff!important;border-color:transparent!important}@media(max-width:720px){.secret-code{font-size:.9rem}.two-factor-setup-card .btn,.two-factor-verify-card .btn{width:100%}}

/* v1.5.7 - Yerel 2FA QR kurulumu */
.two-factor-qr-wrap{display:grid;grid-template-columns:minmax(220px,280px) 1fr;gap:1.25rem;align-items:center;margin:1rem 0 1.25rem}.two-factor-qr{width:min(100%,280px);aspect-ratio:1;background:#fff;border:1px solid var(--border-color,#d7e0e3);border-radius:18px;padding:14px;display:grid;place-items:center;box-shadow:0 10px 30px rgba(0,0,0,.08)}.two-factor-qr svg{display:block;width:100%;height:100%}.two-factor-qr p{color:#445!important;text-align:center}.two-factor-qr-help{display:grid;gap:.45rem}.two-factor-qr-help strong{font-size:1.02rem}.two-factor-qr-help span{color:var(--text-muted,#667)}.manual-secret-details{margin-top:.75rem;border-top:1px solid var(--border-color,#d7e0e3);padding-top:.85rem}.manual-secret-details summary{cursor:pointer;font-weight:700;color:var(--primary,#087f78)}.qr-error{font-size:.9rem;padding:1rem}.theme-dark .two-factor-qr{border-color:#2b4549}.theme-dark .manual-secret-details summary{color:#79e2d8}@media(max-width:720px){.two-factor-qr-wrap{grid-template-columns:1fr}.two-factor-qr{margin-inline:auto}.two-factor-qr-help{text-align:center}}

/* v1.5.8 — Güvenlik Final */
.security-final-overview{display:grid;gap:1.25rem;margin-bottom:1rem}.security-score-main{display:flex;align-items:center;gap:1.25rem}.security-score-ring{--score:0;width:112px;aspect-ratio:1;border-radius:50%;display:grid;place-content:center;text-align:center;flex:0 0 auto;background:conic-gradient(var(--primary,#5ad0c8) calc(var(--score)*1%),color-mix(in srgb,var(--border-color,#d7e0e3) 72%,transparent) 0);position:relative}.security-score-ring:before{content:"";position:absolute;inset:9px;border-radius:inherit;background:var(--surface,#fff)}.security-score-ring strong,.security-score-ring span{position:relative;z-index:1}.security-score-ring strong{font-size:1.75rem;line-height:1}.security-score-ring span{font-size:.78rem;color:var(--text-muted,#667)}.security-score-ring.is-success{--primary:var(--success,#2f9d68)}.security-score-ring.is-warning{--primary:var(--warning,#d59b2d)}.security-score-ring.is-danger{--primary:var(--danger,#d14b45)}.security-component-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.75rem}.security-component-card{display:flex;gap:.7rem;align-items:center;padding:.85rem;border:1px solid var(--border-color,rgba(128,128,128,.22));border-radius:14px;background:var(--surface-muted,rgba(127,127,127,.06))}.security-component-card>span{width:30px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;font-weight:900}.security-component-card.is-complete>span{background:color-mix(in srgb,var(--success,#2f9d68) 18%,transparent);color:var(--success,#2f9d68)}.security-component-card.is-pending>span{background:color-mix(in srgb,var(--warning,#d59b2d) 18%,transparent);color:var(--warning,#d59b2d)}.security-component-card strong,.security-component-card small{display:block}.security-component-card small{margin-top:.15rem;color:var(--text-muted,#667)}.security-final-grid{margin-bottom:1rem}.security-recommendations{display:grid;gap:.7rem;margin:0;padding:0;list-style:none}.security-recommendations li{position:relative;padding:.75rem .85rem .75rem 2.25rem;border-radius:12px;background:var(--surface-muted,rgba(127,127,127,.06))}.security-recommendations li:before{content:"✓";position:absolute;left:.85rem;color:var(--primary,#087f78);font-weight:900}.security-audit-panel{margin-bottom:1rem}.security-audit-list{display:grid;gap:.65rem}.security-audit-list article{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.75rem;align-items:start;padding:.85rem 0;border-bottom:1px solid var(--border-color,rgba(128,128,128,.18))}.security-audit-list article:last-child{border-bottom:0}.security-audit-list p{margin:.2rem 0 0;color:var(--text-muted,#667)}.security-audit-list time{font-size:.82rem;color:var(--text-muted,#667);white-space:nowrap}.security-event-dot{width:10px;aspect-ratio:1;border-radius:50%;margin-top:.35rem;background:var(--primary,#087f78)}.security-event-dot.is-success{background:var(--success,#2f9d68)}.security-event-dot.is-warning{background:var(--warning,#d59b2d)}.security-event-dot.is-danger,.security-event-dot.is-error{background:var(--danger,#d14b45)}
@media(max-width:980px){.security-component-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:640px){.security-score-main{align-items:flex-start}.security-score-ring{width:92px}.security-component-grid{grid-template-columns:1fr}.security-audit-list article{grid-template-columns:auto minmax(0,1fr)}.security-audit-list time{grid-column:2;white-space:normal}}

/* ===== professional-polish-v161.css ===== */
/* Meriç Health OS Professional v1.6.1
   Tasarım sistemi ve koyu mod son rötuşları.
   Bu dosya yalnızca görünümü etkiler; PHP iş mantığına dokunmaz. */

:root {
    --polish-focus: 0 0 0 4px color-mix(in srgb, var(--ui-primary) 24%, transparent);
    --polish-hover-lift: translateY(-1px);
    --polish-card-gap: clamp(14px, 1.8vw, 22px);
}

/* Sayfa ritmi ve içerik genişliği */
.page-container,
.analytics-page,
.security-page,
.report-center,
.health-archive-page {
    width: min(1320px, calc(100% - 40px));
    margin-inline: auto;
}

:is(.page-header, .module-header, .panel-header, .section-header, .report-toolbar) {
    gap: 14px;
}

:is(.page-header, .module-header) {
    margin-bottom: clamp(18px, 2.5vw, 30px);
}

:is(.page-header h1, .module-header h1) {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

/* Kartlar: ortak yükseklik, sınır ve hover */
:is(
    .card, .panel, .module-card, .metric-card, .summary-card, .stat-card,
    .report-card, .security-card, .analytics-card, .archive-card,
    .treatment-card, .health-component-card, .notification-card
) {
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

@media (hover: hover) {
    :is(
        a.card, a.module-card, a.metric-card, a.summary-card,
        .archive-card:has(a), .security-card:has(a)
    ):hover {
        transform: var(--polish-hover-lift);
        border-color: color-mix(in srgb, var(--ui-primary) 42%, var(--ui-border));
        box-shadow: var(--ui-shadow-md);
    }
}

/* Gridlerde eşit kartlar */
:is(
    .dashboard-grid, .summary-grid, .metrics-grid, .report-grid,
    .security-grid, .analytics-grid, .archive-grid, .folder-grid
) {
    gap: var(--polish-card-gap);
    align-items: stretch;
}

:is(
    .dashboard-grid, .summary-grid, .metrics-grid, .report-grid,
    .security-grid, .analytics-grid, .archive-grid, .folder-grid
) > * {
    min-width: 0;
}

/* Buton sistemi: her durumda okunabilirlik */
:is(
    .button, .button-primary, .button-secondary, .button-danger,
    .small-action, button[type="submit"], a.button, a.button-primary,
    a.button-secondary, .header-action, .panel-header-link
) {
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease,
                border-color 150ms ease, color 150ms ease;
}

:is(.button, .button-primary, button[type="submit"]:not(.button-secondary):not(.button-danger)) {
    background: var(--ui-primary);
    color: var(--ui-on-primary) !important;
    border-color: var(--ui-primary);
}

:is(.button, .button-primary, button[type="submit"]:not(.button-secondary):not(.button-danger)):visited {
    color: var(--ui-on-primary) !important;
}

:is(.button-secondary, .small-action, .header-action, .panel-header-link) {
    background: var(--ui-surface-2);
    color: var(--ui-text) !important;
    border: 1px solid var(--ui-border);
}

:is(.button-secondary, .small-action, .header-action, .panel-header-link):visited {
    color: var(--ui-text) !important;
}

:is(.button-danger, .danger-action) {
    background: color-mix(in srgb, var(--ui-danger) 14%, var(--ui-surface));
    color: var(--ui-danger) !important;
    border: 1px solid color-mix(in srgb, var(--ui-danger) 38%, var(--ui-border));
}

@media (hover: hover) {
    :is(.button, .button-primary, .button-secondary, .button-danger, .small-action, button[type="submit"]):hover {
        transform: var(--polish-hover-lift);
    }
}

:is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: 2px;
    box-shadow: var(--polish-focus);
}

button:disabled,
.button[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}

/* Formlar */
:is(input, select, textarea) {
    width: 100%;
    min-height: var(--ui-control-height);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
}

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

:is(input, select, textarea):hover {
    border-color: color-mix(in srgb, var(--ui-primary) 35%, var(--ui-border));
}

:is(input, select, textarea):focus {
    border-color: var(--ui-primary);
}

label {
    color: var(--ui-text);
    font-weight: 700;
}

/* Tablolar */
.table-wrap,
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
}

.table-wrap table,
.table-responsive table {
    margin: 0;
    border: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

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

/* Rozetler ve durumlar */
:is(.badge, .status-badge, .pill, .tag) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 750;
    line-height: 1;
}

/* Koyu mod son kontrast düzenlemeleri */
[data-theme="dark"] :is(
    .card, .panel, .module-card, .metric-card, .summary-card,
    .report-card, .security-card, .analytics-card, .archive-card,
    .form-panel, .table-wrap, .table-responsive
) {
    background: var(--ui-surface);
    color: var(--ui-text);
    border-color: var(--ui-border);
}

[data-theme="dark"] :is(
    .button-secondary, .small-action, .header-action, .panel-header-link
) {
    background: #1b3036;
    color: #edf7f5 !important;
    border-color: #35535b;
}

[data-theme="dark"] :is(
    .button-secondary, .small-action, .header-action, .panel-header-link
):hover {
    background: #244047;
    color: #ffffff !important;
    border-color: #5fd2c3;
}

[data-theme="dark"] :is(input, select, textarea) {
    background: #102126;
    color: #edf7f5;
    border-color: #35535b;
}

[data-theme="dark"] :is(input, textarea)::placeholder {
    color: #89a1a7;
    opacity: 1;
}

[data-theme="dark"] :is(.muted, .text-muted, small, .help-text, .form-help, .field-help) {
    color: #adc0c4;
}

[data-theme="dark"] a:not(.button):not(.button-primary):not(.button-secondary):not(.small-action) {
    color: #7be0d4;
}

[data-theme="dark"] a:not(.button):not(.button-primary):not(.button-secondary):not(.small-action):hover {
    color: #b1f4ec;
}

/* Mobil */
@media (max-width: 760px) {
    .page-container,
    .analytics-page,
    .security-page,
    .report-center,
    .health-archive-page {
        width: min(100% - 24px, 1320px);
        margin-top: 16px;
        margin-bottom: 36px;
    }

    :is(.page-header, .module-header, .panel-header, .section-header, .report-toolbar) {
        align-items: stretch;
        flex-direction: column;
    }

    :is(.page-header-actions, .module-actions, .panel-actions, .report-actions) {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    :is(
        .page-header-actions, .module-actions, .panel-actions, .report-actions
    ) :is(.button, .button-primary, .button-secondary, .small-action, button) {
        width: 100%;
        white-space: normal;
    }

    :is(.card, .panel, .module-card, .form-panel, .report-card) {
        border-radius: 16px;
    }

    table { min-width: 680px; }
}

/* Yazdırma */
@media print {
    .sidebar,
    .topbar,
    .mobile-menu,
    .theme-toggle,
    .pwa-install-button,
    .no-print,
    button:not(.print-keep) {
        display: none !important;
    }

    body,
    .app-main,
    .page-container {
        background: #fff !important;
        color: #111 !important;
        width: 100% !important;
        margin: 0 !important;
    }

    :is(.card, .panel, .module-card, .report-card) {
        box-shadow: none !important;
        break-inside: avoid;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== mobile-responsive-v162.css ===== */
/* Meriç Health OS Professional v1.6.2
   Mobil ve responsive son düzenlemeler. Yalnızca görünümü etkiler. */

:root {
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-top: env(safe-area-inset-top, 0px);
}

/* Büyük ekranlarda daha dengeli içerik */
@media (min-width: 1440px) {
    .page-container,
    .analytics-page,
    .security-page,
    .report-center,
    .health-archive-page {
        width: min(1420px, calc(100% - 64px));
    }
}

/* Tablet */
@media (max-width: 1080px) {
    :is(.dashboard-grid, .summary-grid, .metrics-grid, .report-grid,
        .security-grid, .analytics-grid, .archive-grid, .folder-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-topbar {
        padding-inline: 18px;
    }

    .page-container {
        width: min(100% - 32px, 1320px);
    }
}

/* Mobil menü perdesi */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 89;
    background: rgb(3 12 15 / 58%);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 860px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        width: min(86vw, 330px);
        max-width: 330px;
        padding-top: var(--mobile-safe-top);
        padding-bottom: calc(14px + var(--mobile-safe-bottom));
        transform: translateX(-102%);
        visibility: hidden;
        box-shadow: 24px 0 70px rgb(0 0 0 / 34%);
        transition: transform 200ms ease, visibility 200ms ease;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
    }

    .app-main {
        min-width: 0;
        width: 100%;
        margin-left: 0 !important;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 70;
        min-height: 64px;
        padding: max(10px, var(--mobile-safe-top)) 14px 10px;
        gap: 10px;
        backdrop-filter: blur(14px);
    }

    .mobile-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 13px;
    }

    .topbar-title {
        min-width: 0;
        flex: 1 1 auto;
    }

    .topbar-title strong,
    .topbar-title small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-title strong { font-size: .98rem; }
    .topbar-title small { font-size: .75rem; }

    .topbar-actions {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 6px;
    }

    .topbar-actions :is(button, a) {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
    }

    .pwa-install-button .pwa-label { display: none; }

    .page-container,
    .analytics-page,
    .security-page,
    .report-center,
    .health-archive-page {
        width: min(100% - 22px, 1320px);
        margin-top: 14px;
        margin-bottom: calc(34px + var(--mobile-safe-bottom));
    }

    :is(.dashboard-grid, .summary-grid, .metrics-grid, .report-grid,
        .security-grid, .analytics-grid, .archive-grid, .folder-grid,
        .form-grid, .filters-grid, .stats-grid) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    :is(.page-header, .module-header, .panel-header, .section-header, .report-toolbar) {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    :is(.page-header-actions, .module-actions, .panel-actions, .report-actions,
        .toolbar-actions, .form-actions) {
        width: 100%;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px;
    }

    :is(.page-header-actions, .module-actions, .panel-actions, .report-actions,
        .toolbar-actions, .form-actions) > * {
        width: 100%;
        justify-content: center;
        white-space: normal;
    }

    :is(.card, .panel, .module-card, .metric-card, .summary-card,
        .report-card, .security-card, .analytics-card, .archive-card,
        .form-panel, .notification-card) {
        min-width: 0;
        border-radius: 16px;
    }

    :is(.card, .panel, .module-card, .report-card, .security-card,
        .analytics-card, .archive-card, .form-panel) {
        padding: clamp(14px, 4vw, 18px);
    }

    /* Tablolar kart dışına taşmasın */
    .table-wrap,
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .table-wrap table,
    .table-responsive table,
    table.data-table {
        min-width: 700px;
    }

    /* Grafikler telefonda okunabilir kalsın */
    :is(.chart-wrap, .chart-container, .analytics-chart, .report-chart) {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    :is(.chart-wrap, .chart-container, .analytics-chart, .report-chart) canvas {
        max-width: 100% !important;
        min-height: 230px;
    }

    /* Modal / dialog */
    :is(.modal, .dialog, [role="dialog"]) {
        max-width: calc(100vw - 22px);
        max-height: calc(100dvh - 22px);
        overflow-y: auto;
    }

    /* Dokunma hedefleri */
    :is(button, .button, .button-primary, .button-secondary, .button-danger,
        .small-action, .status-badge, .tag, .pill) {
        min-height: 44px;
    }

    :is(input, select, textarea) {
        font-size: 16px; /* iOS otomatik yakınlaştırmayı önler */
    }

    .sidebar-nav a,
    .sidebar-nav summary {
        min-height: 46px;
        padding-block: 11px;
    }

    .sidebar-footer {
        padding-bottom: calc(12px + var(--mobile-safe-bottom));
    }
}

/* Çok dar telefonlar */
@media (max-width: 390px) {
    .page-container,
    .analytics-page,
    .security-page,
    .report-center,
    .health-archive-page {
        width: min(100% - 16px, 1320px);
    }

    .app-topbar { padding-inline: 9px; }
    .topbar-title small { display: none; }

    :is(.card, .panel, .module-card, .report-card, .security-card,
        .analytics-card, .archive-card, .form-panel) {
        padding: 13px;
    }

    :is(.page-header h1, .module-header h1) {
        font-size: 1.55rem;
    }
}

/* Yatay telefon */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 960px) {
    .sidebar { width: min(74vw, 330px); }
    .sidebar-brand { padding-block: 10px; }
    .sidebar-nav a,
    .sidebar-nav summary { min-height: 40px; padding-block: 8px; }
}

@media print {
    .sidebar-backdrop { display: none !important; }
}

/* ===== notifications-loading-v163.css ===== */
:root {
    --toast-surface: var(--card, #ffffff);
    --toast-text: var(--text, #172126);
    --toast-border: var(--border, #d8e2e5);
    --toast-shadow: 0 18px 48px rgb(15 23 42 / 18%);
}

[data-theme="dark"] {
    --toast-surface: var(--card, #102326);
    --toast-text: var(--text, #f4f7f8);
    --toast-border: var(--border, #29474d);
    --toast-shadow: 0 20px 52px rgb(0 0 0 / 42%);
}

.page-loading-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 10050;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    transition: opacity .16s ease;
}

.page-loading-bar span {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: 999px;
    background: var(--primary, #0f766e);
    transform: translateX(-120%);
}

.page-loading-bar.is-active {
    opacity: 1;
}

.page-loading-bar.is-active span {
    animation: meric-loading-slide 1.05s ease-in-out infinite;
}

@keyframes meric-loading-slide {
    0% { transform: translateX(-120%); }
    55% { transform: translateX(175%); }
    100% { transform: translateX(300%); }
}

.toast-region {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10040;
    display: grid;
    gap: .7rem;
    width: min(390px, calc(100vw - 2rem));
    pointer-events: none;
}

.meric-toast {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .75rem;
    align-items: start;
    padding: .9rem 1rem;
    border: 1px solid var(--toast-border);
    border-left-width: 4px;
    border-radius: 14px;
    color: var(--toast-text);
    background: var(--toast-surface);
    box-shadow: var(--toast-shadow);
    pointer-events: auto;
    animation: meric-toast-in .22s ease-out both;
}

.meric-toast.is-leaving {
    animation: meric-toast-out .18s ease-in both;
}

.meric-toast--success { border-left-color: var(--success, #22a06b); }
.meric-toast--error { border-left-color: var(--danger, #dc4c4c); }
.meric-toast--warning { border-left-color: var(--warning, #d99a21); }
.meric-toast--info { border-left-color: var(--primary, #0f766e); }

.meric-toast__icon {
    line-height: 1.25;
    font-size: 1.05rem;
}

.meric-toast__content {
    min-width: 0;
    line-height: 1.45;
}

.meric-toast__title {
    display: block;
    margin-bottom: .08rem;
    font-weight: 750;
}

.meric-toast__message {
    color: inherit;
    opacity: .88;
    overflow-wrap: anywhere;
}

.meric-toast__close {
    min-width: 32px;
    min-height: 32px;
    margin: -.3rem -.4rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font-size: 1.15rem;
}

.meric-toast__close:hover,
.meric-toast__close:focus-visible {
    background: rgb(127 127 127 / 12%);
    outline: 2px solid var(--primary, #0f766e);
    outline-offset: 1px;
}

@keyframes meric-toast-in {
    from { opacity: 0; transform: translate3d(18px, -6px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes meric-toast-out {
    to { opacity: 0; transform: translate3d(18px, -4px, 0); }
}

button.is-loading,
.btn.is-loading,
[type="submit"].is-loading {
    position: relative;
    cursor: wait;
    opacity: .82;
}

button.is-loading::before,
.btn.is-loading::before,
[type="submit"].is-loading::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: .5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -.14em;
    animation: meric-spin .65s linear infinite;
}

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

.is-busy[aria-busy="true"] {
    cursor: progress;
}

.skeleton {
    position: relative;
    overflow: hidden;
    min-height: 1rem;
    border-radius: 8px;
    background: rgb(127 127 127 / 12%);
    color: transparent !important;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 25%), transparent);
    animation: meric-skeleton 1.25s infinite;
}

@keyframes meric-skeleton { 100% { transform: translateX(100%); } }

@media (max-width: 640px) {
    .toast-region {
        top: .75rem;
        right: .75rem;
        left: .75rem;
        width: auto;
    }

    .meric-toast {
        padding: .85rem .9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-loading-bar span,
    .meric-toast,
    .meric-toast.is-leaving,
    button.is-loading::before,
    .btn.is-loading::before,
    [type="submit"].is-loading::before,
    .skeleton::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .page-loading-bar,
    .toast-region { display: none !important; }
}
