.card {
  background: var(--panel);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--panel-shadow);
}
.primary, .secondary, .nav {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.primary { background: var(--text); color: #fff; border-color: var(--text); }
.primary:hover:not(:disabled) { background: #383838; border-color: #383838; }
.secondary { background: #fff; border-color: #bcbcb7; color: var(--text); }
.secondary:hover:not(:disabled) { background: #ededeb; border-color: #737373; }
.nav { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent; }
label { display: block; font-size: 12px; font-weight: 600; }
input, select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid #bfbfba;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}
input::placeholder { color: #6c6c6c; }
input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--text);
}
input:hover, select:hover { border-color: #858585; }
input:focus, select:focus { border-color: var(--text); }
form > label { margin-bottom: 17px; }
.filters > label { margin-bottom: 0; }
input[type=checkbox] {
  width: 19px;
  height: 19px;
  min-height: 19px;
  margin: 0;
  accent-color: var(--text);
}
.check-label { display: flex; gap: 9px; align-items: center; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #aaa #f2f2f0; scrollbar-width: thin; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; white-space: nowrap; }
th { background: var(--header-bg); color: var(--accent); font-size: 12px; font-weight: 600; }
td, th { padding: 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td { font-size: 13px; }
td .secondary { min-height: 36px; padding: 7px 10px; font-size: 11px; margin-right: 5px; }
.badge { display: inline-flex; padding: 4px 9px; border: 1px solid var(--line); border-radius: 4px; background: #f4f4f2; font-size: 11px; }
.badge.yes { background: #242424; color: #fff; border-color: #242424; }
#notice {
  margin-bottom: 22px;
  padding: 14px 17px;
  border: 1px solid #bababa;
  border-left: 4px solid var(--text);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
}
#notice.error { background: #ededeb; border-color: #5c5c5c; }
#notice.error, #editor-error { color: var(--text); font-weight: 600; }
dialog {
  width: min(510px, 94vw);
  max-height: min(90vh, 90dvh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 80px #10291f33;
  color: var(--text);
  background: #fff;
}
dialog::backdrop { background: #0008; }
dialog h2 { font-size: 20px; margin-bottom: 20px; }
#editor-fields { display: grid; gap: 15px; }
#editor-error:empty { display: none; }
.password-field { position: relative; display: block; margin-top: 7px; }
.password-field input { margin-top: 0; padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #5c5c5c;
}
.password-toggle:hover { color: var(--text); background: #f0f0ee; }
.password-toggle[aria-pressed="true"] { color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; flex: none; }
.auth-card form { margin-top: 30px; }
.auth-card form > label { margin: 20px 0 0; }
.auth-card form > label:first-of-type { margin-top: 0; }
.auth-card .primary { width: 100%; margin-top: 24px; min-height: 48px; }
.template-lock { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.template-lock[aria-pressed="true"] { background: #ecece9; border-color: #222; }
@media (max-width: 520px) {
  .card { padding: 18px; border-radius: 16px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 32px); padding: 23px 18px; }
  td, th { padding: 13px 10px; }
  td .secondary { min-height: 44px; }
}
@media (max-width: 900px) {
  input:not([type=checkbox]), select { font-size: 16px; }
}
@media (forced-colors: active) {
  input:-webkit-autofill { -webkit-text-fill-color: CanvasText; -webkit-box-shadow: none; }
}
