:root {
  color-scheme: light;
  --ink: #182119;
  --muted: #6b746d;
  --cream: #f4f1e9;
  --paper: #fffefa;
  --forest: #183d32;
  --forest-deep: #0f2d25;
  --sage: #92aa8d;
  --line: #d8ddd7;
  --danger: #a64138;
}

* { box-sizing: border-box; }

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

button, input { font: inherit; }

.login-page { display: grid; place-items: center; padding: 32px; }

.login-shell {
  width: min(1080px, 100%);
  min-height: 660px;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(21, 45, 36, 0.14);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 58px;
  color: #f9f7ef;
  background:
    radial-gradient(circle at 15% 15%, rgba(151, 183, 151, 0.24), transparent 32%),
    radial-gradient(circle at 85% 80%, rgba(88, 135, 110, 0.22), transparent 28%),
    linear-gradient(145deg, var(--forest), var(--forest-deep));
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  right: -170px;
  bottom: 45px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 25px;
}

.eyebrow {
  margin: 0 0 20px;
  color: #b8cbb8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand-panel h1 {
  max-width: 410px;
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(40px, 4vw, 58px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.brand-copy { margin: 24px 0 0; color: #b9c6bd; font-size: 15px; }
.security-note { margin: 0; color: #b9c6bd; font-size: 12px; }
.security-note span { margin-right: 8px; color: #7fb48f; font-size: 9px; }

.form-panel { display: grid; place-items: center; padding: 64px; }
.form-wrap { width: min(380px, 100%); }
.mobile-brand { display: none; }

.form-wrap h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.form-intro { margin: 12px 0 38px; color: var(--muted); font-size: 14px; }
label { display: block; margin: 0 0 9px; font-size: 13px; font-weight: 650; }

input[type="text"], input[type="password"] {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

input:focus { border-color: #527d68; box-shadow: 0 0 0 4px rgba(82, 125, 104, 0.11); }
input::placeholder { color: #a5aba6; }
.password-label { margin-top: 22px; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  color: #527d68;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  height: 54px;
  margin-top: 30px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--forest);
  font-weight: 650;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.primary-button:hover { background: #235443; transform: translateY(-1px); }
.primary-button span { margin-left: 8px; }
.form-footnote { margin: 24px 0 0; color: #949b95; text-align: center; font-size: 12px; }

.alert { margin: -18px 0 22px; padding: 12px 14px; border-radius: 9px; font-size: 13px; }
.alert.error { color: var(--danger); background: #faece9; }
.alert.info { color: #35604c; background: #e9f2eb; }

.dashboard-page { background: #f4f3ed; }
.admin-sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: 112px; display: flex; flex-direction: column; align-items: center; padding: 20px 12px; color: white; background: var(--forest-deep); }
.sidebar-brand { display: grid; place-items: center; width: 44px; height: 44px; color: white; text-decoration: none; }
.sidebar-brand span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; font-family: Georgia, serif; font-size: 22px; }
.admin-sidebar nav { width: 100%; margin-top: 54px; }
.sidebar-action { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 14px 8px; border-radius: 12px; color: #b9c9c0; text-align: center; text-decoration: none; font-size: 12px; transition: color .2s, background .2s; }
.sidebar-action:hover, .sidebar-action.active { color: white; background: rgba(255,255,255,.1); }
.edit-icon { font-size: 23px; line-height: 1; }
.admin-content { min-height: 100vh; margin-left: 112px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 5vw, 72px); border-bottom: 1px solid #dcdfd9; background: var(--paper); }
.topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: Georgia, serif; font-size: 20px; }
.topbar-brand span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: white; background: var(--forest); }
.logout-button { padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; cursor: pointer; }
.dashboard-layout { width: min(1100px, calc(100% - 48px)); margin: 10vh auto; }
.dashboard-layout.editing { width: min(1280px, calc(100% - 48px)); display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 520px); gap: 54px; align-items: start; margin-top: 6vh; }
.dashboard-main { min-width: 0; }
.eyebrow.dark { color: #66806e; }
.dashboard-main h1 { margin: 0 0 12px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 7vw, 70px); font-weight: 400; }
.dashboard-main > p:not(.eyebrow) { color: var(--muted); }
.status-card { width: min(420px, 100%); display: flex; align-items: center; gap: 14px; margin-top: 48px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #4c9a69; box-shadow: 0 0 0 5px #e1f0e5; }
.status-card strong, .status-card small { display: block; }
.status-card small { margin-top: 5px; color: var(--muted); }
.dashboard-alert { width: min(420px, 100%); margin: 0 0 28px; }
.alert.success { color: #35604c; background: #e4f0e7; }
.editor-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 20px 55px rgba(20,45,36,.11); }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 26px 28px 20px; border-bottom: 1px solid #e6e8e3; }
.editor-heading p { margin: 0 0 5px; color: #66806e; font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.editor-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 500; }
.editor-heading a { color: #7f8881; text-decoration: none; font-size: 28px; line-height: 1; }
.editor-panel form { max-height: calc(100vh - 220px); overflow-y: auto; padding: 24px 28px 28px; }
.editor-panel label { margin-top: 17px; }
.editor-panel label:first-of-type { margin-top: 0; }
.editor-panel input, .editor-panel textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: white; }
.editor-panel input { height: 45px; }
.editor-panel textarea { min-height: 76px; resize: vertical; }
.editor-panel input:focus, .editor-panel textarea:focus { border-color: #527d68; box-shadow: 0 0 0 4px rgba(82,125,104,.11); }
.editor-actions { position: sticky; bottom: -28px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 26px -28px -28px; padding: 18px 28px; border-top: 1px solid #e6e8e3; background: var(--paper); }
.editor-actions a { padding: 10px 16px; color: var(--muted); text-decoration: none; }
.editor-actions button { padding: 11px 19px; border: 0; border-radius: 9px; color: white; background: var(--forest); font-weight: 650; cursor: pointer; }
#auto-logout-form { display: none; }

@media (max-width: 760px) {
  .login-page { display: block; padding: 0; background: var(--paper); }
  .login-shell { min-height: 100vh; display: block; border-radius: 0; box-shadow: none; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 42px 24px; }
  .form-wrap { width: min(390px, 100%); }
  .mobile-brand { display: inline-grid; place-items: center; width: 52px; height: 52px; margin: 0 0 54px; border-radius: 14px; color: white; background: var(--forest); font-family: Georgia, serif; font-size: 0; }
  .mobile-brand::first-letter { font-size: 24px; }
  .form-wrap h2 { font-size: 36px; }
  .admin-sidebar { inset: auto 0 0; width: 100%; height: 68px; flex-direction: row; justify-content: space-between; padding: 8px 18px; }
  .sidebar-brand { width: 42px; }
  .admin-sidebar nav { width: auto; margin: 0; }
  .sidebar-action { flex-direction: row; gap: 7px; padding: 10px 13px; }
  .edit-icon { font-size: 19px; }
  .admin-content { margin-left: 0; padding-bottom: 68px; }
  .topbar { padding: 0 18px; }
  .topbar-brand span { display: none; }
  .dashboard-layout, .dashboard-layout.editing { width: calc(100% - 36px); display: block; margin: 7vh auto; }
  .dashboard-layout.editing .dashboard-main { display: none; }
  .editor-panel form { max-height: none; }
  .editor-actions { bottom: -28px; }
}

/* Student management workspace */
.dashboard-page { background: #f3f2ed; }
.dashboard-page .admin-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 220px; display: flex; flex-direction: column; align-items: stretch; padding: 26px 18px; color: #fff; background: var(--forest-deep); }
.dashboard-page .sidebar-brand { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; padding: 0 9px; color: #fff; text-decoration: none; }
.dashboard-page .sidebar-brand span { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; font-family: Georgia, serif; font-size: 22px; }
.dashboard-page .sidebar-brand strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.dashboard-page .admin-sidebar nav { display: flex; flex-direction: column; gap: 5px; width: 100%; margin-top: 54px; }
.dashboard-page .sidebar-action { display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 10px; color: #b9c9c0; text-align: left; text-decoration: none; font-size: 13px; transition: color .2s, background .2s; }
.dashboard-page .sidebar-action > span:first-child { width: 22px; color: #8eb09f; text-align: center; font-size: 19px; line-height: 1; }
.dashboard-page .sidebar-action:hover, .dashboard-page .sidebar-action.active { color: #fff; background: rgba(255,255,255,.1); }
.dashboard-page .sidebar-action.active > span:first-child { color: #fff; }
.dashboard-page .admin-content { min-height: 100vh; margin-left: 220px; padding-bottom: 50px; }
.dashboard-page .topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(28px, 4vw, 60px); border-bottom: 1px solid #dcdfd9; background: var(--paper); }
.topbar-kicker { margin: 0 0 3px; color: #708077; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.dashboard-page .topbar > div > strong { font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.signed-user { color: var(--muted); font-size: 13px; }
.dashboard-page .logout-button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; cursor: pointer; }
.page-main { width: min(1460px, calc(100% - 64px)); margin: 0 auto; padding-top: 44px; }
.admin-alert { margin: 0 0 24px; }
.alert.success { color: #35604c; background: #e4f0e7; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.page-heading.compact { align-items: flex-start; }
.page-heading .eyebrow { margin-bottom: 11px; }
.page-heading h1, .record-hero h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(36px, 4vw, 54px); font-weight: 400; letter-spacing: -.03em; }
.page-heading p:not(.eyebrow), .record-hero p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); }
.primary-link { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; padding: 0 17px; border-radius: 9px; color: #fff; background: var(--forest); text-decoration: none; font-size: 13px; font-weight: 650; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.secondary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); text-decoration: none; font-size: 13px; font-weight: 650; }
.edit-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 11px; border: 1px solid #b9c8bf; border-radius: 7px; color: #315c47; background: #f7faf7; text-decoration: none; font-size: 12px; font-weight: 650; white-space: nowrap; }
.edit-link.strong { min-height: 36px; border-color: var(--forest); color: #fff; background: var(--forest); }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; }
.stat-box { min-height: 146px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.stat-box span, .stat-box small { display: block; color: var(--muted); }
.stat-box span { font-size: 13px; }
.stat-box strong { display: block; margin: 14px 0 8px; font-family: Georgia, serif; font-size: 38px; font-weight: 400; }
.stat-box small { font-size: 11px; }
.stat-box.accent { color: #fff; border-color: var(--forest); background: var(--forest); }
.stat-box.accent span, .stat-box.accent small { color: #c3d3c9; }
.workflow-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.workflow-strip a { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; color: var(--ink); text-decoration: none; }
.workflow-strip a + a { border-left: 1px solid var(--line); }
.workflow-strip span { color: var(--muted); font-size: 13px; }
.workflow-strip strong { font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.data-section { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 24px; border-bottom: 1px solid #e4e6e1; }
.section-heading p { margin: 0 0 5px; color: #66806e; font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 23px; font-weight: 500; }
.section-heading > a { color: #426a57; text-decoration: none; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; color: #778078; background: #f5f5f1; text-align: left; font-size: 11px; font-weight: 650; white-space: nowrap; }
td { padding: 16px; border-top: 1px solid #e9eae6; vertical-align: middle; font-size: 13px; }
td small { display: block; max-width: 240px; margin-top: 5px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.student-link { color: var(--ink); font-weight: 650; text-decoration: none; }
.student-link:hover { color: #35604c; text-decoration: underline; }
.status-pill { display: inline-block; max-width: 190px; padding: 5px 8px; overflow: hidden; border-radius: 999px; color: #4d5b53; background: #eceeea; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.status-pill.good { color: #25613f; background: #def0e4; }
.status-pill.danger { color: #93433b; background: #f7e5e2; }
.empty-state { padding: 70px 24px; text-align: center; }
.empty-state strong { font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 500; }
.empty-state p { margin: 10px 0 24px; color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(130px, 1fr)) auto auto; gap: 12px; align-items: end; margin-bottom: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.filter-bar label span, .record-form label > span, .side-panel label > span { display: block; margin-bottom: 7px; color: #465149; font-size: 11px; font-weight: 650; }
.filter-bar input, .filter-bar select, .record-form input, .record-form select, .record-form textarea, .side-panel input, .side-panel textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: #fff; }
.filter-bar input, .filter-bar select, .record-form input, .record-form select, .side-panel input { height: 43px; padding: 0 11px; }
.record-form textarea, .side-panel textarea { min-height: 86px; padding: 11px; resize: vertical; }
.filter-bar input:focus, .filter-bar select:focus, .record-form input:focus, .record-form select:focus, .record-form textarea:focus, .side-panel input:focus, .side-panel textarea:focus { border-color: #527d68; box-shadow: 0 0 0 3px rgba(82,125,104,.1); }
.filter-bar button, .side-panel button { height: 43px; padding: 0 16px; border: 0; border-radius: 8px; color: #fff; background: var(--forest); cursor: pointer; font-weight: 650; }
.filter-bar > a { height: 43px; display: grid; place-items: center; padding: 0 8px; color: var(--muted); text-decoration: none; font-size: 12px; }
.record-form { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.form-section { padding: 28px; }
.form-section + .form-section { border-top: 1px solid #e4e6e1; }
.form-section-title { display: grid; grid-template-columns: 42px 1fr; gap: 15px; margin-bottom: 24px; }
.form-section-title > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--forest); font-family: Georgia, serif; }
.form-section-title h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.form-section-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.full-field { display: block; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 20px 28px; border-top: 1px solid #e4e6e1; background: #f8f8f5; }
.form-actions a { padding: 10px 14px; color: var(--muted); text-decoration: none; }
.form-actions button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; color: #fff; background: var(--forest); cursor: pointer; font-weight: 650; }
.record-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.back-link { display: inline-block; margin-bottom: 28px; color: #496a59; text-decoration: none; font-size: 12px; }
.record-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.record-hero h1 small { display: block; margin-top: 7px; color: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 16px; font-weight: 400; letter-spacing: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .7fr); gap: 22px; align-items: start; }
.detail-form .form-section .section-heading { margin: -28px -28px 24px; }
.timestamp { color: var(--muted); font-size: 11px; }
.detail-side { display: grid; gap: 20px; }
.side-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.side-panel > p, .side-panel > form, .side-panel > .timeline, .mini-history { margin: 0; padding: 20px 22px; }
.side-panel > p { padding-bottom: 0; color: var(--muted); font-size: 12px; }
.side-panel label { display: block; margin-bottom: 15px; }
.side-panel button { width: 100%; }
.mini-history { border-top: 1px solid var(--line); }
.mini-history div + div { margin-top: 13px; }
.mini-history strong, .mini-history small { display: block; }
.mini-history small { margin-top: 4px; color: var(--muted); }
.timeline > div { position: relative; display: grid; grid-template-columns: 11px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline > div > span { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #719a82; box-shadow: 0 0 0 4px #e5eee8; }
.timeline p { margin: 0; }
.timeline strong, .timeline small, .timeline time { display: block; }
.timeline small { margin-top: 4px; color: var(--muted); }
.timeline time { margin-top: 5px; color: #919891; font-size: 10px; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.status-tabs a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); text-decoration: none; font-size: 12px; }
.status-tabs a.active { color: #fff; border-color: var(--forest); background: var(--forest); }
.result-cell { max-width: 300px; color: var(--muted); }
.conversion-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.conversion-row div { padding: 20px 22px; }
.conversion-row div + div { border-left: 1px solid var(--line); }
.conversion-row span { display: block; color: var(--muted); font-size: 12px; }
.conversion-row strong { display: block; margin-top: 8px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.report-grid .data-section { margin-top: 0; }
.distribution-list { display: grid; gap: 17px; padding: 24px; }
.distribution-list > div { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 15px; padding-bottom: 10px; }
.distribution-list i { position: absolute; inset: auto 0 0; height: 4px; overflow: hidden; border-radius: 4px; background: #e6e9e4; }
.distribution-list i::before { content: ""; display: block; width: var(--bar); height: 100%; background: #648873; }
.editor-layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(420px, 560px); gap: 42px; align-items: start; }
.editor-layout .status-card { margin-top: 32px; }
.editor-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 18px 50px rgba(20,45,36,.1); }
.editor-heading { display: flex; justify-content: space-between; padding: 24px 26px 19px; border-bottom: 1px solid var(--line); }
.editor-heading p { margin: 0 0 5px; color: #66806e; font-size: 9px; letter-spacing: .17em; }
.editor-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 500; }
.editor-heading a { color: var(--muted); text-decoration: none; font-size: 26px; }
.editor-panel form { max-height: calc(100vh - 210px); overflow-y: auto; padding: 24px 26px; }
.editor-panel label { display: block; margin: 16px 0 7px; font-size: 11px; font-weight: 650; }
.editor-panel label:first-of-type { margin-top: 0; }
.editor-panel input, .editor-panel textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.editor-panel textarea { min-height: 76px; resize: vertical; }
.editor-actions { position: sticky; bottom: -24px; display: flex; justify-content: flex-end; gap: 10px; margin: 24px -26px -24px; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--paper); }
.editor-actions a { padding: 9px 13px; color: var(--muted); text-decoration: none; }
.editor-actions button { padding: 9px 16px; border: 0; border-radius: 8px; color: #fff; background: var(--forest); cursor: pointer; }
.status-card { width: min(420px, 100%); display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #4c9a69; box-shadow: 0 0 0 5px #e1f0e5; }
.status-card strong, .status-card small { display: block; }
.status-card small { margin-top: 5px; color: var(--muted); }
#auto-logout-form { display: none; }
.upload-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.upload-copy { display: flex; align-items: center; gap: 17px; }
.upload-copy > span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: #fff; background: var(--forest); font-size: 24px; }
.upload-copy h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 23px; font-weight: 500; }
.upload-copy p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.upload-panel form { display: flex; align-items: center; gap: 10px; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker > span, .upload-panel button, .primary-action { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 650; }
.file-picker > span { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.upload-panel button, .primary-action { border: 0; color: #fff; background: var(--forest); }
.import-summary { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.import-summary > div { padding: 19px 21px; }
.import-summary > div + div { border-left: 1px solid var(--line); }
.import-summary span, .import-summary strong { display: block; }
.import-summary span { color: var(--muted); font-size: 11px; }
.import-summary strong { margin-top: 7px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.import-summary .has-error strong, .text-error { color: var(--danger); }
.import-warning { margin: 0 0 24px; }
.error-row { background: #fff7f5; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid, .editor-layout { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .dashboard-page .admin-sidebar { inset: auto 0 0; width: 100%; height: 70px; flex-direction: row; align-items: center; padding: 7px 10px; overflow-x: auto; }
  .dashboard-page .sidebar-brand { display: none; }
  .dashboard-page .admin-sidebar nav { flex-direction: row; gap: 4px; width: max-content; margin: 0; }
  .dashboard-page .sidebar-action { flex-direction: column; gap: 4px; min-width: 76px; padding: 7px 8px; text-align: center; font-size: 10px; }
  .dashboard-page .sidebar-action > span:first-child { height: 20px; font-size: 17px; }
  .dashboard-page .admin-content { margin-left: 0; padding-bottom: 90px; }
  .dashboard-page .topbar { height: 66px; padding: 0 18px; }
  .signed-user, .topbar-kicker { display: none; }
  .page-main { width: calc(100% - 32px); padding-top: 30px; }
  .page-heading, .record-hero { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .page-heading h1, .record-hero h1 { font-size: 37px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-box { min-height: 124px; padding: 18px; }
  .workflow-strip, .conversion-row { grid-template-columns: 1fr; }
  .workflow-strip a + a, .conversion-row div + div { border-top: 1px solid var(--line); border-left: 0; }
  .filter-bar, .form-grid, .report-grid { grid-template-columns: 1fr; }
  .filter-bar button { width: 100%; }
  .form-grid .wide { grid-column: auto; }
  .form-section { padding: 22px 18px; }
  .detail-form .form-section .section-heading { margin: -22px -18px 22px; }
  .record-status { justify-content: flex-start; }
  .editor-layout .page-heading { display: none; }
  .editor-panel form { max-height: none; }
  .section-heading { padding: 18px; }
  .upload-panel, .upload-panel form { align-items: stretch; flex-direction: column; }
  .file-picker > span, .upload-panel button { width: 100%; }
  .import-summary { grid-template-columns: repeat(2, 1fr); }
  .import-summary > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
