:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #ffffff;
  --text: #0f1720;
  --muted: #637083;
  --quiet: #8a96a8;
  --line: #d9e1ea;
  --line-soft: #edf2f6;
  --brand: #006da8;
  --brand-dark: #005987;
  --brand-soft: #eaf6fd;
  --teal: #13a6ad;
  --danger: #dc625f;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

a {
  color: var(--brand);
  font-weight: 650;
  text-decoration: none;
}

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

.side-nav {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.logo {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  min-height: 42px;
  padding: 8px 12px;
}

.logo img {
  display: block;
  max-width: 132px;
  width: 100%;
}

.side-nav nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
}

.nav-group {
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.nav-section {
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.nav-section summary {
  cursor: pointer;
  list-style: none;
  position: relative;
}

.nav-section summary::-webkit-details-marker {
  display: none;
}

.nav-section summary::after {
  color: var(--quiet);
  content: "›";
  font-size: 15px;
  position: absolute;
  right: 9px;
  transform: rotate(0deg);
  transition: transform .16s ease;
}

.nav-section[open] summary::after {
  transform: rotate(90deg);
}

.nav-children {
  display: grid;
  gap: 2px;
  padding: 3px 0 2px;
}

.side-title {
  color: var(--muted);
  font-size: 12px;
  margin: -2px 8px 8px;
  text-align: center;
}

.side-link {
  align-items: center;
  border-radius: 5px;
  color: #1d2a36;
  display: flex;
  font-size: 11px;
  font-weight: 600;
  gap: 9px;
  min-height: 31px;
  padding: 0 9px;
}

.side-link:hover,
.side-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.side-link.parent {
  font-weight: 750;
}

.nav-section[open] > summary {
  background: var(--brand-soft);
  color: var(--brand);
}

.side-link.child {
  color: #66728a;
  font-size: 11px;
  min-height: 28px;
  padding-left: 30px;
}

.side-link.child.active {
  background: transparent;
  color: #1f36ff;
  font-weight: 750;
  position: relative;
}

.side-link.child.active::before {
  background: #6c78ff;
  border-radius: 999px;
  content: "";
  height: 22px;
  left: 18px;
  position: absolute;
  width: 2px;
}

.side-link.child .nav-icon {
  height: 5px;
  width: 5px;
}

.nav-icon {
  border: 1.5px solid currentColor;
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
  height: 14px;
  opacity: .95;
  position: relative;
  width: 14px;
}

.nav-icon.home {
  border-radius: 3px;
  transform: rotate(45deg) scale(.82);
}

.nav-icon.users {
  border-radius: 50%;
}

.nav-icon.users::after,
.nav-icon.meeting::after {
  border: 1.5px solid currentColor;
  border-radius: 8px 8px 3px 3px;
  bottom: -8px;
  content: "";
  height: 6px;
  left: -4px;
  position: absolute;
  width: 19px;
}

.nav-icon.folder::before {
  background: #fff;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
  height: 5px;
  left: -2px;
  position: absolute;
  top: -6px;
  width: 9px;
}

.nav-icon.send {
  border: 0;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-35deg);
}

.nav-icon.tool {
  border-radius: 50%;
}

.nav-icon.dot {
  background: currentColor;
  border: 0;
  border-radius: 50%;
}

.nav-icon.help {
  border-radius: 50%;
}

.nav-icon.file {
  border-radius: 2px;
}

.nav-icon.play {
  border-radius: 50%;
}

.side-footer {
  color: #778393;
  font-size: 10px;
  margin-top: auto;
  padding: 12px 14px;
}

.workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  min-height: 42px;
  padding: 0 14px;
}

.topbar-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-title::before {
  background: var(--teal);
  border-radius: 4px;
  color: #fff;
  content: "✣";
  display: inline-flex;
  height: 20px;
  justify-content: center;
  margin-right: 8px;
  vertical-align: -4px;
  width: 20px;
}

.topbar-links {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: flex-start;
}

.topbar-links a {
  color: #2a3643;
  font-size: 11px;
  font-weight: 600;
}

.user-menu {
  align-items: center;
  display: flex;
  gap: 10px;
}

.avatar {
  align-items: center;
  background: #eef7ff;
  border: 1px solid #cfe0ef;
  border-radius: 50%;
  color: #386175;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.user-menu > span:not(.avatar) {
  color: var(--muted);
  font-size: 11px;
}

.logout-button {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  min-height: 26px;
  padding: 4px 0;
}

.property-switcher,
.profile-menu,
.language-menu {
  position: relative;
}

.property-switcher summary,
.profile-menu summary,
.language-menu summary {
  cursor: pointer;
  list-style: none;
}

.property-switcher summary::-webkit-details-marker,
.profile-menu summary::-webkit-details-marker,
.language-menu summary::-webkit-details-marker {
  display: none;
}

.property-switcher summary {
  color: var(--brand);
  font-size: 11px;
  font-weight: 650;
}

.profile-menu > summary {
  align-items: center;
  display: flex;
  gap: 8px;
}

.dropdown-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(15, 23, 32, .12);
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.property-switcher .dropdown-panel {
  left: 0;
  right: auto;
}

.dropdown-panel a,
.dropdown-panel span,
.dropdown-panel button,
.language-menu summary {
  background: transparent;
  border: 0;
  color: var(--text);
  display: block;
  font-size: 12px;
  min-height: 30px;
  padding: 7px 9px;
  text-align: left;
}

.dropdown-panel a:hover,
.dropdown-panel button:hover,
.language-menu summary:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.profile-panel {
  min-width: 240px;
}

.language-menu > div {
  border-left: 2px solid var(--line-soft);
  display: grid;
  margin-left: 8px;
  padding-left: 6px;
}

main {
  margin: 0 auto;
  max-width: 980px;
  padding: 20px 26px 48px;
}

.public-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.public-shell main {
  max-width: 360px;
  padding: 0;
  width: 100%;
}

.auth-logo {
  margin: 0 auto 18px;
  max-width: 210px;
}

.auth-logo img {
  width: 100%;
}

.panel,
.account-card,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.panel,
.account-card {
  margin-bottom: 14px;
  padding: 16px;
}

.table-panel {
  padding: 16px;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  margin: 12px 0 0;
  min-height: 520px;
  padding: 24px 18px;
}

.admin-card table {
  margin-top: 18px;
}

.admin-toolbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-search {
  max-width: 320px;
  width: 100%;
}

.admin-search.wide {
  max-width: 560px;
}

.admin-select {
  max-width: 240px;
  width: 100%;
}

.cell-muted {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.switches {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  gap: 4px;
}

.panel.narrow,
.panel.auth {
  margin: 0 auto;
  max-width: 360px;
}

.danger {
  border-color: #efb4b4;
}

.page-title {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

h1,
h2 {
  color: var(--text);
  margin: 0 0 6px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

p {
  color: var(--muted);
  margin: 0 0 8px;
}

form {
  margin: 0;
}

label {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 12px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  display: block;
  font: inherit;
  margin-top: 5px;
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(0, 109, 168, .12);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.button,
button {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 4px;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  min-height: 30px;
  padding: 6px 11px;
  text-decoration: none;
}

.button:hover,
button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.button.small {
  font-size: 11px;
  min-height: 28px;
  padding: 5px 9px;
}

.button.subtle {
  background: #fff;
  border-color: var(--line);
  color: var(--brand);
}

.actions-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.account-card {
  align-items: center;
  background: #eef8ff;
  display: flex;
  justify-content: space-between;
  min-height: 96px;
}

.account-card h2 {
  color: var(--text);
  display: inline;
  font-size: 19px;
  margin-right: 8px;
}

.account-card strong {
  display: block;
  font-size: 28px;
  font-weight: 650;
  margin-top: 8px;
}

.account-ref {
  color: var(--text);
  display: inline;
  font-size: 12px;
  font-weight: 650;
}

.toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin: 0 0 14px;
}

.search-field {
  margin: 0;
  max-width: 260px;
  width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f7f9fc;
  color: #526172;
  font-size: 11px;
  font-weight: 700;
}

td {
  color: #263241;
  font-size: 12px;
  font-weight: 500;
}

.empty {
  color: var(--muted);
  font-weight: 500;
  padding: 18px 10px;
}

.badge {
  background: #eef6ff;
  border: 1px solid #cfe3f5;
  border-radius: 999px;
  color: var(--brand);
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 8px;
}

.tabs {
  display: flex;
  gap: 18px;
  margin: 2px 0 14px;
}

.tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 7px 0;
}

.tabs a.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

.grid.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 9px;
}

.metric strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 650;
}

.split {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.split.wide {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr);
}

.split.owners-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

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

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

.span-all {
  grid-column: 1 / -1;
}

.form-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.flash {
  background: #fff8df;
  border: 1px solid #f0dd9f;
  border-radius: var(--radius);
  color: #664f13;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.support-banner {
  align-items: center;
  background: #102a43;
  border-radius: var(--radius);
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 9px 11px;
}

.support-banner form {
  display: inline;
}

.chat-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  bottom: 18px;
  color: var(--brand);
  display: flex;
  font-size: 16px;
  height: 38px;
  justify-content: center;
  position: fixed;
  right: 18px;
  width: 38px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 164px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 10px 14px;
  }

  .topbar-links {
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .side-nav {
    min-height: 0;
  }

  .side-nav nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .side-footer {
    display: none;
  }

  main {
    padding: 16px;
  }

  .page-title,
  .account-card,
  .toolbar,
  .topbar-links,
  .user-menu {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.cards,
  .split,
  .split.wide,
  .split.owners-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
