/* public/css/settings.css — the Settings page and its sign-in card (render/settings.js), on top of shell.css's tokens. */

.settings { background: var(--chrome); --gutter: clamp(16px, 2.5vw, 40px); } /* the page uses the whole window behind this gutter */

/* sign-in */
.st-login { display: flex; justify-content: center; padding: 10vh 16px 40px; }
.st-login-card { width: 100%; max-width: 380px; background: var(--background); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 28px 30px 22px; text-align: center; }
.st-login-logo { height: 54px; }
.st-login-card h1 { font-size: 22px; margin: 12px 0 4px; color: var(--foreground); }
.st-login-card .st-sub { text-align: center; margin: 0 0 18px; }
.st-login-card .st-field { text-align: left; }
.st-login-btn { width: 100%; justify-content: center; margin-top: 14px; }
.st-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; border-radius: var(--radius); padding: 8px 12px; font-size: 14px; margin: 0 0 14px; }
.st-foot { margin: 16px 0 0; font-size: 13px; } .st-foot a { color: var(--brand); }

/* header: brand + title on the left, the section tabs (shadcn "tabs") in the middle, Home / Sign out on the right */
.st-head { position: sticky; top: 0; z-index: 10; background: var(--background); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.st-head-inner { display: flex; align-items: center; gap: 14px; padding: 10px var(--gutter); }
.st-brand { display: block; flex: 0 0 auto; }
.st-brand img { height: 38px; display: block; }
.st-head-title { display: flex; flex-direction: column; min-width: 0; margin-right: 10px; }
.st-head-title h1 { font-size: 18px; line-height: 1.2; margin: 0; color: var(--foreground); white-space: nowrap; }
.st-head-sub { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.st-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 10px; margin-left: auto; }
.st-tabs a { padding: 6px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted-foreground); text-decoration: none; transition: background-color .12s, color .12s; }
.st-tabs a:hover { color: var(--foreground); }
.st-tabs a.is-active { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
.st-tabs a:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.st-head-btn { text-decoration: none; }
.st-inline-form { display: inline; margin: 0; }

/* page */
.st-main { padding: 8px var(--gutter) 60px; }
/* the "Saved" toast: fixed under the header, so it is seen wherever the page lands after the save (#documents / #doctors) */
.st-flash { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 8px 18px; background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md); transition: opacity .4s; }
.st-flash.is-gone { opacity: 0; }
.st-banner { max-width: none; margin: 10px var(--gutter) 0; }
.st-section { margin-top: 28px; scroll-margin-top: 70px; }
.st-section-head h2 { font-size: 20px; margin: 0 0 4px; color: var(--foreground); }
.st-count { font-size: 13px; font-weight: 500; color: var(--muted-foreground); margin-left: 8px; }
.st-sub { color: var(--muted-foreground); font-size: 14px; margin: 0 0 14px; line-height: 1.5; max-width: 1100px; } /* the one thing not stretched: a help paragraph stays readable */
.st-form { position: relative; }
.st-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 10px 0; margin-top: 10px; background: linear-gradient(to top, var(--chrome) 70%, transparent); }
.st-dirty { font-size: 13px; color: #b45309; visibility: hidden; }
.st-form.is-dirty .st-dirty { visibility: visible; }
.st-storage { color: var(--muted-foreground); font-size: 12px; margin-top: 30px; }
.st-storage code, .st-banner code, .st-slug { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--muted); padding: 1px 5px; border-radius: 4px; }

/* fields */
.st-field { display: block; font-size: 13px; color: var(--muted-foreground); }
.st-field > span:first-child { display: block; font-weight: 500; margin-bottom: 4px; }
.st-ctl { position: relative; display: block; }
.st-in { width: 100%; height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); color: var(--foreground); font: inherit; font-size: 14px; box-shadow: var(--shadow-sm); }
textarea.st-in { height: auto; min-height: 58px; padding-top: 7px; padding-bottom: 7px; resize: vertical; line-height: 1.4; }
.st-in:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.is-changed > .st-in, .st-field.is-changed .st-in { border-color: #f59e0b; background: #fffbeb; }
.st-reset { position: absolute; top: 6px; right: 6px; display: none; width: 24px; height: 24px; padding: 0; border: 1px solid var(--input); border-radius: 50%; background: var(--background); color: #b45309; font: inherit; font-size: 14px; line-height: 22px; text-align: center; cursor: pointer; }
.is-changed > .st-reset, .st-field.is-changed .st-reset { display: block; }
.st-reset:hover { background: #fef3c7; }

/* switch (shadcn "switch") */
.st-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--foreground); user-select: none; }
.st-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; transition: background .15s; flex: 0 0 auto; }
.sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.st-switch input:checked + .sw-track { background: var(--primary); }
.st-switch input:checked + .sw-track::after { transform: translateX(16px); }
.st-switch input:focus-visible + .sw-track { outline: 2px solid var(--ring); outline-offset: 2px; }

/* documents: cards two to a row once the window is wide enough for two of 680 px, else one under the other */
.st-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 680px), 1fr)); gap: 14px; }
.st-none { margin: 14px 0; color: var(--muted-foreground); font-size: 14px; text-align: center; }
.st-more { display: flex; justify-content: center; }
.st-more .tb-btn { margin-top: 14px; }
.st-doc { display: grid; grid-template-columns: 150px 1fr; gap: 18px; background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); }
.st-doc.is-hidden { opacity: .72; background: var(--muted); }
.st-doc-preview { display: flex; align-items: flex-start; justify-content: center; }
.st-doc-preview img, .st-doc-preview .doc-card-paper { width: 100%; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(15, 23, 42, .12); background: #fff; }
.st-doc.page-A5 .st-doc-preview img, .st-doc.page-A5 .st-doc-preview .doc-card-paper { width: 86%; }
.st-doc-preview .doc-card-paper { aspect-ratio: 210 / 297; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); font-weight: 700; }
.st-doc.page-A5 .st-doc-preview .doc-card-paper { aspect-ratio: 148 / 210; }
.st-doc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted-foreground); }
.st-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--muted); color: var(--foreground); font-size: 12px; font-weight: 500; white-space: nowrap; }
.st-pill-plato { background: #dcfce7; color: #166534; }
.st-pill-left { background: #fef3c7; color: #92400e; }
.st-link { margin-left: auto; color: var(--brand); font-size: 13px; text-decoration: none; }
.st-link:hover { text-decoration: underline; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.st-doc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.st-hint { font-size: 12px; color: var(--muted-foreground); }

/* the search + filter + count bar above each section's rows */
.st-tools { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.st-tools .picker-search { flex: 1 1 auto; max-width: 420px; }
.st-select { height: 36px; padding: 0 8px; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); font: inherit; font-size: 14px; color: var(--foreground); } /* only visible if combo.js did not run */
.st-tools .combo-btn { min-width: 160px; }
.st-tools .combo-pop { width: max-content; min-width: 100%; }
.st-table-wrap { background: var(--background); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-foreground); padding: 10px 8px; border-bottom: 1px solid var(--border); background: var(--background); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.st-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table .st-in { height: 32px; }
.st-code { font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: var(--foreground); white-space: nowrap; }
.st-lic { max-width: 120px; }
.st-src { white-space: nowrap; }
.st-sw { white-space: nowrap; }
.st-row.is-hidden td { background: var(--muted); }
.st-row.is-hidden .st-code { color: var(--muted-foreground); }
.st-row[hidden] { display: none; }
.st-muted { color: var(--muted-foreground); }

@media (max-width: 900px) {
  .st-head-sub, .st-head-btn span { display: none; }
  .st-head-btn { width: 36px; padding: 0; justify-content: center; }
}
@media (max-width: 760px) {
  .st-doc { grid-template-columns: 1fr; }
  .st-doc-preview img, .st-doc-preview .doc-card-paper, .st-doc.page-A5 .st-doc-preview img { width: 50%; }
  .st-grid2 { grid-template-columns: 1fr; }
  .st-tabs { display: none; }
}
