/* Adapt existing CMS component classes to admin-template/components.css. */
body { margin: 0; font-family: var(--font-sans); font-size: var(--fs-base); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.25; font-weight: 650; }
::selection { background: var(--accent-ring); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.btn { justify-content: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-sm); border-color: var(--border-strong); font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; transition: background var(--transition),border-color var(--transition); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { background: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 8px; border-radius: var(--radius-sm); color: var(--text-muted); position: relative; flex: none; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.panel { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.panel-h { padding: var(--sp-4) var(--sp-5); }
.panel-h h2,.fold-btn { font-size: var(--fs-base); }
.panel-b { padding: var(--sp-5); }
.stack { gap: var(--sp-4); }
.ph { gap: var(--sp-4); margin-bottom: var(--sp-5); }
.ph h1 { font-size: var(--fs-2xl); }
.ph .desc { margin-top: 4px; font-size: var(--fs-sm); }
.field { margin-bottom: var(--sp-4); }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.input,select.input,textarea.input { border-color: var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; transition: border-color var(--transition),box-shadow var(--transition); }
.input::placeholder { color: var(--text-faint); }
.input:focus { box-shadow: 0 0 0 3px var(--accent-ring); }
table { font-size: var(--fs-sm); }
th { background: var(--surface); font-weight: 650; font-size: 11px; letter-spacing: .07em; padding: 11px var(--sp-4); }
td { padding: 11px var(--sp-4); }
tbody tr:hover { background: var(--surface-2); }
.reference-table { min-width: 640px; }
.reference-table input[name="label"] { min-width: 280px; }
.filters { padding: var(--sp-3) var(--sp-5); gap: var(--sp-3); }
.filters .seg { flex-wrap: wrap; }
.pill { font-size: 11px; font-weight: 650; padding: 2px 9px; }
.track { grid-template-columns: repeat(8,minmax(112px,1fr)); }
.avatar { width: 36px; height: 36px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: 700; flex: none; }
.seg { background: var(--surface-2); padding: 3px; gap: 3px; border: 0; border-radius: var(--radius); }
.seg button { border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.breadcrumb { flex: 1; min-width: 0; }
.breadcrumb .current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header .user-btn { padding: 3px; }
.header .bell-btn { border: 0; background: transparent; }
.header .menu { top: calc(100% + 8px); border-radius: var(--radius); }
.header .lang { flex: none; }
.sidebar .nav-link svg { flex: none; }
.nav-link.later { cursor: default; opacity: .55; }
.nav-link.later .nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav-link.later .tag { margin-left: auto; font-size: 9px; }
.nav-link.later:hover { background: transparent; }
[data-sidebar="collapsed"] .nav-link.later .tag { display: none; }
.sidebar-foot .avatar { width: 32px; height: 32px; }
.sidebar-user .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-aside .brand { color: #e0e3eb; margin-bottom: 64px; }
.auth-aside .brand-text { display: inline !important; }
.auth-aside .login-facts { color: #9aa0ae; }
.auth-aside .login-foot { opacity: 1; color: #656b7a; }
.auth-card .sub { color: var(--text-muted); margin: 4px 0 24px; }
.auth-toolbar { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 8px; }
.auth-main { background: var(--bg); }
.auth-card { padding: var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.customizer[hidden] { display: none; }
.customizer h3 { font-size: var(--fs-lg); }
.customizer section { min-width: 0; }
.customizer .hint { color: var(--text-faint); font-size: var(--fs-xs); }
.font-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
.font-option { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; font-family: var(--font-sans); font-size: var(--fs-sm); min-width: 0; }
.font-option:hover { border-color: var(--border-strong); }
.font-option[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.font-option small { color: var(--text-muted); font-size: var(--fs-xs); }
.font-hint { margin: var(--sp-2) 0 0; }
.theme-modal-open { overflow: hidden; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--up); border-radius: var(--radius); }
.toast.err { background: var(--surface); border-left-color: var(--down); }
.toast.err svg { color: var(--down); }
.error-card { width: min(460px,100%); padding: var(--sp-6); }
.error-card p { color: var(--text-muted); margin: var(--sp-5) 0; }
.error-card .btn-row { justify-content: center; }
[data-density="compact"] td,[data-density="compact"] th { padding-top: 7px; padding-bottom: 7px; }
[data-density="compact"] .doc-row,[data-density="compact"] .nlist.big .nitem { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 992px) {
  body.sidebar-open { overflow: hidden; }
  [data-sidebar="collapsed"] .nav-link.later .tag { display: inline-flex; }
  .auth-main { min-height: 100vh; }
}
@media (max-width: 768px) {
  .header .user-meta { display: none; }
  .header-search { display: none; }
  .header-actions { gap: 2px; }
  .header .lang button { padding: 5px 7px; min-width: 0; }
  .ph h1 { font-size: 1.4rem; }
  .panel-h,.panel-b,.filters { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .filters .q { min-width: 0; flex-basis: 100%; }
  .filters .input { max-width: 100%; }
  .filters .seg { width: 100%; }
  .perm-grid { grid-template-columns: 1fr; }
  .auth-card { padding: var(--sp-5); }
  .auth-toolbar { top: 12px; right: 12px; }
  .footer { font-size: 11px; }
}
@media (max-width: 480px) {
  .header { gap: 8px; padding: 0 8px; }
  .header .btn-icon { width: 32px; height: 32px; padding: 6px; }
  .header .user-btn { gap: 0; }
  .header .user-btn > svg { display: none; }
  .header .avatar { width: 32px; height: 32px; }
  .header .lang button { padding-left: 5px; padding-right: 5px; }
}
