:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #15181e;
  --muted: #69707d;
  --line: #dde3ea;
  --accent: #0f7b6c;
  --accent-dark: #075d52;
  --accent-soft: #e6f5f1;
  --warm: #fff7e8;
  --coral: #f08a78;
  --danger: #b3261e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 123, 108, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 108, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
button.secondary {
  color: var(--ink);
  background: #eef2f5;
}
button.secondary:hover { background: #dde5ec; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(16, 32, 29, 0.96), rgba(15, 123, 108, 0.82)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}
.login-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.login-backdrop span {
  position: absolute;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: floatCard 5.6s ease-in-out infinite;
}
.login-backdrop span:nth-child(1) { left: 10%; top: 18%; }
.login-backdrop span:nth-child(2) { right: 12%; top: 28%; animation-delay: 0.8s; }
.login-backdrop span:nth-child(3) { right: 18%; bottom: 18%; animation-delay: 1.5s; }
.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  animation: cardIn 0.5s ease both;
}
.login-mark, .brand-mark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #20a48f, #0f7b6c);
  color: #fff;
  font-weight: 800;
}
.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.login-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 123, 108, 0.24);
}
.login-card h1 { margin: 0 0 6px; }
.login-card p { margin: 0; color: var(--muted); }
.login-note {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #37645e;
  background: var(--accent-soft);
  line-height: 1.5;
}
.login-card label { display: grid; gap: 8px; margin-bottom: 14px; color: var(--muted); }
.login-card input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 123, 108, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 123, 108, 0.12);
}
.login-card button {
  width: 100%;
  margin-top: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 123, 108, 0.24);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  transition: grid-template-columns 0.22s ease;
}
.shell.sidebar-collapsed {
  grid-template-columns: 84px 1fr;
}
.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  background: #101820;
  color: #eef5f3;
  position: sticky;
  top: 0;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-mark { width: 42px; height: 42px; }
.brand strong, .brand small { display: block; }
.brand small { color: #a7b3bc; margin-top: 4px; }
.brand-text {
  min-width: 0;
  white-space: nowrap;
}
.collapse-btn {
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border-radius: 10px;
  color: #d9e2e8;
  background: #22303b;
}
.nav-groups {
  display: grid;
  gap: 8px;
}
.nav-section {
  display: grid;
  gap: 4px;
}
.nav-subsection {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.nav-toggle,
.nav {
  width: 100%;
  min-height: 42px;
  color: #d9e2e8;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.nav-toggle {
  justify-content: space-between;
  padding: 9px 10px;
  font-weight: 800;
}
.nav-toggle:hover,
.nav-toggle:focus-visible,
.nav:hover,
.nav.active {
  background: #22303b;
}
.nav-toggle-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-caret {
  color: #7f909d;
  transition: transform 0.18s ease;
}
.nav-section.open > .nav-toggle .nav-caret {
  transform: rotate(180deg);
}
.nav-children {
  display: none;
  gap: 4px;
}
.nav-section.open > .nav-children {
  display: grid;
}
.nav {
  padding-left: 18px;
}
.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  color: #8fe2d3;
  background: rgba(143, 226, 211, 0.12);
  font-family: "Segoe UI Symbol", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.nav-dot,
.nav-leaf {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(143, 226, 211, 0.42);
}
.nav-dot {
  width: 7px;
  height: 7px;
  margin-left: 9px;
}
.nav-leaf {
  width: 5px;
  height: 5px;
  margin-left: 22px;
}
.nav-depth-3 {
  min-height: 34px;
  color: #b9c9d2;
  font-size: 14px;
}
.nav-depth-3.active {
  color: #eef5f3;
}
.nav-text {
  min-width: 0;
  white-space: nowrap;
}
.sidebar.collapsed {
  padding-inline: 14px;
}
.sidebar.collapsed .brand {
  justify-content: center;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-caret,
.sidebar.collapsed .nav-dot,
.sidebar.collapsed .nav-leaf,
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar.collapsed .collapse-btn {
  position: absolute;
  right: 8px;
  top: 78px;
}
.sidebar.collapsed .nav-toggle,
.sidebar.collapsed .nav {
  justify-content: center;
  padding-inline: 8px;
}
.sidebar.collapsed .nav-subsection {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.app { min-width: 0; padding: 28px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-right: 260px;
}
.topbar h1 { margin: 0 0 6px; font-size: 28px; }
.topbar p, .hint { margin: 0; color: var(--muted); }
.topbar-actions {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.admin-pill {
  min-height: 46px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 34px rgba(25, 34, 45, 0.12);
}
.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), #f1b84b);
  font-weight: 900;
}
.admin-pill strong,
.admin-pill small {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
}
.admin-pill small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.logout-link {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.logout-link:hover {
  color: #fff;
  background: var(--accent);
}
.view { display: none; }
.view.active {
  display: block;
  animation: fadeUp 0.28s ease both;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(15, 123, 108, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f1fbf7 64%, #fff7e8 100%);
  box-shadow: 0 14px 36px rgba(25, 34, 45, 0.06);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 180px;
  height: 180px;
  background:
    linear-gradient(90deg, rgba(15, 123, 108, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 108, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  transform: rotate(10deg);
}
.dashboard-hero h2 {
  margin: 8px 0 8px;
  font-size: 24px;
}
.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.hero-kicker {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}
.hero-chips {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hero-chips span {
  padding: 9px 12px;
  border-radius: 12px;
  color: #37645e;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 123, 108, 0.12);
  box-shadow: 0 10px 24px rgba(25, 34, 45, 0.05);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.metric-grid.compact { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(25, 34, 45, 0.05);
}
.metric {
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(25, 34, 45, 0.08);
}
.metric span { display: block; color: var(--muted); margin-bottom: 10px; }
.metric strong {
  font-size: 30px;
  color: var(--accent-dark);
}
.content-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}
.panel { padding: 18px; min-width: 0; margin-bottom: 16px; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; }
.actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e6edf2;
  border-radius: 12px;
  background: #fbfcfd;
}

.filter-bar input,
.filter-bar select {
  min-width: 0;
}

.filter-bar button {
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pager button {
  padding: 7px 10px;
  color: var(--ink);
  background: #eef2f5;
}

.pager button:hover,
.pager button.active {
  color: #fff;
  background: var(--accent);
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.pager .pager-info {
  margin-right: 6px;
}

.compact-pager {
  justify-content: space-between;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  padding: 28px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  background: rgba(16, 24, 32, 0.48);
  backdrop-filter: blur(6px);
  animation: modalFade 0.18s ease both;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 28px 90px rgba(15, 24, 34, 0.24);
  overflow: hidden;
  animation: modalIn 0.22s ease both;
}

.modal-card-large {
  width: min(1120px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(12px);
}

.modal-head h2 {
  margin: 0 0 5px;
  font-size: 19px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-body {
  max-height: calc(min(88vh, 920px) - 78px);
  overflow: auto;
  padding: 18px 20px 22px;
}

.modal-actions {
  justify-content: flex-end;
  padding-top: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--ink);
  background: #eef2f5;
  font-size: 22px;
  line-height: 34px;
}

.icon-btn:hover {
  color: #fff;
  background: var(--accent);
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 180px;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}
.bar { flex: 1; min-width: 14px; max-width: 44px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; }
.bar i { display: block; width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bar i {
  background: linear-gradient(180deg, #32bda6, var(--accent));
  animation: growBar 0.42s ease both;
}
.bar small { color: var(--muted); font-size: 11px; white-space: nowrap; }

.list { display: grid; gap: 10px; }
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #edf4f2;
  color: var(--accent-dark);
}
.status.draft { background: #fff2df; color: #a45c00; }
.status.archived, .status.disabled { background: #f2f3f5; color: #606774; }
.row-actions button { padding: 7px 10px; color: var(--ink); background: #eef2f5; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span { padding: 8px 10px; border-radius: 8px; color: #0e4f48; background: #e3f4ef; }

.permission-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}
.permission-box h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.permission-item input {
  width: auto;
  margin: 0;
}
.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.permission-tags span {
  padding: 4px 7px;
  border-radius: 6px;
  color: #245a50;
  background: #e7f4f0;
  font-size: 12px;
}
td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.editor-panel textarea {
  width: 100%;
  min-height: 520px;
  margin-top: 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}
.editor-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
}
.editor-tab {
  color: var(--ink);
  background: #eef2f5;
}
.editor-tab.active {
  color: #fff;
  background: var(--accent);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}
.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  color: var(--ink);
}
.span-2 { grid-column: 1 / -1; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.drama-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(15, 123, 108, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, #f6fbfa 0%, #f9fbfb 100%);
}
.drama-project-card h3 {
  margin: 8px 0 8px;
  font-size: 24px;
}
.drama-project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.drama-status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #0e5f54;
  background: #dff5ef;
  font-size: 12px;
  font-weight: 800;
}
.drama-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.drama-tags span {
  padding: 7px 9px;
  border-radius: 8px;
  color: #254b45;
  background: #e8f1ef;
  font-size: 13px;
  font-weight: 700;
}
.drama-meta {
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}
.drama-meta strong {
  display: block;
  margin-bottom: 8px;
}
.module-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}
.module-card span {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #47615c;
  background: #e8f1ef;
  font-size: 12px;
  font-weight: 800;
}
.module-card.active span {
  color: #0e5f54;
  background: #dff5ef;
}
.module-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}
.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}
.section-head h3 { margin: 0; font-size: 16px; }
.builder-list {
  display: grid;
  gap: 12px;
}
.builder-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}
.builder-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.builder-card h4 { margin: 0; }
.option-row, .rule-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}
.rule-grid {
  grid-template-columns: 90px 90px 1fr 120px auto;
}
.json-field {
  font-family: Consolas, "Courier New", monospace;
}
.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
}
.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}
.admin-form {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.modal-card.admin-form {
  margin-bottom: 0;
  padding: 0;
  border-radius: 18px;
  background: #fffdf9;
}
.role-help {
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  color: #38514d;
  background: #e8f4f1;
}
.table-title {
  max-width: 360px;
  white-space: normal;
  line-height: 1.4;
}
.table-tags {
  max-width: 520px;
  white-space: normal;
  line-height: 1.45;
}
.settings-list { display: grid; gap: 12px; }
.settings-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.settings-row span { color: var(--muted); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1d2630;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes growBar {
  from { transform: scaleY(0.35); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .shell,
  .shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    min-height: auto;
    position: static;
  }
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .nav-caret,
  .sidebar.collapsed .nav-dot,
  .sidebar.collapsed .nav-leaf,
  .sidebar.collapsed .nav-text {
    display: inline-flex;
  }
  .sidebar.collapsed .nav-toggle,
  .sidebar.collapsed .nav {
    justify-content: flex-start;
  }
  .sidebar.collapsed .nav-subsection {
    margin-left: 12px;
    padding-left: 8px;
    border-left: 1px solid rgba(143, 226, 211, 0.14);
  }
  .sidebar.collapsed .collapse-btn {
    position: static;
  }
  .topbar,
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar {
    padding-right: 0;
    padding-top: 56px;
  }
  .topbar-actions {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    justify-content: flex-end;
  }
  .metric-grid, .metric-grid.compact, .content-grid, .form-grid, .option-row, .rule-grid { grid-template-columns: 1fr; }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .panel.wide { grid-column: auto; }
  .modal {
    padding: 12px;
    place-items: center;
    align-items: center;
    justify-items: center;
  }
  .modal-card,
  .modal-card-large {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px;
  }
  .modal-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .modal-head .actions {
    width: 100%;
  }
  .modal-head .actions button:not(.icon-btn) {
    flex: 1;
  }
  .modal-head .icon-btn {
    position: absolute;
    right: 14px;
    top: 14px;
  }
}
