:root {
  --bg: #f3f6fc;
  --panel: #ffffff;
  --panel-2: #f8faff;
  --surface: #ffffff;
  --surface-2: #f6f9ff;
  --text: #172036;
  --muted: #5f6f8a;
  --line: #d8e2f0;
  --line-2: #e6edf7;
  --line-soft: #dbe3ef;
  --primary: #1f5cc7;
  --accent: #1f5cc7;
  --accent-2: #17499f;
  --ok: #157347;
  --danger: #b42318;
  /* Базовая (светлая) палитра для левого сайдбара */
  --side-bg: #f4f7fd;
  --side-bg-2: #edf2fa;
  --side-text: #183153;
  --side-muted: #637a9f;
  --shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
}

body[data-theme="dark"] {
  --bg: #0c1424;
  --panel: #121d30;
  --panel-2: #0f192b;
  --surface: #121d30;
  --surface-2: #162338;
  --text: #e6edff;
  --muted: #99acd0;
  --line: #24314a;
  --line-2: #1d273c;
  --line-soft: #27334d;
  --primary: #7aa2ff;
  --accent: #7aa2ff;
  --accent-2: #5f88e8;
  --ok: #57c892;
  --danger: #f19a94;
  --side-bg: #081325;
  --side-bg-2: #060f20;
  --side-text: #dce6ff;
  --side-muted: #8ca0c6;
  --shadow: 0 18px 28px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app-sidebar {
  background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  color: var(--side-text);
  border-right: 1px solid rgba(255, 255, 255, .08);
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

body[data-theme="light"] .app-sidebar {
  border-right-color: rgba(190, 206, 231, 0.88);
}

body[data-theme="light"] .brand-block {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.72);
}

.brand-block {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,.05);
}

.brand-mark,
.topbar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
}

.brand-mark {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 188px;
  margin: 0 auto 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(255,255,255,.04);
}

.topbar-mark {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  flex: 0 0 auto;
}

.brand-mark img,
.topbar-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark__dark,
.topbar-mark__dark {
  display: block;
}

.brand-mark__light,
.topbar-mark__light {
  display: none;
}

body[data-theme="dark"] .brand-mark__dark,
body[data-theme="dark"] .topbar-mark__dark {
  display: block;
}

body[data-theme="dark"] .brand-mark__light,
body[data-theme="dark"] .topbar-mark__light {
  display: none;
}
.brand-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--side-text);
}
.brand-block h2 { margin: 8px 0 4px; color: var(--side-text); font-size: 18px; }
.brand-block .muted { color: var(--side-muted); }

.side-nav { display: grid; gap: 8px; margin-top: 12px; }
.side-link {
  display: block;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--side-text);
  background: rgba(255,255,255,.05);
  font-weight: 600;
}

body[data-theme="light"] .side-link {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.78);
}

body[data-theme="light"] .side-link:hover {
  text-decoration: none;
  border-color: rgba(86, 127, 214, 0.68);
  background: linear-gradient(180deg, rgba(243,247,255,0.98), rgba(233,240,255,0.94));
}

body[data-theme="light"] .side-link.is-active {
  color: #fff;
  border-color: rgba(31, 88, 202, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.20), rgba(255,153,77,0) 40%),
    linear-gradient(135deg, #2d6ee5, #1d57bd);
  box-shadow: 0 14px 26px rgba(42, 92, 182, 0.20);
}

.side-link:hover {
  text-decoration: none;
  border-color: rgba(162,188,255,.55);
  background: rgba(108,142,239,.25);
}
.side-link.is-active {
  border-color: rgba(108,142,239,.72);
  background: linear-gradient(135deg, rgba(55,110,235,.44), rgba(29,78,216,.26));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-nav { display: none; border-top: 1px solid var(--line-2); }
.app-work .topbar-nav { display: flex; }

.menu-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.menu-inline-form {
  display: inline-flex;
  margin: 0;
}
.menu-inline a,
.btn-linklike,
.btn-ghost {
  display: inline-block;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}
.btn-linklike {
  cursor: pointer;
  font: inherit;
}
.btn-ghost { cursor: pointer; }
.menu-inline a:hover,
.btn-linklike:hover,
.btn-ghost:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.menu-inline a.is-active {
  border-color: var(--accent);
  background: rgba(102, 146, 255, 0.18);
  color: #fff;
}

.app-admin {
  background:
    radial-gradient(circle at top left, rgba(40, 90, 210, 0.20), transparent 26%),
    radial-gradient(circle at top right, rgba(12, 112, 255, 0.16), transparent 22%),
    linear-gradient(180deg, #07101d 0%, #091426 100%);
}

.app-admin .app-main {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(28, 83, 196, 0.20), transparent 18%),
    radial-gradient(circle at 85% 0%, rgba(16, 115, 229, 0.16), transparent 18%);
}

.app-admin .app-sidebar {
  background:
    linear-gradient(180deg, rgba(5, 16, 34, 0.98), rgba(5, 14, 29, 0.98)),
    linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  border-right: 1px solid rgba(97, 130, 196, .18);
}

.app-admin .page {
  max-width: 100%;
  margin: 0;
  padding: 24px 24px 28px;
}

body[data-theme="light"].app-admin {
  background:
    radial-gradient(circle at top left, rgba(72, 127, 245, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(24, 151, 255, 0.10), transparent 24%),
    linear-gradient(180deg, #eef5ff 0%, #f7faff 100%);
}

body[data-theme="light"].app-admin .app-main {
  background:
    radial-gradient(circle at 20% 10%, rgba(82, 128, 233, 0.10), transparent 18%),
    radial-gradient(circle at 85% 0%, rgba(38, 145, 228, 0.08), transparent 18%);
}

body[data-theme="light"].app-admin .app-sidebar {
  background:
    linear-gradient(180deg, #f4f8ff, #eaf1fb),
    linear-gradient(180deg, #f4f8ff, #eaf1fb);
  color: #183153;
  border-right-color: rgba(210, 223, 241, 0.96);
}

body[data-theme="light"].app-admin .topbar {
  background: rgba(255, 255, 255, 0.84);
  border-bottom-color: rgba(210, 223, 241, 0.96);
  backdrop-filter: blur(12px);
}

body[data-theme="light"].app-admin .menu-inline a,
body[data-theme="light"].app-admin .btn-ghost,
body[data-theme="light"].app-admin .topbar-user {
  background: rgba(246, 249, 255, 0.98);
  border-color: rgba(206, 220, 240, 0.98);
  color: #183153;
}

body[data-theme="light"].app-admin .menu-inline a:hover,
body[data-theme="light"].app-admin .btn-ghost:hover {
  border-color: rgba(79, 124, 215, 0.72);
  background: rgba(231, 239, 255, 0.98);
}

.brand-block--admin {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}

.brand-block--admin h2 {
  color: #f4f7ff;
}

body[data-theme="light"].app-admin .brand-block--admin {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,248,255,.96));
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"] .brand-mark,
body[data-theme="light"] .topbar-mark {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.9);
}

body[data-theme="light"] .brand-mark__dark,
body[data-theme="light"] .topbar-mark__dark {
  display: none;
}

body[data-theme="light"] .brand-mark__light,
body[data-theme="light"] .topbar-mark__light {
  display: block;
}

body[data-theme="light"].app-admin .brand-kicker {
  color: #4f6487;
}

body[data-theme="light"].app-admin .brand-block h2,
body[data-theme="light"].app-admin .brand-block--admin h2 {
  color: #183153;
}

body[data-theme="light"].app-admin .brand-block .muted,
body[data-theme="light"].app-admin .app-sidebar .muted {
  color: #637a9f;
}

.side-nav--admin {
  margin-top: 16px;
}

.side-link--module {
  color: var(--side-muted);
}

body[data-theme="light"].app-admin .side-link,
body[data-theme="light"].app-admin .side-link--module {
  color: #183153;
  background: rgba(255,255,255,.78);
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"].app-admin .side-link:hover,
body[data-theme="light"].app-admin .side-link--module:hover {
  border-color: rgba(95, 132, 210, 0.62);
  background: rgba(234, 241, 255, 0.98);
}

body[data-theme="light"].app-admin .side-link.is-active {
  color: #ffffff;
  border-color: rgba(56, 103, 219, 0.92);
  background: linear-gradient(135deg, #3a73de, #255fc9);
  box-shadow: 0 12px 24px rgba(56, 103, 219, 0.20);
}

.sidebar-meta {
  margin-top: 18px;
}

.sidebar-meta strong {
  display: block;
  margin-top: 4px;
}

.card-surface {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.04);
  color: var(--side-text);
}

.card-surface .muted {
  color: var(--side-muted);
}

body[data-theme="light"] .card-surface {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.86);
  color: var(--side-text);
}

body[data-theme="light"].app-admin .card-surface {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.86);
  color: #183153;
}

.topbar-inner--admin {
  max-width: 100%;
  padding: 14px 24px;
  gap: 16px;
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.admin-search {
  position: relative;
  width: min(100%, 420px);
}

.topbar-search {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(76, 104, 158, .36);
  border-radius: 14px;
  background: rgba(10, 18, 34, .82);
}

.topbar-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 0;
  color: #edf4ff;
}

.topbar-search input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.topbar-search input:focus {
  outline: none;
}

.topbar-search-icon {
  color: #9fb5de;
  font-size: 14px;
}

.admin-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(78, 97, 137, .36);
  border-radius: 16px;
  background: rgba(10, 18, 34, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .26);
}

.admin-search-results[hidden],
.admin-search-empty[hidden] {
  display: none !important;
}

.admin-search-item,
.admin-search-empty {
  display: block;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.admin-search-item:hover,
.admin-search-item.is-active {
  text-decoration: none;
  border-color: rgba(108,142,239,.55);
  background: rgba(108,142,239,.16);
}

.admin-search-empty {
  color: var(--muted);
}

body[data-theme="light"].app-admin .topbar-search {
  border-color: rgba(170, 187, 220, 0.86);
  background: rgba(255, 255, 255, 0.92);
}

body[data-theme="light"].app-admin .topbar-search input {
  color: var(--text);
}

body[data-theme="light"].app-admin .topbar-search-icon {
  color: #6d7f9e;
}

body[data-theme="light"].app-admin .admin-search-results {
  border-color: rgba(209, 221, 239, 0.96);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 30px rgba(36, 58, 99, 0.12);
}

body[data-theme="light"].app-admin .admin-search-item,
body[data-theme="light"].app-admin .admin-search-empty {
  background: rgba(244, 247, 255, 0.96);
}

body[data-theme="light"].app-admin .admin-search-item strong {
  color: #163255;
}

.menu-inline--admin {
  flex-wrap: nowrap;
}

.menu-inline--work {
  flex-wrap: nowrap;
  margin-left: auto;
}

.menu-inline-form--locale select {
  min-height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 34px 0 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.menu-inline-form--locale select:focus {
  outline: none;
  border-color: var(--accent);
}

.menu-inline-form--locale select option {
  color: #1a3150;
  background: #ffffff;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 600;
}

.page {
  max-width: 1680px;
  width: 100%;
  margin: 16px auto;
  padding: 0 16px 20px;
  min-width: 0;
  overflow-x: hidden;
}

.public-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 147, 41, 0.24), transparent 18%),
    radial-gradient(circle at 80% 15%, rgba(90, 154, 255, 0.18), transparent 20%),
    linear-gradient(180deg, #08111f 0%, #0c1628 100%);
}

.topbar--public {
  background: rgba(8, 16, 30, 0.78);
  backdrop-filter: blur(16px);
}

.topbar-inner--public {
  max-width: 1540px;
  padding: 14px 20px;
}

.public-brandbar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.public-brandbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(255,255,255,.04);
  overflow: hidden;
  flex: 0 0 auto;
}

.public-brandbar__logo img,
.auth-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-brandbar__logo-light,
.auth-logo--light {
  display: none;
}

body[data-theme="dark"] .public-brandbar__logo-dark,
body[data-theme="dark"] .auth-logo--dark {
  display: block;
}

body[data-theme="dark"] .public-brandbar__logo-light,
body[data-theme="dark"] .auth-logo--light {
  display: none;
}

body[data-theme="light"] .public-brandbar__logo-dark,
body[data-theme="light"] .auth-logo--dark {
  display: none;
}

body[data-theme="light"] .public-brandbar__logo-light,
body[data-theme="light"] .auth-logo--light {
  display: block;
}

.public-brandbar__text {
  display: grid;
  gap: 4px;
}

.public-brandbar__text strong {
  font-size: 18px;
  color: #f2f7ff;
}

.menu-inline--public a {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: #e6eeff;
}

.menu-inline--public .btn-ghost {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: #e6eeff;
}

.page--public {
  max-width: 1540px;
  padding: 24px 20px 32px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 480px);
  gap: 24px;
  align-items: stretch;
  min-height: calc(100vh - 150px);
}

.auth-showcase,
.auth-panel {
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.auth-showcase {
  display: flex;
  align-items: flex-end;
  min-height: 620px;
  background:
    linear-gradient(160deg, rgba(10, 18, 34, 0.88), rgba(10, 18, 34, 0.74)),
    linear-gradient(135deg, rgba(255, 120, 24, 0.12), rgba(26, 86, 219, 0.10));
}

.auth-showcase__glow {
  position: absolute;
  filter: blur(30px);
  border-radius: 999px;
  opacity: 0.7;
}

.auth-showcase__glow--orange {
  inset: 40px auto auto 40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 120, 24, 0.42), transparent 70%);
}

.auth-showcase__glow--blue {
  inset: auto 40px 40px auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(66, 142, 255, 0.32), transparent 70%);
}

.auth-showcase__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  max-width: 720px;
  padding: 56px;
}

.auth-showcase__content h1 {
  margin: 0;
  font-size: clamp(34px, 4.1vw, 56px);
  line-height: 1.02;
  color: #f5f8ff;
}

.auth-showcase__content p {
  margin: 0;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.6;
  color: #adbfdf;
}

.auth-ai-block {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin-top: 6px;
}

.auth-ai-block strong {
  color: #f5f8ff;
  font-size: 18px;
}

.auth-ai-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-ai-list li {
  position: relative;
  padding-left: 18px;
  color: #d6e1f5;
  font-size: 16px;
  line-height: 1.55;
}

.auth-ai-list li::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8f2b, #5f88e8);
  box-shadow: 0 0 0 4px rgba(255, 143, 43, 0.12);
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(8, 16, 30, 0.92), rgba(10, 18, 34, 0.88)),
    rgba(10, 18, 34, 0.9);
}

.auth-panel__logo {
  width: 180px;
  height: 180px;
  margin: 0 auto 4px;
}

.auth-panel__head {
  display: grid;
  gap: 8px;
  text-align: center;
}

.auth-panel__head h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
  color: #f7fbff;
}

.auth-panel__head p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.auth-form {
  gap: 12px;
}

.auth-form label {
  font-size: 14px;
  font-weight: 600;
  color: #cedaf0;
}

.auth-form input {
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(148, 170, 214, 0.34);
  background: rgba(14, 24, 44, 0.92);
  color: #edf4ff;
  caret-color: #ff8f2b;
}

.auth-form input::placeholder {
  color: rgba(190, 206, 235, 0.62);
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(255, 143, 43, 0.92);
  box-shadow: 0 0 0 4px rgba(255, 143, 43, 0.14);
}

.auth-submit {
  min-height: 54px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff8f2b, #ff6f1e);
  border-color: #ff8f2b;
  color: #1f0e00;
}

body[data-theme="light"].public-shell {
  background:
    radial-gradient(circle at top left, rgba(64, 124, 255, 0.12), transparent 18%),
    radial-gradient(circle at 80% 15%, rgba(255, 139, 30, 0.10), transparent 20%),
    linear-gradient(180deg, #edf5ff 0%, #f7fbff 100%);
}

body[data-theme="light"].public-shell .topbar--public {
  background: rgba(255, 255, 255, 0.84);
}

body[data-theme="light"].public-shell .menu-inline--public a,
body[data-theme="light"].public-shell .menu-inline--public .btn-ghost {
  background: rgba(255,255,255,.88);
  border-color: rgba(206, 220, 240, 0.98);
  color: #183153;
}

body[data-theme="light"].public-shell .public-brandbar__text strong {
  color: #183153;
}

body[data-theme="light"].public-shell .public-brandbar__logo {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(255,255,255,.9);
}

body[data-theme="light"].public-shell .auth-showcase {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(243, 248, 255, 0.82)),
    linear-gradient(135deg, rgba(56, 114, 235, 0.10), rgba(255, 131, 39, 0.06));
}

body[data-theme="light"].public-shell .auth-showcase__content h1 {
  color: #163255;
}

body[data-theme="light"].public-shell .auth-showcase__content p {
  color: #506887;
}

body[data-theme="light"].public-shell .auth-ai-block strong {
  color: #163255;
}

body[data-theme="light"].public-shell .auth-ai-list li {
  color: #415e83;
}

body[data-theme="light"].public-shell .auth-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(245, 249, 255, .94));
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"].public-shell .auth-panel__head h2 {
  color: #163255;
}

body[data-theme="light"].public-shell .auth-form label,
body[data-theme="light"].public-shell .auth-panel .muted,
body[data-theme="light"].public-shell .kicker {
  color: #35506f;
}

body[data-theme="light"].public-shell .auth-form input {
  background: rgba(255,255,255,.96);
  border-color: rgba(188, 204, 228, 0.98);
  color: #163255;
  caret-color: #1f5cc7;
}

body[data-theme="light"].public-shell .auth-form input::placeholder {
  color: rgba(80, 104, 135, 0.68);
}

body[data-theme="light"].public-shell .auth-form input:focus {
  border-color: rgba(46, 108, 226, 0.86);
  box-shadow: 0 0 0 4px rgba(46, 108, 226, 0.12);
}

.flash {
  border: 1px solid;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.flash.success { border-color: #9bdcbc; background: #ecfdf3; color: var(--ok); }
.flash.error { border-color: #f3b8b4; background: #fff1f0; color: var(--danger); }

.app-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1400;
  width: min(420px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(226, 94, 82, 0.78);
  background: linear-gradient(135deg, rgba(108, 26, 22, 0.94), rgba(31, 45, 74, 0.96));
  color: #fff2f1;
  box-shadow: 0 22px 42px rgba(8, 12, 25, 0.42);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast strong,
.app-toast p {
  margin: 0;
}

.app-toast strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.app-toast--success {
  border-color: rgba(78, 178, 127, 0.78);
  background: linear-gradient(135deg, rgba(21, 95, 59, 0.94), rgba(23, 54, 86, 0.96));
  color: #edfff4;
}

.app-toast p {
  line-height: 1.45;
}

.ui-pref-backdrop[hidden] {
  display: none !important;
}

.ui-pref-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 12, 24, 0.62);
  backdrop-filter: blur(12px);
}

.ui-pref-dialog {
  width: min(560px, 100%);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(9, 17, 32, 0.98), rgba(12, 22, 40, 0.96));
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.34);
  padding: 28px;
}

.ui-pref-head {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.ui-pref-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  color: #f5f8ff;
}

.ui-pref-head p {
  margin: 0;
}

.ui-pref-form {
  display: grid;
  gap: 18px;
}

.ui-pref-section {
  display: grid;
  gap: 10px;
}

.ui-pref-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #cedaf0;
}

.ui-pref-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ui-pref-options--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-pref-option {
  position: relative;
  display: block;
}

.ui-pref-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.ui-pref-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid rgba(142, 164, 206, 0.30);
  border-radius: 14px;
  background: rgba(18, 28, 49, 0.92);
  color: #e9f0ff;
  font-weight: 600;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ui-pref-option input:checked + span {
  border-color: rgba(255, 143, 43, 0.92);
  background: linear-gradient(135deg, rgba(255, 143, 43, 0.20), rgba(33, 73, 146, 0.28));
  box-shadow: 0 10px 24px rgba(255, 143, 43, 0.14);
  transform: translateY(-1px);
}

.ui-pref-submit {
  width: 100%;
}

body[data-theme="light"] .ui-pref-dialog {
  border-color: rgba(206, 220, 240, 0.98);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,249,255,.96));
  box-shadow: 0 22px 44px rgba(36, 58, 99, 0.18);
}

body[data-theme="light"] .ui-pref-head h2 {
  color: #163255;
}

body[data-theme="light"] .ui-pref-label,
body[data-theme="light"] .ui-pref-head .muted,
body[data-theme="light"] .ui-pref-head .kicker {
  color: #4d678a;
}

body[data-theme="light"] .ui-pref-option span {
  border-color: rgba(188, 204, 228, 0.98);
  background: rgba(255,255,255,.98);
  color: #163255;
}

body[data-theme="light"] .ui-pref-option input:checked + span {
  border-color: rgba(46, 108, 226, 0.86);
  background: linear-gradient(135deg, rgba(46, 108, 226, 0.12), rgba(255, 143, 43, 0.12));
  box-shadow: 0 10px 24px rgba(46, 108, 226, 0.12);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.card.narrow { max-width: 560px; }
.auth-card { margin: 7vh auto 0; }

.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compact-grid { display: grid; grid-template-columns: minmax(240px,1fr) auto; gap: 12px; align-items: end; }
.widgets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.stat-tile {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

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

.stat-tile strong {
  font-size: 34px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.link-tile:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.hero {
  display: grid;
  gap: 16px;
}

.form-grid { display: grid; gap: 10px; }
input, select, textarea, button {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
input::placeholder,
textarea::placeholder { color: var(--muted); }
button {
  cursor: pointer;
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
button.danger {
  border-color: #912a21;
  background: linear-gradient(135deg, #b42318, #912a21);
}

.btn-primary,
.btn-muted,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
}

.btn-muted {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #b42318, #912a21);
  border-color: #912a21;
}

.btn-primary:hover,
.btn-muted:hover,
.btn-danger:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.btn-primary[disabled],
.btn-muted[disabled],
.btn-danger[disabled],
.btn-primary.is-disabled,
.btn-muted.is-disabled,
.btn-danger.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

body[data-theme="dark"] .btn-primary {
  color: #081325;
  background: linear-gradient(135deg, #8fb2ff, #6f97f0);
  border-color: #8fb2ff;
}

body[data-theme="dark"] .btn-muted {
  color: var(--text);
  background: #1a2740;
  border-color: #334155;
}

body[data-theme="dark"] .btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #d2564e, #a33129);
  border-color: #d2564e;
}

.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input[type="password"] { min-width: 170px; }

.table-wrap,
.table-responsive { overflow: auto; }
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  border: 1px solid var(--line-2);
  padding: 9px;
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--panel-2);
  color: var(--text);
}

.badge,
.muted-badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: var(--panel-2);
}
.badge.ok { border-color: #9bdcbc; background: #ecfdf3; color: var(--ok); }
.muted-badge { color: var(--muted); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.section-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.role-list { display: grid; gap: 8px; }
.role-item {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.module-title {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.perm-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  padding: 8px;
}

.perm-module {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}

.perm-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line-2);
  list-style: none;
}

.perm-module-head::-webkit-details-marker {
  display: none;
}

.perm-module-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.perm-module-title::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transform: translateY(-1px);
}

.perm-module[open] .perm-module-title::before {
  content: "▾";
}

.perm-module-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.perm-module-body {
  padding: 10px 12px 12px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-hero h1 {
  margin: 4px 0 8px;
  font-size: 42px;
  line-height: 1.05;
}

.admin-hero .muted {
  max-width: 860px;
}

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

.stats-grid--admin {
  margin-bottom: 16px;
}

.stat-tile--accent {
  background:
    radial-gradient(circle at top left, rgba(66, 142, 255, 0.22), transparent 40%),
    var(--panel);
}

.stat-tile--success {
  background:
    radial-gradient(circle at top left, rgba(40, 179, 104, 0.24), transparent 42%),
    var(--panel);
}

.stat-tile--violet {
  background:
    radial-gradient(circle at top left, rgba(154, 93, 255, 0.20), transparent 42%),
    var(--panel);
}

.stat-tile--neutral {
  background:
    radial-gradient(circle at top left, rgba(120, 145, 190, 0.16), transparent 42%),
    var(--panel);
}

body[data-theme="light"].app-admin .stat-tile {
  border-color: rgba(209, 221, 239, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(37, 64, 111, 0.08);
}

body[data-theme="light"].app-admin .stat-tile--accent {
  background:
    radial-gradient(circle at top left, rgba(63, 125, 255, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.95);
}

body[data-theme="light"].app-admin .stat-tile--success {
  background:
    radial-gradient(circle at top left, rgba(36, 169, 104, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.95);
}

body[data-theme="light"].app-admin .stat-tile--violet {
  background:
    radial-gradient(circle at top left, rgba(131, 84, 214, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.95);
}

body[data-theme="light"].app-admin .stat-tile--neutral {
  background:
    radial-gradient(circle at top left, rgba(122, 142, 184, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.95);
}

body[data-theme="light"].app-admin .stat-tile strong,
body[data-theme="light"].app-admin .admin-hero h1,
body[data-theme="light"].app-admin h2,
body[data-theme="light"].app-admin h3 {
  color: #183153;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.admin-workspace--single {
  grid-template-columns: minmax(0, 1fr);
}

.card--admin-main,
.card--admin-side {
  border-color: rgba(78, 97, 137, .36);
  background: rgba(10, 18, 34, 0.88);
  backdrop-filter: blur(12px);
}

body[data-theme="light"].app-admin .card--admin-main,
body[data-theme="light"].app-admin .card--admin-side {
  border-color: rgba(209, 221, 239, 0.96);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(37, 64, 111, 0.10);
}

.app-admin .card,
.app-admin .flash,
.app-admin input,
.app-admin select,
.app-admin textarea {
  border-color: rgba(78, 97, 137, .36);
}

.app-admin input,
.app-admin select,
.app-admin textarea {
  background: rgba(14, 24, 44, 0.88);
}

body[data-theme="light"].app-admin .card,
body[data-theme="light"].app-admin .flash,
body[data-theme="light"].app-admin input,
body[data-theme="light"].app-admin select,
body[data-theme="light"].app-admin textarea {
  border-color: rgba(210, 221, 239, 0.92);
}

body[data-theme="light"].app-admin input,
body[data-theme="light"].app-admin select,
body[data-theme="light"].app-admin textarea {
  background: rgba(255, 255, 255, 0.95);
}

body[data-theme="light"].app-admin .btn-primary {
  border-color: #2b69da;
  background: linear-gradient(135deg, #2f76f2, #205fcc);
  box-shadow: 0 10px 20px rgba(43, 105, 218, 0.20);
}

body[data-theme="light"].app-admin .btn-muted {
  color: #183153;
  background: rgba(244, 247, 255, 0.98);
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"].app-admin .btn-muted:hover {
  background: rgba(233, 240, 255, 0.98);
  border-color: rgba(95, 132, 210, 0.62);
}

.app-admin .flash.success {
  background: rgba(20, 65, 44, 0.35);
}

.app-admin .flash.error {
  background: rgba(83, 28, 28, 0.30);
}

.admin-side-column {
  display: grid;
  gap: 16px;
}

.section-head--stack {
  align-items: stretch;
}

.users-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field-shell {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  background: var(--panel-2);
  overflow: hidden;
}

.field-shell--compact {
  min-width: 0;
  width: 100%;
}

.field-shell input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding-inline: 0;
}

.field-shell input:focus {
  outline: none;
}

.field-shell-icon {
  color: var(--muted);
}

.table-wrap--admin {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 12, 24, 0.36);
}

body[data-theme="light"].app-admin .table-wrap--admin {
  background: rgba(248, 251, 255, 0.96);
}

.admin-table th,
.admin-table td {
  border-width: 0 0 1px;
  border-color: rgba(78, 97, 137, .30);
  padding: 14px 12px;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(14, 24, 44, 0.95);
}

body[data-theme="light"].app-admin .admin-table th,
body[data-theme="light"].app-admin .admin-table td {
  border-color: rgba(221, 230, 242, 0.92);
}

body[data-theme="light"].app-admin .admin-table thead th {
  background: rgba(241, 246, 255, 0.98);
}

body[data-theme="light"].app-admin .admin-table tbody tr:hover td {
  background: rgba(244, 248, 255, 0.90);
}

.table-id {
  color: var(--muted);
  font-weight: 600;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3f7dff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.badge--role {
  background: rgba(55, 104, 235, 0.18);
  border-color: rgba(95, 138, 255, 0.38);
  color: #cfe1ff;
}

body[data-theme="light"].app-admin .badge--role {
  color: #1f4fb1;
  background: rgba(61, 113, 235, 0.10);
  border-color: rgba(122, 155, 232, 0.46);
}

body[data-theme="light"].app-admin .badge,
body[data-theme="light"].app-admin .muted-badge {
  background: rgba(244, 247, 255, 0.96);
  border-color: rgba(206, 220, 240, 0.98);
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-row--users {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
}

.inline-icon-form {
  display: inline-flex;
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(78, 97, 137, .52);
  background: rgba(18, 30, 55, 0.92);
  color: #e7eefb;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.btn-icon:hover {
  transform: translateY(-1px);
}

.admin-table__actions {
  width: 210px;
}

.badge--user-enabled {
  color: #bdf0ca;
  border-color: rgba(72, 184, 116, 0.58);
  background: rgba(21, 64, 40, 0.30);
}

.badge--user-disabled {
  color: #ffd0c4;
  border-color: rgba(214, 98, 82, 0.56);
  background: rgba(72, 27, 27, 0.28);
}

.btn-icon--violet {
  border-color: rgba(140, 119, 255, 0.56);
  color: #d9d1ff;
}

.btn-icon--violet.is-active {
  background: rgba(94, 74, 185, 0.34);
}

.btn-icon--success {
  border-color: rgba(72, 184, 116, 0.58);
  color: #bdf0ca;
}

.btn-icon--warn {
  border-color: rgba(228, 178, 76, 0.58);
  color: #ffe09a;
}

.btn-icon--accent {
  border-color: rgba(89, 138, 255, 0.56);
  color: #d4e2ff;
}

.inline-action-details {
  position: relative;
}

.inline-action-details--icon[open] {
  position: relative;
  overflow: visible;
}

.inline-action-details summary {
  list-style: none;
  cursor: pointer;
}

.inline-action-details summary::-webkit-details-marker {
  display: none;
}

.inline-action-details[open] {
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-theme="light"].app-admin .inline-action-details[open] {
  background: transparent;
}

.inline-form--reset {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 15;
  min-width: 240px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 18, 34, 0.96);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.inline-form--reset strong {
  font-size: 13px;
  line-height: 1.2;
}

.inline-form--reset button {
  width: 100%;
}

body[data-theme="light"].app-admin .inline-form--reset {
  background: rgba(255, 255, 255, 0.98);
}

.form-grid--dense {
  gap: 8px;
}

.admin-form-section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.52);
}

.admin-form-section__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-perm-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.46);
  overflow: hidden;
}

.admin-perm-section__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  background: rgba(14, 24, 44, 0.72);
}

.admin-perm-section__summary::-webkit-details-marker {
  display: none;
}

.admin-perm-section .table-wrap {
  margin: 0 14px 14px;
}

body[data-theme="light"].app-admin .admin-form-section,
body[data-theme="light"].app-admin .admin-perm-section {
  background: rgba(247, 250, 255, 0.96);
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"].app-admin .admin-perm-section__summary {
  background: rgba(243, 247, 255, 0.98);
}

.perm-scroll {
  max-height: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 15, 29, 0.62);
}

body[data-theme="light"].app-admin .perm-scroll {
  background: rgba(247, 250, 255, 0.96);
}

body[data-theme="light"].app-admin .perm-module,
body[data-theme="light"].app-admin .perm-item,
body[data-theme="light"].app-admin .role-item,
body[data-theme="light"].app-admin .field-shell {
  border-color: rgba(206, 220, 240, 0.98);
  background: rgba(247, 250, 255, 0.98);
}

body[data-theme="light"].app-admin .perm-module-head {
  background: rgba(255, 255, 255, 0.98);
}

.perm-scroll--compact {
  max-height: 180px;
}

.user-override-card {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 34, 0.60);
  overflow: hidden;
}

body[data-theme="light"].app-admin .user-override-card {
  background: rgba(255, 255, 255, 0.94);
}

.user-override-summary {
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  background: rgba(14, 24, 44, 0.80);
}

body[data-theme="light"].app-admin .user-override-summary {
  background: rgba(243, 247, 255, 0.98);
}

.user-override-summary::-webkit-details-marker {
  display: none;
}

.user-override-form {
  padding: 16px;
}

.user-access-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 16, 31, 0.58);
}

.user-access-summary__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.user-access-summary__head > div {
  display: grid;
  gap: 4px;
}

.user-access-summary__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-access-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.user-access-chip--success {
  color: #bdf0ca;
  border-color: rgba(72, 184, 116, 0.58);
  background: rgba(21, 64, 40, 0.34);
}

.user-access-chip--warn {
  color: #ffe09a;
  border-color: rgba(228, 178, 76, 0.58);
  background: rgba(78, 58, 17, 0.34);
}

.user-access-role-base {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 18, 34, 0.52);
}

.user-access-toolbar {
  display: grid;
  gap: 10px;
}

.user-access-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-access-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 30, 55, 0.88);
  color: #dce7fb;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.user-access-tab:hover {
  transform: translateY(-1px);
}

.user-access-tab.is-active {
  border-color: rgba(95, 138, 255, 0.58);
  background: rgba(45, 79, 170, 0.36);
}

.user-access-pane {
  display: none;
  gap: 8px;
}

.user-access-pane.is-active {
  display: grid;
}

.user-access-save {
  width: 100%;
}

body[data-theme="light"].app-admin .user-access-role-base {
  background: rgba(247, 250, 255, 0.98);
  border-color: rgba(206, 220, 240, 0.98);
}

body[data-theme="light"].app-admin .user-access-tab {
  background: rgba(247, 250, 255, 0.98);
  border-color: rgba(206, 220, 240, 0.98);
  color: #183153;
}

body[data-theme="light"].app-admin .user-access-tab.is-active {
  background: rgba(231, 239, 255, 0.98);
  border-color: rgba(95, 132, 210, 0.62);
}

.role-list--compact {
  gap: 10px;
}

.role-item--link {
  text-decoration: none;
  color: inherit;
}

.role-item--link.is-active {
  border-color: rgba(95, 138, 255, 0.58);
  background: rgba(33, 58, 120, 0.26);
}

.admin-inline-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 16, 31, 0.46);
}

.admin-inline-form--stretch {
  min-width: 0;
}

.admin-inline-form--danger p {
  margin: 0;
}

.access-role-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 16, 31, 0.46);
}

.access-role-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.access-role-summary__head h2 {
  margin: 0 0 6px;
}

.access-role-summary__head p {
  margin: 0;
}

.access-role-summary__meta {
  display: inline-flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.access-role-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(14, 24, 44, 0.72);
}

.access-role-meta span {
  color: var(--muted);
  font-size: 13px;
}

.access-role-meta strong {
  font-size: 18px;
  line-height: 1;
}

.access-role-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}

.role-item__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body[data-theme="light"].app-admin .role-item--link.is-active,
body[data-theme="light"].app-admin .admin-inline-form {
  background: rgba(247, 250, 255, 0.98);
  border-color: rgba(95, 132, 210, 0.48);
}

body[data-theme="light"].app-admin .access-role-summary {
  background: rgba(247, 250, 255, 0.98);
  border-color: rgba(95, 132, 210, 0.32);
}

body[data-theme="light"].app-admin .access-role-meta {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(206, 220, 240, 0.98);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.module-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(14, 24, 44, 0.78);
}

.module-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.module-actions form {
  margin: 0;
}

.settings-stack {
  max-width: 420px;
}

.overview-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 24, 44, 0.78);
  color: var(--text);
  text-decoration: none;
}

body[data-theme="light"].app-admin .overview-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(209, 221, 239, 0.96);
}

body[data-theme="light"].app-admin .module-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(209, 221, 239, 0.96);
}

.overview-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.overview-card h3,
.access-role-card h3 {
  margin: 0;
}

.overview-card p {
  margin: 0;
}

.access-role-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 15, 29, 0.56);
}

body[data-theme="light"].app-admin .access-role-card {
  background: rgba(249, 251, 255, 0.98);
  border-color: rgba(209, 221, 239, 0.96);
}

/* Light admin refresh */
body[data-theme="light"].app-admin {
  background:
    radial-gradient(circle at 0% 0%, rgba(74, 127, 255, 0.18), transparent 24%),
    radial-gradient(circle at 100% 8%, rgba(255, 153, 77, 0.14), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(83, 158, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #f4f7fd 0%, #eef3fb 52%, #e9eef8 100%);
}

body[data-theme="light"].app-admin .app-main {
  background:
    radial-gradient(circle at 18% 12%, rgba(82, 128, 233, 0.12), transparent 18%),
    radial-gradient(circle at 84% 4%, rgba(255, 153, 77, 0.10), transparent 16%),
    linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0.04)),
    repeating-linear-gradient(90deg, rgba(130, 155, 205, 0.05) 0, rgba(130, 155, 205, 0.05) 1px, transparent 1px, transparent 120px);
}

body[data-theme="light"].app-admin .app-sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,248,255,0.92)),
    radial-gradient(circle at 20% 0%, rgba(85, 133, 255, 0.18), transparent 30%);
  color: #19304f;
  border-right-color: rgba(188, 203, 228, 0.92);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.68);
  backdrop-filter: blur(18px);
}

body[data-theme="light"].app-admin .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(249,251,255,0.84));
  border-bottom-color: rgba(196, 210, 233, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 32px rgba(41, 62, 101, 0.08);
}

body[data-theme="light"].app-admin .menu-inline a,
body[data-theme="light"].app-admin .btn-ghost,
body[data-theme="light"].app-admin .topbar-user {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,246,255,0.92));
  border-color: rgba(192, 208, 232, 0.92);
  color: #19304f;
  box-shadow: 0 4px 14px rgba(63, 87, 133, 0.06);
}

body[data-theme="light"].app-admin .menu-inline a:hover,
body[data-theme="light"].app-admin .btn-ghost:hover {
  border-color: rgba(82, 128, 233, 0.72);
  background: linear-gradient(180deg, rgba(244,248,255,0.98), rgba(232,239,255,0.96));
}

body[data-theme="light"].app-admin .brand-block--admin {
  background:
    radial-gradient(circle at top right, rgba(255, 162, 74, 0.16), transparent 32%),
    radial-gradient(circle at top left, rgba(74, 127, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,248,255,.96));
  border-color: rgba(192, 208, 232, 0.92);
  box-shadow: 0 18px 34px rgba(44, 69, 110, 0.10);
}

body[data-theme="light"] .brand-mark,
body[data-theme="light"] .topbar-mark {
  border-color: rgba(192, 208, 232, 0.9);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,255,0.92));
}

body[data-theme="light"].app-admin .brand-kicker {
  color: #5c7092;
}

body[data-theme="light"].app-admin .brand-block h2,
body[data-theme="light"].app-admin .brand-block--admin h2,
body[data-theme="light"].app-admin .stat-tile strong,
body[data-theme="light"].app-admin .admin-hero h1,
body[data-theme="light"].app-admin h2,
body[data-theme="light"].app-admin h3 {
  color: #1a3150;
}

body[data-theme="light"].app-admin .brand-block .muted,
body[data-theme="light"].app-admin .app-sidebar .muted {
  color: #6b7e9f;
}

body[data-theme="light"].app-admin .side-link,
body[data-theme="light"].app-admin .side-link--module {
  color: #19304f;
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(246,249,255,.76));
  border-color: rgba(192, 208, 232, 0.88);
  box-shadow: 0 6px 16px rgba(64, 86, 129, 0.05);
}

body[data-theme="light"].app-admin .side-link:hover,
body[data-theme="light"].app-admin .side-link--module:hover {
  border-color: rgba(86, 127, 214, 0.68);
  background: linear-gradient(180deg, rgba(241,246,255,.98), rgba(232,239,255,.96));
  transform: translateX(2px);
}

body[data-theme="light"].app-admin .side-link.is-active {
  color: #ffffff;
  border-color: rgba(31, 88, 202, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.22), rgba(255,153,77,0) 42%),
    linear-gradient(135deg, #245fcb, #1f4fae);
  box-shadow: 0 16px 28px rgba(44, 87, 176, 0.24);
}

body[data-theme="light"].app-admin .card-surface,
body[data-theme="light"].app-admin .card--admin-main,
body[data-theme="light"].app-admin .card--admin-side,
body[data-theme="light"].app-admin .overview-card,
body[data-theme="light"].app-admin .module-card,
body[data-theme="light"].app-admin .access-role-card {
  border-color: rgba(190, 206, 231, 0.88);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
  box-shadow: 0 22px 44px rgba(41, 63, 102, 0.11);
}

body[data-theme="light"].app-admin .overview-card,
body[data-theme="light"].app-admin .module-card {
  position: relative;
  overflow: hidden;
}

body[data-theme="light"].app-admin .overview-card::before,
body[data-theme="light"].app-admin .module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #3d7cff, #ff9d4d);
  opacity: 0.9;
}

body[data-theme="light"].app-admin .overview-card:hover,
body[data-theme="light"].app-admin .module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 50px rgba(41, 63, 102, 0.15);
}

body[data-theme="light"].app-admin .stat-tile {
  border-color: rgba(190, 206, 231, 0.88);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
  box-shadow: 0 18px 36px rgba(41, 63, 102, 0.10);
}

body[data-theme="light"].app-admin .stat-tile--accent {
  background:
    radial-gradient(circle at top left, rgba(63, 125, 255, 0.20), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
}

body[data-theme="light"].app-admin .stat-tile--success {
  background:
    radial-gradient(circle at top left, rgba(36, 169, 104, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
}

body[data-theme="light"].app-admin .stat-tile--violet {
  background:
    radial-gradient(circle at top left, rgba(131, 84, 214, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
}

body[data-theme="light"].app-admin .stat-tile--neutral {
  background:
    radial-gradient(circle at top left, rgba(255, 159, 64, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,255,0.92));
}

body[data-theme="light"].app-admin .admin-hero {
  padding: 8px 0 20px;
}

body[data-theme="light"].app-admin .topbar-search,
body[data-theme="light"].app-admin .field-shell,
body[data-theme="light"].app-admin .perm-module,
body[data-theme="light"].app-admin .perm-item,
body[data-theme="light"].app-admin .role-item,
body[data-theme="light"].app-admin .admin-inline-form,
body[data-theme="light"].app-admin .access-role-summary,
body[data-theme="light"].app-admin .user-access-tab {
  border-color: rgba(190, 206, 231, 0.88);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,255,0.94));
}

body[data-theme="light"].app-admin .topbar-search {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 10px 24px rgba(54, 75, 112, 0.08);
}

body[data-theme="light"].app-admin input,
body[data-theme="light"].app-admin select,
body[data-theme="light"].app-admin textarea,
body[data-theme="light"].app-admin .topbar-search input {
  color: #1a3150;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,255,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84);
}

body[data-theme="light"].app-admin .topbar-search-icon,
body[data-theme="light"].app-admin .field-shell-icon {
  color: #6b7e9f;
}

body[data-theme="light"].app-admin .admin-search-results {
  border-color: rgba(190, 206, 231, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,248,255,0.97));
  box-shadow: 0 24px 44px rgba(42, 62, 101, 0.18);
}

body[data-theme="light"].app-admin .admin-search-item,
body[data-theme="light"].app-admin .admin-search-empty {
  background: linear-gradient(180deg, rgba(248,250,255,0.98), rgba(242,246,255,0.94));
}

body[data-theme="light"].app-admin .admin-search-item strong {
  color: #163255;
}

body[data-theme="light"].app-admin .btn-primary {
  border-color: #1f59c4;
  background:
    linear-gradient(135deg, rgba(255, 162, 74, 0.16), rgba(255,162,74,0) 36%),
    linear-gradient(135deg, #2e72ea, #1e57bd);
  box-shadow: 0 14px 26px rgba(42, 92, 182, 0.24);
}

body[data-theme="light"].app-admin .btn-muted {
  color: #19304f;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(242,246,255,0.94));
  border-color: rgba(190, 206, 231, 0.92);
}

body[data-theme="light"].app-admin .btn-muted:hover {
  background: linear-gradient(180deg, rgba(244,248,255,0.98), rgba(233,240,255,0.96));
  border-color: rgba(86, 127, 214, 0.68);
}

body[data-theme="light"].app-admin .table-wrap--admin {
  background: linear-gradient(180deg, rgba(250,252,255,0.98), rgba(244,248,255,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

body[data-theme="light"].app-admin .admin-table th,
body[data-theme="light"].app-admin .admin-table td {
  border-color: rgba(214, 223, 237, 0.9);
}

body[data-theme="light"].app-admin .admin-table thead th {
  background: linear-gradient(180deg, rgba(245,248,255,0.99), rgba(238,243,252,0.96));
}

body[data-theme="light"].app-admin .admin-table tbody tr:hover td {
  background: rgba(236, 242, 252, 0.92);
}

body[data-theme="light"].app-admin .badge--role {
  color: #1f4fb1;
  background: linear-gradient(180deg, rgba(91, 136, 239, 0.12), rgba(91, 136, 239, 0.08));
  border-color: rgba(122, 155, 232, 0.48);
}

body[data-theme="light"].app-admin .badge,
body[data-theme="light"].app-admin .muted-badge {
  background: linear-gradient(180deg, rgba(248,250,255,0.98), rgba(241,245,255,0.94));
  border-color: rgba(190, 206, 231, 0.92);
}

body[data-theme="light"].app-admin .role-item--link.is-active,
body[data-theme="light"].app-admin .user-access-tab.is-active {
  background:
    linear-gradient(135deg, rgba(255, 164, 82, 0.10), rgba(255,164,82,0) 40%),
    linear-gradient(180deg, rgba(236,242,255,0.98), rgba(230,238,255,0.94));
  border-color: rgba(86, 127, 214, 0.62);
}

/* Light work refresh */
body[data-theme="light"].app-work {
  background:
    radial-gradient(circle at 0% 0%, rgba(74, 127, 255, 0.14), transparent 22%),
    radial-gradient(circle at 100% 8%, rgba(255, 153, 77, 0.10), transparent 18%),
    linear-gradient(180deg, #f4f7fd 0%, #edf2fa 58%, #e8eef8 100%);
}

body[data-theme="light"].app-work .app-main {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.04)),
    repeating-linear-gradient(90deg, rgba(130, 155, 205, 0.05) 0, rgba(130, 155, 205, 0.05) 1px, transparent 1px, transparent 120px);
}

body[data-theme="light"].app-work .app-sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,255,0.88)),
    radial-gradient(circle at top left, rgba(74, 127, 255, 0.12), transparent 36%);
  color: #19304f;
  border-right-color: rgba(190, 206, 231, 0.88);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
}

body[data-theme="light"].app-work .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(248,250,255,0.84));
  border-bottom-color: rgba(196, 210, 233, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 32px rgba(41, 62, 101, 0.08);
}

body[data-theme="light"].app-work .brand-block {
  background:
    radial-gradient(circle at top right, rgba(255, 162, 74, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,248,255,0.94));
  border-color: rgba(190, 206, 231, 0.9);
  box-shadow: 0 16px 30px rgba(44, 69, 110, 0.09);
}

body[data-theme="light"].app-work .brand-kicker {
  color: #5b7092;
}

body[data-theme="light"].app-work .brand-block h2,
body[data-theme="light"].app-work .topbar-title strong,
body[data-theme="light"].app-work h1,
body[data-theme="light"].app-work h2,
body[data-theme="light"].app-work h3 {
  color: #1a3150;
}

body[data-theme="light"].app-work .brand-block .muted,
body[data-theme="light"].app-work .muted {
  color: #6b7e9f;
}

body[data-theme="light"].app-work .brand-mark,
body[data-theme="light"].app-work .topbar-mark,
body[data-theme="light"].app-work .menu-inline a,
body[data-theme="light"].app-work .btn-ghost,
body[data-theme="light"].app-work .side-link,
body[data-theme="light"].app-work .catalog-quick-link {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,246,255,0.92));
  border-color: rgba(190, 206, 231, 0.88);
  color: #19304f;
  box-shadow: 0 8px 18px rgba(54, 76, 115, 0.05);
}

body[data-theme="light"].app-work .menu-inline a:hover,
body[data-theme="light"].app-work .btn-ghost:hover,
body[data-theme="light"].app-work .side-link:hover,
body[data-theme="light"].app-work .catalog-quick-link:hover {
  border-color: rgba(86, 127, 214, 0.68);
  background: linear-gradient(180deg, rgba(243,247,255,0.98), rgba(233,240,255,0.94));
  text-decoration: none;
}

body[data-theme="light"].app-work .menu-inline a.is-active,
body[data-theme="light"].app-work .side-link.is-active {
  color: #fff;
  border-color: rgba(31, 88, 202, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.20), rgba(255,153,77,0) 40%),
    linear-gradient(135deg, #2d6ee5, #1d57bd);
  box-shadow: 0 14px 26px rgba(42, 92, 182, 0.20);
}

.app-work .app-shell {
  grid-template-columns: 1fr;
  align-items: stretch;
  overflow: visible;
}

.app-work .topbar-left--work {
  min-width: 0;
}

.app-work .work-topnav {
  position: relative;
  min-width: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-work .work-topnav__head {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: min(100%, 420px);
}

.app-work .work-topnav__launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px 0 14px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,246,255,0.92));
  box-shadow: 0 8px 18px rgba(54, 76, 115, 0.05);
}

.app-work .work-topnav__launch-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-work .work-topnav__launch-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-work .work-topnav__launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  color: #35527f;
  font-size: 14px;
  line-height: 1;
}

.app-work .work-topnav__launch-icon.is-active {
  color: #ffffff;
  border-color: rgba(31, 88, 202, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.20), rgba(255,153,77,0) 40%),
    linear-gradient(135deg, #2d6ee5, #1d57bd);
}

.app-work .work-topnav__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  transition: transform .18s ease;
}

.app-work .work-topnav:focus-within .work-topnav__caret,
.app-work .work-topnav.is-open .work-topnav__caret {
  transform: rotate(180deg);
}

.app-work .work-topnav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 90;
  width: min(30vw, 620px);
  min-width: 420px;
  max-width: calc(100vw - 220px);
  padding: 16px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,248,255,0.96));
  box-shadow: 0 26px 46px rgba(41, 63, 102, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.app-work .work-topnav:focus-within .work-topnav__panel,
.app-work .work-topnav.is-open .work-topnav__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.app-work .work-shift-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 8px 6px 14px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,246,255,0.92));
  box-shadow: 0 8px 18px rgba(54, 76, 115, 0.05);
}

.app-work .work-shift-toggle__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-work .work-shift-toggle__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-work .work-shift-toggle__state {
  font-size: 14px;
  line-height: 1.2;
  color: #1a3150;
  white-space: nowrap;
}

.app-work .work-shift-toggle__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px 0 6px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  color: #1a3150;
  font-weight: 700;
}

.app-work .work-shift-toggle__button-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  transition: background .18s ease;
}

.app-work .work-shift-toggle__button-thumb {
  position: absolute;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform .18s ease;
}

.app-work .work-shift-toggle[data-shift-state="open"] .work-shift-toggle__button-track {
  background: linear-gradient(135deg, #2fb67c, #34d399);
}

.app-work .work-shift-toggle[data-shift-state="open"] .work-shift-toggle__button-thumb {
  transform: translateX(18px);
}

.app-work .work-shift-toggle[data-shift-state="open"] .work-shift-toggle__state {
  color: #12714f;
}

.app-work .work-shift-toggle[data-shift-state="opening"] .work-shift-toggle__state,
.app-work .work-shift-toggle[data-shift-state="closing"] .work-shift-toggle__state {
  color: #9a6700;
}


.app-work .work-topnav__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(238,244,255,0.9));
}

.app-work .work-topnav__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #18b47a, #5ed4a7);
  box-shadow: 0 0 0 5px rgba(24, 180, 122, 0.12);
}

.app-work .work-topnav__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  max-width: 100%;
}

.app-work .work-topnav__item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(190, 206, 231, 0.88);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,246,255,0.92));
  color: #19304f;
  box-shadow: 0 8px 18px rgba(54, 76, 115, 0.05);
  white-space: nowrap;
}

.app-work .work-topnav__item:hover {
  border-color: rgba(86, 127, 214, 0.68);
  background: linear-gradient(180deg, rgba(243,247,255,0.98), rgba(233,240,255,0.94));
  text-decoration: none;
  transform: translateY(-1px);
}

.app-work .work-topnav__item.is-active {
  color: #ffffff;
  border-color: rgba(31, 88, 202, 0.92);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.20), rgba(255,153,77,0) 40%),
    linear-gradient(135deg, #2d6ee5, #1d57bd);
  box-shadow: 0 14px 26px rgba(42, 92, 182, 0.20);
}

.app-work .work-topnav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  font-size: 18px;
  line-height: 1;
}

.app-work .work-topnav__label {
  font-weight: 600;
}

.app-work .topbar-left--work .topbar-title {
  min-width: 0;
}

.app-work .topbar-left--work .topbar-title strong,
.app-work .topbar-left--work .topbar-title .kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-work .topbar-nav {
  display: none !important;
}

.app-work .app-main {
  position: relative;
  z-index: 1;
}

body[data-theme="light"].app-work .work-topnav__item .work-topnav__icon,
body[data-theme="light"].app-work .work-topnav__meta,
body[data-theme="light"].app-work .work-topnav__head .topbar-title strong {
  color: #1a3150;
}

body[data-theme="dark"].app-work {
  background:
    radial-gradient(circle at 0% 0%, rgba(74, 127, 255, 0.18), transparent 24%),
    radial-gradient(circle at 100% 8%, rgba(255, 153, 77, 0.10), transparent 18%),
    linear-gradient(180deg, #07101d 0%, #091426 56%, #0b1526 100%);
}

body[data-theme="dark"].app-work .app-main {
  background:
    linear-gradient(180deg, rgba(11,18,33,0.52), rgba(11,18,33,0.18)),
    repeating-linear-gradient(90deg, rgba(82, 108, 160, 0.06) 0, rgba(82, 108, 160, 0.06) 1px, transparent 1px, transparent 120px);
}

body[data-theme="dark"].app-work .topbar {
  background: linear-gradient(180deg, rgba(10,18,34,0.90), rgba(11,19,35,0.84));
  border-bottom-color: rgba(40, 58, 94, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"].app-work .work-topnav__item,
body[data-theme="dark"].app-work .work-topnav__meta,
body[data-theme="dark"].app-work .work-topnav__panel,
body[data-theme="dark"].app-work .work-shift-toggle,
body[data-theme="dark"].app-work .menu-inline a,
body[data-theme="dark"].app-work .menu-inline-form--locale select,
body[data-theme="dark"].app-work .btn-ghost,
body[data-theme="dark"].app-work .topbar-mark,
body[data-theme="dark"].app-work .work-topnav__launch {
  background: linear-gradient(180deg, rgba(18, 31, 56, 0.98), rgba(13, 24, 44, 0.94));
  border-color: rgba(58, 84, 130, 0.66);
  color: #dbe6ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"].app-work .work-topnav__launch-icon {
  border-color: rgba(58, 84, 130, 0.66);
  background: rgba(10, 18, 34, 0.34);
  color: #dbe6ff;
}

body[data-theme="dark"].app-work .work-topnav__launch-label {
  color: #96abd0;
}

body[data-theme="dark"].app-work .work-shift-toggle__state,
body[data-theme="dark"].app-work .work-shift-toggle__button {
  color: #f2f6ff;
}

body[data-theme="dark"].app-work .work-shift-toggle__button {
  border-color: rgba(58, 84, 130, 0.66);
  background: rgba(10, 18, 34, 0.34);
}

body[data-theme="dark"].app-work .work-shift-toggle__button-track {
  background: rgba(148, 163, 184, 0.22);
}

body[data-theme="dark"].app-work .work-shift-toggle[data-shift-state="open"] .work-shift-toggle__state {
  color: #86efac;
}

body[data-theme="dark"].app-work .work-shift-toggle[data-shift-state="opening"] .work-shift-toggle__state,
body[data-theme="dark"].app-work .work-shift-toggle[data-shift-state="closing"] .work-shift-toggle__state {
  color: #fde68a;
}


body[data-theme="dark"].app-work .menu-inline-form--locale select {
  color-scheme: dark;
  color: #eef4ff;
  background: linear-gradient(180deg, rgba(18, 31, 56, 0.98), rgba(13, 24, 44, 0.94));
}

body[data-theme="dark"].app-work .menu-inline-form--locale select option {
  color: #eef4ff;
  background: #13233f;
}

body[data-theme="dark"].app-work .work-topnav__item:hover {
  border-color: rgba(110, 147, 224, 0.72);
  background: linear-gradient(180deg, rgba(24, 40, 70, 0.98), rgba(17, 31, 56, 0.96));
  transform: translateY(-1px);
}

body[data-theme="dark"].app-work .work-topnav__item.is-active {
  color: #ffffff;
  border-color: rgba(104, 146, 235, 0.88);
  background:
    linear-gradient(135deg, rgba(255, 153, 77, 0.16), rgba(255,153,77,0) 40%),
    linear-gradient(135deg, #2d6ee5, #1d57bd);
  box-shadow: 0 16px 28px rgba(24, 56, 126, 0.36);
}

body[data-theme="dark"].app-work .work-topnav__item .work-topnav__icon,
body[data-theme="dark"].app-work .work-topnav__meta,
body[data-theme="dark"].app-work .work-topnav__head .topbar-title strong,
body[data-theme="dark"].app-work .topbar-title strong {
  color: #f2f6ff;
}

body[data-theme="dark"].app-work .brand-kicker,
body[data-theme="dark"].app-work .muted,
body[data-theme="dark"].app-work .topbar-title .kicker {
  color: #96abd0;
}

body[data-theme="light"].app-work .card,
body[data-theme="light"].app-work .catalog-main-card,
body[data-theme="light"].app-work .catalog-side-card,
body[data-theme="light"].app-work .overview-card,
body[data-theme="light"].app-work .stat-tile {
  border-color: rgba(190, 206, 231, 0.88);
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(246,249,255,0.93));
  box-shadow: 0 20px 38px rgba(41, 63, 102, 0.09);
}

body[data-theme="light"].app-work .overview-card {
  position: relative;
  overflow: hidden;
}

body[data-theme="light"].app-work .overview-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #3d7cff, #ff9d4d);
  opacity: 0.92;
}

body[data-theme="light"].app-work .overview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(86, 127, 214, 0.68);
  box-shadow: 0 24px 44px rgba(41, 63, 102, 0.13);
}

body[data-theme="light"].app-work input,
body[data-theme="light"].app-work select,
body[data-theme="light"].app-work textarea {
  color: #1a3150;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,247,255,0.94));
  border-color: rgba(190, 206, 231, 0.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84);
}

body[data-theme="light"].app-work .btn-primary {
  border-color: #1f59c4;
  background:
    linear-gradient(135deg, rgba(255, 162, 74, 0.16), rgba(255,162,74,0) 36%),
    linear-gradient(135deg, #2e72ea, #1e57bd);
  box-shadow: 0 14px 26px rgba(42, 92, 182, 0.22);
}

body[data-theme="light"].app-work .btn-muted {
  color: #19304f;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(242,246,255,0.94));
  border-color: rgba(190, 206, 231, 0.92);
}

body[data-theme="light"].app-work .btn-muted:hover {
  background: linear-gradient(180deg, rgba(244,248,255,0.98), rgba(233,240,255,0.96));
  border-color: rgba(86, 127, 214, 0.68);
}

body[data-theme="light"].app-work table,
body[data-theme="light"].app-work .table-wrap,
body[data-theme="light"].app-work .table-responsive {
  background: transparent;
}

body[data-theme="light"].app-work thead th {
  background: linear-gradient(180deg, rgba(245,248,255,0.99), rgba(238,243,252,0.96));
}

body[data-theme="light"].app-work tbody tr:hover td {
  background: rgba(236, 242, 252, 0.92);
}

/* Admin readability fix */
body[data-theme="light"].app-admin .admin-table {
  color: #203554;
}

body[data-theme="light"].app-admin .admin-table thead th {
  color: #223859;
  font-weight: 800;
}

body[data-theme="light"].app-admin .admin-table tbody td {
  color: #2b3f60;
}

body[data-theme="light"].app-admin .table-id {
  color: #6d7f9c;
}

body[data-theme="light"].app-admin .user-cell strong,
body[data-theme="light"].app-admin .admin-table strong,
body[data-theme="light"].app-admin .admin-side-column h2,
body[data-theme="light"].app-admin .admin-form-section__title {
  color: #1d3150;
}

body[data-theme="light"].app-admin .user-avatar {
  background: linear-gradient(135deg, #3b76e8, #2a5fc8);
  box-shadow: 0 10px 18px rgba(53, 102, 198, 0.22);
}

body[data-theme="light"].app-admin .badge--role {
  color: #285abf;
  background: linear-gradient(180deg, rgba(225,235,255,0.98), rgba(238,243,255,0.94));
  border-color: rgba(143, 173, 230, 0.82);
}

body[data-theme="light"].app-admin .badge--user-enabled {
  color: #1c7b45;
  background: linear-gradient(180deg, rgba(232,252,239,0.98), rgba(221,248,231,0.92));
  border-color: rgba(123, 212, 156, 0.88);
}

body[data-theme="light"].app-admin .badge--user-disabled {
  color: #af4b35;
  background: linear-gradient(180deg, rgba(255,239,234,0.98), rgba(255,231,224,0.92));
  border-color: rgba(241, 170, 150, 0.86);
}

body[data-theme="light"].app-admin .btn-icon {
  border-color: rgba(183, 199, 226, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,244,255,0.94));
  color: #2b446c;
  box-shadow: 0 10px 18px rgba(50, 73, 112, 0.10);
}

body[data-theme="light"].app-admin .btn-icon--violet {
  color: #6e59ce;
  border-color: rgba(192, 177, 244, 0.92);
  background: linear-gradient(180deg, rgba(244,239,255,0.98), rgba(234,228,255,0.94));
}

body[data-theme="light"].app-admin .btn-icon--violet.is-active {
  color: #ffffff;
  border-color: rgba(130, 103, 223, 0.88);
  background: linear-gradient(135deg, #b59dff, #8f72ea);
}

body[data-theme="light"].app-admin .btn-icon--warn {
  color: #98641e;
  border-color: rgba(240, 204, 132, 0.92);
  background: linear-gradient(180deg, rgba(255,247,226,0.98), rgba(255,238,201,0.94));
}

body[data-theme="light"].app-admin .btn-icon--success {
  color: #1f7c47;
  border-color: rgba(131, 214, 164, 0.92);
  background: linear-gradient(180deg, rgba(232,252,239,0.98), rgba(221,248,231,0.94));
}

body[data-theme="light"].app-admin .btn-icon--accent {
  color: #2d62cb;
  border-color: rgba(153, 180, 236, 0.92);
  background: linear-gradient(180deg, rgba(232,240,255,0.98), rgba(223,234,255,0.94));
}

body[data-theme="light"].app-admin .inline-form--reset {
  border-color: rgba(186, 203, 230, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,248,255,0.96));
  box-shadow: 0 22px 34px rgba(48, 72, 112, 0.16);
}

body[data-theme="light"].app-admin .inline-form--reset strong {
  color: #1d3150;
}

body[data-theme="light"].app-admin .admin-form-section label,
body[data-theme="light"].app-admin .form-grid label,
body[data-theme="light"].app-admin .admin-inline-form label {
  color: #2d4160;
  font-weight: 600;
}

body[data-theme="light"].app-admin .admin-form-section input,
body[data-theme="light"].app-admin .admin-form-section select,
body[data-theme="light"].app-admin .admin-inline-form input,
body[data-theme="light"].app-admin .admin-inline-form select,
body[data-theme="light"].app-admin .users-toolbar select {
  border-color: rgba(183, 199, 226, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(244,248,255,0.95));
  color: #203554;
}

body[data-theme="light"].app-admin .admin-form-section input:focus,
body[data-theme="light"].app-admin .admin-form-section select:focus,
body[data-theme="light"].app-admin .admin-inline-form input:focus,
body[data-theme="light"].app-admin .admin-inline-form select:focus,
body[data-theme="light"].app-admin .users-toolbar select:focus {
  border-color: rgba(72, 122, 228, 0.84);
  box-shadow: 0 0 0 3px rgba(84, 128, 224, 0.14);
}

body[data-theme="light"].app-admin .admin-form-section,
body[data-theme="light"].app-admin .admin-inline-form,
body[data-theme="light"].app-admin .field-shell {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.access-role-card:first-child {
  margin-top: 0;
}

.access-perm-form {
  margin-top: 12px;
}

.perm-item span {
  min-width: 0;
}

body[data-nav-mode="topbar"] .app-shell {
  grid-template-columns: 1fr;
}
body[data-nav-mode="topbar"] .app-sidebar {
  display: none;
}
body[data-nav-mode="topbar"] .topbar-nav {
  display: flex;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .35);
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .topbar-nav { display: flex; }
  .admin-workspace { grid-template-columns: 1fr; }
  .topbar-center { justify-content: stretch; width: 100%; }
  .admin-search,
  .topbar-search { width: 100%; }

  .app-work .app-shell {
    grid-template-columns: 1fr;
  }

  .app-work .work-topnav__panel {
    width: min(620px, calc(100vw - 24px));
  }
}

@media (max-width: 900px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .grid-two,
  .compact-grid { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input[type="password"] { min-width: 0; }
  .page { padding: 0 12px 16px; }
  .app-admin .page { padding: 18px 12px 20px; }
  .admin-hero { flex-direction: column; align-items: stretch; }
  .admin-hero h1 { font-size: 34px; }
  .users-toolbar { flex-direction: column; }
  .field-shell { width: 100%; }
  .topbar-inner--admin { padding: 12px; }
  .menu-inline--admin { flex-wrap: wrap; }
  .menu-inline--work { flex-wrap: wrap; width: 100%; }
  .access-role-summary__meta { width: 100%; }
  .access-role-actions { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-work .work-topnav__trigger {
    max-width: 100%;
  }

  .app-work .work-topnav__panel {
    left: -8px;
    width: calc(100vw - 24px);
  }

  .app-work .work-topnav__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .topbar-inner--public {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-inline--public {
    flex-wrap: wrap;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-showcase {
    min-height: 420px;
  }

  .auth-showcase__content {
    padding: 34px 24px;
  }

  .auth-panel {
    padding: 24px;
  }

  .auth-panel__logo {
    width: 132px;
    height: 132px;
  }
}

@media (max-width: 720px) {
  .ui-pref-dialog {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .ui-pref-options,
  .ui-pref-options--two {
    grid-template-columns: 1fr;
  }
}
