/* NutriIQ online: sign-in pages and the account strip inside the practice workspace. */
:root {
    --nq-brand: #00516b;
    --nq-brand-dark: #00384a;
    --nq-surface: #ffffff;
    --nq-page: #f3f7f5;
    --nq-text: #0f172a;
    --nq-muted: #5b6b7a;
    --nq-line: #dbe5e1;
    --nq-error: #b42318;
    --nq-success: #067647;
}

.auth-page {
    margin: 0;
    min-height: 100vh;
    background: var(--nq-page);
    color: var(--nq-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }

.auth-shell {
    max-width: 440px;
    margin: 0 auto;
    padding: 48px 16px 64px;
}

.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 24px; }
.auth-wordmark { font-size: 2rem; letter-spacing: -0.02em; color: var(--nq-brand-dark); }
.auth-wordmark strong { color: var(--nq-brand); }
.auth-tagline { color: var(--nq-muted); font-size: 0.9rem; }

.auth-card {
    background: var(--nq-surface);
    border: 1px solid var(--nq-line);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 8px 24px rgba(0, 56, 74, 0.06);
}

.auth-card h1 { font-size: 1.35rem; margin: 0 0 12px; }
.auth-intro { color: var(--nq-muted); margin: 0 0 16px; }

.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.auth-card label small { font-weight: 400; color: var(--nq-muted); }
.auth-card input {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid #c7d4cf;
    border-radius: 8px;
    background: #fff;
    color: var(--nq-text);
}
.auth-card input:focus { outline: 3px solid rgba(0, 81, 107, 0.25); border-color: var(--nq-brand); }
.code-form input { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; }

.auth-primary {
    font: inherit;
    font-weight: 600;
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--nq-brand);
    color: #fff;
    cursor: pointer;
}
.auth-primary:hover:not(:disabled) { background: var(--nq-brand-dark); }
.auth-primary:disabled { opacity: 0.6; cursor: progress; }

.auth-links { margin: 16px 0 0; font-size: 0.9rem; }
.auth-links a, .auth-help summary { color: var(--nq-brand); }
.auth-help { margin-top: 14px; font-size: 0.9rem; color: var(--nq-muted); }
.auth-help summary { cursor: pointer; }
.auth-help p { margin: 8px 0; }

.auth-steps { margin: 0 0 16px; padding-left: 20px; color: var(--nq-muted); }
.auth-steps li { margin-bottom: 6px; }
.auth-qr { display: block; margin: 0 auto 8px; width: 220px; height: 220px; max-width: 100%; }
.auth-secret { display: block; padding: 8px; border-radius: 6px; background: var(--nq-page); font-size: 0.95rem; word-break: break-all; color: var(--nq-text); }

.auth-message {
    margin: 16px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef3f2;
    color: var(--nq-error);
    border: 1px solid #fecdca;
}
.auth-message[data-kind="success"] { background: #ecfdf3; color: var(--nq-success); border-color: #abefc6; }

/* Account strip in the practice workspace sidebar. */
.online-account {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.online-account strong { color: var(--text-primary, #0f172a); font-size: 0.85rem; }
.online-account-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.online-account-actions a, .online-account-actions button {
    font: inherit;
    padding: 0;
    border: 0;
    background: none;
    color: var(--nq-brand);
    cursor: pointer;
    text-decoration: underline;
}
.online-session-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 10px;
    background: #7a271a;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.online-session-banner a { color: #fff; font-weight: 600; }

/* Practice branding: logo picker and live preview on the sign-in pages. */
.brand-fieldset { border: 1px solid var(--nq-line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.brand-fieldset legend { font-weight: 600; font-size: 0.9rem; padding: 0 4px; }
.brand-fieldset legend small { font-weight: 400; color: var(--nq-muted); }
.brand-hint { margin: 0; font-size: 0.85rem; color: var(--nq-muted); }
.brand-fieldset input[type=file] { padding: 6px; font-size: 0.85rem; }
.brand-preview { display: flex; flex-direction: column; gap: 10px; }
.brand-preview-caption { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nq-muted); }
.brand-preview-sidebar { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 10px; background: #fff; border: 1px solid var(--nq-line); }
.brand-preview-sidebar img { max-width: 200px; max-height: 80px; width: auto; height: auto; }
.brand-preview-button { display: inline-block; padding: 9px 14px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 0.85rem; }
.brand-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-card .brand-color { flex-direction: row; align-items: center; gap: 10px; }
.auth-card .brand-color input { width: 48px; height: 34px; padding: 2px; cursor: pointer; }
.brand-link { font: inherit; font-size: 0.85rem; border: 0; background: none; padding: 0; color: var(--nq-brand); text-decoration: underline; cursor: pointer; }
.brand-link[hidden] { display: none; }

/* Practice logo or name in the workspace sidebar and printed reports. */
.practice-logo { width: auto; max-width: 215px; max-height: 90px; }
.practice-name-logo { display: block; font-size: 19px; font-weight: 700; color: var(--primary-color); white-space: normal; line-height: 1.2; }
.report-logo { width: auto; max-width: 190px; max-height: 70px; }
.report-practice-name { font-size: 18px; color: var(--primary-color); }

/* Signed-in pages next to the workspace: settings and calendar. */
.shell-page { margin: 0; min-height: 100vh; background: var(--nq-page); color: var(--nq-text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5; }
.shell-page *, .shell-page *::before, .shell-page *::after { box-sizing: border-box; }
.shell-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--nq-line); position: sticky; top: 0; z-index: 10; }
.shell-brand { display: flex; align-items: center; font-weight: 700; font-size: 1.1rem; color: var(--nq-brand); text-decoration: none; }
.shell-brand img { max-height: 44px; max-width: 180px; width: auto; }
.shell-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shell-nav a, .shell-logout { font: inherit; font-size: 0.9rem; padding: 8px 12px; border-radius: 8px; color: var(--nq-text); text-decoration: none; background: none; border: 0; cursor: pointer; }
.shell-nav a:hover, .shell-logout:hover { background: var(--nq-page); }
.shell-nav a[aria-current="page"] { background: var(--nq-page); color: var(--nq-brand); font-weight: 600; }
.shell-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
.shell-main.agenda { max-width: 1200px; }
.shell-title { font-size: 1.6rem; margin: 8px 0 16px; text-transform: capitalize; }
.shell-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 10px; background: var(--nq-success); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.shell-toast[data-kind="error"] { background: var(--nq-error); }

.auth-secondary { display: inline-block; font: inherit; font-weight: 600; font-size: 0.9rem; padding: 9px 14px; border-radius: 8px; border: 1px solid #c7d4cf; background: #fff; color: var(--nq-brand); cursor: pointer; text-decoration: none; }
.auth-secondary:hover { border-color: var(--nq-brand); }
.shell-page .auth-primary { font-size: 0.9rem; padding: 9px 14px; }
.brand-link.danger { color: var(--nq-error); }

.settings-toc { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.settings-toc a { font-size: 0.85rem; padding: 6px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--nq-line); color: var(--nq-text); text-decoration: none; }
.settings-card { background: #fff; border: 1px solid var(--nq-line); border-radius: 14px; padding: 22px 22px 24px; margin-bottom: 18px; scroll-margin-top: 80px; }
.settings-card h2 { font-size: 1.2rem; margin: 0 0 8px; }
.settings-card h3 { font-size: 1rem; margin: 22px 0 8px; }
.settings-intro { color: var(--nq-muted); margin: 0 0 12px; }
.settings-steps { margin: 0 0 14px; padding-left: 20px; color: var(--nq-muted); }
.settings-steps li { margin-bottom: 4px; }
.settings-form { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.settings-form label, .agenda-dialog label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.settings-form label small { font-weight: 400; color: var(--nq-muted); }
.settings-form input, .settings-form select, .settings-form textarea, .libre-connections select { font: inherit; padding: 9px 11px; border: 1px solid #c7d4cf; border-radius: 8px; background: #fff; color: var(--nq-text); }
.settings-form .brand-color { flex-direction: row; align-items: center; }
.settings-form button[type=submit] { align-self: flex-start; }
.settings-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.settings-alert { padding: 10px 12px; border-radius: 8px; background: #fffaeb; border: 1px solid #fedf89; color: #93370d; }
.libre-status { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #ecfdf3; color: var(--nq-success); }
.status-pill[data-kind="warn"], .status-pill[data-kind="busy"] { background: #fffaeb; color: #93370d; }
.status-pill[data-kind="error"] { background: #fef3f2; color: var(--nq-error); }
.libre-connections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.libre-connections li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--nq-line); border-radius: 10px; }
.libre-name { display: flex; flex-direction: column; }
.libre-name small { color: var(--nq-muted); }
.libre-connections select { max-width: 100%; }

/* Calendar */
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agenda-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.agenda-month { background: #fff; border: 1px solid var(--nq-line); border-radius: 14px; overflow: hidden; }
.agenda-weekdays, .agenda-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-weekdays span { padding: 8px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nq-muted); border-bottom: 1px solid var(--nq-line); }
.agenda-cell { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 6px; border: 0; border-right: 1px solid var(--nq-line); border-bottom: 1px solid var(--nq-line); background: #fff; cursor: pointer; overflow: hidden; color: var(--nq-text); }
.agenda-cell:nth-child(7n) { border-right: 0; }
.agenda-cell.outside { background: #fafbfa; color: #9aa6a0; }
.agenda-cell.selected { box-shadow: inset 0 0 0 2px var(--nq-brand); }
.agenda-number { font-size: 0.85rem; font-weight: 600; }
.agenda-cell.today .agenda-number { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--nq-brand); color: #fff; }
.agenda-chip { display: block; font-size: 0.72rem; line-height: 1.3; padding: 2px 5px; border-radius: 5px; background: #e8f1ef; color: #134e40; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-chip.telefonisch, .agenda-item.telefonisch { background: #eef2fb; color: #2f3f73; }
.agenda-chip.online, .agenda-item.online { background: #f3eefb; color: #4a2f73; }
.agenda-chip.follow-up, .agenda-item.follow-up { background: #fff6e5; color: #7a4b00; }
.agenda-more { font-size: 0.72rem; color: var(--nq-muted); }
.agenda-day { background: #fff; border: 1px solid var(--nq-line); border-radius: 14px; padding: 16px; position: sticky; top: 84px; }
.agenda-day h2 { font-size: 1.05rem; margin: 0 0 10px; text-transform: capitalize; }
.agenda-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agenda-item { border-radius: 10px; background: #e8f1ef; color: #134e40; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.agenda-item button { font: inherit; text-align: left; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; display: flex; flex-direction: column; }
.agenda-item small { opacity: .85; }
.agenda-item .brand-link { color: inherit; font-size: 0.8rem; align-self: flex-start; }
.agenda-dialog { border: 0; border-radius: 14px; padding: 22px; width: min(520px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.agenda-dialog::backdrop, .setup-wizard::backdrop { background: rgba(15, 23, 42, .45); }
.agenda-dialog h2 { margin: 0 0 4px; font-size: 1.2rem; }
.agenda-dialog .settings-form { max-width: none; }
.agenda-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
@media (max-width: 860px) {
    .agenda-layout { grid-template-columns: 1fr; }
    .agenda-day { position: static; }
    .agenda-cell { min-height: 64px; }
    .agenda-chip { font-size: 0; padding: 0; height: 6px; }
    .agenda-row { grid-template-columns: 1fr 1fr; }
}

/* First-login setup wizard and notices inside the workspace. */
.setup-wizard { border: 0; border-radius: 16px; padding: 26px 26px 22px; width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(0,0,0,.28); color: var(--text-primary, #0f172a); }
.setup-wizard h2 { margin: 6px 0 8px; font-size: 1.35rem; }
.setup-wizard p { color: var(--text-secondary, #64748b); margin: 0 0 12px; }
.setup-wizard .eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--primary-color, #176b5b); font-weight: 700; }
.wizard-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.wizard-progress span { height: 4px; border-radius: 4px; background: #e2e8e4; }
.wizard-progress span.done { background: var(--primary-color, #176b5b); }
.wizard-list { margin: 0 0 14px; padding-left: 20px; color: var(--text-secondary, #64748b); }
.wizard-list li { margin-bottom: 6px; }
.wizard-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 8px; }
.wizard-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12px; }
.wizard-form input { font: inherit; padding: 9px 10px; border: 1px solid #cdd8d2; border-radius: 8px; }
.wizard-status { min-height: 1.2em; font-size: 13px; }
.wizard-status[data-kind="success"] { color: var(--nq-success); }
.wizard-status[data-kind="error"] { color: var(--nq-error); }
.wizard-note { font-size: 13px; }
.wizard-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.setup-wizard .brand-fieldset { border-color: #dfe6df; }
@media (max-width: 600px) { .wizard-form { grid-template-columns: 1fr; } }
.online-readings-banner { position: fixed; right: 16px; bottom: 16px; z-index: 1000; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--primary-color, #176b5b); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.online-readings-banner button { font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 6px; border: 0; background: #fff; color: var(--primary-color, #176b5b); cursor: pointer; }
a.sidebar-tool { text-decoration: none; }
