:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: rgba(39, 52, 82, 0.12);
  --line-strong: rgba(39, 52, 82, 0.18);
  --blue: #2563eb;
  --teal: #0d9488;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 18px 46px rgba(24, 38, 72, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei UI", "Microsoft YaHei", serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.95) 0, transparent 30rem),
    radial-gradient(circle at 88% 10%, rgba(191, 219, 254, 0.5) 0, transparent 28rem),
    linear-gradient(160deg, var(--bg) 0%, #e9edf5 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
}

.auth-card,
.panel,
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-card {
  width: min(420px, 100%);
  padding: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0;
  background: linear-gradient(135deg, #3730a3, #0d9488);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.field,
.quota-field {
  display: grid;
  gap: 7px;
}

.field span,
.quota-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.field input,
.quota-field input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.quota-field input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-card .field {
  margin-top: 22px;
}

.primary-button,
.ghost-button,
.danger-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 12px 22px rgba(13, 148, 136, 0.2);
}

.primary-button--compact {
  min-height: 38px;
}

.ghost-button,
.small-button {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
}

.danger-button {
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(254, 242, 242, 0.82);
}

.small-button {
  min-height: 36px;
  padding: 0 12px;
}

.primary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.danger-button:hover:not(:disabled),
.small-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.auth-card .primary-button {
  width: 100%;
  margin-top: 18px;
}

.form-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.9rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}

.tab-button {
  min-height: 38px;
  padding: 0 18px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.tab-button--active {
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: 0 8px 18px rgba(24, 38, 72, 0.09);
}

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head p,
.empty-state {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.item-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

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

.item-meta {
  margin-top: 5px;
  color: var(--muted);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

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

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

.field--wide {
  grid-column: 1 / -1;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.quota-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
}

.quota-box h3 {
  color: #344054;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  color: #184e45;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.toast--error {
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 242, 242, 0.95);
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 560px);
    padding-top: 22px;
  }

  .dashboard-header,
  .panel-head,
  .item-head {
    flex-direction: column;
  }

  .item-actions {
    justify-content: flex-start;
  }

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

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

