:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --line: #dce7dd;
  --text: #193226;
  --muted: #64756a;
  --green: #0f8b4c;
  --green-dark: #08713d;
  --danger: #d44848;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

button.danger {
  border-color: rgba(212, 72, 72, 0.4);
  color: var(--danger);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-shell.is-login {
  grid-template-columns: 1fr;
  min-height: 100vh;
  background:
    linear-gradient(110deg, rgba(7, 49, 30, 0.82), rgba(9, 82, 45, 0.5), rgba(244, 247, 244, 0.94)),
    url("./assets/images/field-sensor-row.jpg") center / cover;
}

.admin-shell.is-login .admin-sidebar,
.admin-shell.is-login .admin-topbar {
  display: none;
}

.admin-shell.is-login .admin-main {
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #0b2e1d;
  color: #eafff2;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.admin-brand strong,
.admin-brand span {
  display: block;
}

.admin-brand span {
  color: rgba(234, 255, 242, 0.68);
  font-size: 12px;
}

[data-tabs] {
  display: grid;
  gap: 8px;
}

[data-tabs] button,
.admin-sidebar .ghost {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eafff2;
  text-align: left;
}

[data-tabs] button.is-active {
  background: #fff;
  color: #0b2e1d;
}

.admin-sidebar .ghost {
  margin-top: 12px;
  text-align: center;
}

.admin-main {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 244, 0.94);
  backdrop-filter: blur(12px);
}

.admin-topbar h1 {
  margin: 0;
  font-size: 24px;
}

.admin-topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-actions button {
  height: 38px;
  padding: 0 16px;
}

.admin-actions span {
  color: var(--muted);
  font-size: 13px;
}

.admin-workspace {
  padding: 24px 28px 52px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 90px);
  padding: 28px;
}

.admin-shell.is-login .login-panel {
  min-height: 100vh;
}

.login-panel form {
  display: grid;
  gap: 14px;
  justify-items: stretch;
  width: min(420px, calc(100vw - 36px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(4, 39, 23, 0.24);
}

.login-panel form > img {
  justify-self: center;
  width: 62px;
  height: 62px;
  border-radius: 10px;
  object-fit: contain;
}

.login-panel h2 {
  text-align: center;
  margin: 0;
  font-size: 26px;
}

[data-login-message] {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.field-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 78px;
  padding: 9px 10px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 139, 76, 0.12);
}

.filter-row {
  margin-bottom: 16px;
}

.filter-row input {
  max-width: 520px;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.section-card + .section-card {
  margin-top: 16px;
}

.section-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f9fbf9;
}

.section-card h2,
.section-card h3 {
  margin: 0;
}

.section-card header button {
  height: 34px;
  padding: 0 12px;
}

.translation-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf2ee;
}

.translation-row code {
  align-self: start;
  overflow-wrap: anywhere;
  color: #31533d;
  font-size: 13px;
}

.item-card {
  padding: 16px;
  border-bottom: 1px solid #edf2ee;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.item-head strong {
  font-size: 15px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

.profile-editor {
  padding: 16px;
  border-bottom: 1px solid #edf2ee;
}

.profile-editor textarea {
  min-height: 104px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.upload-row input[type="file"] {
  display: none;
}

.json-editor {
  min-height: 62vh;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.help-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #d6eadc;
  border-radius: 6px;
  background: #f4fbf6;
  color: #44624f;
}

.message-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.message-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #edf2ee;
  border-radius: 8px;
  background: #fff;
}

.message-card header {
  padding: 0;
  border: 0;
  background: transparent;
}

.message-card header span {
  color: var(--muted);
  font-size: 13px;
}

.message-card p {
  margin: 0;
  line-height: 1.7;
}

.message-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.message-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .translation-row,
  .field-grid,
  .message-card dl {
    grid-template-columns: 1fr;
  }
}

/* Admin polish 2026-06-30 */
:root {
  --bg: #eef4f0;
  --bg-soft: #f7faf8;
  --panel: #ffffff;
  --panel-soft: #f8fbf9;
  --line: #d8e4dc;
  --line-strong: #bfd2c5;
  --text: #10251b;
  --muted: #62736a;
  --green: #0d8c4e;
  --green-dark: #063d26;
  --green-deep: #052c1c;
  --green-soft: #e8f6ee;
  --aqua: #23b6a7;
  --amber: #c98818;
  --danger: #cf3f42;
  --shadow: 0 18px 44px rgba(8, 40, 24, 0.1);
  --shadow-soft: 0 10px 30px rgba(8, 40, 24, 0.08);
  --radius: 10px;
}

html {
  background: var(--bg);
}

body {
  min-width: 0;
  background:
    radial-gradient(circle at 26% -8%, rgba(28, 169, 103, 0.13), transparent 30%),
    linear-gradient(180deg, #f6faf7 0%, #eef4f0 45%, #e8f0ec 100%);
  letter-spacing: 0;
}

button {
  min-width: 0;
  border-radius: 8px;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover {
  border-color: rgba(13, 140, 78, 0.46);
  box-shadow: 0 8px 22px rgba(8, 40, 24, 0.08);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.primary {
  border-color: var(--green);
  background: linear-gradient(135deg, #15995a, #08713d);
  box-shadow: 0 12px 26px rgba(13, 140, 78, 0.2);
}

button.danger {
  border-color: rgba(207, 63, 66, 0.24);
  background: #fffafa;
  color: var(--danger);
}

.admin-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-shell.is-login {
  background:
    linear-gradient(105deg, rgba(4, 44, 28, 0.9), rgba(8, 90, 52, 0.62), rgba(244, 247, 244, 0.92)),
    url("./assets/images/field-sensor-row.jpg") center / cover;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(13, 140, 78, 0.14), transparent 24%),
    linear-gradient(180deg, #083820 0%, #062d1c 52%, #041f16 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.admin-brand {
  min-height: 70px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.admin-brand img {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 9px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.admin-brand strong {
  line-height: 1.35;
  font-size: 17px;
}

[data-tabs] {
  gap: 6px;
  padding: 2px;
}

[data-tabs] button,
.admin-sidebar .ghost {
  border-color: transparent;
  background: transparent;
  color: rgba(234, 255, 242, 0.82);
}

[data-tabs] button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

[data-tabs] button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}

[data-tabs] button.is-active {
  border-color: rgba(255, 255, 255, 0.14);
  background: #fff;
  color: var(--green-deep);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.tab-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(234, 255, 242, 0.66);
  font-size: 12px;
  font-weight: 900;
}

[data-tabs] button.is-active .tab-mark {
  background: var(--green-soft);
  color: var(--green);
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar .ghost {
  min-height: 44px;
  margin-top: 0;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-align: center;
}

.admin-sidebar .ghost:first-of-type {
  margin-top: auto;
}

.admin-sidebar .ghost:hover {
  background: rgba(255, 255, 255, 0.13);
  box-shadow: none;
}

.admin-topbar {
  align-items: center;
  min-height: 90px;
  padding: 18px clamp(20px, 3vw, 34px);
  border-bottom: 1px solid rgba(216, 228, 220, 0.92);
  background: rgba(248, 251, 249, 0.92);
  backdrop-filter: blur(14px);
}

.admin-topbar h1 {
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}

.admin-topbar p {
  margin-top: 7px;
  font-size: 14px;
}

.admin-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-actions button {
  height: 40px;
}

.admin-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.admin-actions span.is-saved {
  border-color: rgba(13, 140, 78, 0.22);
  background: var(--green-soft);
  color: var(--green-dark);
}

.admin-actions span.is-dirty {
  border-color: rgba(201, 136, 24, 0.34);
  background: #fff7e6;
  color: #8d5d0b;
}

.admin-workspace {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 34px) 56px;
}

.login-panel form {
  position: relative;
  width: min(420px, calc(100vw - 36px));
  padding: 38px 34px 34px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(3, 35, 21, 0.28);
}

.login-panel form::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-panel form > img {
  justify-self: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.login-panel h2 {
  margin: 2px 0 8px;
  text-align: center;
  font-size: 27px;
  line-height: 1.2;
}

.login-panel button.primary {
  height: 42px;
}

label span,
.field-title {
  font-weight: 800;
}

input,
textarea,
select {
  border-radius: 8px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 86px;
  padding: 10px 11px;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(13, 140, 78, 0.12);
}

.filter-row {
  position: sticky;
  top: 90px;
  z-index: 3;
  margin: -2px 0 16px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(246, 250, 247, 0.96), rgba(246, 250, 247, 0.82));
  backdrop-filter: blur(10px);
}

.filter-row input {
  max-width: 560px;
  height: 42px;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.section-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-card header {
  min-height: 62px;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(13, 140, 78, 0.08), transparent 58%),
    var(--panel-soft);
}

.section-card h2 {
  font-size: 20px;
  line-height: 1.25;
}

.section-card h3 {
  font-size: 17px;
  line-height: 1.25;
}

.section-card header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.section-card header button {
  min-width: 78px;
  height: 36px;
  border-color: rgba(13, 140, 78, 0.28);
  color: var(--green-dark);
}

.translation-row {
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px 18px;
  border-bottom-color: #edf3ef;
}

.translation-row:nth-child(odd),
.item-card:nth-child(even) {
  background: #fcfdfc;
}

.translation-row:last-child,
.item-card:last-child,
.profile-editor:last-child {
  border-bottom: 0;
}

.translation-row code {
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #dbe9e0;
  border-radius: 8px;
  background: #f3faf6;
  line-height: 1.5;
}

.item-card {
  padding: 18px;
  border-bottom-color: #edf3ef;
}

.item-head {
  align-items: center;
}

.item-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-head button {
  flex: 0 0 auto;
  height: 34px;
}

.field-grid {
  gap: 13px 14px;
}

.profile-editor {
  padding: 18px;
  border-bottom-color: #edf3ef;
}

.profile-editor textarea {
  min-height: 112px;
}

.upload-row button {
  min-width: 72px;
  height: 40px;
  border-color: rgba(13, 140, 78, 0.28);
  color: var(--green-dark);
}

.json-editor {
  padding: 16px;
  border-radius: 0;
  border-width: 0;
  border-top: 1px solid var(--line);
}

.help-box {
  border-radius: var(--radius);
  line-height: 1.7;
}

.section-card > .help-box {
  margin: 16px;
}

.message-card {
  border-color: #e4eee7;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(13, 140, 78, 0.05), transparent 42%),
    #fff;
}

.message-card p {
  color: #253a30;
  line-height: 1.75;
}

.message-card dt {
  font-weight: 800;
}

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .translation-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  [data-tabs] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar .ghost:first-of-type {
    margin-top: 4px;
  }

  .admin-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .filter-row {
    position: static;
  }

  .field-grid,
  .message-card dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  [data-tabs] {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    padding-inline: 14px;
  }

  .admin-topbar {
    padding-inline: 16px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-panel form {
    padding: 24px;
  }

  .upload-row {
    grid-template-columns: 1fr;
  }
}

[hidden] {
  display: none !important;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 24px;
  border: 1px solid rgba(13, 140, 78, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(13, 140, 78, 0.14), rgba(255, 255, 255, 0.72)),
    #fff;
  box-shadow: var(--shadow-soft);
}

.dashboard-hero span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  margin: 6px 0;
  font-size: 28px;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}

.dashboard-actions,
.header-actions-inline,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.metric-card span,
.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 28px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-strip div {
  padding: 12px;
  border: 1px solid #e2eee6;
  border-radius: 8px;
  background: #fbfdfc;
}

.summary-strip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

.compact-list {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.compact-list p {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #edf3ef;
  color: #263d31;
}

.compact-list p:last-child {
  border-bottom: 0;
}

.compact-list time {
  color: var(--muted);
  font-size: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(13, 140, 78, 0.26);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.field-link {
  width: max-content;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.upload-preview-img {
  width: 100%;
  max-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f5faf7;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.asset-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e3eee7;
  border-radius: var(--radius);
  background: #fff;
}

.asset-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  background: #eff6f2;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-card code {
  display: block;
  overflow-wrap: anywhere;
  color: #31533d;
  font-size: 12px;
}

.table-list {
  display: grid;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 190px auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #edf3ef;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row code {
  overflow-wrap: anywhere;
}

.log-row {
  grid-template-columns: 180px 150px 110px minmax(0, 1fr);
}

.log-row p {
  margin: 0;
  color: var(--muted);
}

.message-card em {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff4dd;
  color: #8d5d0b;
  font-style: normal;
  font-size: 12px;
}

.message-card.is-done em {
  background: var(--green-soft);
  color: var(--green-dark);
}

.message-card textarea {
  min-height: 56px;
}

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
}

.password-form button {
  height: 40px;
}

.password-form p {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .metric-grid,
  .asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .password-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .asset-grid,
  .summary-strip,
  .password-form {
    grid-template-columns: 1fr;
  }

  .table-row,
  .log-row,
  .compact-list p {
    grid-template-columns: 1fr;
  }
}

.menu-group {
  display: grid;
  gap: 4px;
}

[data-tabs] .menu-parent {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
}

[data-tabs] .menu-parent:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-group.is-active > .menu-parent {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.menu-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(234, 255, 242, 0.7);
  font-size: 12px;
  font-weight: 900;
}

.menu-group.is-active .menu-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.submenu {
  display: none;
  gap: 4px;
  padding: 2px 0 8px 42px;
}

.menu-group.is-open .submenu {
  display: grid;
}

[data-tabs] .submenu-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(234, 255, 242, 0.72);
  font-size: 14px;
}

[data-tabs] .submenu-item span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(234, 255, 242, 0.36);
}

[data-tabs] .submenu-item b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-tabs] .submenu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-tabs] .submenu-item.is-active {
  background: #fff;
  color: var(--green-deep);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.13);
}

[data-tabs] .submenu-item.is-active span {
  background: var(--green);
}

@media (max-width: 860px) {
  .submenu {
    padding-left: 12px;
  }
}

/* Dashboard layout refinement */
.admin-workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px clamp(18px, 2vw, 28px) 56px;
}

.dashboard-hero {
  min-height: 0;
  margin-bottom: 14px;
  padding: 18px 20px;
}

.dashboard-hero h2 {
  margin: 4px 0 6px;
  font-size: 25px;
}

.dashboard-hero p {
  font-size: 14px;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 86px;
  padding: 14px 16px;
}

.metric-card strong {
  margin-top: 6px;
  font-size: 26px;
}

.dashboard-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.dashboard-grid .section-card {
  min-height: 0;
}

.dashboard-grid .section-card header {
  min-height: 54px;
  padding: 13px 16px;
}

.summary-strip {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  padding: 14px 16px;
}

.summary-strip div {
  padding: 10px 12px;
}

.compact-list {
  gap: 0;
  padding: 12px 16px;
}

.compact-list p {
  min-height: 44px;
  align-items: center;
  padding: 8px 0;
}

.compact-list .activity-line {
  grid-template-columns: 150px 112px minmax(0, 1fr);
}

.compact-list .activity-line time {
  order: 0;
}

.compact-list .activity-line b {
  order: 1;
}

.compact-list .activity-line span {
  order: 2;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-workspace {
    padding: 14px;
  }

  .metric-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .compact-list .activity-line {
    grid-template-columns: 1fr;
  }
}
