:root {
  --navy: #0a1423;
  --navy-2: #162944;
  --blue: #5b9cff;
  --blue-dark: #8ab7ff;
  --blue-soft: #152f52;
  --teal: #55c7c2;
  --violet: #7256c6;
  --amber: #f2b85b;
  --red: #ef6d65;
  --red-soft: #3a1d22;
  --green: #58c99c;
  --green-soft: #15352d;
  --ink: #e8edf5;
  --muted: #9aa9bc;
  --muted-2: #718197;
  --line: #26364a;
  --line-strong: #374960;
  --surface: #111b2a;
  --surface-2: #172437;
  --canvas: #0b1220;
  --topbar: rgba(12, 22, 35, .94);
  --input: #0d1827;
  --subtle: #182638;
  --hover: #1a2a3e;
  --field-ink: #c8d3e1;
  --table-head: #142235;
  --row-line: #213148;
  --auth-panel: #0b1523;
  --shadow: 0 8px 24px rgba(0, 0, 0, .14);
  --shadow-strong: 0 16px 42px rgba(0, 0, 0, .28);
  --radius: 12px;
  --radius-sm: 10px;
  --sidebar: 272px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --navy: #17243a;
  --navy-2: #21324e;
  --blue: #2268d8;
  --blue-dark: #1751ad;
  --blue-soft: #eaf2ff;
  --teal: #0c8585;
  --amber: #b7700c;
  --red: #b42318;
  --red-soft: #fef0ef;
  --green: #087a55;
  --green-soft: #e7f7f0;
  --ink: #172033;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #dde3ec;
  --line-strong: #cbd3df;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --canvas: #eef2f7;
  --topbar: rgba(255,255,255,.94);
  --input: #ffffff;
  --subtle: #f4f6f8;
  --hover: #fbfcfe;
  --field-ink: #344054;
  --table-head: #f7f9fc;
  --row-line: #e9edf3;
  --auth-panel: #f7f9fc;
  --shadow: 0 10px 32px rgba(23, 36, 58, .07);
  --shadow-strong: 0 18px 55px rgba(23, 36, 58, .13);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(34,104,216,.24); outline-offset: 2px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 11px 15px; color: white; background: #145fc5; border-radius: 8px; font-weight: 800; text-decoration: none; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--navy); color: #dfe7f3;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand strong { display: block; color: inherit; font-size: 20px; line-height: 1.05; letter-spacing: -.3px; }
.brand small { display: block; margin-top: 4px; color: inherit; opacity: .66; font-size: 11px; letter-spacing: .02em; }
.sidebar > .brand { min-height: 84px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 42px;
  border-radius: 13px; color: white; font-size: 20px; font-weight: 800;
  background: linear-gradient(145deg, #3d8cff, #1b60d2); box-shadow: 0 8px 22px rgba(13,80,188,.35);
}
.side-nav { flex: 1; overflow-y: auto; padding: 18px 14px; }
.sidebar-primary-action { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 9px; margin: 16px 14px 0; padding: 11px 14px; color: white; background: #276fd1; border: 1px solid #4f8edf; border-radius: 10px; font-weight: 800; text-decoration: none; }
.sidebar-primary-action:hover { background: #337bdc; }
.nav-label { margin: 14px 10px 7px; color: #8290a8; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; margin: 3px 0; padding: 9px 12px;
  color: #cdd7e7; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 620;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { color: white; background: rgba(57,139,255,.17); border-color: rgba(93,160,255,.22); }
.nav-link.active::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; background: #69a4ff; border-radius: 4px; }
.nav-icon { width: 27px; height: 24px; display: grid; place-items: center; color: #9fb1ca; background: rgba(255,255,255,.055); border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 850; letter-spacing: .02em; }
.sidebar-foot { padding: 16px 18px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.user-summary, .person-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-summary { margin-bottom: 12px; }
.user-summary > span:last-child, .person-cell > span:last-child { min-width: 0; }
.user-summary strong, .person-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-summary small, .person-cell small { display: block; color: #8fa0ba; font-size: 12px; }
.person-cell small { color: var(--muted); }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: #dbe8fb; color: var(--blue-dark); font-weight: 800; }
.avatar.large { width: 48px; height: 48px; flex-basis: 48px; font-size: 18px; }
.quiet-link { display: block; width: 100%; padding: 7px 2px; color: #9eacc2; text-decoration: none; font-size: 13px; text-align: left; }
.quiet-link:hover { color: white; }
.button-link { border: 0; background: transparent; cursor: pointer; }
.sidebar-account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sidebar-account-actions .quiet-link { min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 8px; color: #c4d0e0; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; text-align: center; }
.sidebar-account-actions form { margin: 0; }

.app-main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 20px;
  padding: 0 clamp(20px, 3vw, 42px); background: var(--topbar); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-search { flex: 1; max-width: 760px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface-2); border: 1px solid transparent; border-radius: 11px; }
.top-search:focus-within { background: var(--surface); border-color: #6f9bdc; box-shadow: 0 0 0 3px rgba(34,104,216,.1); }
.top-search input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.role-badge, .status, .action-chip, .step-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 27px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap;
}
.role-admin { color: #6941c6; background: #f0eaff; }
.role-subadmin { color: #075985; background: #e0f2fe; }
.role-user { color: #146a50; background: #e4f5ef; }
.content { width: 100%; max-width: 1580px; margin: 0 auto; padding: 34px clamp(20px, 3vw, 44px) 70px; }

.page-heading { margin-bottom: 24px; }
.page-heading.split, .card-head.split, .study-hero, .heading-actions, .row-actions, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-heading h1 { margin: 4px 0 5px; color: var(--ink); font-size: clamp(28px, 3vw, 38px); line-height: 1.16; letter-spacing: -.8px; }
.page-heading p, .card-head p { margin: 0; color: var(--muted); }
.page-heading p { max-width: 850px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow.light { color: #8fbbff; }
.heading-actions { justify-content: flex-end; flex-wrap: wrap; }

.button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 750; line-height: 1.15;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: white; box-shadow: 0 7px 17px rgba(34,104,216,.17); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.button.secondary:hover, .button.ghost:hover { border-color: #aab5c5; background: var(--surface-2); }
.button.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.button.light { color: var(--blue-dark); background: var(--surface); }
.button.danger { background: var(--red); color: white; }
.button.small { min-height: 40px; padding: 7px 11px; border-radius: 8px; font-size: 13px; }
.button.wide { width: 100%; min-height: 48px; }
.danger-text { color: var(--red) !important; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .anchor-section + .anchor-section { margin-top: 22px; }
.card-head { padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.2px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { min-height: 132px; display: flex; align-items: center; gap: 17px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.metric-card small, .mini-metric small { display: block; color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; margin: 2px 0 0; font-size: 27px; line-height: 1.2; }
.metric-card div > span { color: var(--muted-2); font-size: 12px; }
.metric-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; font-weight: 800; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.teal { color: var(--teal); background: #e1f5f4; }
.metric-icon.violet { color: var(--violet); background: #f0ebff; }
.metric-icon.amber { color: var(--amber); background: #fff3d8; }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.compact-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin: 18px 0 22px; }
.mini-metric { padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.mini-metric strong { display: block; margin-top: 4px; color: var(--ink); font-size: 23px; }

.table-card { overflow: hidden; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; background: var(--table-head); color: var(--field-ink); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
.align-right { text-align: right; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.code-label { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.2px; }
.row-muted { opacity: .58; background: var(--surface-2); }
.muted { color: var(--muted); font-size: 13px; }
.table-search { min-width: 250px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--input); }
.table-search input { min-width: 0; width: 100%; height: 38px; border: 0; outline: 0; background: transparent; }

.status { color: #475467; background: #eef1f5; }
.status::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.status-recruiting, .status.success { color: #087a55; background: #e6f7ef; }
.status-active_closed_to_recruitment { color: #175cd3; background: #eaf2ff; }
.status-planned { color: #6941c6; background: #f0ebff; }
.status-suspended { color: #b54708; background: #fff2dd; }
.status-closed, .status.danger { color: #b42318; background: #fdeceb; }
.status.neutral { color: #475467; background: #eef1f5; }
.status.demo, .demo-chip { color: #725200; background: #fff0b8; }
.demo-chip { display: inline-flex; margin-left: 7px; padding: 3px 6px; border-radius: 999px; font-family: Inter, system-ui, sans-serif; font-size: 9px; font-weight: 900; letter-spacing: .05em; vertical-align: middle; }
.action-chip { color: #175cd3; background: #edf4ff; text-transform: capitalize; }

.empty-state { min-height: 280px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 30px; text-align: center; }
.empty-state.compact { min-height: 190px; }
.empty-state > span { color: #8ba7cf; font-size: 38px; }
.empty-state h3 { margin: 0; font-size: 19px; }
.empty-state p { max-width: 520px; margin: 0 0 8px; color: var(--muted); }
.empty-state div { display: flex; gap: 9px; }
.empty-inline { padding: 25px; color: var(--muted); text-align: center; }

.info-banner, .warning-banner {
  display: flex; align-items: center; gap: 13px; margin-bottom: 20px; padding: 14px 18px; border: 1px solid #bcd3f4; border-radius: 12px; background: #edf5ff; color: #24466f;
}
.info-banner strong, .warning-banner strong { white-space: nowrap; }
.warning-banner { border-color: #f2cf84; background: #fff8e7; color: #744d0a; }
.demo-data-banner { justify-content: space-between; }
.demo-data-banner > div { display: flex; align-items: center; gap: 12px; }

.activity-list { padding: 7px 24px 16px; }
.activity-item { display: grid; grid-template-columns: 13px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf0f4; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #b9d0f4; }
.activity-item strong { display: block; }
.activity-item p { margin: 1px 0 0; color: var(--muted); font-size: 13px; text-transform: capitalize; }
.activity-item time { color: var(--muted); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--field-ink); font-weight: 700; }
.field > span:first-child { font-size: 13px; }
.field b { color: var(--red); }
.field input, .field select, .field textarea, .search-hero input, .top-search input, .inline-form select, .confirm-import input {
  width: 100%; min-height: 48px; padding: 10px 12px; color: var(--ink); background: var(--input); border: 1px solid var(--line-strong); border-radius: 9px; outline: none; font-weight: 500;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-hero input:focus { border-color: #78a5e9; box-shadow: 0 0 0 3px rgba(34,104,216,.10); }
.field small { color: var(--muted); font-size: 12px; font-weight: 500; }
.field.readonly output { min-height: 44px; display: flex; align-items: center; padding: 9px 11px; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-radius: 9px; font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; }
.field.inline > span { white-space: nowrap; }
.field-button { align-self: end; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 68px; }
.password-wrap button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 5px 7px; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }
.form-card { overflow: hidden; }
.form-section { padding: 25px 27px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.section-title { display: flex; gap: 13px; margin-bottom: 20px; }
.section-title > span { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 850; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title p, .section-help { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; gap: 17px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: 1.2fr 1fr 1.45fr auto; align-items: end; }
.span-3 { grid-column: span 3; }
.form-actions { position: sticky; bottom: 0; z-index: 6; justify-content: space-between; padding: 18px 27px; background: var(--topbar); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.form-actions > div { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.save-guidance { color: var(--muted); font-size: 13px; }
.compact-form { margin-bottom: 22px; }
.compact-form form { padding: 20px 24px 24px; }
.narrow-page { max-width: 930px; margin: 0 auto; }
.stack-form { display: grid; gap: 16px; }
.strength-label[data-strength="weak"] { color: var(--red); }
.strength-label[data-strength="medium"] { color: var(--amber); }
.strength-label[data-strength="strong"] { color: var(--green); }
.legacy-note { margin: 0 27px 24px; padding: 13px 15px; border: 1px solid #eed49f; border-radius: 10px; background: #fff9eb; }
.legacy-note span { display: block; color: var(--muted); font-size: 12px; }

.search-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 13px; margin-bottom: 22px; padding: 22px; }
.search-hero label { display: flex; flex-direction: column; gap: 6px; color: var(--field-ink); font-weight: 700; }

.study-hero { margin-bottom: 17px; }
.study-identity { min-width: 0; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--blue); }
.study-title-row { display: flex; align-items: center; gap: 15px; }
.protocol-avatar { width: 62px; height: 62px; flex: 0 0 62px; display: grid; place-items: center; border-radius: 17px; color: white; background: linear-gradient(145deg, var(--navy-2), var(--blue)); font-size: 19px; font-weight: 850; box-shadow: 0 11px 25px rgba(29,74,139,.18); }
.study-title-row h1 { margin: 3px 0 0; font-size: 32px; line-height: 1.05; letter-spacing: -.6px; }
.study-title-row p { max-width: 790px; margin: 5px 0 0; color: var(--muted); }
.title-meta { display: flex; gap: 7px; }
.section-nav { position: sticky; top: 84px; z-index: 10; display: flex; align-items: center; gap: 5px; margin-bottom: 17px; padding: 7px; background: var(--topbar); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 18px rgba(23,36,58,.05); overflow-x: auto; }
.section-nav a { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 750; white-space: nowrap; }
.section-nav a:hover { color: var(--blue); background: var(--blue-soft); }
.section-nav span { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--muted); background: var(--subtle); font-size: 11px; }
.anchor-section { scroll-margin-top: 145px; overflow: hidden; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 26px; padding: 23px 25px; }
.detail-group h3 { margin: 0 0 12px; color: var(--blue-dark); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.detail-group dl { margin: 0; }
.detail-group dl > div { display: grid; grid-template-columns: minmax(105px,.7fr) minmax(0,1.3fr); gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--row-line); }
.detail-group dt { color: var(--muted); font-size: 13px; }
.detail-group dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.note-panel { margin: 0 25px 24px; padding: 16px 18px; background: var(--surface-2); border-left: 3px solid var(--blue); border-radius: 9px; }
.note-panel p { margin: 3px 0 0; color: var(--muted); white-space: pre-wrap; }
.document-upload { display: grid; grid-template-columns: 230px minmax(260px,1fr) auto; align-items: end; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.file-drop { min-height: 65px; display: flex; align-items: center; padding: 9px 13px; border: 1px dashed #758aa5; border-radius: 10px; background: var(--input); cursor: pointer; }
.file-drop:hover { border-color: var(--blue); background: var(--blue-soft); }
.file-drop input { width: 1px; height: 1px; position: absolute; opacity: 0; }
.file-drop span { display: block; }
.file-drop strong, .file-drop small { display: block; }
.file-drop strong { color: var(--blue); }
.file-drop small { color: var(--muted); }
.document-list { padding: 4px 24px 16px; }
.document-item { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid var(--row-line); }
.document-item:last-child { border: 0; }
.document-item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.document-item small { color: var(--muted-2); font-family: ui-monospace, monospace; }
.doc-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-size: 10px; font-weight: 850; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 20px 23px; border: 1px solid #f1aaa6; border-radius: var(--radius); background: #fff7f6; }
.danger-zone h2 { margin: 0; color: var(--red); font-size: 18px; }
.danger-zone p { margin: 2px 0 0; color: #8b423d; }

.admin-section { margin: 28px 0; }
.admin-section-heading { margin-bottom: 14px; }
.admin-section-heading h2 { margin: 3px 0 2px; font-size: 23px; }
.admin-section-heading p { margin: 0; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.admin-grid-secondary { grid-template-columns: repeat(2, minmax(0,1fr)); }
.admin-tile { min-height: 170px; display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: start; gap: 15px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.admin-tile:hover { transform: translateY(-2px); border-color: #a8c4ef; box-shadow: var(--shadow-strong); }
.admin-tile > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 900; }
.admin-tile h2, .admin-tile h3 { margin: 0 0 5px; font-size: 18px; }
.admin-tile p { margin: 0; color: var(--muted); font-size: 13px; }
.admin-tile em { display: inline-block; margin-top: 15px; color: var(--blue-dark); font-size: 13px; font-style: normal; font-weight: 800; }
.primary-admin-tile { border-color: rgba(91,156,255,.62); box-shadow: inset 0 3px 0 var(--blue), var(--shadow); }
.branding-settings { margin-bottom: 22px; overflow: hidden; }
.branding-form { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(300px,1.3fr) auto; align-items: end; gap: 16px; padding: 22px 24px 25px; }
.brand-preview { min-width: 170px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--ink); }
.brand-preview i { width: 36px; height: 36px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #3d8cff, #1b60d2); border-radius: 11px; font-style: normal; font-weight: 850; }
.brand-preview strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; padding: 20px 22px; }
.system-summary > div { display: flex; align-items: center; gap: 10px; }
.system-summary strong { display: block; }
.system-summary p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.health-dot { width: 12px; height: 12px; border-radius: 50%; }
.health-dot.ok { background: #12a775; box-shadow: 0 0 0 5px #e4f7f0; }
.health-dot.bad { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }

.one-time-secret { margin-bottom: 22px; padding: 20px 22px; color: white; background: linear-gradient(125deg, #0c7156, #0d8d70); border-radius: 15px; box-shadow: 0 13px 35px rgba(8,122,85,.2); }
.one-time-secret > div:first-child { display: flex; gap: 12px; align-items: center; }
.one-time-secret h2 { margin: 0; font-size: 18px; }
.one-time-secret p { margin: 3px 0 0; color: #d8fff0; }
.secret-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #0c7156; background: white; font-weight: 850; }
.secret-value { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.secret-value code { min-height: 48px; display: flex; align-items: center; flex: 1; padding: 9px 14px; border-radius: 9px; background: rgba(0,0,0,.2); color: white; font-size: 19px; letter-spacing: .05em; overflow-x: auto; }
.inline-form select { min-width: 145px; }
.row-actions { justify-content: flex-start; }
.row-actions.end { justify-content: flex-end; }

.assignment-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 18px; align-items: start; }
.assignment-users { position: sticky; top: 90px; padding: 22px; }
.assignment-users h2 { margin: 0 0 18px; font-size: 18px; }
.selected-person { display: flex; align-items: center; gap: 12px; margin: 20px 0; padding: 15px; background: var(--blue-soft); border-radius: 12px; }
.selected-person p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.role-explanation { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.role-explanation p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.assignment-studies { overflow: hidden; }
.assignment-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.check-label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 700; }
.check-label input { width: 18px; height: 18px; accent-color: var(--blue); }
.assignment-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 17px 20px 92px; }
.assignment-card { position: relative; min-height: 86px; display: grid; grid-template-columns: 26px minmax(0,1fr); align-items: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.assignment-card:hover { border-color: #6f94ca; background: var(--hover); }
.assignment-card input { position: absolute; opacity: 0; }
.custom-check { width: 23px; height: 23px; display: grid; place-items: center; border: 2px solid #aeb8c6; border-radius: 6px; color: transparent; }
.assignment-card input:checked + .custom-check { color: white; background: var(--blue); border-color: var(--blue); }
.assignment-card:has(input:checked) { border-color: #5f8ed4; background: var(--blue-soft); box-shadow: inset 0 0 0 1px #4875b6; }
.assignment-card strong, .assignment-card small, .assignment-card em { display: block; }
.assignment-card small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-card em { margin-top: 6px; color: var(--blue-dark); font-size: 11px; font-style: normal; font-weight: 750; }
.sticky-actions { position: absolute; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; background: var(--topbar); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.assignment-studies { position: relative; }

.restore-note { display: flex; align-items: flex-start; gap: 15px; margin-top: 22px; padding: 20px 22px; }
.restore-note > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #7a4a00; background: #fff0ca; font-weight: 850; }
.restore-note h2 { margin: 0; font-size: 17px; }
.restore-note p { margin: 3px 0 0; color: var(--muted); }

.migration-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.migration-steps li { display: flex; gap: 10px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.migration-steps li > span { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 850; }
.migration-steps strong { display: block; font-size: 13px; }
.migration-steps p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.migration-upload { display: grid; grid-template-columns: minmax(0,1fr) minmax(390px,.8fr); align-items: center; gap: 28px; margin-bottom: 18px; padding: 24px; }
.migration-upload > div { display: flex; align-items: center; gap: 17px; }
.migration-upload h2 { margin: 0; font-size: 19px; }
.migration-upload p { margin: 4px 0 0; color: var(--muted); }
.migration-upload form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.upload-illustration { width: 62px; height: 62px; flex: 0 0 62px; display: grid; place-items: center; border-radius: 17px; color: var(--blue); background: var(--blue-soft); font-size: 30px; }
.file-drop.large { min-height: 74px; }
.migration-runs { padding: 16px 20px 20px; }
.migration-run { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.migration-run:last-child { margin-bottom: 0; }
.run-head { display: flex; justify-content: space-between; gap: 20px; }
.run-head h3 { margin: 6px 0 0; }
.run-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.confirm-import { display: flex; align-items: end; gap: 9px; }
.count-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-top: 16px; }
.count-strip > div { padding: 11px; text-align: center; background: var(--surface-2); border-radius: 9px; }
.count-strip small, .count-strip strong { display: block; }
.count-strip small { color: var(--muted); }
.count-strip strong { font-size: 19px; }
.migration-run details { margin-top: 13px; }
.migration-run summary, .change-detail summary { color: var(--blue); cursor: pointer; font-weight: 750; }
.report-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.report-grid > div { min-width: 0; padding: 9px; background: var(--surface-2); border-radius: 8px; }
.report-grid span, .report-grid strong { display: block; overflow-wrap: anywhere; }
.report-grid span { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.report-grid strong { margin-top: 2px; font-size: 12px; }

.filter-bar { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: end; gap: 12px; margin-bottom: 20px; padding: 18px; }
.change-detail code { display: block; max-width: 400px; max-height: 140px; margin-top: 7px; padding: 8px; overflow: auto; background: var(--subtle); border-radius: 7px; color: var(--field-ink); font-size: 11px; white-space: pre-wrap; }

.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-history-button { flex: 0 0 auto; padding: 3px 7px; color: var(--blue-dark); background: var(--blue-soft); border: 1px solid #c5d8f5; border-radius: 6px; font-size: 11px; font-weight: 800; cursor: pointer; }
.field-history-button:hover { background: #dceaff; border-color: #8eb1e6; }
.change-reason-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 20px; padding: 22px 27px; background: var(--blue-soft); border-top: 1px solid var(--line); }
.change-reason-panel .text-link { padding-bottom: 10px; white-space: nowrap; }
.change-reason-fields { display: grid; grid-template-columns: minmax(210px,.8fr) minmax(250px,1.2fr); align-items: end; gap: 10px; }
.change-reason-fields:has(> :only-child) { grid-template-columns: minmax(210px,1fr); }
.change-reason-fields .field > span small { color: var(--muted); font-weight: 600; }
.archive-reason-form { min-width: min(100%, 520px); display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 10px; }
.archive-inline { display: flex; align-items: center; gap: 7px; }
.archive-inline input { width: 185px; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; }

.integrity-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 17px 20px; color: #075e44; background: var(--green-soft); border: 1px solid #9bd6c1; border-radius: 13px; }
.integrity-banner > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-weight: 900; }
.integrity-banner p { margin: 2px 0 0; color: #326f5d; font-size: 13px; }
.history-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.history-field-card { overflow: hidden; }
.history-field-card.empty-history { box-shadow: none; background: var(--surface-2); }
.history-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.history-field-head small { color: var(--muted-2); font-family: ui-monospace, monospace; }
.history-field-head h2 { margin: 1px 0 0; font-size: 17px; }
.history-count { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 8px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 999px; font-weight: 850; }
.history-timeline { padding: 7px 20px 17px; }
.history-entry { position: relative; margin-left: 7px; padding: 15px 0 15px 22px; border-left: 2px solid #d6e3f6; }
.history-entry:last-child { padding-bottom: 4px; }
.timeline-dot { position: absolute; top: 21px; left: -6px; width: 10px; height: 10px; background: var(--blue); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 2px #aac5ed; }
.history-values { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 9px; }
.history-values > div { min-width: 0; padding: 9px 10px; background: var(--subtle); border-radius: 8px; }
.history-values small, .history-values strong { display: block; overflow-wrap: anywhere; }
.history-values small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.history-values strong { margin-top: 2px; font-size: 13px; white-space: pre-wrap; }
.history-values > span { color: var(--blue); font-weight: 900; }
.history-reason { margin: 9px 0 6px; color: var(--field-ink); font-size: 13px; }
.history-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 11px; }
.history-meta span { padding-right: 9px; border-right: 1px solid var(--line); }
.history-meta span:last-child { border-right: 0; }
.no-history { margin: 0; padding: 22px 20px; color: var(--muted); text-align: center; }

.modal-open { overflow: hidden; }
.history-modal[hidden] { display: none; }
.history-modal { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 1fr minmax(420px,610px); }
.history-modal-backdrop { grid-column: 1 / -1; grid-row: 1; border: 0; background: rgba(13,24,41,.58); backdrop-filter: blur(2px); cursor: default; }
.history-modal-panel { grid-column: 2; grid-row: 1; z-index: 1; height: 100vh; overflow-y: auto; background: var(--surface); box-shadow: -18px 0 50px rgba(0,0,0,.35); }
.history-modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 24px; background: var(--topbar); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.history-modal-head h2 { margin: 2px 0 0; font-size: 22px; }
.history-modal-content { padding: 22px 24px 36px; }
.history-loading, .history-error { padding: 28px; color: var(--muted); background: var(--surface-2); border-radius: 10px; text-align: center; }
.history-error { color: var(--red); background: var(--red-soft); }
.history-current { margin-bottom: 16px; padding: 14px 16px; background: var(--blue-soft); border: 1px solid #c4d8f5; border-radius: 10px; }
.history-current small, .history-current strong { display: block; }
.history-current small { color: var(--blue-dark); font-weight: 750; }
.history-current strong { margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.modal-history-list { display: grid; gap: 12px; }
.modal-history-entry { padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.history-hash { display: block; margin-top: 10px; color: var(--muted-2); font-size: 9px; overflow-wrap: anywhere; }
.audit-review-form { min-width: 260px; display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.audit-review-form textarea { grid-column: 1 / -1; width: 100%; min-height: 54px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 7px; resize: vertical; }
.audit-review-form select { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 7px; }
.chain-ok, .chain-bad { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-weight: 750; }
.chain-ok { color: var(--green); background: var(--green-soft); }
.chain-bad { color: var(--red); background: var(--red-soft); }
.snapshot-hash { padding: 7px 10px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 8px; font-size: 12px; }
.access-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 7px; color: #344054; background: #eef2f7; border-radius: 6px; font-size: 11px; font-weight: 700; }
.access-attestation { margin-top: 22px; }
.access-attestation form { padding: 22px 24px 0; }
.span-2 { grid-column: span 2; }
.review-list { padding: 8px 22px 20px; }
.review-record { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,.35fr); gap: 22px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.review-record:last-child { border-bottom: 0; }
.review-record h3 { margin: 8px 0 2px; }
.review-record p { margin: 0; color: var(--muted); }
.review-meta { display: grid; align-content: start; gap: 3px; color: var(--muted); font-size: 12px; }
.review-meta code { margin: 4px 0; color: var(--blue-dark); }

.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-weight: 650; box-shadow: var(--shadow); transition: opacity .22s ease, transform .22s ease; }
.flash.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); }
.flash button { border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.flash-success { color: #086447; border-color: #9ed7c3; background: #eaf8f2; }
.flash-error { color: #8f241d; border-color: #f0b0ac; background: #fff0ef; }
.flash-warning { color: #78500d; border-color: #eccd88; background: #fff8e7; }
.flash-info { color: #244e86; border-color: #b5cef2; background: #eef5ff; }

.auth-body { min-height: 100vh; background: var(--auth-panel); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px,1.08fr) minmax(420px,.92fr); }
.auth-brand-panel { position: relative; overflow: hidden; color: white; background: radial-gradient(circle at 72% 16%, rgba(51,130,237,.24), transparent 35%), radial-gradient(circle at 17% 78%, rgba(17,94,151,.22), transparent 38%), linear-gradient(145deg, #111d30, #192e4c 64%, #143f68); }
.auth-brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .42; background-image: linear-gradient(115deg, transparent 0 47%, rgba(153,197,239,.055) 48% 49%, transparent 50% 100%), linear-gradient(25deg, transparent 0 47%, rgba(153,197,239,.04) 48% 49%, transparent 50% 100%), radial-gradient(rgba(208,228,250,.34) .7px, transparent .8px); background-size: 84px 84px, 112px 112px, 25px 25px; mask-image: linear-gradient(135deg, transparent 0%, black 27%, black 82%, transparent 100%); }
.auth-brand-panel::after { content: ""; position: absolute; right: -18%; bottom: -29%; width: 70%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 78px rgba(255,255,255,.018), 0 0 0 156px rgba(255,255,255,.012); }
.oncology-field { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.auth-system-identity { position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; justify-items: center; transform: translate(-50%,-50%); pointer-events: none; }
.auth-system-identity strong { max-width: min(72vw,680px); color: rgba(245,249,255,.92); font-size: clamp(44px,6.2vw,84px); line-height: .95; letter-spacing: -.055em; text-align: center; text-shadow: 0 16px 45px rgba(5,17,34,.35); }
.auth-form-panel, .auth-center-panel { display: grid; place-items: center; padding: 34px; background: var(--auth-panel); }
.auth-center-panel { grid-column: 1 / -1; min-height: 100vh; background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--blue) 13%, transparent), transparent 35%), var(--auth-panel); }
.auth-card { position: relative; width: min(100%, 460px); padding: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-strong); }
.auth-card.compact { width: min(100%, 500px); }
.auth-logo { color: var(--ink); }
.auth-heading { margin: 32px 0 24px; }
.auth-heading h2 { margin: 0 0 5px; font-size: 28px; letter-spacing: -.6px; }
.auth-heading p { margin: 0; color: var(--muted); }
.question-callout { margin-top: 13px !important; padding: 14px; color: var(--ink) !important; background: var(--blue-soft); border-radius: 10px; font-weight: 750; }
.text-link { color: var(--blue); font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.centered { display: block; margin-top: 17px; text-align: center; }
.security-note { margin: 22px 0 0; padding-top: 17px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; text-align: center; }
.step-pill { color: var(--blue); background: var(--blue-soft); }
.auth-card-tools { display: flex; justify-content: flex-end; margin: -17px -17px 18px 0; }
.theme-toggle { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 760; transition: color .15s ease, border-color .15s ease, transform .15s ease; }
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
.theme-toggle-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--blue-dark); font-size: 16px; }
.theme-toggle.compact { flex: 0 0 auto; }
.auth-flashes { position: fixed; top: 22px; right: clamp(34px,5.5vw,105px); left: auto; z-index: 50; width: min(calc(46vw - 68px),460px); transform: none; }
.auth-flashes .flash { min-height: 58px; padding: 14px 16px; background-clip: padding-box; backdrop-filter: blur(12px); animation: auth-flash-in .28s ease both; }
.auth-flashes .flash::before { content: "!"; width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 900; opacity: .8; }
.auth-flashes .flash-success::before { content: "✓"; }
.auth-flashes .flash-info::before { content: "i"; }
.auth-flashes .flash > span { flex: 1; }
@keyframes auth-flash-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

.error-page { min-height: 65vh; display: grid; place-items: center; align-content: center; text-align: center; }
.error-page > span { color: #c9d8ee; font-size: 92px; font-weight: 900; line-height: 1; }
.error-page h1 { margin: 3px 0; }
.error-page p { max-width: 520px; margin: 0 0 18px; color: var(--muted); }
.mobile-only { display: none; }
.icon-button { width: 42px; height: 42px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }

/* Sade operasyon görünümü */
.compact-heading { margin-bottom: 20px; }
.section-kicker { display: block; margin-bottom: 2px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.task-launcher { display: grid; grid-template-columns: minmax(190px,.32fr) minmax(0,1fr); gap: 18px; margin-bottom: 18px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.task-launcher-head h2 { margin: 3px 0 0; font-size: 21px; }
.task-launcher-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.task-action { min-height: 78px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.task-action > span { width: 31px; height: 31px; display: grid; place-items: center; color: var(--blue-dark); background: var(--blue-soft); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 900; }
.task-action strong, .task-action small { display: block; }
.task-action small { margin-top: 2px; color: var(--muted); }
.task-action b { color: var(--blue); font-size: 18px; }
.task-action.primary-task { border-color: rgba(91,156,255,.55); box-shadow: inset 3px 0 0 var(--blue); }
.process-guide { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0 0 18px; padding: 0; list-style: none; }
.process-guide li { min-height: 78px; display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.process-guide li > span { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; color: white; background: #276fd1; border-radius: 50%; font-weight: 850; }
.process-guide strong, .process-guide small { display: block; }
.process-guide small { margin-top: 2px; color: var(--muted); }
.summary-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.summary-strip > div { display: flex; align-items: baseline; justify-content: center; gap: 9px; padding: 14px 18px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip small { color: var(--muted); font-weight: 700; }
.summary-strip strong { color: var(--ink); font-size: 24px; }
.study-list-card { overflow: hidden; }
.study-list { display: grid; }
.study-row { min-height: 92px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 22px; padding: 16px 20px; border-bottom: 1px solid var(--row-line); }
.study-row:last-child { border-bottom: 0; }
.study-row:hover { background: var(--hover); }
.study-row-main { min-width: 0; display: grid; grid-template-columns: minmax(105px,.22fr) minmax(210px,1fr) auto; align-items: center; gap: 16px; text-decoration: none; }
.study-code { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 17px; font-weight: 850; }
.study-name { min-width: 0; }
.study-name strong, .study-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-name small { margin-top: 3px; color: var(--muted); }
.study-row-counts { display: flex; gap: 4px; }
.study-row-counts span { min-width: 66px; padding: 7px 9px; text-align: center; background: var(--surface-2); border-radius: 9px; }
.study-row-counts b, .study-row-counts small { display: block; }
.study-row-counts b { color: var(--ink); font-size: 18px; }
.study-row-counts small { color: var(--muted); font-size: 10px; }
.simple-study-hero { align-items: end; }
.simple-study-hero h1 { margin: 8px 0 2px; font-size: clamp(32px,4vw,46px); letter-spacing: -.8px; }
.simple-study-hero .title-meta { margin-top: 3px; }
.study-stats-bar { display: grid; grid-template-columns: repeat(8,minmax(92px,1fr)); gap: 1px; margin: 0 0 18px; overflow-x: auto; background: var(--line); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.study-stats-bar > div { min-width: 92px; padding: 13px 12px; background: var(--surface); text-align: center; }
.study-stats-bar small, .study-stats-bar strong { display: block; }
.study-stats-bar small { color: var(--muted); font-size: 11px; font-weight: 750; }
.study-stats-bar strong { margin-top: 2px; color: var(--ink); font-size: 23px; }
.study-core-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: 18px; margin-bottom: 18px; }
.study-summary-card, .study-team-card { overflow: hidden; }
.plain-detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; padding: 8px 22px 18px; }
.plain-detail-list > div { padding: 12px 4px; border-bottom: 1px solid var(--row-line); }
.plain-detail-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.plain-detail-list dt, .plain-detail-list dd { margin: 0; }
.plain-detail-list dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.plain-detail-list dd { margin-top: 2px; color: var(--ink); font-weight: 700; }
.team-lines { display: grid; padding: 8px 22px 13px; }
.team-lines > div { padding: 10px 0; border-bottom: 1px solid var(--row-line); }
.team-lines small, .team-lines strong { display: block; }
.team-lines small { color: var(--muted); }
.assigned-people { padding: 4px 22px 22px; }
.assigned-people h3, .current-study-list h3 { margin: 8px 0 10px; color: var(--field-ink); font-size: 13px; }
.person-chip { display: inline-flex; align-items: center; gap: 7px; margin: 3px 4px 3px 0; padding: 6px 9px; color: var(--field-ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.person-chip small { color: var(--muted); }
.patient-section, .document-section { margin-bottom: 18px; overflow: hidden; }
.patient-scroll-hint { display: flex; align-items: center; gap: 8px; padding: 10px 18px; color: var(--field-ink); background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.patient-scroll-hint > span { display: grid; place-items: center; width: 27px; height: 27px; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 18px; }
.patient-scroll-hint small { color: var(--muted); }
.patient-table-scroll { max-width: 100%; overflow: auto; scrollbar-color: var(--line-strong) var(--surface-2); scrollbar-width: thin; }
.patient-table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.patient-all-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; color: var(--field-ink); font-size: 12px; }
.patient-all-table th, .patient-all-table td { min-width: 132px; max-width: 230px; padding: 12px 13px; text-align: left; vertical-align: top; border-right: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line); white-space: nowrap; }
.patient-all-table th { position: sticky; top: 0; z-index: 3; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.patient-all-table tbody tr:hover td { background: var(--hover); }
.patient-all-table tbody tr:last-child td { border-bottom: 0; }
.patient-all-table .sticky-patient { position: sticky; left: 0; z-index: 2; min-width: 185px; max-width: 210px; background: var(--surface); box-shadow: 8px 0 13px -13px var(--ink); }
.patient-all-table th.sticky-patient { z-index: 5; background: var(--surface-2); }
.patient-all-table .sticky-patient strong, .patient-all-table .sticky-patient small { display: block; }
.patient-all-table .sticky-patient strong { color: var(--ink); font-size: 14px; }
.patient-all-table .sticky-patient small { margin-top: 4px; color: var(--muted); white-space: normal; }
.patient-all-table .sticky-actions { position: sticky; right: 0; z-index: 2; min-width: 235px; background: var(--surface); box-shadow: -8px 0 13px -13px var(--ink); }
.patient-all-table th.sticky-actions { z-index: 5; background: var(--surface-2); }
.patient-all-table tbody tr:hover .sticky-patient, .patient-all-table tbody tr:hover .sticky-actions { background: var(--hover); }
.patient-all-table .wide-cell { min-width: 220px; max-width: 310px; }
.patient-all-table .preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.patient-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.remove-menu { position: relative; }
.remove-menu > summary { min-height: 40px; display: inline-flex; align-items: center; padding: 7px 10px; color: var(--red); border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
.remove-menu > summary::-webkit-details-marker { display: none; }
.remove-menu[open] > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 12; width: 250px; display: grid; gap: 9px; padding: 13px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; box-shadow: var(--shadow-strong); }
.patient-all-table .remove-menu[open] > form { position: static; margin-top: 7px; }
.document-slot-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 18px; }
.document-slot { min-width: 0; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.document-slot-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.document-slot-head h3 { margin: 0; font-size: 16px; }
.document-slot-head small { color: var(--muted); }
.slot-files { display: grid; margin-bottom: 11px; }
.slot-file { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--row-line); }
.slot-file strong, .slot-file small { display: block; overflow-wrap: anywhere; }
.slot-file small { color: var(--muted); font-size: 11px; }
.slot-upload { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--row-line); }
.slot-upload .file-drop { min-height: 54px; }
.disclosure-card { margin-top: 18px; overflow: hidden; }
.disclosure-card > summary { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; cursor: pointer; list-style: none; }
.disclosure-card > summary::-webkit-details-marker { display: none; }
.disclosure-card > summary strong, .disclosure-card > summary small { display: block; }
.disclosure-card > summary small { margin-top: 2px; color: var(--muted); }
.disclosure-card > summary b { color: var(--blue); font-size: 13px; }
.disclosure-card[open] > summary { border-bottom: 1px solid var(--line); }
.quiet-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 18px 22px; color: var(--field-ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quiet-danger-zone h2 { margin: 0; font-size: 17px; }
.quiet-danger-zone p { margin: 2px 0 0; color: var(--muted); }

/* Basitleştirilmiş erişim matrisi */
.simple-assignments { grid-template-columns: 310px minmax(0,1fr); }
.current-study-list { margin: 18px 0; }
.current-study-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; color: var(--ink); border-top: 1px solid var(--row-line); text-decoration: none; }
.current-study-list a small { color: var(--muted); }
.current-study-list p { color: var(--muted); }
.assignment-list { display: grid; padding-bottom: 84px; }
.assignment-line.assignment-card { min-height: 102px; display: grid; grid-template-columns: minmax(250px,.72fr) 150px minmax(260px,1fr); align-items: center; gap: 18px; padding: 16px 20px; border: 0; border-bottom: 1px solid var(--row-line); border-radius: 0; cursor: default; }
.assignment-line.assignment-card:hover { background: var(--hover); }
.assignment-check { position: relative; display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 11px; align-items: center; cursor: pointer; }
.assignment-check input { position: absolute; opacity: 0; }
.assignment-check strong, .assignment-check small { display: block; }
.assignment-check small { margin-top: 2px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-check input:checked + .custom-check { color: white; background: var(--blue); border-color: var(--blue); }
.assignment-level { margin: 0; }
.assignment-people > small { display: block; margin-bottom: 5px; color: var(--muted); font-weight: 750; }
.assignment-save { position: absolute; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; background: var(--topbar); border-top: 1px solid var(--line); backdrop-filter: blur(9px); }

:root[data-theme="dark"] .role-admin { color: #cbb7ff; background: #2d2347; }
:root[data-theme="dark"] .role-subadmin { color: #8ad8ff; background: #15344a; }
:root[data-theme="dark"] .role-user { color: #91dfc0; background: #17372f; }
:root[data-theme="dark"] .status, :root[data-theme="dark"] .status.neutral { color: #bdc9d8; background: #253246; }
:root[data-theme="dark"] .status-recruiting, :root[data-theme="dark"] .status.success { color: #79ddb7; background: #17372f; }
:root[data-theme="dark"] .status-active_closed_to_recruitment, :root[data-theme="dark"] .action-chip { color: #9dc3ff; background: #173154; }
:root[data-theme="dark"] .status-planned { color: #c7b6ff; background: #30254d; }
:root[data-theme="dark"] .status-suspended { color: #f2c171; background: #43311b; }
:root[data-theme="dark"] .status-closed, :root[data-theme="dark"] .status.danger { color: #ffaaa4; background: #452226; }
:root[data-theme="dark"] .status.demo, :root[data-theme="dark"] .demo-chip { color: #f5d47d; background: #463719; }
:root[data-theme="dark"] .flash-success { color: #91dfc0; border-color: #2b6c58; background: #15352d; }
:root[data-theme="dark"] .flash-error { color: #ffaaa4; border-color: #773b40; background: #3a1d22; }
:root[data-theme="dark"] .flash-warning { color: #f2c171; border-color: #72562a; background: #392d1b; }
:root[data-theme="dark"] .flash-info { color: #a8caff; border-color: #335c91; background: #172d4a; }
:root[data-theme="dark"] .metric-icon.teal { background: #153a3a; }
:root[data-theme="dark"] .metric-icon.violet { color: #bfa9ff; background: #30274a; }
:root[data-theme="dark"] .metric-icon.amber { background: #40301a; }
:root[data-theme="dark"] .info-banner { color: #b7d2f8; border-color: #31577f; background: #162c47; }
:root[data-theme="dark"] .warning-banner, :root[data-theme="dark"] .legacy-note { color: #efca83; border-color: #6d542a; background: #372b1a; }
:root[data-theme="dark"] .danger-zone { border-color: #6e373c; background: #321b20; }
:root[data-theme="dark"] .danger-zone p { color: #d99a96; }
:root[data-theme="dark"] .access-chip { color: #c8d3e1; background: #253246; }

@media (max-width: 1250px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .migration-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .migration-upload { grid-template-columns: 1fr; }
  .study-row { grid-template-columns: minmax(0,1fr) auto; }
  .study-row-counts { grid-column: 1; }
  .assignment-line.assignment-card { grid-template-columns: minmax(230px,1fr) 150px; }
  .assignment-people { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); transform: translateX(-104%); box-shadow: 18px 0 45px rgba(10,23,43,.24); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; place-items: center; }
  .topbar { height: 66px; padding: 0 18px; }
  .role-badge { display: none; }
  .content { padding: 25px 18px 55px; }
  .detail-grid { grid-template-columns: 1fr; }
  .assignment-layout { grid-template-columns: 1fr; }
  .assignment-users { position: static; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; }
  .form-grid.three, .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .span-3 { grid-column: span 2; }
  .field-button { align-self: stretch; }
  .system-summary { grid-template-columns: 1fr; }
  .document-upload { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .history-field-grid { grid-template-columns: 1fr; }
  .review-record { grid-template-columns: 1fr; }
  .auth-flashes { top: 14px; right: auto; left: 50%; width: min(92%,540px); transform: translateX(-50%); }
  .branding-form { grid-template-columns: 1fr; }
  .change-reason-fields { grid-template-columns: 1fr; }
  .study-core-grid, .simple-assignments { grid-template-columns: 1fr; }
  .study-row-main { grid-template-columns: minmax(100px,.24fr) minmax(0,1fr); }
  .study-row-main .status { grid-column: 2; justify-self: start; }
  .document-slot-grid { grid-template-columns: 1fr; }
  .task-launcher { grid-template-columns: 1fr; }
}

@media (max-width: 690px) {
  body { font-size: 14px; }
  .page-heading.split, .study-hero, .card-head.split, .danger-zone, .run-head { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .metric-grid, .compact-grid, .admin-grid, .migration-steps, .assignment-card-grid, .count-strip, .report-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 110px; }
  .compact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .span-3 { grid-column: auto; }
  .form-section { padding: 21px 18px; }
  .form-actions { padding: 17px 18px; }
  .top-search { padding-left: 10px; }
  .top-search input::placeholder { color: transparent; }
  .study-title-row { align-items: flex-start; }
  .protocol-avatar { width: 50px; height: 50px; flex-basis: 50px; }
  .study-title-row h1 { font-size: 26px; }
  .section-nav { top: 76px; }
  .detail-grid { padding: 19px; }
  .document-item { grid-template-columns: 42px minmax(0,1fr); }
  .document-item .row-actions { grid-column: 2; }
  .assignment-toolbar, .sticky-actions, .migration-upload form, .confirm-import, .filter-bar { align-items: stretch; flex-direction: column; display: flex; }
  .sticky-actions { position: static; }
  .assignment-card-grid { padding-bottom: 18px; }
  .auth-form-panel, .auth-center-panel { padding: 18px; }
  .auth-card { padding: 27px 22px; }
  .auth-card-tools { margin: -9px -9px 15px 0; }
  .theme-toggle.compact [data-theme-label] { display: none; }
  .secret-value { align-items: stretch; flex-direction: column; }
  .search-hero { grid-template-columns: 1fr; }
  .activity-item { grid-template-columns: 13px minmax(0,1fr); }
  .activity-item time { grid-column: 2; }
  .info-banner, .warning-banner, .demo-data-banner > div { align-items: flex-start; flex-direction: column; }
  .change-reason-panel, .archive-reason-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .change-reason-panel .text-link { white-space: normal; }
  .history-modal { grid-template-columns: 1fr; }
  .history-modal-panel { grid-column: 1; }
  .archive-inline { align-items: stretch; flex-direction: column; }
  .archive-inline input { width: 100%; }
  .summary-strip > div { align-items: center; flex-direction: column; gap: 0; padding: 12px 8px; }
  .study-row { grid-template-columns: 1fr; gap: 12px; }
  .study-row-main { grid-template-columns: 1fr; gap: 6px; }
  .study-row-main .status { grid-column: 1; }
  .study-row-counts { grid-column: 1; width: 100%; }
  .study-row-counts span { flex: 1; }
  .study-stats-bar { grid-template-columns: repeat(4,minmax(92px,1fr)); }
  .plain-detail-list { grid-template-columns: 1fr; }
  .plain-detail-list > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--row-line); }
  .plain-detail-list > div:last-child { border-bottom: 0; }
  .patient-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .patient-actions { flex-wrap: wrap; }
  .remove-menu[open] > form { position: fixed; right: 16px; left: 16px; top: auto; bottom: 16px; width: auto; }
  .slot-upload, .slot-file { grid-template-columns: 1fr; }
  .quiet-danger-zone { align-items: flex-start; flex-direction: column; }
  .assignment-line.assignment-card { grid-template-columns: 1fr; }
  .assignment-people { grid-column: 1; }
  .assignment-save { position: static; align-items: stretch; flex-direction: column; }
  .assignment-list { padding-bottom: 0; }
  .task-launcher-actions, .process-guide { grid-template-columns: 1fr; }
  .task-launcher { padding: 16px; }
  .form-actions { position: static; align-items: stretch; flex-direction: column; }
  .form-actions > div { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .admin-grid-secondary { grid-template-columns: 1fr; }
}

@media (hover: hover) {
  .task-action:hover { border-color: #6f94ca; background: var(--hover); }
}

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

@media print {
  .sidebar, .topbar, .heading-actions, .section-nav, .flash-stack, .document-upload, .slot-upload, .remove-menu, .quiet-danger-zone, .danger-zone, .button { display: none !important; }
  body, .app-main, .content { background: white !important; }
  .content { max-width: none; padding: 0; }
  .card, .metric-card, .mini-metric { break-inside: avoid; box-shadow: none; }
  .responsive-table { overflow: visible; }
  .anchor-section { page-break-before: auto; }
}

/* 2.7 — Kurumsal üst navigasyon ve operasyon görünümü */
:root {
  --canvas: #0d1117;
  --surface: #141a22;
  --surface-2: #19212b;
  --input: #10161d;
  --line: #29323d;
  --line-strong: #3a4654;
  --ink: #edf1f5;
  --muted: #9ca8b5;
  --muted-2: #728091;
  --blue: #4f8fdc;
  --blue-dark: #79a9e3;
  --blue-soft: #172a40;
  --hover: #19232e;
  --topbar: rgba(13,17,23,.96);
  --shadow: none;
  --shadow-strong: 0 18px 42px rgba(0,0,0,.32);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: #79a9e3;
}
.filter-feedback-bar { display:flex; align-items:center; justify-content:space-between; padding:8px 18px; border-bottom:1px solid var(--line); color:var(--muted); font-size:13px; }
.header-inner { flex-wrap:wrap; }
.header-brand { max-width:240px; overflow-wrap:anywhere; }
.header-nav-link, .row-open-link, .header-export { min-height:44px; }
.row-open-link { display:flex; align-items:center; justify-content:flex-end; }
.study-row > .status { white-space:normal; text-align:left; justify-content:flex-start; }
.patient-all-table { font-size:14px; }
.patient-all-table th { font-size:12px; }
:root[data-theme="light"] {
  --canvas: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --input: #ffffff;
  --line: #d9dee5;
  --line-strong: #b9c2ce;
  --ink: #18202a;
  --muted: #606c7a;
  --muted-2: #8792a0;
  --blue: #245f9f;
  --blue-dark: #184c84;
  --blue-soft: #edf4fb;
  --hover: #f5f8fb;
  --topbar: rgba(255,255,255,.96);
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.app-shell { min-height: 100vh; display: block; }
.app-main { min-width: 0; }
.app-header { position: sticky; top: 0; z-index: 40; color: var(--ink); background: var(--topbar); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { width: 100%; max-width: 1580px; min-height: 68px; display: flex; align-items: center; gap: 28px; margin: 0 auto; padding: 0 clamp(20px,3vw,44px); }
.header-brand { min-width: 158px; display: flex; flex-direction: column; justify-content: center; color: var(--ink); text-decoration: none; }
.header-brand strong { font-size: 19px; line-height: 1.1; letter-spacing: -.3px; }
.header-brand span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.header-navigation { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.primary-navigation, .header-tools { display: flex; align-items: center; gap: 4px; }
.header-nav-link { min-height: 68px; display: inline-flex; align-items: center; padding: 0 14px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; text-decoration: none; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
.header-nav-link::-webkit-details-marker, .account-menu summary::-webkit-details-marker { display: none; }
.header-nav-link:hover { color: var(--ink); }
.header-nav-link.active { color: var(--ink); border-bottom-color: var(--blue); }
.header-menu, .account-menu { position: relative; }
.header-menu-panel, .account-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-strong); }
.header-menu-panel a, .account-menu-panel a, .account-menu-panel button { width: 100%; min-height: 40px; display: flex; align-items: center; padding: 8px 11px; color: var(--ink); background: transparent; border: 0; border-radius: 5px; text-align: left; text-decoration: none; font-size: 13px; cursor: pointer; }
.header-menu-panel a:hover, .account-menu-panel a:hover, .account-menu-panel button:hover { background: var(--hover); }
.account-menu-panel form { margin: 0; }
.header-tools { justify-content: flex-end; gap: 8px; }
.header-search { height: 38px; display: flex; align-items: center; overflow: hidden; background: var(--input); border: 1px solid var(--line); border-radius: 6px; }
.header-search:focus-within { border-color: var(--blue); }
.header-search input { width: clamp(150px,16vw,245px); height: 36px; padding: 0 10px; color: var(--ink); background: transparent; border: 0; outline: 0; }
.header-search button { height: 28px; margin-right: 4px; padding: 0 9px; color: var(--muted); background: var(--surface-2); border: 0; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 700; }
.header-export { min-height: 38px; display: inline-flex; align-items: center; padding: 0 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 700; }
.app-header .theme-toggle { width: 38px; height: 38px; min-height: 38px; padding: 0; justify-content: center; border-radius: 6px; }
.account-menu summary { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 3px 7px; border-radius: 6px; cursor: pointer; list-style: none; }
.account-menu summary:hover { background: var(--hover); }
.account-menu summary > span:last-child { max-width: 130px; }
.account-menu summary strong, .account-menu summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu summary strong { font-size: 12px; }
.account-menu summary small { color: var(--muted); font-size: 10px; }
.account-menu .avatar { width: 31px; height: 31px; flex-basis: 31px; color: #dbe9f8; background: #274b70; border-radius: 6px; font-size: 12px; }
.content { max-width: 1580px; padding-top: 38px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin: 0 0 5px; font-size: clamp(27px,3vw,34px); font-weight: 720; letter-spacing: -.65px; }
.page-heading p { font-size: 14px; }
.eyebrow, .section-kicker { color: var(--muted); letter-spacing: .075em; }
.card, .metric-card, .mini-metric, .summary-strip, .study-stats-bar { border-radius: 8px; box-shadow: none; }
.button { min-height: 42px; border-radius: 6px; font-size: 13px; }
.button.primary { background: #356fae; box-shadow: none; }
.button.primary:hover { background: #427fbe; }
.button.secondary { background: var(--surface); }
.status { border-radius: 4px; }

.dashboard-heading { align-items: flex-end; }
.overview-bar { display: flex; align-items: stretch; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.overview-bar > div { min-width: 170px; display: flex; align-items: baseline; gap: 9px; padding: 17px 22px; border-right: 1px solid var(--line); }
.overview-bar > div:last-child { border-right: 0; }
.overview-bar strong { font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-bar span { color: var(--muted); font-size: 12px; }
.study-workspace { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.study-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.study-toolbar h2 { display: inline; margin: 0; font-size: 17px; }
.study-toolbar > div:first-child > span { margin-left: 9px; color: var(--muted); font-size: 12px; }
.study-filters { display: flex; align-items: center; gap: 8px; }
.study-filters .table-search { width: min(36vw,360px); min-width: 220px; background: var(--input); border-radius: 6px; }
.study-filters select { min-height: 40px; padding: 7px 30px 7px 10px; color: var(--ink); background: var(--input); border: 1px solid var(--line-strong); border-radius: 6px; }
.study-list-head, .study-row { display: grid; grid-template-columns: minmax(320px,1fr) 175px 82px 100px 82px 50px; align-items: center; gap: 12px; }
.study-list-head { min-height: 38px; padding: 0 18px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.study-row { min-height: 92px; padding: 13px 18px; border-bottom: 1px solid var(--row-line); }
.study-row:last-child { border-bottom: 0; }
.study-row:hover { background: var(--hover); }
.study-identity-cell { min-width: 0; display: block; text-decoration: none; }
.study-identity-cell > strong, .study-identity-cell > span, .study-identity-cell > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-identity-cell > strong { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.study-identity-cell > span { margin-top: 3px; color: var(--ink); font-size: 14px; font-weight: 680; }
.study-identity-cell > small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.study-number { color: var(--ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-open-link { color: var(--blue-dark); font-size: 13px; font-weight: 750; text-align: right; text-decoration: none; }
.disclosure-card { box-shadow: none; }
.section-nav { top: 80px; justify-content: flex-start; gap: 0; padding: 0 12px; border-radius: 8px; box-shadow: none; }
.section-nav a { min-height: 47px; padding: 0 15px; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; }
.section-nav a:hover { color: var(--ink); background: transparent; border-bottom-color: var(--line-strong); }
.section-title > span { color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 5px; }
.admin-overview-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.admin-overview-bar > div { min-height: 90px; display: flex; flex-direction: column; justify-content: center; padding: 16px 20px; border-right: 1px solid var(--line); }
.admin-overview-bar > div:last-child { border-right: 0; }
.admin-overview-bar span, .admin-overview-bar small { color: var(--muted); font-size: 11px; }
.admin-overview-bar strong { margin-top: 2px; font-size: 23px; font-variant-numeric: tabular-nums; }
.admin-overview-bar small { margin-top: 2px; }
.health-text.ok { color: var(--green); font-size: 16px; }
.health-text.bad { color: var(--red); font-size: 16px; }
.admin-section { margin: 0 0 26px; }
.admin-section-heading { margin-bottom: 9px; }
.admin-section-heading h2 { margin: 0; font-size: 16px; }
.admin-action-list { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.admin-action-list > a { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.admin-action-list > a:last-child { border-bottom: 0; }
.admin-action-list > a:hover { background: var(--hover); }
.admin-action-list strong, .admin-action-list span { display: block; }
.admin-action-list strong { font-size: 14px; }
.admin-action-list span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.admin-action-list b { min-width: 56px; color: var(--blue-dark); font-size: 12px; text-align: right; }
.branding-settings { box-shadow: none; }
.brand-preview i { display: none; }

@media (max-width: 1180px) {
  .header-inner { gap: 14px; }
  .header-brand { min-width: 125px; }
  .header-brand span { display: none; }
  .header-nav-link { padding: 0 9px; }
  .account-menu summary > span:last-child { display: none; }
  .study-list-head, .study-row { grid-template-columns: minmax(280px,1fr) 150px 64px 82px 70px 42px; }
}
@media (max-width: 980px) {
  .app-header { position: sticky; }
  .header-inner { min-height: 62px; justify-content: space-between; }
  .header-brand { min-width: 0; }
  .header-navigation { position: absolute; top: 100%; left: 0; right: 0; display: none; align-items: stretch; padding: 12px 18px 18px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-strong); }
  .header-navigation.open { display: block; }
  .primary-navigation { align-items: stretch; flex-direction: column; }
  .header-nav-link { min-height: 45px; width: 100%; padding: 0 10px; border-bottom: 0; border-left: 2px solid transparent; }
  .header-nav-link.active { border-left-color: var(--blue); border-bottom-color: transparent; background: var(--hover); }
  .header-menu-panel { position: static; margin: 0 0 8px 10px; box-shadow: none; }
  .header-tools { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
  .header-search { flex: 1; }
  .header-search input { width: 100%; }
  .account-menu-panel { right: 0; }
  .content { padding-top: 26px; }
  .study-list-head { display: none; }
  .study-row { grid-template-columns: minmax(0,1fr) auto; gap: 9px 14px; }
  .study-identity-cell { grid-column: 1; }
  .study-row > .status { grid-column: 2; grid-row: 1; }
  .study-number { display: flex; align-items: baseline; gap: 5px; color: var(--ink); font-size: 14px; }
  .study-number::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 650; }
  .row-open-link { grid-column: 2; }
  .admin-overview-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-overview-bar > div:nth-child(2) { border-right: 0; }
  .admin-overview-bar > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 690px) {
  body { font-size: 14px; }
  .header-inner { padding: 0 14px; }
  .header-tools { flex-wrap: wrap; }
  .header-search { flex-basis: 100%; order: -1; }
  .dashboard-heading { align-items: stretch; }
  .dashboard-heading .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .overview-bar { display: grid; grid-template-columns: repeat(3,1fr); }
  .overview-bar > div { min-width: 0; align-items: flex-start; flex-direction: column; gap: 4px; padding: 13px 10px; }
  .overview-bar strong { font-size: 21px; }
  .study-toolbar { align-items: stretch; flex-direction: column; }
  .study-filters { align-items: stretch; flex-direction: column; }
  .study-filters .table-search { width: 100%; min-width: 0; }
  .study-row { padding: 14px; }
  .study-row > .status { align-self: start; }
  .section-nav { top: 72px; }
}

@media print {
  .app-header { display: none !important; }
}
