:root {
  color-scheme: light;
  --ink: #182027;
  --ink-soft: #35424b;
  --muted: #68747d;
  --line: #d9dfe3;
  --line-strong: #bdc7cd;
  --surface: #ffffff;
  --surface-soft: #f5f7f8;
  --surface-muted: #edf1f3;
  --nav: #132a3a;
  --nav-hover: #203b4d;
  --primary: #08766c;
  --primary-hover: #056158;
  --primary-soft: #e7f3f1;
  --success: #19724b;
  --success-soft: #e8f5ed;
  --warning: #8a5a08;
  --warning-soft: #fff3d7;
  --danger: #ae3028;
  --danger-soft: #fceceb;
  --info: #2b628b;
  --info-soft: #eaf2f8;
  --focus: #83c8c1;
  --shadow: 0 10px 30px rgb(18 42 58 / 9%);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--surface-soft); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.5;
}

button,
input,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

svg { display: block; }

.is-hidden { display: none !important; }
.muted-value { color: #98a2a9; }

/* Application shell */
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 64px;
  padding: 0 clamp(20px, 3.5vw, 52px);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 24px;
  background: var(--nav);
  color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}
.brand > span:last-child { display: grid; }
.brand strong { font-size: 16px; font-weight: 650; line-height: 1.3; }
.brand small { color: #aebdc7; font-size: 10px; line-height: 1.2; text-transform: none; }

.main-nav { height: 100%; display: flex; align-items: stretch; gap: 4px; }
.nav-link {
  min-width: 112px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c6d1d8;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-link svg { width: 17px; height: 17px; }
.nav-link:hover { color: #fff; background: var(--nav-hover); }
.nav-link.is-active { color: #fff; border-bottom-color: #56b8ad; background: rgb(255 255 255 / 5%); }

.account-area {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.account-copy { min-width: 0; display: grid; justify-items: end; }
.account-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-copy span { color: #aebdc7; font-size: 11px; }
.avatar,
.user-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: #397184;
  font-weight: 650;
}
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.logout-form { margin: 0; }
.mobile-nav { display: none; }

.page-shell {
  width: min(1540px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 30px clamp(18px, 3.5vw, 52px) 50px;
}

.page-heading {
  min-height: 80px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.page-heading h1 { margin: 1px 0 4px; font-size: 25px; line-height: 1.25; font-weight: 670; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); }
.breadcrumb { margin: 0; color: var(--primary); font-size: 12px; font-weight: 600; }
.environment-state,
.permission-notice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}
.environment-state { margin-bottom: 5px; font-size: 13px; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #39a86f; box-shadow: 0 0 0 3px #dff1e7; }
.permission-notice {
  width: 100%;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #c9dce9;
  background: var(--info-soft);
  color: #285874;
  border-radius: 5px;
}
.permission-notice svg { width: 17px; height: 17px; }

.section-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.section-block + .section-block { margin-top: 20px; }
.section-heading {
  min-height: 67px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 650; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

/* Form controls */
.field { min-width: 0; display: grid; gap: 7px; }
.field > span:first-child { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field em { margin-left: 4px; color: var(--muted); font-size: 11px; font-style: normal; font-weight: 400; }
.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select { cursor: pointer; }
.field input::placeholder { color: #9ba5ab; }
.field input:focus,
.field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(8 118 108 / 12%); }
.field input:disabled,
.field select:disabled { color: #7c878e; background: var(--surface-muted); cursor: not-allowed; }
.field small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

.input-with-icon,
.input-with-action { position: relative; display: block; }
.input-with-icon > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #77858d;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-with-icon > input { padding-left: 39px; }
.input-with-action > input { padding-right: 42px; }
.input-action {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 34px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #6d7981;
  cursor: pointer;
  transform: translateY(-50%);
}
.input-action:hover { color: var(--primary); }
.input-action svg { width: 17px; height: 17px; }
.plain-input-action { width: 100%; }

.button,
.icon-button,
.icon-text-button {
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.button {
  min-height: 38px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { color: var(--ink-soft); background: #fff; border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { background: var(--surface-soft); border-color: #9caab2; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover:not(:disabled) { background: #93271f; border-color: #93271f; }
.button:disabled,
.icon-button:disabled,
.icon-text-button:disabled { opacity: .55; cursor: wait; }
.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}
.icon-button:hover:not(:disabled) { color: var(--primary); background: var(--primary-soft); border-color: #9ecbc7; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button-on-dark { color: #c6d1d8; background: transparent; border-color: rgb(255 255 255 / 15%); }
.icon-button-on-dark:hover:not(:disabled) { color: #fff; background: rgb(255 255 255 / 9%); border-color: rgb(255 255 255 / 28%); }
.icon-text-button {
  min-height: 30px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
}
.icon-text-button svg { width: 14px; height: 14px; }
.danger-action { color: var(--danger); border-color: #e5aaa6; }
.danger-action:hover:not(:disabled) { background: var(--danger-soft); }
.button-spinner,
.loading-spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.button-spinner { opacity: .8; }
.is-refreshing svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Upload */
.upload-form {
  padding: 18px 20px 20px;
  display: grid;
  grid-template-columns: 150px minmax(260px, .8fr) minmax(360px, 1.3fr) 126px;
  align-items: end;
  gap: 16px;
}
.file-picker {
  position: relative;
  min-height: 40px;
  padding: 8px 12px 8px 112px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.file-picker input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-picker-button {
  position: absolute;
  inset: 0 auto 0 0;
  width: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
}
.file-picker-button svg { width: 15px; height: 15px; }
.file-picker small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker small.has-files { color: var(--ink-soft); }
.inline-message { min-height: 0; margin: 0 20px 14px; color: var(--muted); font-size: 12px; }
.inline-message:not(:empty) { min-height: 20px; }
.inline-message.is-success { color: var(--success); }
.inline-message.is-error { color: var(--danger); }
.inline-message.is-loading { color: var(--info); }

/* Tables */
.tasks-section,
.users-section { min-height: 300px; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; background: #fff; }
.data-table th,
.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.data-table th { color: #46535b; background: var(--surface-muted); font-size: 12px; font-weight: 650; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafcfc; }
.task-table { min-width: 1320px; }
.task-table th:nth-child(1) { width: 210px; }
.task-table th:nth-child(2) { width: 100px; }
.task-table th:nth-child(3) { width: 95px; }
.task-table th:nth-child(4) { width: 115px; }
.task-table th:nth-child(5) { width: 155px; }
.task-table th:nth-child(6),
.task-table th:nth-child(7) { width: 245px; }
.task-table th:nth-child(8) { width: 80px; }
.action-column { text-align: center !important; }
.data-table td:last-child { text-align: center; }
.batch-id { color: #29434f; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.created-time,
.failure-count { margin-top: 4px; display: block; color: var(--muted); font-size: 10px; }
.file-progress { color: var(--success); }
.file-progress.has-failures,
.failure-count { color: var(--danger); }
.status {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.status svg { width: 13px; height: 13px; }
.status-processing svg { animation: spin .9s linear infinite; }
.status-pending,
.status-retry { color: var(--info); background: var(--info-soft); }
.status-processing,
.status-partial { color: var(--warning); background: var(--warning-soft); }
.status-succeeded { color: var(--success); background: var(--success-soft); }
.status-failed { color: var(--danger); background: var(--danger-soft); }
.result-list {
  max-height: 210px;
  padding-right: 3px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
}
.download-link {
  max-width: 100%;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
}
.download-link:hover span { text-decoration: underline; }
.download-link svg { width: 14px; height: 14px; }
.download-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-link small { color: var(--muted); font-size: 10px; }
.task-message { max-width: 420px; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.empty-state {
  height: 190px;
  padding: 30px !important;
  color: var(--muted);
  text-align: center !important;
}
.empty-state > svg { width: 24px; height: 24px; margin: 0 auto 8px; color: #96a4ac; }
.empty-state > strong,
.empty-state > span:not(.loading-spinner) { display: block; }
.empty-state > strong { margin-bottom: 2px; color: var(--ink-soft); }
.empty-state .loading-spinner { margin-right: 8px; vertical-align: -3px; }
.error-state,
.error-state > svg { color: var(--danger); }

/* User management */
.users-page-heading { align-items: center; }
.users-table th:nth-child(1) { width: 230px; }
.users-table th:nth-child(2) { width: 230px; }
.users-table th:nth-child(3) { width: 130px; }
.users-table th:nth-child(4) { width: 105px; }
.users-table th:nth-child(5),
.users-table th:nth-child(6) { width: 170px; }
.users-table th:nth-child(7) { width: 105px; }
.users-table tr.is-inactive td { color: #7e898f; background: #fafafa; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 5px; background: #477584; font-size: 13px; }
.user-cell > span:last-child { min-width: 0; display: grid; }
.user-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.user-cell small { margin-top: 1px; color: var(--muted); }
.self-tag { margin-left: 4px; color: var(--primary); }
.email-link { color: var(--info); text-decoration: none; }
.email-link:hover { text-decoration: underline; }
.role-badge { padding: 3px 7px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.role-admin { color: #654c0f; background: #f7edcf; }
.role-operator { color: #245d78; background: #e5f0f5; }
.role-viewer { color: #5f6570; background: #eceef0; }
.account-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.account-status > span { width: 7px; height: 7px; border-radius: 50%; }
.account-status.is-enabled { color: var(--success); }
.account-status.is-enabled > span { background: #3ca36e; }
.account-status.is-disabled { color: #7d858b; }
.account-status.is-disabled > span { background: #a8afb4; }
.row-actions { display: flex; justify-content: center; gap: 5px; }

/* Dialogs */
.app-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
}
.app-dialog::backdrop { background: rgb(13 27 36 / 48%); }
.app-dialog-small { width: min(480px, calc(100vw - 28px)); }
.dialog-heading {
  min-height: 74px;
  padding: 17px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading h2 { margin: 0; font-size: 18px; font-weight: 650; }
.dialog-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.dialog-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.switch-row { height: 40px; display: flex; align-items: center; gap: 8px; }
.switch-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch-row > span { color: var(--ink-soft); font-weight: 400; }
.dialog-message { min-height: 0; margin: -4px 20px 12px; color: var(--muted); font-size: 12px; }
.dialog-message:not(:empty) { min-height: 20px; padding: 8px 10px; border-radius: 4px; }
.dialog-message.is-error { color: var(--danger); background: var(--danger-soft); }
.dialog-actions { padding: 13px 20px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); background: var(--surface-soft); }

/* Login */
.login-body { background: #eef2f4; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .85fr) minmax(500px, 1.15fr); }
.login-brand {
  min-height: 100vh;
  padding: clamp(42px, 8vw, 110px);
  display: flex;
  align-items: center;
  color: #fff;
  background: #162f40;
}
.login-brand-inner { max-width: 460px; }
.brand-mark-large { width: 48px; height: 48px; margin-bottom: 26px; }
.brand-mark-large svg { width: 26px; height: 26px; }
.login-eyebrow { margin: 0 0 7px; color: #65c2b7; font-size: 11px; font-weight: 700; }
.login-brand h1 { margin: 0 0 14px; font-size: 36px; font-weight: 650; }
.login-brand h1 + p { max-width: 400px; margin: 0; color: #b8c8d1; font-size: 16px; }
.login-security { margin-top: 44px; display: flex; align-items: center; gap: 9px; color: #aebfc8; font-size: 12px; }
.login-security svg { width: 17px; height: 17px; color: #65c2b7; }
.login-form-section { padding: 40px; display: flex; align-items: center; justify-content: center; background: #f7f9fa; }
.login-form { width: min(390px, 100%); }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { margin: 0; font-size: 24px; font-weight: 650; }
.login-heading p { margin: 5px 0 0; color: var(--muted); }
.login-form .field { margin-top: 17px; }
.login-form .field input { height: 44px; }
.login-submit { width: 100%; min-height: 44px; margin-top: 24px; justify-content: space-between; padding-left: 18px; padding-right: 18px; }
.login-help { margin: 14px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.alert { padding: 10px 12px; display: flex; align-items: flex-start; gap: 8px; border: 1px solid; border-radius: 4px; font-size: 12px; }
.alert svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.alert-danger { color: var(--danger); background: var(--danger-soft); border-color: #efc0bc; }

/* Toasts */
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast {
  width: min(380px, calc(100vw - 40px));
  min-height: 44px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
  transition: opacity .18s ease, transform .18s ease;
}
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; }
.toast-info { border-left-color: var(--info); color: var(--info); }
.toast-success { border-left-color: var(--success); color: var(--success); }
.toast-danger { border-left-color: var(--danger); color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .app-header { grid-template-columns: auto 1fr auto; }
  .main-nav { justify-self: center; }
  .account-copy { display: none; }
  .upload-form { grid-template-columns: 140px 1fr 1.3fr; }
  .upload-submit { grid-column: 3; width: 126px; justify-self: end; }
}

@media (max-width: 760px) {
  .app-header { position: static; height: 58px; grid-template-columns: 1fr auto; padding: 0 16px; }
  .brand strong { font-size: 15px; }
  .brand small,
  .main-nav,
  .avatar { display: none; }
  .mobile-nav {
    height: 48px;
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav a {
    min-width: 120px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
  }
  .mobile-nav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
  .mobile-nav svg { width: 16px; height: 16px; }
  .page-shell { min-height: calc(100vh - 106px); padding: 20px 14px 34px; }
  .page-heading { min-height: 0; margin-bottom: 18px; align-items: flex-start; }
  .page-heading h1 { font-size: 22px; }
  .environment-state { display: none; }
  .users-page-heading { align-items: flex-end; }
  .section-heading { padding: 14px; align-items: flex-start; }
  .section-heading p { max-width: 460px; }
  .table-heading .button span { display: none; }
  .table-heading .button { width: 38px; padding: 0; }
  .upload-form { padding: 16px 14px; grid-template-columns: 1fr; }
  .upload-submit { grid-column: auto; width: 100%; }
  .inline-message { margin-left: 14px; margin-right: 14px; }
  .data-table th,
  .data-table td { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .login-shell { display: block; }
  .login-brand { min-height: 210px; padding: 32px 24px; align-items: flex-end; }
  .brand-mark-large { width: 40px; height: 40px; margin-bottom: 15px; }
  .login-brand h1 { margin-bottom: 6px; font-size: 26px; }
  .login-brand h1 + p { font-size: 13px; }
  .login-security { display: none; }
  .login-form-section { min-height: calc(100vh - 210px); padding: 34px 24px 44px; align-items: flex-start; }
  .toast-region { right: 12px; bottom: 12px; }
}

@media (max-width: 440px) {
  .users-page-heading { display: grid; }
  .users-page-heading .button { width: 100%; }
  .dialog-actions .button { flex: 1; }
}

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

/* Left navigation shared by every authenticated page. */
.app-header { grid-template-columns: 1fr auto; padding: 0 24px; }
.app-sidebar { position: fixed; z-index: 25; top: 64px; bottom: 0; left: 0; width: 244px; overflow-y: auto; overscroll-behavior: contain; padding: 20px 12px; background: #fff; border-right: 1px solid var(--line); }
.sidebar-caption { margin: 0 14px 14px; color: var(--muted); font-size: 11px; letter-spacing: 2px; }
.sidebar-nav { display: grid; gap: 6px; }
.nav-group summary, .sidebar-link { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink-soft); border-radius: 5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary svg, .sidebar-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-group summary .nav-chevron { margin-left: auto; width: 14px; height: 14px; transition: transform .15s ease; }
.nav-group:not([open]) .nav-chevron { transform: rotate(-90deg); }
.nav-group summary:hover, .sidebar-link:hover { background: var(--surface-soft); }
.nav-children { display: grid; gap: 2px; margin: 2px 0 8px 21px; padding-left: 13px; border-left: 1px solid var(--line); }
.nav-children a { display: block; min-height: 38px; padding: 9px 10px; font-size: 13px; line-height: 20px; text-decoration: none; border-radius: 4px; color: var(--muted); }
.nav-children a:hover { background: var(--surface-soft); color: var(--ink); }
.nav-children a.is-active, .sidebar-link.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 650; }
.sidebar-nav a:focus-visible, .sidebar-nav summary:focus-visible, .menu-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.app-body > .page-shell { width: calc(100% - 244px); margin-left: 244px; padding: 30px 28px 50px; }
.menu-toggle, .sidebar-backdrop { display: none; }
.task-table:has(.empty-state) { min-width: 0; }
.module-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.module-empty > svg { width: 40px; height: 40px; margin-bottom: 16px; color: var(--primary); }
.module-empty h2 { margin: 0; font-size: 18px; }
.module-empty p { margin: 10px 0 20px; color: var(--muted); }
@media (min-width: 761px) and (max-width: 1400px) {
  .upload-form { grid-template-columns: 140px minmax(0, 1fr) 126px; }
  .email-field { grid-column: 2 / 4; }
  .file-field { grid-column: 1 / 3; }
  .upload-submit { grid-column: 3; width: 126px; justify-self: end; }
  .environment-state { display: none; }
}
@media (max-width: 760px) {
  .app-header { position: sticky; z-index: 30; height: 58px; grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 14px; }
  .menu-toggle { display: inline-grid; grid-column: 1; grid-row: 1; }
  .app-header .brand { grid-column: 2; grid-row: 1; }
  .account-area { grid-column: 3; grid-row: 1; }
  .app-sidebar { top: 58px; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .menu-open .app-sidebar { transform: translateX(0); visibility: visible; }
  .menu-open .sidebar-backdrop { display: block; position: fixed; z-index: 24; inset: 58px 0 0; border: 0; padding: 0; background: rgb(19 42 58 / 35%); }
  .app-body.menu-open { overflow: hidden; }
  .app-body > .page-shell { width: 100%; min-height: calc(100vh - 58px); margin-left: 0; padding: 22px 14px 34px; }
}
