:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --bg-soft: #f5f5f3;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --line: #e7e5e0;
  --line-strong: #d8d5ce;
  --text: #111111;
  --muted: #6f6c66;
  --muted-2: #9a968e;
  --brand: #111111;
  --brand-deep: #000000;
  --danger: #b3261e;
  --ok: #0d7f4f;
  --warn: #8a5c00;
  --shadow: 0 24px 70px rgba(35, 34, 31, 0.10);
  --shadow-soft: 0 12px 34px rgba(35, 34, 31, 0.07);
  --radius: 18px;
  --pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(0, 0, 0, 0.055), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #f3f2ef 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

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

a {
  color: var(--text);
  font-weight: 700;
  text-decoration-color: rgba(17, 17, 17, 0.28);
  text-underline-offset: 4px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px;
}

.auth-brand {
  position: relative;
  display: flex;
  min-height: calc(100vh - 56px);
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 64px;
  color: var(--text);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(231, 229, 224, 0.82);
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.05) 1px, transparent 1px),
    rgba(255, 255, 255, 0.62);
  background-size: 36px 36px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  right: 54px;
  bottom: 64px;
  width: min(420px, 72%);
  height: 210px;
  border: 1px solid rgba(231, 229, 224, 0.9);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #ffffff 0 52px, #f7f6f3 52px 100%),
    #ffffff;
  box-shadow: 0 30px 90px rgba(35, 34, 31, 0.16);
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 8px 13px;
  border: 1px solid rgba(216, 213, 206, 0.9);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  backdrop-filter: blur(18px);
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(216, 213, 206, 0.88);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 244, 240, 0.88));
  color: var(--text);
  font-weight: 850;
  font-size: 24px;
  box-shadow: 0 12px 28px rgba(35, 34, 31, 0.10);
}

.auth-brand .mark {
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border-radius: 18px;
  font-size: 27px;
}

.auth-brand h1 {
  max-width: 620px;
  margin: 0 0 16px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-brand p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.auth-panel {
  display: grid;
  align-items: center;
  padding: 24px;
}

.panel {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid rgba(231, 229, 224, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel h2,
.section h2,
.section h3 {
  margin: 0;
  letter-spacing: 0;
}

.panel h2 {
  font-size: 30px;
}

.panel p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

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

label {
  color: #25231f;
  font-weight: 750;
  font-size: 13px;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus {
  border-color: #111;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  padding: 0 18px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.button:hover {
  background: var(--brand-deep);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.button.secondary:hover {
  background: #f2f1ee;
  border-color: var(--line-strong);
  box-shadow: none;
}

.button.danger {
  background: #fff;
  color: var(--danger);
  border-color: #edd0cc;
  box-shadow: none;
}

.button.danger:hover {
  background: #fff4f2;
  box-shadow: none;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  align-self: start;
  padding: 16px;
  border: 1px solid rgba(231, 229, 224, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.brand-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-line strong {
  display: block;
  font-size: 17px;
}

.brand-line span {
  display: block;
  max-width: 160px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  min-height: 42px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: #35322c;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav button.active {
  background: #111;
  color: #fff;
}

.nav button:hover {
  background: #efeee9;
  color: #111;
}

.nav button.active:hover {
  background: #111;
  color: #fff;
  transform: translateY(-1px);
}

.main {
  min-width: 0;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 0 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(231, 229, 224, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
}

.topbar .muted {
  margin-top: 5px;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.section {
  grid-column: span 12;
  overflow: hidden;
  border: 1px solid rgba(231, 229, 224, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.section.half {
  grid-column: span 6;
}

.section.third {
  grid-column: span 4;
  min-height: 150px;
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.035), transparent 48%),
    rgba(255, 255, 255, 0.86);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section p {
  line-height: 1.7;
}

.stat {
  margin-top: 16px;
  color: #111;
  font-size: 42px;
  line-height: 1;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7f6f2;
  color: #403c35;
  font-size: 13px;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: rgba(248, 247, 244, 0.76);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid #dce8df;
  border-radius: var(--pill);
  background: #f1faf4;
  color: var(--ok);
  font-size: 12px;
  font-weight: 800;
}

.tag.warn {
  border-color: #f0dfb5;
  background: #fff8e8;
  color: var(--warn);
}

.tag.danger {
  border-color: #f0ccc7;
  background: #fff1ef;
  color: var(--danger);
}

.notice {
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid #dce8df;
  border-radius: 16px;
  background: #f3fbf5;
  color: var(--ok);
  white-space: pre-wrap;
}

.notice.error {
  border-color: #efcdc8;
  background: #fff4f2;
  color: var(--danger);
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(250, 249, 247, 0.72);
  color: var(--muted);
}

.inline-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.settings-divider {
  height: 1px;
  margin: 28px 0 22px;
  background: var(--line);
}

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

.color-option {
  position: relative;
  min-width: 0;
  font-size: 13px;
}

.color-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-option span,
.table-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-option span {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.72);
  color: #2b2924;
  font-weight: 800;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.color-option i,
.table-color i {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(35, 34, 31, 0.16);
}

.color-option input:checked + span {
  border-color: #111;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 34, 31, 0.10);
  transform: translateY(-1px);
}

.color-option input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.table-color {
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 1060px) {
  .auth-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 76px 34px;
  }

  .auth-brand::after {
    opacity: 0.36;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section.half,
  .section.third {
    grid-column: span 12;
  }
}

@media (max-width: 680px) {
  .auth-shell,
  .app-shell {
    padding: 14px;
  }

  .auth-brand {
    padding: 46px 24px;
  }

  .auth-brand::before {
    inset: 0;
    border-radius: 24px;
  }

  .auth-brand::after {
    display: none;
  }

  .auth-panel {
    padding: 0;
  }

  .panel,
  .section,
  .topbar,
  .sidebar {
    border-radius: 20px;
  }

  .panel,
  .section {
    padding: 20px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .field-row {
    grid-template-columns: 1fr;
  }

  .color-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
