:root {
  --bg: #f7f9fd;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --text: #172b4d;
  --muted: #718096;
  --line: #e7edf5;
  --line-strong: #d8e1ee;
  --brand: #F5AD1B;
  --brand-dark: #16A085;
  --brand-contrast: #34495E;
  --blue: #16A085;
  --danger: #d92d20;
  --warning: #b7791f;
  --success: #039855;
  --sidebar: #ffffff;
  --sidebar-soft: #f3f6fb;
  --shadow: 0 12px 30px rgba(25, 42, 70, .06);
  --shadow-soft: 0 4px 16px rgba(25, 42, 70, .05);
  --app-font: "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --control-height: 38px;
  --control-radius: 9px;
  --gap: 12px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--app-font);
  font-optical-sizing: auto;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "GRAD" 0;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 16px;
  color: var(--text);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(25, 42, 70, .03);
}

.brand, .auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand { margin-bottom: 22px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 42, 70, .08);
  overflow: hidden;
}
.brand-logo { display: block; width: 30px; height: 30px; object-fit: contain; }
.brand-name { color: var(--text); font-size: 17px; font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 12px; }

.nav {
  display: grid;
  gap: 4px;
}
.nav-section {
  margin: 18px 10px 7px;
  color: #a0aec0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.icon {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
}
.icon-lg {
  width: 22px;
  height: 22px;
}
.nav-link, .logout {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-link:hover, .logout:hover {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 10%, white);
}
.nav-link.is-active {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 14%, white);
  font-weight: 600;
}
.nav-link-accent { margin-top: 6px; }

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 16%, white);
  font-weight: 700;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { max-width: 170px; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--muted); font-size: 12px; }
.logout { display: flex; justify-content: center; border: 1px solid var(--line); }
.legal {
  display: grid;
  gap: 2px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.legal strong {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: 11px;
  font-weight: 600;
}
.legal span { display: block; }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
.topbar strong { display: block; font-size: 18px; }
.topbar-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--control-height);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: var(--muted);
}
.language-switch .icon { width: 16px; }
.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.language-switch a.is-active {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 14%, white);
}
.language-switch a:hover {
  color: var(--brand-dark);
  background: var(--surface-soft);
}
.user-menu {
  position: relative;
}
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  cursor: pointer;
  list-style: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.user-menu-identity {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}
.user-menu-identity strong {
  max-width: 140px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-identity span {
  max-width: 140px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  width: 300px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.metric {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface-soft);
}
.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.metric strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.page {
  width: min(100%, 1480px);
  padding: 24px 26px 40px;
}
.titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: 0; }
h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}
.page-subtitle { margin-top: 4px; color: var(--muted); }

.grid { display: grid; gap: var(--gap); }
.stats { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 14px; }
.card, .panel {
  background: var(--surface);
  border: 1px solid rgba(226, 233, 243, .88);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.card { padding: 18px; }
.panel { padding: 18px; margin-bottom: 16px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat-value { margin-top: 8px; font-size: 24px; font-weight: 700; }
.stat-hint { margin-top: 6px; color: var(--muted); font-size: 12px; }
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 16%, white);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.toolbar > .btn,
.toolbar > button,
.toolbar > .inline-form {
  align-self: end;
}
.toolbar > .btn,
.toolbar > button {
  width: 100%;
}
.toolbar > .inline-form .btn { width: 100%; }
.field { display: grid; gap: 6px; min-width: 0; }
label { color: var(--muted); font-size: 12px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}
select[multiple] { min-height: 92px; padding: 7px 10px; }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: auto;
}
input[type="color"] {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  padding: 4px;
  background: #fff;
  cursor: pointer;
}
input[type="file"] {
  min-height: var(--control-height);
  padding: 4px;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #fff; }
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--control-height);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-height);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--text);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { border-color: #94a3b8; background: var(--surface-soft); }
.btn.primary { color: var(--brand-contrast); border-color: var(--brand); background: var(--brand); }
.btn.primary:hover { color: #fff; border-color: var(--brand-dark); background: var(--brand-dark); }
.btn.blue { color: #fff; border-color: var(--blue); background: var(--blue); }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.danger:hover { background: #fff5f5; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
table { width: 100%; min-width: 880px; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8faff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
tr:hover td { background: #f9fbff; }
tr:last-child td { border-bottom: 0; }
.cell-title strong { display: block; margin-bottom: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #3730a3;
  background: #eef2ff;
  font-size: 12px;
  font-weight: 700;
}
.badge.success { color: var(--success); background: #dcfce7; }
.badge.warning { color: var(--warning); background: #fef3c7; }
.badge.danger { color: var(--danger); background: #fee4e2; }
.badge.gray { color: #475569; background: #eef2f7; }
.badge.tag-colored {
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 13%, white);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.muted { color: var(--muted); }
.flash {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  background: #fff;
  font-weight: 700;
}
.flash.success { color: var(--success); border-color: #a7f3d0; background: #ecfdf5; }
.flash.error { color: var(--danger); border-color: #fecaca; background: #fff5f5; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.full { grid-column: 1 / -1; }
.branding-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.color-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.color-card {
  display: grid;
  grid-template-columns: 1fr 34px;
  grid-template-areas:
    "label picker"
    "hex picker";
  align-items: center;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.color-card span {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.color-card input { grid-area: picker; }
.color-card input[type="color"] {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  padding: 0;
}
.color-card code {
  grid-area: hex;
  color: var(--text);
  font-family: var(--app-font);
  font-size: 13px;
  font-weight: 500;
}
.color-card:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line-strong)); }
.brand-preview {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-color: #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.brand-preview img { max-width: 88px; max-height: 88px; object-fit: contain; }
.settings-preview {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, white), #fff 64%);
}
.settings-preview strong { color: var(--text); font-size: 20px; }
.settings-preview span { color: var(--muted); }
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.preview-button-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--brand-contrast);
  background: var(--brand);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}
.preview-button-sample.is-hover {
  color: #fff;
  background: var(--brand-dark);
}
.preview-kicker {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--surface-soft); }
.detail-item label { display: block; margin-bottom: 5px; }
.content-box { max-height: 430px; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); white-space: pre-wrap; }
.viewer-frame, .viewer-image { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.viewer-frame { height: 720px; }
.viewer-image { max-width: 100%; }

.auth-page {
  min-height: 100vh;
  padding: 0;
  background: #eef3f1;
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr);
  min-height: 100vh;
}
.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(13, 50, 45, .50), rgba(13, 50, 45, .12)),
    linear-gradient(180deg, transparent 42%, rgba(13, 50, 45, .74)),
    url("/assets/brand/login-bg.jpg") center / cover no-repeat;
  overflow: hidden;
}
.auth-visual-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 520px;
}
.auth-visual-content .preview-kicker { color: color-mix(in srgb, var(--brand) 72%, white); }
.auth-visual-content strong {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.04;
}
.auth-visual-content span {
  max-width: 440px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
}
.auth-card {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 420px;
  margin: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .13);
}
.auth-brand { margin-bottom: 22px; }
.auth-brand .brand-name { color: var(--text); }
.auth-brand .brand-subtitle { color: var(--muted); }
.auth-card h1 { font-size: 24px; }
.auth-form { margin-top: 18px; }
.auth-language {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}
.auth-legal {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.inline-form { display: inline; }
.dropzone {
  border: 1px dashed #94a3b8;
  border-radius: var(--control-radius);
  background: #f8fafc;
  padding: 14px;
  transition: border-color .15s, background .15s;
}
.dropzone.is-dragging { border-color: var(--brand); background: #ecfdf5; }
.dropzone input { margin-top: 10px; }
.inline-panel { box-shadow: none; margin: 0; background: var(--surface-soft); }

.browser-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
.browser-tree {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 116px);
  overflow: auto;
}
.tree-head, .browser-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
}
.tree-node span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.tree-node strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}
.tree-node:hover { background: var(--surface-soft); }
.tree-node.is-active {
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 14%, white);
  font-weight: 700;
}
.tree-node.is-active strong { color: var(--brand-dark); }
.level-2 { padding-left: 26px; }
.level-3 { padding-left: 44px; }
.browser-documents { min-width: 0; }
.dictionary-table {
  min-width: 780px;
  table-layout: fixed;
}
.dictionary-table th:nth-child(1),
.dictionary-table td:nth-child(1) { width: 52px; }
.dictionary-table th:nth-child(2),
.dictionary-table td:nth-child(2) { width: auto; }
.dictionary-table th:nth-child(3),
.dictionary-table td:nth-child(3) { display: none; }
.dictionary-table th:nth-child(4),
.dictionary-table td:nth-child(4) { width: 150px; }
.dictionary-edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}
.dictionary-edit input,
.dictionary-edit select { max-width: 100%; }
.dictionary-edit .checkbox-label {
  min-height: var(--control-height);
  gap: 5px;
  font-size: 11px;
}
.dictionary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dictionary-actions .btn {
  min-width: 0;
  padding-inline: 10px;
}
.custom-field-list { margin-top: 8px; }
.user-list {
  display: grid;
  gap: var(--gap);
}
.user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.user-edit { display: grid; gap: var(--gap); min-width: 0; }
.user-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.avatar-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 12%, white);
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.user-card-head strong,
.user-card-head span {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-head strong { color: var(--text); font-size: 15px; }
.user-card-head span { color: var(--muted); font-size: 12px; }
.user-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: var(--gap);
}
.user-fields label {
  display: grid;
  gap: 5px;
}
.user-fields .checkbox-label {
  display: inline-flex;
  align-self: end;
  min-height: 36px;
}
.user-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}
.user-card-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
}
.user-card-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-menu-identity { display: none; }
  .color-settings { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  .sidebar-footer { margin-top: 18px; }
  .topbar, .titlebar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-tools { justify-content: flex-start; }
  .user-menu-panel {
    left: 0;
    right: auto;
    width: min(300px, calc(100vw - 36px));
  }
  .page { padding: 18px; }
  .stats, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .branding-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual {
    min-height: 260px;
    padding: 26px;
  }
  .auth-card {
    align-self: start;
    max-width: none;
    margin: 16px;
  }
  .browser-layout { grid-template-columns: 1fr; }
  .browser-tree { position: static; max-height: none; }
  .title-actions { justify-content: flex-start; }
  .toolbar .field { min-width: 100%; }
  .dictionary-edit { grid-template-columns: 1fr; }
  .user-card { grid-template-columns: 1fr; }
  .user-card-meta, .user-card-actions { justify-content: flex-start; }
  .user-fields { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .panel { padding: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 13px; }
  .sidebar { padding: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .page { padding: 14px; }
  .title-actions, .dictionary-actions { width: 100%; }
  .title-actions .btn, .dictionary-actions .btn { flex: 1 1 auto; }
  .btn { width: auto; min-width: 0; }
  .stats { gap: 10px; }
  .card { padding: 12px; }
  .stat-value { font-size: 19px; }
  .table-wrap { border-radius: 8px; }
  th, td { padding: 8px 10px; }
  table { min-width: 720px; }
  .dictionary-table { min-width: 680px; }
  .color-settings { grid-template-columns: 1fr; }
  .auth-visual { min-height: 220px; }
  .auth-visual-content strong { font-size: 28px; }
}
