:root {
  --warm-page: #fbf5f0;
  --warm-page-top: #fdf8f4;
  --warm-surface: #ffffff;
  --warm-surface-soft: #fbfcfc;
  --warm-border: #eee2d9;
  --warm-border-soft: #f5ebe4;
  --warm-ink: #392f2b;
  --warm-muted: #9c8e86;
  --warm-teal: #d96238;
  --warm-teal-dark: #c44f27;
  --warm-teal-soft: #fff0e9;
  --warm-orange: #df6237;
  --warm-orange-dark: #ca512b;
  --warm-orange-soft: #fff0e9;
  --warm-purple: #8e52dc;
  --warm-purple-soft: #f1e8ff;
  --warm-green: #16ae5c;
  --warm-green-soft: #e2faeb;
  --warm-red: #ec4f68;
  --warm-red-soft: #ffe8ed;
  --warm-shadow: 0 2px 7px rgba(150, 91, 63, 0.08), 0 1px 2px rgba(90, 55, 37, 0.04);
}

html,
body,
#app {
  min-height: 100%;
  background: var(--warm-page) !important;
  color: var(--warm-ink);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  background-image: radial-gradient(ellipse at 70% 0%, #f9e7dc 0%, var(--warm-page) 62%) !important;
  background-attachment: fixed !important;
}

body:has(.sidebar) {
  background: var(--warm-page) !important;
}

body:has(.sidebar) main,
body:has(.sidebar) [class*="bg-gray-50"],
body:has(.sidebar) [class*="bg-slate-50"] {
  background: transparent !important;
}

body:has(.sidebar) header {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom-color: var(--warm-border-soft) !important;
}

body:has(.sidebar) [class*="text-gray-900"],
body:has(.sidebar) [class*="text-slate-900"],
body:has(.sidebar) [class*="text-gray-800"],
body:has(.sidebar) [class*="text-slate-800"] {
  color: var(--warm-ink) !important;
}

body:has(.sidebar) [class*="text-gray-500"],
body:has(.sidebar) [class*="text-slate-500"],
body:has(.sidebar) [class*="text-gray-600"],
body:has(.sidebar) [class*="text-slate-600"] {
  color: #7e746e !important;
}

body:has(.sidebar) [class*="text-gray-400"],
body:has(.sidebar) [class*="text-slate-400"] {
  color: var(--warm-muted) !important;
}

/* Preserve vendor colors; theme accents belong on named UI components. */

.sidebar {
  width: 16rem;
  background: var(--warm-surface) !important;
  border-right: 1px solid var(--warm-border) !important;
}

.sidebar-header {
  border-bottom-color: var(--warm-border-soft) !important;
  background: var(--warm-surface) !important;
}

.sidebar-nav {
  background: var(--warm-surface) !important;
}

.sidebar-link {
  color: #58636f !important;
}

.sidebar-link:hover {
  background: #fff8f4 !important;
  color: var(--warm-teal-dark) !important;
}

.sidebar-link-active {
  background: var(--warm-teal-soft) !important;
  color: var(--warm-teal-dark) !important;
}

.sidebar-section-title {
  color: #a39a95 !important;
}

.card,
.stat-card,
.table-container,
.card-glass {
  background: var(--warm-surface) !important;
  border-color: var(--warm-border-soft) !important;
  box-shadow: var(--warm-shadow) !important;
}

body:has(.sidebar) .card,
body:has(.sidebar) .stat-card {
  box-shadow: 0 2px 7px rgba(150, 91, 63, 0.08), 0 1px 2px rgba(90, 55, 37, 0.04) !important;
}

.card,
.stat-card {
  border-radius: 1rem !important;
}

.card-header {
  border-bottom-color: var(--warm-border-soft) !important;
}

.page-title,
.stat-value {
  color: var(--warm-ink) !important;
}

.page-description,
.stat-label {
  color: var(--warm-muted) !important;
}

.stat-value {
  letter-spacing: 0 !important;
}

.stat-icon-primary {
  background: var(--warm-orange-soft) !important;
  color: var(--warm-orange) !important;
}

.stat-icon-success {
  background: var(--warm-green-soft) !important;
  color: var(--warm-green) !important;
}

.stat-icon-warning {
  background: var(--warm-purple-soft) !important;
  color: var(--warm-purple) !important;
}

.stat-icon-danger {
  background: var(--warm-red-soft) !important;
  color: var(--warm-red) !important;
}

.stat-trend-up,
.text-green-600,
.text-emerald-600 {
  color: var(--warm-green) !important;
}

.stat-trend-down,
.text-red-600,
.text-rose-600 {
  color: var(--warm-red) !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-dark)) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(223, 98, 55, 0.24) !important;
}

.btn-primary:hover {
  background: var(--warm-orange-dark) !important;
}

.btn-secondary {
  border-color: var(--warm-border) !important;
  color: #59636d !important;
  background: var(--warm-surface) !important;
}

.badge-primary {
  background: var(--warm-orange-soft) !important;
  color: var(--warm-orange-dark) !important;
}

.badge-success {
  background: var(--warm-green-soft) !important;
  color: #14924e !important;
}

.badge-warning {
  background: #fff5d9 !important;
  color: #b77810 !important;
}

.badge-danger {
  background: var(--warm-red-soft) !important;
  color: #d83f59 !important;
}

input,
textarea,
select {
  border-color: var(--warm-border) !important;
  background: var(--warm-surface) !important;
  color: var(--warm-ink) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--warm-teal) !important;
  box-shadow: 0 0 0 3px rgba(16, 168, 153, 0.13) !important;
  outline: none !important;
}

.table-container {
  overflow: hidden;
}

.table thead,
.table thead tr {
  background: #fbf8f5 !important;
}

.table th,
.table td {
  border-color: var(--warm-border-soft) !important;
}

.table th {
  color: #80766f !important;
  font-weight: 600 !important;
}

.table td {
  color: var(--warm-ink) !important;
}

.table tbody tr:hover {
  background: #fffaf7 !important;
}

.dark body,
body.dark {
  background-image: none !important;
}

@media (max-width: 768px) {
  .sidebar {
    width: 16rem;
  }

  .stat-card {
    padding: 1rem !important;
  }
}

/* Public home: soften the heavy navy and saturated feature blocks. */
body:has(.bg-gray-950) {
  background: #fbf7f4 !important;
  background-image:
    radial-gradient(ellipse at 88% 0%, rgba(248, 228, 215, 0.65) 0%, transparent 58%),
    radial-gradient(ellipse at 18% 30%, rgba(255, 250, 246, 0.95) 0%, transparent 52%) !important;
}

body:has(.bg-gray-950) [class*="bg-gray-950"],
body:has(.bg-gray-950) [class*="bg-gray-900"],
body:has(.bg-gray-950) [class*="bg-gray-800"] {
  background: #fffdfb !important;
  border-color: #f0e3da !important;
  color: #75665e !important;
  box-shadow: 0 14px 30px rgba(112, 76, 53, 0.08) !important;
}

body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-gray-800"],
body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-gray-800"] {
  background: #fdf5f0 !important;
  box-shadow: none !important;
}

body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="text-gray-400"],
body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="text-gray-400"] {
  color: #a28b7e !important;
}

body:has(.bg-gray-950) [class*="bg-blue-500"] {
  background: #f0f5ff !important;
  color: #6e9bea !important;
  box-shadow: 0 7px 15px rgba(52, 116, 223, 0.08) !important;
}

body:has(.bg-gray-950) [class*="bg-teal-500"],
body:has(.bg-gray-950) [class*="bg-emerald-500"] {
  background: #effaf5 !important;
  color: #52b890 !important;
  box-shadow: 0 7px 15px rgba(21, 155, 107, 0.07) !important;
}

body:has(.bg-gray-950) [class*="bg-purple-500"] {
  background: #f7f0ff !important;
  color: #ad83e1 !important;
  box-shadow: 0 7px 15px rgba(141, 82, 217, 0.07) !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="text-white"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="text-white"] {
  color: #5f4c43 !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="text-green"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="text-green"] {
  color: #169c65 !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="text-yellow"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="text-yellow"] {
  color: #c18722 !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="text-cyan"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="text-cyan"] {
  color: #2f88a6 !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-green"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-green"] {
  background: #e5f8ed !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-yellow"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-yellow"] {
  background: #fff5d9 !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-blue"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-blue"] {
  background: #e9f0ff !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-purple"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-purple"] {
  background: #f1e8ff !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="bg-emerald"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="bg-emerald"] {
  background: #e5f8ed !important;
}

body:has(.bg-gray-950) [class*="bg-gray-900"] [class*="rounded-full"],
body:has(.bg-gray-950) [class*="bg-gray-950"] [class*="rounded-full"] {
  background: #fff5ef !important;
  color: #df855f !important;
}

body:has(.bg-gray-950) .btn-primary,
body:has(.bg-gray-950) [class*="bg-orange-500"],
body:has(.bg-gray-950) [class*="from-orange-500"] {
  background: #efa07d !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(223, 98, 55, 0.14) !important;
}

body:has(.bg-gray-900) [class*="bg-gray-900"],
body:has(.bg-gray-900) [class*="bg-slate-900"],
body:has(.bg-gray-900) [class*="bg-slate-950"],
body:has(.bg-gray-900) [class*="bg-neutral-900"] {
  background: #fffdfb !important;
  border-color: #f0e3da !important;
  color: #75665e !important;
  box-shadow: 0 14px 30px rgba(112, 76, 53, 0.08) !important;
}

body:has(.bg-gray-900) [class*="bg-gray-900"] [class*="text-white"],
body:has(.bg-gray-900) [class*="bg-slate-900"] [class*="text-white"],
body:has(.bg-gray-900) [class*="bg-slate-950"] [class*="text-white"] {
  color: #75665e !important;
}

body:has(.bg-gray-900) [class*="bg-gray-900"] [class*="bg-gray-800"],
body:has(.bg-gray-900) [class*="bg-slate-900"] [class*="bg-slate-800"] {
  background: #fdf5f0 !important;
  box-shadow: none !important;
}

body:has(.terminal-window) {
  background: #fcfaf8 !important;
}

body:has(.terminal-window) .terminal-window {
  background: #fffdfb !important;
  border: 1px solid #f0e4dc !important;
  box-shadow: 0 18px 34px rgba(112, 76, 53, 0.09), 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
}

body:has(.terminal-window) .terminal-header {
  background: #fff7f2 !important;
  border-bottom-color: #f4e7df !important;
}

body:has(.terminal-window) .terminal-title {
  color: #b09a8d !important;
}

body:has(.terminal-window) .terminal-body {
  background: #fffdfb !important;
  color: #806e63 !important;
}

body:has(.terminal-window) .code-prompt,
body:has(.terminal-window) .code-success {
  color: #63b58a !important;
}

body:has(.terminal-window) .code-success {
  background: #eaf7ef !important;
}

body:has(.terminal-window) .code-cmd {
  color: #78a7c2 !important;
}

body:has(.terminal-window) .code-flag {
  color: #ad8fc9 !important;
}

body:has(.terminal-window) .code-url {
  color: #6daea6 !important;
}

body:has(.terminal-window) .code-comment {
  color: #b09e94 !important;
}

body:has(.terminal-window) .code-response {
  color: #c59a52 !important;
}

body:has(.terminal-window) .cursor {
  background: #75bd91 !important;
}

body:has(.terminal-window) [class*="from-blue-500"] {
  background: #f0f5ff !important;
  background-image: none !important;
  box-shadow: 0 7px 15px rgba(91, 137, 220, 0.08) !important;
}

body:has(.terminal-window) [class*="from-blue-500"] svg {
  color: #82a9e8 !important;
}

body:has(.terminal-window) [class*="from-primary-500"] {
  background: #fff2ec !important;
  background-image: none !important;
  box-shadow: 0 7px 15px rgba(223, 126, 91, 0.08) !important;
}

body:has(.terminal-window) [class*="from-primary-500"] svg {
  color: #e49a7a !important;
}

body:has(.terminal-window) [class*="from-purple-500"] {
  background: #f7f1ff !important;
  background-image: none !important;
  box-shadow: 0 7px 15px rgba(157, 117, 212, 0.08) !important;
}

body:has(.terminal-window) [class*="from-purple-500"] svg {
  color: #b495df !important;
}

body:has(.terminal-window) [class*="bg-primary-400\/20"],
body:has(.terminal-window) [class*="bg-primary-500\/15"],
body:has(.terminal-window) [class*="bg-primary-300\/10"],
body:has(.terminal-window) [class*="bg-primary-400\/10"] {
  opacity: 0.35 !important;
}
