:root {
  --red: #9e1010;
  --red-deep: #700707;
  --ink: #202020;
  --muted: #77746f;
  --line: #e6e2dc;
  --paper: #f4f2ee;
  --white: #fff;
  --gold: #c8a25f;
  --green: #158d61;
  --shadow: 0 18px 48px rgba(37, 28, 17, .07);
  --number: "Bahnschrift", "DIN Alternate", "Arial Narrow", sans-serif;
  --ui: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(500px, 1.08fr) minmax(430px, .92fr);
  background: #f8f6f2;
}

.login-art {
  min-height: 100vh;
  padding: 46px clamp(45px, 6vw, 95px) 34px;
  display: flex;
  flex-direction: column;
  color: white;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 18%, rgba(218, 181, 110, .17), transparent 23%),
    radial-gradient(circle at 16% 83%, rgba(255,255,255,.05), transparent 29%),
    linear-gradient(145deg, #180e0d, #290d0c 45%, #580b0a);
}

.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 60% 50%, black, transparent 74%);
}

.login-art::after {
  content: "";
  position: absolute;
  width: 470px;
  height: 470px;
  right: -220px;
  top: -200px;
  border-radius: 50%;
  border: 1px solid rgba(225, 194, 130, .15);
  box-shadow: inset 0 0 0 72px rgba(255,255,255,.017), inset 0 0 0 144px rgba(255,255,255,.013);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  width: fit-content;
  position: relative;
  z-index: 2;
}

.admin-brand.light {
  color: white;
}

.brand-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(237, 205, 146, .5);
  display: grid;
  place-items: center;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  color: #e6c98f;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.02);
}

.admin-brand strong {
  display: block;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
}

.admin-brand small {
  display: block;
  margin-top: 4px;
  font-family: var(--number);
  font-size: 7px;
  letter-spacing: 1.8px;
  opacity: .48;
}

.art-copy {
  margin: auto 0 5vh;
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.art-kicker,
.panel-kicker,
.card-kicker {
  color: #c9a45d;
  font-family: var(--number);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
}

.art-copy h1 {
  margin: 20px 0 18px;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: clamp(37px, 4.2vw, 64px);
  line-height: 1.35;
  letter-spacing: 1px;
  font-weight: 600;
}

.art-copy h1 em {
  color: #d7b873;
  font-style: normal;
}

.art-copy p {
  margin: 0;
  color: rgba(255,255,255,.47);
  font-size: 13px;
  letter-spacing: .5px;
}

.art-quote {
  width: min(100%, 530px);
  min-height: 185px;
  padding: 20px 22px 0;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.art-quote-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.46);
  font-family: var(--number);
  font-size: 9px;
  letter-spacing: 1.4px;
}

.art-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8fdcb3;
}

.art-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #75dda6;
  box-shadow: 0 0 8px #75dda6;
}

.art-line {
  width: 100%;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.09), transparent);
}

.art-quote-value {
  margin-top: 13px;
  color: #f1dfb8;
  font-family: var(--number);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.art-quote-value > span {
  margin-right: 4px;
  color: rgba(241, 223, 184, .48);
  font-size: 20px;
}

.art-quote-value small {
  margin-left: 7px;
  color: rgba(255,255,255,.36);
  font-size: 12px;
}

.art-chart {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
}

.art-chart svg {
  width: 100%;
  height: 100%;
}

.art-footer {
  margin: 28px 0 0;
  color: rgba(255,255,255,.25);
  font-size: 9px;
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 42px;
  position: relative;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 84% 14%, rgba(201, 164, 93, .13), transparent 22%),
    radial-gradient(circle at 8% 86%, rgba(158, 16, 16, .045), transparent 20%);
  pointer-events: none;
}

.login-box {
  width: min(390px, 100%);
  position: relative;
}

.login-box h2 {
  margin: 10px 0 8px;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: 30px;
  letter-spacing: 1px;
}

.panel-desc {
  margin: 0 0 33px;
  color: #96918a;
  font-size: 12px;
}

.form-field {
  display: block;
  margin-bottom: 18px;
}

.form-field > span,
.compact-field > span {
  display: block;
  margin-bottom: 8px;
  color: #756f67;
  font-size: 11px;
  font-weight: 600;
}

.input-shell {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #ded9d1;
  border-radius: 9px;
  background: rgba(255,255,255,.7);
  transition: .2s ease;
}

.input-shell:focus-within {
  border-color: #a93a32;
  box-shadow: 0 0 0 3px rgba(158,16,16,.07);
  background: white;
}

.input-shell svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #a7a198;
  stroke-width: 1.6;
}

.input-shell input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.password-toggle {
  border: 0;
  background: transparent;
  color: #989187;
  font-size: 10px;
  padding: 5px;
}

.form-error {
  min-height: 19px;
  margin: -3px 0 9px;
  color: #bf2a20;
  font-size: 11px;
}

.login-button {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 9px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: linear-gradient(115deg, var(--red-deep), var(--red));
  box-shadow: 0 13px 28px rgba(126, 8, 8, .21);
  font-size: 13px;
  letter-spacing: 1px;
  transition: .2s ease;
}

.login-button b {
  font-size: 18px;
  font-weight: 400;
}

.login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 31px rgba(126, 8, 8, .27);
}

.login-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  color: #aaa39a;
  font-size: 9px;
}

.login-foot a {
  color: #8f877e;
  text-decoration: none;
}

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

.sidebar {
  width: 242px;
  height: 100vh;
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  color: white;
  background:
    radial-gradient(circle at 30% 8%, rgba(210, 173, 101, .1), transparent 23%),
    linear-gradient(175deg, #220d0d, #15100f 65%);
  z-index: 20;
}

.sidebar .admin-brand {
  margin: 0 7px 34px;
}

.sidebar .brand-seal {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.sidebar .admin-brand strong {
  font-size: 16px;
}

.side-label {
  margin: 0 13px 10px;
  color: rgba(255,255,255,.22);
  font-family: var(--number);
  font-size: 8px;
  letter-spacing: 2px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav button {
  width: 100%;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,.5);
  background: transparent;
  text-align: left;
  font-size: 12px;
  transition: .2s ease;
}

.side-nav button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav button:hover {
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.035);
}

.side-nav button.active {
  color: #f6e6c8;
  border-color: rgba(214, 177, 108, .16);
  background: linear-gradient(90deg, rgba(174, 39, 29, .34), rgba(255,255,255,.035));
  box-shadow: inset 2px 0 #d0a55b;
}

.side-market-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background: rgba(255,255,255,.028);
}

.side-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,.55);
}

.side-market-head span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.side-market-head i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75dda6;
  box-shadow: 0 0 8px rgba(117,221,166,.5);
}

.side-market-head i.offline {
  background: #e5a141;
  box-shadow: none;
}

.side-market-head b {
  color: #79d8a7;
  font-size: 9px;
  font-weight: 500;
}

.side-market-card > p {
  margin: 14px 0;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}

.side-market-time {
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.25);
  font-size: 8px;
}

.side-market-time strong {
  color: rgba(255,255,255,.55);
  font-family: var(--number);
}

.sidebar-user {
  margin-top: 13px;
  padding: 13px 5px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #dfc590;
  background: rgba(217, 187, 131, .1);
  border: 1px solid rgba(217, 187, 131, .16);
  font-size: 11px;
  flex: 0 0 auto;
}

.sidebar-user > span:nth-child(2) {
  min-width: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,.72);
}

.sidebar-user small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.26);
  font-size: 8px;
}

.sidebar-user button {
  margin-left: auto;
  padding: 5px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.28);
  font-size: 8px;
}

.sidebar-user button:hover {
  color: #fff;
}

.admin-main {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  padding: 0 32px 45px;
}

.admin-topbar {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e4dfd8;
}

.admin-topbar p {
  margin: 0 0 5px;
  color: #b39153;
  font-family: var(--number);
  font-size: 8px;
  letter-spacing: 2px;
}

.admin-topbar h1 {
  margin: 0;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: 23px;
  letter-spacing: 1px;
}

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

.ghost-button,
.refresh-button,
.secondary-button,
.primary-button,
.danger-button {
  border-radius: 7px;
  transition: .18s ease;
}

.ghost-button {
  height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #dcd7cf;
  color: #6e6962;
  background: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 10px;
}

.ghost-button svg,
.refresh-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #dcd7cf;
  color: #79736a;
  background: white;
}

.ghost-button:hover,
.refresh-button:hover,
.secondary-button:hover {
  border-color: #b8aea0;
  background: white;
}

.admin-panel {
  display: none;
  padding-top: 26px;
  animation: panel-in .25s ease;
}

.admin-panel.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.stat-card,
.content-card {
  border: 1px solid #e4dfd7;
  border-radius: 11px;
  background: rgba(255,255,255,.83);
  box-shadow: 0 2px 0 rgba(80, 64, 43, .015);
}

.stat-card {
  min-height: 113px;
  padding: 17px 18px;
}

.stat-label {
  display: block;
  color: #938c82;
  font-size: 9px;
  letter-spacing: .8px;
}

.stat-card > strong {
  display: block;
  margin: 13px 0 6px;
  font-family: var(--number);
  font-size: 23px;
  font-weight: 600;
}

.stat-card > strong small {
  color: #aaa39a;
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 400;
}

.stat-card p {
  margin: 0;
  color: #a59f96;
  font-size: 9px;
  white-space: nowrap;
}

.good-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--green);
}

.good-dot.offline {
  background: #d29233;
}

.stat-card.accent {
  color: #fff6e4;
  border-color: transparent;
  background:
    radial-gradient(circle at 88% 8%, rgba(255,255,255,.12), transparent 34%),
    linear-gradient(135deg, #8d0d0d, #b21b14);
}

.stat-card.accent .stat-label,
.stat-card.accent p {
  color: rgba(255,255,255,.55);
}

.action-grid {
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  gap: 13px;
  margin-top: 13px;
}

.content-card {
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.card-head h2,
.panel-heading h2 {
  margin: 5px 0 0;
  font-family: "STZhongsong", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  letter-spacing: .5px;
}

.tiny-badge,
.live-chip {
  padding: 4px 8px;
  border: 1px solid #e3d6bd;
  border-radius: 30px;
  color: #a17e3f;
  background: #fbf7ee;
  font-size: 8px;
}

.live-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  border-color: #cfeadd;
  color: var(--green);
  background: #edf8f3;
  font-family: var(--number);
  letter-spacing: .8px;
}

.live-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(21,141,97,.55);
}

.live-chip.cached {
  border-color: #f0dab5;
  color: #aa721a;
  background: #fdf7eb;
}

.adjust-card form {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  align-items: end;
  gap: 9px;
  margin-top: 19px;
}

.compact-field select,
.compact-field input,
.settings-fields input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #ded9d1;
  border-radius: 7px;
  outline: 0;
  color: #3f3b36;
  background: #fdfcf9;
  font-size: 11px;
  transition: .18s ease;
}

.compact-field select:focus,
.compact-field input:focus,
.settings-fields input:focus,
.settings-card textarea:focus {
  border-color: #ad5a51;
  box-shadow: 0 0 0 3px rgba(158,16,16,.055);
}

.primary-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #8d0d0d;
  color: white;
  background: linear-gradient(120deg, #800909, #aa1511);
  box-shadow: 0 7px 16px rgba(113, 8, 8, .12);
  font-size: 10px;
  white-space: nowrap;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(120deg, #730707, #9d0f0d);
}

.primary-button span {
  margin-left: 8px;
}

.helper-text {
  margin: 12px 0 0;
  color: #a49d94;
  font-size: 9px;
}

.helper-text b {
  color: #8c7660;
}

.feed-main {
  margin-top: 17px;
  display: grid;
  gap: 10px;
}

.feed-main > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-main span {
  color: #928c83;
  font-size: 9px;
}

.feed-main strong {
  color: #555049;
  font-size: 10px;
  font-weight: 500;
}

.feed-error {
  margin: 12px 0 0;
  padding: 8px 9px;
  border-radius: 5px;
  color: #9b6419;
  background: #fbf4e7;
  font-size: 8px;
  line-height: 1.5;
}

.quote-control-card {
  margin-top: 13px;
  padding: 0;
  overflow: hidden;
}

.quote-head {
  padding: 19px 20px 16px;
  align-items: center;
}

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

.unsaved-note {
  margin-right: 4px;
  color: #ae7a20;
  font-size: 9px;
}

.secondary-button {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid #ded9d1;
  color: #6e6962;
  background: #fff;
  font-size: 10px;
}

.control-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #eeeae4;
  border-bottom: 1px solid #eeeae4;
}

.control-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.control-table th {
  height: 39px;
  padding: 0 12px;
  color: #9b948b;
  background: #f8f6f2;
  border-bottom: 1px solid #eae5de;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .5px;
  text-align: left;
}

.control-table th:nth-child(1) {
  width: 19%;
}

.control-table th:nth-child(2) {
  width: 14%;
}

.control-table th:nth-child(3),
.control-table th:nth-child(5) {
  width: 12%;
}

.control-table th:nth-child(4),
.control-table th:nth-child(6) {
  width: 14%;
}

.control-table th:nth-child(7) {
  width: 15%;
}

.control-table td {
  height: 62px;
  padding: 7px 12px;
  border-bottom: 1px solid #f0ece6;
  font-size: 10px;
  vertical-align: middle;
}

.control-table tbody tr:hover {
  background: #fcfaf7;
}

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

.control-name strong {
  display: block;
  color: #37332e;
  font-size: 11px;
  font-weight: 600;
}

.control-name span {
  display: block;
  margin-top: 4px;
  color: #aaa39a;
  font-size: 8px;
}

.base-price,
.calculated-price {
  font-family: var(--number);
  font-variant-numeric: tabular-nums;
}

.base-price {
  color: #6f6960;
}

.calculated-price {
  color: #b5321d;
  font-size: 14px;
  font-weight: 600;
}

.offset-shell {
  display: flex;
  align-items: center;
  width: 100%;
  height: 33px;
  border: 1px solid #dfdad2;
  border-radius: 6px;
  background: #fdfcf9;
  overflow: hidden;
}

.offset-shell:focus-within {
  border-color: #b76a62;
  box-shadow: 0 0 0 2px rgba(158,16,16,.05);
}

.offset-shell button {
  width: 25px;
  height: 100%;
  flex: 0 0 auto;
  border: 0;
  color: #8d867d;
  background: #f5f2ed;
  font-family: var(--number);
  font-size: 14px;
}

.offset-shell button:hover {
  color: var(--red);
  background: #eee8df;
}

.offset-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 5px;
  border: 0;
  outline: 0;
  color: #48433c;
  background: transparent;
  font-family: var(--number);
  font-size: 11px;
  text-align: center;
  -moz-appearance: textfield;
}

.offset-shell input::-webkit-inner-spin-button,
.offset-shell input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.quick-actions button {
  min-width: 31px;
  height: 25px;
  padding: 0 5px;
  border: 1px solid #e1dcd4;
  border-radius: 4px;
  color: #817a71;
  background: #fff;
  font-family: var(--number);
  font-size: 8px;
}

.quick-actions button:hover {
  color: var(--red);
  border-color: #e0b4ae;
  background: #fdf7f5;
}

.table-loading {
  color: #9a9389 !important;
  text-align: center !important;
  padding: 35px !important;
}

.table-foot {
  min-height: 42px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a19a91;
  font-size: 8px;
}

.table-foot > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-foot i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9a157;
}

.panel-heading {
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 7px 0 6px;
  font-size: 23px;
}

.panel-heading p {
  margin: 0;
  color: #918a80;
  font-size: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 13px;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.settings-fields .full {
  grid-column: 1 / -1;
}

.settings-fields .form-field {
  margin: 0;
}

.settings-fields .form-field > span {
  color: #8e877d;
  font-size: 9px;
}

.mode-options {
  display: grid;
  gap: 9px;
  margin-top: 19px;
}

.mode-options label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #e4ded7;
  border-radius: 8px;
  background: #fcfaf7;
  cursor: pointer;
  transition: .18s ease;
}

.mode-options label:has(input:checked) {
  border-color: #ccaca6;
  background: #fdf7f5;
  box-shadow: inset 3px 0 #ad2016;
}

.mode-options input {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
}

.mode-options b {
  display: block;
  color: #504b44;
  font-size: 10px;
  font-weight: 600;
}

.mode-options small {
  display: block;
  margin-top: 3px;
  color: #a49d93;
  font-size: 8px;
}

.chars-count {
  color: #a39c93;
  font-family: var(--number);
  font-size: 9px;
}

.settings-card textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #ded9d1;
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  color: #49443d;
  background: #fdfcf9;
  font-size: 11px;
  line-height: 1.7;
}

.settings-submit {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.audit-card {
  padding: 0;
  overflow: hidden;
}

.audit-list {
  padding: 4px 20px;
}

.audit-item {
  display: grid;
  grid-template-columns: 115px 120px 1fr;
  gap: 16px;
  align-items: start;
  min-height: 68px;
  padding: 16px 0;
  border-bottom: 1px solid #eeeae4;
}

.audit-item:last-child {
  border-bottom: 0;
}

.audit-time {
  color: #a29b91;
  font-family: var(--number);
  font-size: 9px;
  line-height: 1.5;
}

.audit-action span {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 3px;
  color: #9c1b12;
  background: #faeee9;
  font-size: 8px;
}

.audit-detail {
  color: #6f6961;
  font-size: 10px;
  line-height: 1.7;
  word-break: break-word;
}

.audit-detail small {
  margin-left: 8px;
  color: #b2aba2;
  font-size: 8px;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 15, 12, .45);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(360px, 100%);
  padding: 25px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
  text-align: center;
}

.confirm-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 13px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #b97b12;
  background: #fbf2df;
  font-family: Georgia, serif;
  font-size: 18px;
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.confirm-dialog p {
  margin: 0 0 20px;
  color: #8e877e;
  font-size: 10px;
  line-height: 1.7;
}

.confirm-dialog > div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.danger-button {
  min-height: 35px;
  padding: 0 17px;
  border: 1px solid #8f0d0d;
  color: white;
  background: #a41412;
  font-size: 10px;
}

.admin-toast {
  position: fixed;
  right: 28px;
  bottom: 27px;
  z-index: 120;
  padding: 11px 15px;
  border-radius: 7px;
  color: white;
  background: rgba(32, 28, 25, .95);
  box-shadow: 0 14px 40px rgba(0,0,0,.2);
  font-size: 10px;
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.error {
  background: #9e1512;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .admin-main {
    padding-inline: 22px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card.wide {
    grid-column: auto;
  }

  .adjust-card form {
    grid-template-columns: 1.25fr 1fr 1fr auto;
  }
}

@media (max-width: 860px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 430px;
    padding: 30px;
  }

  .art-copy {
    margin: 70px 0 0;
  }

  .art-copy h1 {
    font-size: 37px;
  }

  .art-quote {
    margin-top: 34px;
  }

  .art-footer {
    margin-top: 18px;
  }

  .login-panel {
    padding: 44px 28px;
  }

  .admin-shell {
    display: block;
  }

  .sidebar {
    width: 72px;
    padding: 22px 10px 14px;
  }

  .sidebar .admin-brand {
    margin: 0 auto 27px;
  }

  .sidebar .admin-brand > span:last-child,
  .side-label,
  .side-nav button > span,
  .side-market-card,
  .sidebar-user > span:nth-child(2),
  .sidebar-user button {
    display: none;
  }

  .side-nav button {
    justify-content: center;
    padding: 0;
  }

  .side-nav button svg {
    width: 19px;
    height: 19px;
  }

  .sidebar-user {
    justify-content: center;
    margin-top: auto;
  }

  .admin-main {
    margin-left: 72px;
    padding-inline: 18px;
  }

  .admin-topbar {
    height: 85px;
  }
}

@media (max-width: 640px) {
  .login-art {
    min-height: 385px;
    padding: 22px 20px;
  }

  .art-copy {
    margin-top: 48px;
  }

  .art-copy h1 {
    font-size: 29px;
    line-height: 1.4;
  }

  .art-copy p {
    font-size: 10px;
  }

  .art-quote {
    display: none;
  }

  .login-panel {
    padding: 36px 20px;
  }

  .login-box h2 {
    font-size: 25px;
  }

  .login-foot {
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 62px;
    inset: auto 0 0 0;
    padding: 7px 10px;
    flex-direction: row;
    align-items: center;
  }

  .sidebar .admin-brand,
  .sidebar-user {
    display: none;
  }

  .side-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .side-nav button {
    height: 46px;
    flex-direction: column;
    gap: 2px;
  }

  .side-nav button > span {
    display: block;
    font-size: 8px;
  }

  .side-nav button.active {
    box-shadow: inset 0 2px #d0a55b;
  }

  .admin-main {
    margin: 0;
    padding: 0 12px 85px;
  }

  .admin-topbar {
    height: 74px;
  }

  .admin-topbar h1 {
    font-size: 19px;
  }

  .ghost-button {
    display: none;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    min-height: 100px;
    padding: 13px;
  }

  .stat-card > strong {
    font-size: 18px;
  }

  .stat-card p {
    white-space: normal;
    line-height: 1.5;
  }

  .content-card {
    padding: 15px;
  }

  .adjust-card form {
    grid-template-columns: 1fr 1fr;
  }

  .adjust-card form .compact-field:first-child {
    grid-column: 1 / -1;
  }

  .adjust-card form .primary-button {
    grid-column: 1 / -1;
  }

  .quote-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-head-actions {
    width: 100%;
  }

  .unsaved-note {
    margin-right: auto;
  }

  .control-table {
    min-width: 760px;
  }

  .table-foot {
    min-height: 50px;
  }

  .table-foot > span:first-child {
    max-width: 230px;
    line-height: 1.6;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .settings-fields .full {
    grid-column: auto;
  }

  .settings-submit .primary-button {
    width: 100%;
  }

  .audit-item {
    grid-template-columns: 80px 1fr;
    gap: 9px;
  }

  .audit-detail {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
