:root,
[data-theme="porcelain-jade"] {
  --bg-canvas: #f7f4ee;
  --bg-surface: #ffffff;
  --bg-subtle: #f1ede4;
  --bg-sidebar: #fcfaf6;
  --bg-topbar: rgba(255, 255, 255, 0.88);
  --bg-hover: #f3efe6;
  --border-subtle: #e6dfd3;
  --border-strong: #d3c9b8;
  --text-main: #182226;
  --text-secondary: #4e5d64;
  --text-muted: #78868c;

  --primary: #0f5c52;
  --primary-soft: #e4f3ef;
  --primary-hover: #0b4941;

  --accent-collect: #0d7a6c;
  --accent-collect-bg: #e3f5f1;
  --accent-caliber: #364fc7;
  --accent-caliber-bg: #ebefff;
  --accent-review: #c85a32;
  --accent-review-bg: #fdf0ea;
  --accent-fill: #6d28d9;
  --accent-fill-bg: #f3ecff;
  --accent-warn: #b7791f;
  --accent-warn-bg: #fef7e6;
  --accent-danger: #c53030;
  --accent-danger-bg: #feecec;
  --accent-success: #15803d;
  --accent-success-bg: #e8f8ed;

  --hero-gradient: linear-gradient(135deg, #f3efe6 0%, #e7f4f0 48%, #fbeee8 100%);
  --shadow-sm: 0 1px 3px rgba(24, 34, 38, 0.05), 0 1px 2px rgba(24, 34, 38, 0.03);
  --shadow-md: 0 8px 24px rgba(24, 34, 38, 0.06), 0 2px 6px rgba(24, 34, 38, 0.03);
}

[data-theme="seasalt-cobalt"] {
  --bg-canvas: #f2f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #e9eff6;
  --bg-sidebar: #fafcff;
  --bg-topbar: rgba(255, 255, 255, 0.9);
  --bg-hover: #edf3fa;
  --border-subtle: #dce4ee;
  --border-strong: #c2cfe0;
  --text-main: #132033;
  --text-secondary: #475870;
  --text-muted: #708299;

  --primary: #1d4ed8;
  --primary-soft: #e8f0fe;
  --primary-hover: #173fb0;

  --accent-collect: #0d9488;
  --accent-collect-bg: #e2f7f4;
  --accent-caliber: #4338ca;
  --accent-caliber-bg: #ecebff;
  --accent-review: #d97706;
  --accent-review-bg: #fef4e2;
  --accent-fill: #7c3aed;
  --accent-fill-bg: #f3edff;
  --accent-warn: #b45309;
  --accent-warn-bg: #fef3c7;
  --accent-danger: #dc2626;
  --accent-danger-bg: #fee2e2;
  --accent-success: #059669;
  --accent-success-bg: #e3f9f1;

  --hero-gradient: linear-gradient(135deg, #eef4fc 0%, #e5f6f4 50%, #fdf3e4 100%);
  --shadow-sm: 0 1px 3px rgba(19, 32, 51, 0.05);
  --shadow-md: 0 10px 26px rgba(19, 32, 51, 0.06);
}

[data-theme="linen-carmine"] {
  --bg-canvas: #f8f3eb;
  --bg-surface: #fffdf9;
  --bg-subtle: #efe7da;
  --bg-sidebar: #fcf9f2;
  --bg-topbar: rgba(255, 253, 249, 0.9);
  --bg-hover: #f3ece0;
  --border-subtle: #e6ddd0;
  --border-strong: #d0c2ae;
  --text-main: #241c1a;
  --text-secondary: #5e504b;
  --text-muted: #8a7b75;

  --primary: #8e2939;
  --primary-soft: #fae9ec;
  --primary-hover: #731f2d;

  --accent-collect: #3a634c;
  --accent-collect-bg: #e7f2eb;
  --accent-caliber: #2b5b84;
  --accent-caliber-bg: #e8f1f8;
  --accent-review: #b46924;
  --accent-review-bg: #fbf0e3;
  --accent-fill: #72498a;
  --accent-fill-bg: #f3ecf7;
  --accent-warn: #a66e2e;
  --accent-warn-bg: #fcf2df;
  --accent-danger: #b91c1c;
  --accent-danger-bg: #fde8e8;
  --accent-success: #2f6f4e;
  --accent-success-bg: #e6f4ec;

  --hero-gradient: linear-gradient(135deg, #f9f1e7 0%, #faebee 50%, #e9f2ec 100%);
  --shadow-sm: 0 1px 3px rgba(36, 28, 26, 0.05);
  --shadow-md: 0 10px 24px rgba(36, 28, 26, 0.06);
}
* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.num-tabular {
  font-variant-numeric: tabular-nums;
  font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-canvas);
}

.app-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-card {
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--hero-gradient);
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.brand-sub {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.16s ease;
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: 62px;
  background: var(--bg-topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-content {
  padding: 24px 28px 40px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.hero-banner {
  background: var(--hero-gradient);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-warm {
  background: var(--accent-review);
  color: #ffffff;
}

.btn-danger {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
  border-color: #f6c4c4;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  text-align: left;
  padding: 11px 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 34, 38, 0.28);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 34, 38, 0.22);
  display: flex;
  justify-content: flex-end;
  z-index: 65;
}

.drawer-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: -8px 0 30px rgba(24, 34, 38, 0.08);
}

.tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.theme-chip.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: var(--bg-canvas);
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    display: none;
  }
}
