:root {
  --ink: #172321;
  --muted: #6c7975;
  --line: #dfe6e2;
  --canvas: #f4f7f5;
  --surface: #ffffff;
  --forest: #183f35;
  --forest-2: #245648;
  --mint: #c9f264;
  --mint-soft: #eef9d1;
  --coral: #e76f51;
  --red-soft: #fde8e3;
  --amber: #b7791f;
  --amber-soft: #fff2cf;
  --shadow: 0 18px 45px rgba(26, 48, 42, .09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(201, 242, 100, .2), transparent 30%),
    radial-gradient(circle at 84% 75%, rgba(105, 179, 153, .18), transparent 28%),
    var(--forest);
  position: relative;
  overflow: hidden;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.login-screen::before { top: -180px; right: -90px; }
.login-screen::after { bottom: -240px; left: -80px; width: 480px; height: 480px; }

.login-card {
  width: min(440px, 100%);
  padding: 42px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 30px 80px rgba(4, 22, 17, .28);
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--mint);
  color: var(--forest);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.06em;
  margin-bottom: 25px;
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; margin: 0; flex: none; }

.eyebrow {
  margin: 0 0 7px;
  color: #5e746d;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .14em;
}
.eyebrow.light { color: rgba(255,255,255,.58); }
.login-card h1 { margin: 0; font-size: 29px; letter-spacing: -.04em; }
.login-copy { margin: 12px 0 28px; color: var(--muted); line-height: 1.65; }

label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #354541; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ced8d3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus { border-color: #4f786b; box-shadow: 0 0 0 3px rgba(36, 86, 72, .12); }
input::placeholder, textarea::placeholder { color: #a2ada9; }

.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.text-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 800;
  padding: 6px;
}
.field-help { margin: 8px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.field-help code { background: #edf1ef; padding: 1px 5px; border-radius: 4px; color: #374a44; }
.form-error { margin: 10px 0 0; color: #b33e2a; font-size: 12px; line-height: 1.5; }

.button {
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 800;
  transition: transform .15s, background .15s, opacity .15s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { background: var(--forest); color: white; box-shadow: 0 7px 18px rgba(24, 63, 53, .15); }
.button.primary:hover { background: #0e3028; }
.button.secondary { background: #e8eeeb; color: #30433e; }
.button.secondary:hover { background: #dce5e1; }
.button.light { background: var(--mint); color: var(--forest); }
.button.wide { width: 100%; padding: 12px; }
.login-status { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5abb83; box-shadow: 0 0 0 4px rgba(90,187,131,.13); flex: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background: #143a31;
  color: white;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 27px; }
.sidebar-brand div:last-child { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 14px; letter-spacing: -.01em; }
.sidebar-brand span { color: rgba(255,255,255,.48); font-size: 11px; }
.nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255,255,255,.66);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--mint); color: var(--forest); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 900; }
.nav-item.active .nav-icon { background: rgba(24,63,53,.1); }
.sidebar-footer { margin-top: auto; }
.security-note { margin: 0 5px 12px; padding: 13px; border-radius: 10px; background: rgba(255,255,255,.055); display: grid; gap: 4px; }
.security-note span { color: rgba(255,255,255,.45); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.security-note strong { font-size: 10px; color: rgba(255,255,255,.78); }
.nav-item.subtle { border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; margin-top: 6px; padding-top: 15px; }

.main-content { grid-column: 2; min-width: 0; padding: 0 34px 45px; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.server-state { display: flex; align-items: center; gap: 8px; color: #4c5d58; font-size: 12px; font-weight: 700; }
.server-state.offline .status-dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(231,111,81,.13); }
.view { display: none; animation: enter .18s ease-out; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.hero-panel {
  min-height: 181px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 31px 34px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  color: white;
  background:
    radial-gradient(circle at 85% 30%, rgba(201,242,100,.19), transparent 28%),
    linear-gradient(120deg, #183f35, #245849);
  box-shadow: var(--shadow);
}
.hero-panel::after { content: ""; position: absolute; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; right: 90px; top: -125px; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { margin: 0 0 9px; font-size: 29px; letter-spacing: -.04em; }
.hero-panel p:last-child { margin: 0; color: rgba(255,255,255,.65); font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin: 17px 0; }
.stat-card { min-height: 129px; padding: 20px 21px; border: 1px solid #e2e8e5; border-radius: 14px; background: var(--surface); display: grid; align-content: space-between; box-shadow: 0 7px 20px rgba(30,48,43,.035); }
.stat-card.accent { background: var(--mint-soft); border-color: #ddecba; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; margin: 7px 0 2px; font-size: 31px; letter-spacing: -.05em; }
.stat-foot { color: #8b9692; font-size: 11px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 17px; }
.panel { border: 1px solid #e0e7e3; border-radius: 14px; background: var(--surface); box-shadow: 0 8px 22px rgba(30,48,43,.035); overflow: hidden; }
.panel-heading { min-height: 75px; padding: 18px 21px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf0ee; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.link-button { border: 0; background: transparent; color: var(--forest-2); font-size: 12px; font-weight: 800; padding: 7px; }
.activity-list, .capacity-list { padding: 5px 20px; }
.activity-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #eff2f0; }
.activity-item:last-child, .capacity-row:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.activity-icon.success { background: var(--mint-soft); color: #4f7021; }
.activity-icon.failure { background: var(--red-soft); color: #ad4934; }
.activity-main { min-width: 0; display: grid; gap: 3px; }
.activity-main strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-main span, .activity-time { color: var(--muted); font-size: 10px; }
.capacity-row { padding: 14px 0; border-bottom: 1px solid #eff2f0; }
.capacity-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-bottom: 8px; }
.capacity-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capacity-meta span { color: var(--muted); flex: none; }
.progress { height: 6px; border-radius: 99px; background: #edf1ef; overflow: hidden; }
.progress span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--forest-2); }
.progress.full span { background: var(--coral); }
.progress progress { display: block; width: 100%; height: 100%; border: 0; appearance: none; background: transparent; }
.progress progress::-webkit-progress-bar { background: transparent; }
.progress progress::-webkit-progress-value { border-radius: 99px; background: var(--forest-2); }
.progress.full progress::-webkit-progress-value { background: var(--coral); }
.progress progress::-moz-progress-bar { border-radius: 99px; background: var(--forest-2); }
.progress.full progress::-moz-progress-bar { background: var(--coral); }

.section-heading { min-height: 71px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 5px 0 15px; }
.section-heading h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.view-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; background: #e8eeeb; }
.view-tab { border: 0; border-radius: 7px; padding: 8px 12px; background: transparent; color: #62716c; font-size: 11px; font-weight: 800; }
.view-tab:hover { color: var(--forest); background: rgba(255,255,255,.55); }
.view-tab.active { color: var(--forest); background: white; box-shadow: 0 2px 8px rgba(24,63,53,.1); }
.view-tab span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 3px; padding: 0 5px; place-items: center; border-radius: 99px; background: rgba(24,63,53,.08); font-size: 9px; }
.table-panel { min-height: 340px; }
.table-toolbar { min-height: 65px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #edf0ee; }
.search-field { width: min(330px, 100%); display: flex; align-items: center; gap: 8px; border: 1px solid #d7dfdb; border-radius: 9px; padding: 0 11px; background: #fafcfb; color: #77837f; }
.search-field:focus-within { border-color: #698b80; box-shadow: 0 0 0 3px rgba(36,86,72,.08); }
.search-field input { border: 0; box-shadow: none; background: transparent; padding: 9px 0; font-size: 12px; }
.search-field input:focus { box-shadow: none; }
.table-toolbar select { width: auto; min-width: 130px; padding: 9px 31px 9px 11px; font-size: 12px; background-color: #fafcfb; }
.muted { color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 17px; color: #83908b; background: #fafcfb; border-bottom: 1px solid #e8edeb; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 14px 17px; border-bottom: 1px solid #eef1ef; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfb; }
.device-row { cursor: pointer; }
.device-row:focus-visible { outline: 2px solid var(--forest-2); outline-offset: -2px; background: #f4f8f6; }
.cell-main { display: grid; gap: 3px; }
.cell-main strong { font-size: 12px; font-weight: 750; }
.cell-main span { color: var(--muted); font-size: 10px; }
.log-serial-cell { max-width: 230px; }
.log-serial-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; }
.badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; border-radius: 99px; padding: 5px 8px; font-size: 10px; font-weight: 800; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: #517628; background: var(--mint-soft); }
.badge.failure { color: #ad4934; background: var(--red-soft); }
.badge.warning { color: #956517; background: var(--amber-soft); }
.badge.neutral { color: #61716c; background: #edf1ef; }
.capacity-text { display: grid; gap: 6px; width: 110px; }
.capacity-text span { color: var(--muted); font-size: 10px; }
.row-action { border: 1px solid #d9e1dd; background: white; border-radius: 8px; padding: 6px 9px; color: #455853; font-size: 11px; font-weight: 750; }
.row-action:hover { background: #f0f4f2; }
.row-action.danger { border-color: #efc6bc; color: #a43f2c; background: #fff7f5; }
.row-action.danger:hover { background: var(--red-soft); }
.row-action.restore { border-color: #cfe0a8; color: #537426; background: #f7fbe9; }
.row-action.restore:hover { background: var(--mint-soft); }
.row-action:disabled { opacity: .55; cursor: wait; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.disabled-row { background: #fffafa; }
.empty-state { min-height: 240px; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 7px; }
.empty-state strong { color: #4b5a56; font-size: 14px; }
.empty-state span { font-size: 12px; }
.empty-state.compact-empty { min-height: 190px; }

.modal {
  width: min(520px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(15,35,29,.35);
}
.modal.wide-modal { width: min(760px, calc(100% - 30px)); }
.modal::backdrop { background: rgba(10, 29, 24, .52); backdrop-filter: blur(3px); }
.modal form { display: grid; gap: 18px; padding: 26px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.icon-button { width: 31px; height: 31px; border: 0; border-radius: 8px; background: #edf1ef; color: #53645f; font-size: 21px; line-height: 1; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal .field-help { margin: -7px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.modal.detail-modal {
  width: min(1040px, calc(100vw - 32px));
  height: min(900px, calc(100vh - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: none;
  overflow: hidden;
}
.detail-modal form {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.detail-modal > form > .modal-heading {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.detail-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  padding: 18px 24px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  outline: none;
}
.detail-modal-body > *,
.detail-modal .detail-section {
  min-width: 0;
  max-width: 100%;
}
.detail-modal-body:focus-visible { box-shadow: inset 0 0 0 2px rgba(36, 86, 72, .28); }
.detail-modal > form > .modal-actions {
  margin: 0;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.detail-modal .table-wrap { max-width: 100%; }
.detail-modal table { min-width: 760px; }
#related-authorization-details .cell-main span {
  max-width: 420px;
  white-space: normal;
  line-height: 1.45;
}
.identity-box { padding: 12px 14px; border-radius: 10px; background: #f0f4f2; display: grid; gap: 3px; }
.identity-box strong { font-size: 13px; }
.identity-box span { color: var(--muted); font-size: 11px; }
.batch-result { display: grid; gap: 9px; padding: 13px; border: 1px solid #dfe7e3; border-radius: 11px; background: #f5f8f6; }
.batch-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.batch-result-heading strong { font-size: 12px; }
.text-button.inline { position: static; transform: none; padding: 4px 7px; }
.batch-result textarea { min-height: 190px; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.secret-result { display: grid; gap: 9px; padding: 13px; border: 1px solid #efcf9a; border-radius: 11px; background: #fff8e9; }
.secret-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.secret-result-heading strong { font-size: 12px; color: #7c5718; }
.secret-result textarea { min-height: 92px; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.mode-settings { display: grid; gap: 13px; padding: 14px; border: 1px solid #dfe7e3; border-radius: 12px; background: #f7faf8; }
.mode-settings .field-help { margin: -5px 0 0; }
.mode-settings .secret-result { background: #fff8e9; }
.carousel-config { display: grid; gap: 11px; padding: 14px; border: 1px solid #dfe7e3; border-radius: 12px; background: #f7faf8; }
.carousel-config-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.carousel-config-heading div { display: grid; gap: 3px; }
.carousel-config-heading strong { font-size: 13px; }
.carousel-config-heading span { color: var(--muted); font-size: 11px; }
.carousel-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.carousel-slot { min-width: 0; display: grid; gap: 10px; padding: 12px; border: 1px solid #e0e7e3; border-radius: 10px; background: white; }
.carousel-slot-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.carousel-slot-heading strong { font-size: 12px; }
.carousel-slot-heading span { color: var(--muted); font-size: 10px; }
.carousel-slot .field-grid { grid-template-columns: 105px minmax(0, 1fr); }
.carousel-slot label { font-size: 11px; gap: 6px; }
.carousel-slot input, .carousel-slot select { padding: 9px 10px; font-size: 12px; }
.hardware-summary { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 13px; color: white; background: linear-gradient(125deg, var(--forest), var(--forest-2)); }
.hardware-avatar { width: 48px; height: 48px; display: grid; place-items: center; flex: none; border-radius: 13px; background: var(--mint); color: var(--forest); font-size: 20px; font-weight: 900; }
.hardware-summary-text { min-width: 0; display: flex; align-items: center; gap: 9px 14px; flex-wrap: wrap; }
.hardware-summary-text strong { width: 100%; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hardware-summary-text > span:not(.badge) { color: rgba(255,255,255,.65); font-size: 11px; }
.hardware-summary-text .badge.success { color: #d9f58d; background: rgba(201,242,100,.12); }
.hardware-summary-text .badge.failure { color: #ffd1c8; background: rgba(231,111,81,.16); }
.hardware-summary-text .badge.warning { color: #ffe5a7; background: rgba(255,196,87,.14); }
.hardware-summary-text .badge.neutral { color: #dce6e2; background: rgba(255,255,255,.12); }
.hardware-summary-text > .mono { overflow-wrap: anywhere; white-space: normal; }
.detail-section { display: grid; gap: 12px; }
.embedded-detail-section { margin-top: 18px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.detail-heading h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.detail-heading span { color: var(--muted); font-size: 10px; }
.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { min-width: 0; padding: 11px 12px; border-radius: 9px; background: #f5f8f6; border: 1px solid #e9eeeb; }
.detail-item.wide { grid-column: 1 / -1; }
.detail-item dt { margin-bottom: 5px; color: #81908b; font-size: 10px; font-weight: 750; }
.detail-item dd { margin: 0; color: #2d3d38; font-size: 12px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.detail-item .detail-value.mono { font-size: 11px; font-weight: 600; }
.empty-detail { padding: 18px; border: 1px dashed #d8e1dd; border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }
.batch-item-results { max-height: 430px; display: grid; gap: 7px; overflow: auto; }
.batch-item-result { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto minmax(140px, .8fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #e3eae6; border-radius: 8px; background: white; }
.batch-item-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-item-result code { color: var(--muted); font-size: 10px; }
.hardware-note { margin: -3px 0 0; padding: 11px 13px; border-left: 3px solid #a7c957; border-radius: 0 8px 8px 0; background: var(--mint-soft); color: #59664f; font-size: 11px; line-height: 1.55; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; }
.switch-row span { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); font-weight: 400; font-size: 11px; }
.switch-row input { appearance: none; width: 38px; height: 22px; border: 0; border-radius: 99px; background: #c5cfcb; padding: 0; position: relative; flex: none; }
.switch-row input::after { content: ""; width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: white; transition: transform .18s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch-row input:checked { background: var(--forest-2); }
.switch-row input:checked::after { transform: translateX(16px); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 20; display: grid; gap: 9px; width: min(350px, calc(100% - 44px)); }
.toast { padding: 13px 15px; border-radius: 10px; color: white; background: #173c32; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: #9d3e2e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .detail-modal .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .batch-item-result { grid-template-columns: auto minmax(0, 1fr); }
  .batch-item-result > span.mono, .batch-item-result > code { grid-column: 2; }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar { inset: auto 0 0; width: auto; height: 64px; padding: 8px; flex-direction: row; align-items: center; background: #143a31; }
  .sidebar-brand, .sidebar-footer { display: none; }
  .nav { width: 100%; grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .nav-item { display: grid; justify-items: center; gap: 3px; padding: 5px 2px; font-size: 9px; }
  .nav-icon { width: 20px; height: 20px; }
  .main-content { padding: 0 15px 28px; }
  .topbar { height: 78px; }
  .topbar h1 { font-size: 19px; }
  .server-state { display: none; }
  .hero-panel { min-height: 210px; align-items: flex-start; flex-direction: column; padding: 25px; }
  .hero-panel h2 { font-size: 25px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 116px; padding: 16px; }
  .stat-card strong { font-size: 27px; }
  .section-heading { align-items: flex-end; flex-wrap: wrap; }
  .section-heading p { display: none; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .table-toolbar select { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .carousel-editor { grid-template-columns: 1fr; }
  .carousel-slot .field-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.wide { grid-column: auto; }
  .hardware-summary { align-items: flex-start; }
  .modal.detail-modal {
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .detail-modal > form > .modal-heading { padding: 16px 15px 13px; }
  .detail-modal-body { gap: 15px; padding: 15px; scrollbar-gutter: auto; }
  .detail-modal > form > .modal-actions { padding: 12px 15px calc(12px + env(safe-area-inset-bottom)); }
  .detail-modal .table-wrap { overflow: visible; }
  .detail-modal table,
  .detail-modal tbody { display: block; width: 100%; min-width: 0; white-space: normal; }
  .detail-modal thead { display: none; }
  .detail-modal tbody { display: grid; gap: 10px; }
  .detail-modal tbody tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #e3eae6;
    border-radius: 10px;
    background: var(--surface);
  }
  .detail-modal tbody td {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(88px, .4fr) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 10px 12px;
    white-space: normal;
  }
  .detail-modal tbody td::before {
    content: attr(data-label);
    color: #81908b;
    font-size: 10px;
    font-weight: 750;
  }
  .detail-modal tbody td:last-child { border-bottom: 0; }
  .detail-modal .row-actions { flex-wrap: wrap; }
  .login-card { padding: 31px 25px; }
}

@media (max-width: 430px) {
  .topbar .button { padding: 9px 10px; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 225px; }
}

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