:root {
  --bg: #f4f1e9;
  --bg-deep: #eee9de;
  --surface: #fffdf8;
  --surface-soft: #faf6ee;
  --ink: #252a23;
  --ink-soft: #4e5349;
  --muted: #8b8479;
  --muted-light: #b2aa9e;
  --line: #e9e1d5;
  --line-soft: #f1ebe1;
  --accent: #f26b3a;
  --accent-deep: #d95a2b;
  --accent-soft: #fce9de;
  --green: #22372c;
  --green-2: #2d4a3b;
  --green-soft: #e6efe9;
  --sage: #7e9b86;
  --gold: #d9a84e;
  --red: #c9564b;
  --red-soft: #fbeae7;
  --blue-soft: #e8f0f4;
  --shadow: 0 16px 40px rgba(54, 43, 28, 0.055);
  --shadow-strong: 0 24px 60px rgba(31, 24, 16, 0.16);
  --radius: 20px;
  --sidebar-width: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: inherit;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}

.hidden,
[hidden] {
  display: none !important;
}

body.no-scroll {
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}

.eyebrow-light {
  margin: 0 0 18px;
  color: rgba(250, 246, 236, 0.42);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.8px;
}

/* ========== Login ========== */
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(430px, 47%) 1fr;
  background: var(--surface);
}

.login-art {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 42px 52px;
  display: flex;
  flex-direction: column;
  color: #fbf7ed;
  background:
    radial-gradient(circle at 82% 18%, rgba(242, 168, 94, 0.12), transparent 34%),
    linear-gradient(148deg, #2c493a 0%, #18271f 72%);
}

.login-art::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    radial-gradient(rgba(255, 248, 235, 0.1) 0.8px, transparent 0.8px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.login-art-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.glow-a {
  width: 420px;
  height: 420px;
  right: -190px;
  top: -130px;
  background: rgba(242, 140, 84, 0.12);
}

.glow-b {
  width: 320px;
  height: 320px;
  left: -130px;
  bottom: -140px;
  background: rgba(118, 156, 128, 0.1);
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.4px;
}

.login-brand em {
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 5px;
  color: rgba(255, 249, 238, 0.5);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 1.4px;
  vertical-align: 2px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 247, 234, 0.1);
  border: 1px solid rgba(255, 247, 234, 0.14);
  display: grid;
  place-items: center;
  color: #f4c6a4;
}

.brand-mark .icon {
  width: 23px;
  height: 23px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 247, 234, 0.08);
  border-color: rgba(255, 247, 234, 0.1);
}

.brand-mark.small .icon {
  width: 20px;
  height: 20px;
}

.login-hero {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 36px;
  max-width: 480px;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(38px, 4vw, 55px);
  font-weight: 780;
  line-height: 1.26;
  letter-spacing: -1.6px;
}

.login-intro {
  max-width: 420px;
  margin: 20px 0 0;
  color: rgba(248, 243, 233, 0.56);
  font-size: 13.5px;
  line-height: 1.85;
}

.login-preview {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  padding: 20px 22px 16px;
  margin-bottom: 44px;
  border: 1px solid rgba(250, 245, 235, 0.12);
  border-radius: 18px;
  background: rgba(250, 246, 236, 0.055);
  backdrop-filter: blur(14px);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(250, 246, 236, 0.48);
  font-size: 11px;
}

.preview-badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(242, 107, 58, 0.18);
  color: #ffb897;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.preview-amount {
  margin-top: 6px;
  font-size: 33px;
  font-weight: 760;
  letter-spacing: -1.2px;
  font-variant-numeric: tabular-nums;
}

.preview-amount span {
  color: rgba(250, 246, 236, 0.55);
  font-size: 17px;
}

.preview-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 62px;
  margin-top: 15px;
  padding-bottom: 1px;
}

.preview-chart i {
  flex: 1;
  min-height: 5px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(250, 246, 236, 0.16);
}

.preview-chart i.active {
  background: linear-gradient(to top, #f26b3a, #f3a068);
  box-shadow: 0 6px 18px rgba(242, 107, 58, 0.25);
}

.preview-foot {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(250, 246, 236, 0.09);
  color: rgba(250, 246, 236, 0.42);
  font-size: 10px;
}

.login-art-foot {
  position: relative;
  z-index: 2;
  margin: 0;
  color: rgba(250, 246, 236, 0.24);
  font-size: 9px;
  letter-spacing: 2px;
}

.login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 36px 70px;
  background:
    radial-gradient(circle at 88% 8%, rgba(242, 156, 104, 0.1), transparent 30%),
    var(--surface);
}

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

.login-box h2 {
  margin: 0;
  font-size: 31px;
  font-weight: 760;
  letter-spacing: -0.8px;
}

.login-sub {
  margin: 9px 0 30px;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.input-wrap input::placeholder {
  color: var(--muted-light);
}

.input-wrap input:focus {
  border-color: #e9a88d;
  box-shadow: 0 0 0 4px rgba(242, 107, 58, 0.09);
  background: #fff;
}

.form-error {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: #a8443b;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  transition: transform 0.16s, background 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(242, 107, 58, 0.22);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-login {
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: 12px;
  font-size: 14px;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface-soft);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #b7473d;
}

.btn.is-loading {
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-hint {
  margin: 20px 0 0;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.7;
}

.login-copyright {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0;
  padding: 0 20px;
  color: var(--muted-light);
  font-size: 10px;
  letter-spacing: 0.2px;
  text-align: center;
}

/* ========== Shell ========== */
.dashboard {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  color: #f8f3e9;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.06), transparent 34%),
    linear-gradient(180deg, #263c2f 0%, #1b2a22 100%);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.3px;
}

.sidebar-brand small {
  display: block;
  margin-top: 1px;
  color: rgba(248, 243, 233, 0.36);
  font-size: 9px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border-radius: 11px;
  color: rgba(248, 243, 233, 0.55);
  text-align: left;
  font-size: 13px;
  font-weight: 550;
  transition: color 0.18s, background 0.18s;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  opacity: 0.72;
}

.nav-item:hover {
  color: rgba(248, 243, 233, 0.9);
  background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
  color: #fff9ef;
  background: rgba(255, 248, 235, 0.1);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 12px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: #f29a69;
}

.nav-item.active .icon {
  opacity: 1;
  color: #f5a779;
}

.sidebar-rule {
  height: 1px;
  margin: 20px 12px;
  background: rgba(255, 255, 255, 0.075);
}

.sidebar-tip {
  display: flex;
  gap: 10px;
  margin: 0 4px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 248, 235, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.tip-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9fbfa9;
  flex: 0 0 auto;
}

.tip-icon .icon {
  width: 17px;
  height: 17px;
}

.sidebar-tip strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.sidebar-tip p {
  margin: 3px 0 0;
  color: rgba(248, 243, 233, 0.33);
  font-size: 9.5px;
  line-height: 1.6;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 26px;
}

.side-action {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  color: rgba(248, 243, 233, 0.46);
  font-size: 11.5px;
  text-align: left;
  transition: background 0.18s, color 0.18s;
}

.side-action .icon {
  width: 16px;
  height: 16px;
}

.side-action:hover {
  color: #fff8ed;
  background: rgba(255, 255, 255, 0.05);
}

.side-action.logout:hover {
  color: #f5b5ac;
}

.version {
  margin: 20px 0 0;
  padding: 0 12px;
  color: rgba(248, 243, 233, 0.18);
  font-size: 8.5px;
  letter-spacing: 1.3px;
}

.sidebar-scrim {
  display: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  padding: 16px 34px;
  background: rgba(244, 241, 233, 0.88);
  border-bottom: 1px solid rgba(226, 217, 204, 0.7);
  backdrop-filter: blur(14px);
}

.icon-btn.menu-btn {
  display: none;
}

.page-heading {
  min-width: 0;
}

.page-heading p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
}

.page-heading h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.7px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.month-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  cursor: pointer;
}

.month-control .icon {
  width: 15px;
  height: 15px;
}

.month-control input {
  width: 112px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.icon-btn:hover {
  background: #fffdf8;
  border-color: #dcd2c4;
  color: var(--ink);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn.spinning .icon {
  animation: spin 0.8s linear infinite;
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f5a172, #f26b3a);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(242, 107, 58, 0.19);
}

.admin-copy strong {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.3;
}

.admin-copy small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.content {
  padding: 26px 34px 52px;
  max-width: 1580px;
  margin: 0 auto;
}

/* ========== Shared panels ========== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.panel-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.panel-link:hover {
  color: var(--accent);
}

.panel-link .icon {
  width: 13px;
  height: 13px;
}

/* ========== KPI ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 96px;
  right: -34px;
  bottom: -48px;
  border-radius: 50%;
  background: var(--kpi-tint, var(--accent-soft));
  opacity: 0.48;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--kpi-tint, var(--accent-soft));
  color: var(--kpi-ink, var(--accent-deep));
}

.kpi-icon .icon {
  width: 18px;
  height: 18px;
}

.kpi-value {
  margin: 12px 0 0;
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -1.2px;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 650;
}

.delta.up {
  background: var(--accent-soft);
  color: #c15b32;
}

.delta.down {
  background: var(--green-soft);
  color: #5e826d;
}

.delta.flat {
  background: var(--surface-soft);
  color: var(--muted);
}

/* ========== Dashboard grids ========== */
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.trend-panel {
  min-height: 350px;
}

.chart-body {
  padding: 18px 20px 20px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.category-panel {
  min-height: 350px;
}

.donut-area {
  display: flex;
  justify-content: center;
  padding: 18px 16px 8px;
}

.donut {
  position: relative;
  width: 166px;
  height: 166px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.3s;
}

.donut:hover {
  transform: rotate(1deg);
}

.donut-hole {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(233, 225, 213, 0.55);
}

.donut-hole span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.6px;
}

.donut-hole strong {
  margin-top: 2px;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.donut-hole small {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 8.5px;
}

.category-legend {
  padding: 2px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
}

.legend-color {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.legend-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.legend-icon .icon {
  width: 13px;
  height: 13px;
}

.legend-name {
  flex: 1;
  min-width: 0;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legend-pct {
  width: 38px;
  text-align: right;
  color: var(--muted-light);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mini-list {
  padding: 10px 22px 18px;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-rank {
  width: 20px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  font-size: 15px;
  flex: 0 0 auto;
}

.mini-avatar .icon {
  width: 15px;
  height: 15px;
  color: var(--sage);
}

.mini-avatar.mini-device {
  background: var(--green-soft);
}

.mini-main {
  flex: 1;
  min-width: 0;
}

.mini-name {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-value {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ========== Tables ========== */
.table-panel {
  overflow: hidden;
}

.recent-panel .table-wrap {
  padding: 6px 0 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  padding: 12px 16px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: left;
  text-transform: uppercase;
  background: var(--surface-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  vertical-align: middle;
}

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

.data-table tbody tr {
  transition: background 0.16s;
}

.data-table tbody tr:hover {
  background: #fdfaf4;
}

.data-table .align-right {
  text-align: right;
}

.data-table .align-center {
  text-align: center;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  font-size: 15px;
  flex: 0 0 auto;
}

.cell-avatar.round {
  border-radius: 50%;
}

.cell-title {
  display: block;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.cell-note {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.money.negative {
  color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.badge .icon {
  width: 11px;
  height: 11px;
}

.cat-badge {
  gap: 5px;
  padding: 3px 8px 3px 6px;
  font-weight: 500;
}

.badge.accent {
  background: var(--accent-soft);
  color: #b95a34;
}

.badge.green {
  background: var(--green-soft);
  color: #5b7b66;
}

.badge.red {
  background: var(--red-soft);
  color: #a9473e;
}

.badge.blue {
  background: var(--blue-soft);
  color: #507284;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.action-link {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  transition: background 0.16s, color 0.16s;
}

.action-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.action-link.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.action-link .icon {
  width: 14px;
  height: 14px;
  display: inline-block;
}

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
  flex: 1;
  max-width: 330px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted-light);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  font-size: 12px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.search-box input::placeholder {
  color: var(--muted-light);
}

.search-box input:focus {
  border-color: #e7b8a3;
  box-shadow: 0 0 0 3px rgba(242, 107, 58, 0.07);
}

.select-control {
  height: 38px;
  padding: 0 28px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238b8479' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 11.5px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.toolbar-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 10.5px;
}

.toolbar-meta strong {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.filter-chip:hover {
  color: var(--ink);
}

.page-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.page-summary strong {
  color: var(--ink);
}

.content-card {
  padding: 20px 22px;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10.5px;
}

.page-buttons {
  display: flex;
  gap: 4px;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.page-btn:hover:not(:disabled) {
  border-color: #d8cbbb;
  color: var(--ink);
  background: var(--surface-soft);
}

.page-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff8ed;
}

.page-btn:disabled {
  opacity: 0.42;
}

/* ========== Empty / loading / error ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 58px 24px;
  text-align: center;
}

.empty-emoji {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  font-size: 25px;
}

.empty-state h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.empty-state p {
  max-width: 280px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.error-state {
  padding: 48px 24px;
  border: 1px solid #efd8d3;
  border-radius: var(--radius);
  background: #fffaf8;
  text-align: center;
}

.error-state h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.error-state p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
}

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

.skeleton {
  position: relative;
  overflow: hidden;
  height: 116px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.4s infinite;
}

.skeleton.wide {
  height: 350px;
  margin-top: 16px;
}

.skeleton.table {
  height: 300px;
  margin-top: 16px;
}

/* ========== Drawer ========== */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 29, 24, 0.28);
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(480px, 94vw);
  padding: 0;
  background: var(--bg);
  box-shadow: -24px 0 60px rgba(30, 26, 18, 0.16);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.24, 1);
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 26px 18px;
  background: rgba(244, 241, 233, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.5px;
}

.drawer-content {
  padding: 20px 24px 36px;
}

.drawer-hero {
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-2);
  flex: 0 0 auto;
}

.device-avatar .icon {
  width: 22px;
  height: 22px;
}

.drawer-title-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.drawer-title-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.drawer-metric {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.drawer-metric span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.drawer-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.drawer-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.drawer-section h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.drawer-section h4 span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 400;
}

.drawer-list {
  display: flex;
  flex-direction: column;
}

.drawer-record {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-record:last-child {
  border-bottom: 0;
}

.drawer-record .cell-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
}

.drawer-record .category-cell-icon .icon {
  width: 13px;
  height: 13px;
}

.drawer-record-main {
  flex: 1;
  min-width: 0;
}

.drawer-record-main strong {
  display: block;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-record-main span {
  display: block;
  color: var(--muted-light);
  font-size: 9px;
}

.drawer-record-money {
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.drawer-actions .btn {
  flex: 1;
}

/* ========== Modal ========== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 27, 22, 0.45);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(100%, 400px);
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
  animation: modal-in 0.22s ease both;
}

.modal-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--red-soft);
  color: var(--red);
}

.modal-icon .icon {
  width: 20px;
  height: 20px;
}

.modal-card h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.4px;
}

.modal-message {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== Toast ========== */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: #2d3c32;
  color: #fbf6eb;
  box-shadow: 0 14px 36px rgba(24, 27, 22, 0.22);
  font-size: 11.5px;
  pointer-events: auto;
  animation: toast-in 0.25s ease both;
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9c5a9;
  flex: 0 0 auto;
}

.toast.error {
  background: #4b2c28;
}

.toast.error::before {
  background: #eba79d;
}

.toast.leaving {
  animation: toast-out 0.2s ease both;
}

/* ========== Animations ========== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid,
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .login-art {
    min-height: 420px;
    padding: 32px;
  }

  .login-hero {
    margin: 50px 0 24px;
  }

  .login-preview {
    display: none;
  }

  .login-art-foot {
    display: none;
  }

  .login-panel {
    padding: 42px 24px 60px;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 0.24s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(23, 28, 23, 0.36);
    backdrop-filter: blur(2px);
  }

  .main {
    margin-left: 0;
  }

  .icon-btn.menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 13px 20px;
    gap: 12px;
  }

  .content {
    padding: 20px 20px 40px;
  }

  .admin-copy {
    display: none;
  }

  .admin-chip {
    padding-left: 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-wrap: wrap;
    min-height: 74px;
  }

  .page-heading {
    flex: 1;
  }

  .page-heading h1 {
    font-size: 20px;
  }

  .topbar-actions {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 4px;
  }

  .month-control {
    flex: 1;
  }

  .month-control input {
    width: 100%;
  }

  .content {
    padding: 16px 14px 34px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-card {
    padding: 15px 14px 13px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .kpi-icon {
    width: 31px;
    height: 31px;
  }

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

  .panel-head {
    padding: 18px 18px 0;
  }

  .chart-body {
    padding: 14px 12px 16px;
  }

  .category-legend {
    padding: 2px 18px 18px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .toolbar-meta {
    width: 100%;
    margin-left: 0;
  }

  .search-box {
    max-width: none;
    min-width: 160px;
  }

  .recent-panel .data-table th:nth-child(3),
  .recent-panel .data-table td:nth-child(3),
  .recent-panel .data-table th:nth-child(4),
  .recent-panel .data-table td:nth-child(4) {
    display: none;
  }

  .recent-panel .data-table th,
  .recent-panel .data-table td {
    padding: 10px 8px;
  }

  .recent-panel .cell-sub {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .trend-panel,
  .category-panel {
    min-height: 0;
  }

  .login-art {
    min-height: 300px;
    padding: 26px 24px;
  }

  .login-hero {
    margin: 34px 0 0;
  }

  .login-hero h1 {
    font-size: 31px;
    letter-spacing: -1px;
  }

  .login-intro {
    display: none;
  }

  .login-panel {
    padding: 32px 22px 54px;
  }

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

  .drawer-content {
    padding: 18px 16px 30px;
  }

  .drawer-head {
    padding: 20px 18px 15px;
  }

  .toast-root {
    right: 14px;
    bottom: 14px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card {
    padding: 13px 12px 12px;
  }

  .kpi-value {
    font-size: 21px;
  }

  .kpi-label {
    font-size: 10px;
  }

  .kpi-icon {
    width: 28px;
    height: 28px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
  }

  .admin-avatar {
    width: 33px;
    height: 33px;
  }
}

/* ========== Site settings ========== */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.settings-panel {
  overflow: hidden;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line-light, #f0e9df);
}

.settings-head h2 {
  margin: 3px 0 0;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.6px;
}

.settings-sub {
  max-width: 540px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.settings-saved {
  flex: 0 0 auto;
  padding-top: 3px;
  color: var(--muted-light);
  font-size: 10.5px;
  white-space: nowrap;
}

.site-form {
  padding: 0 26px 24px;
}

.form-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line-light, #f0e9df);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.form-section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 650;
}

.form-field-wide {
  margin-top: 16px;
}

.form-field > span {
  line-height: 1.3;
}

.form-field small {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.5;
}

.site-input,
.site-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefb;
  color: var(--ink);
  outline: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 400;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.site-input {
  height: 44px;
  padding: 0 13px;
}

.site-textarea {
  min-height: 74px;
  padding: 11px 13px;
  line-height: 1.65;
  resize: vertical;
}

.site-input:focus,
.site-textarea:focus {
  border-color: #e9a88d;
  box-shadow: 0 0 0 4px rgba(242, 107, 58, 0.09);
  background: #fff;
}

.site-input::placeholder,
.site-textarea::placeholder {
  color: var(--muted-light);
}

.logo-editor {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-light, #f0e9df);
  border-radius: 14px;
  background: var(--surface-soft, #faf7f2);
}

.logo-preview {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 17px;
  background: #fffdf9;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.logo-preview .icon {
  width: 33px;
  height: 33px;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-copy strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
}

.logo-copy p {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 10.5px;
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logo-upload {
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-panel {
  overflow: hidden;
}

.site-preview {
  margin: 16px;
  padding: 20px;
  border-radius: 18px;
  color: #fff9ef;
  background:
    radial-gradient(circle at 92% 0%, rgba(242, 156, 104, 0.24), transparent 36%),
    linear-gradient(145deg, #3a5647, #1f3128);
  box-shadow: 0 14px 28px rgba(31, 49, 40, 0.18);
}

.site-preview-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-preview-logo {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff9ef;
}

.site-preview-logo .icon {
  width: 24px;
  height: 24px;
}

.site-preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-preview-brand strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.site-preview-brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 249, 239, 0.42);
  font-size: 8.5px;
  letter-spacing: 1px;
}

.site-preview-eyebrow {
  margin: 24px 0 8px;
  color: rgba(255, 249, 239, 0.35);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.site-preview h4 {
  margin: 0;
  white-space: pre-line;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 750;
}

.site-preview-desc {
  margin: 11px 0 0;
  color: rgba(255, 249, 239, 0.52);
  font-size: 10.5px;
  line-height: 1.7;
}

.site-preview-announcement {
  margin: 13px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 249, 239, 0.08);
  color: rgba(255, 249, 239, 0.68);
  font-size: 9.5px;
  line-height: 1.55;
}

.site-preview-action {
  margin-top: 18px;
  padding: 11px;
  border-radius: 10px;
  background: #1aae6b;
  color: #fff;
  text-align: center;
  font-size: 10.5px;
  font-weight: 650;
}

.site-preview-support {
  display: block;
  margin-top: 10px;
  color: rgba(255, 249, 239, 0.38);
  font-size: 9px;
  text-align: center;
}

.site-preview-footer {
  display: block;
  margin-top: 5px;
  color: rgba(255, 249, 239, 0.24);
  font-size: 8px;
  text-align: center;
  letter-spacing: 0.4px;
}

.settings-help {
  padding: 20px 22px;
}

.settings-help h3 {
  margin: 0;
  font-size: 13px;
}

.settings-help p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.settings-help code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-soft, #faf7f2);
  color: var(--accent-deep, #d65a2e);
  font-size: 9.5px;
}

@media (max-width: 1120px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
}

@media (max-width: 880px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .settings-head {
    flex-direction: column;
    gap: 6px;
    padding: 20px 18px 16px;
  }

  .site-form {
    padding: 0 18px 20px;
  }

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

  .settings-side {
    display: flex;
  }

  .logo-editor {
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ========== Login settings ========== */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.ok {
  background: #e8f2eb;
  color: #56806a;
}

.status-pill.warn {
  background: #fbf0e2;
  color: #a87845;
}

.login-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-light, #f0e9df);
  border-radius: 11px;
  background: var(--surface-soft, #faf7f2);
  color: var(--muted);
  font-size: 10.5px;
}

.login-status-row .status-pill {
  min-height: 22px;
}

.form-hint,
.login-hint-text {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.secret-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-light, #f0e9df);
  color: var(--muted);
  font-size: 10.5px;
}

.secret-actions .btn {
  height: 34px;
  font-size: 10.5px;
}

.secret-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.login-settings-layout .settings-panel {
  min-width: 0;
}

@media (max-width: 620px) {
  .login-status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .secret-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ========== Admin user management ========== */
.user-admin-panel {
  padding: 2px 0 0;
}

.user-admin-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-admin-row label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
}

.user-admin-row .site-input {
  flex: 1;
  min-width: 120px;
  height: 36px;
  font-size: 11.5px;
}

.user-admin-row .btn {
  height: 36px;
  font-size: 10.5px;
}

.user-admin-meta {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 9.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.user-admin-panel .drawer-actions {
  margin-top: 12px;
}

.user-admin-panel .drawer-actions .btn {
  flex: 1;
  height: 36px;
  font-size: 10.5px;
}
