:root {
  --zyp-navy: #0B1B34;
  --zyp-blue: #2563EB;
  --zyp-sky: #0EA5E9;
  --zyp-cyan: #22D3EE;
  --zyp-bg: #F4F8FC;
  --zyp-card: #FFFFFF;
  --zyp-text: #0B1B34;
  --zyp-muted: #5B6B82;
  --zyp-border: #D7E3F0;
  --zyp-shadow: 0 16px 40px rgba(11, 27, 52, 0.08);
  --zyp-badge-success-bg: #DCFCE7;
  --zyp-badge-success-fg: #166534;
  --zyp-badge-success-bd: #BBF7D0;
  --zyp-badge-warning-bg: #FEF3C7;
  --zyp-badge-warning-fg: #92400E;
  --zyp-badge-warning-bd: #FDE68A;
  --zyp-badge-info-bg: #DBEAFE;
  --zyp-badge-info-fg: #1E40AF;
  --zyp-badge-info-bd: #BFDBFE;
  --zyp-badge-danger-bg: #FEE2E2;
  --zyp-badge-danger-fg: #991B1B;
  --zyp-badge-danger-bd: #FECACA;
  --zyp-badge-muted-bg: #F1F5F9;
  --zyp-badge-muted-fg: #475569;
  --zyp-badge-muted-bd: #E2E8F0;
  --zyp-alert-success-bg: #ECFDF5;
  --zyp-alert-success-fg: #065F46;
  --zyp-alert-danger-bg: #FEF2F2;
  --zyp-alert-danger-fg: #991B1B;
}

html[data-bs-theme="dark"] {
  --zyp-navy: #E8F1FF;
  --zyp-blue: #60A5FA;
  --zyp-sky: #38BDF8;
  --zyp-cyan: #22D3EE;
  --zyp-bg: #07111F;
  --zyp-card: #12243C;
  --zyp-text: #F8FAFC;
  --zyp-muted: #94A3B8;
  --zyp-border: #1E3A5F;
  --zyp-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --zyp-badge-success-bg: rgba(74, 222, 128, 0.14);
  --zyp-badge-success-fg: #86EFAC;
  --zyp-badge-success-bd: rgba(74, 222, 128, 0.28);
  --zyp-badge-warning-bg: rgba(251, 191, 36, 0.14);
  --zyp-badge-warning-fg: #FBBF24;
  --zyp-badge-warning-bd: rgba(251, 191, 36, 0.28);
  --zyp-badge-info-bg: rgba(56, 189, 248, 0.14);
  --zyp-badge-info-fg: #7DD3FC;
  --zyp-badge-info-bd: rgba(56, 189, 248, 0.28);
  --zyp-badge-danger-bg: rgba(248, 113, 113, 0.14);
  --zyp-badge-danger-fg: #FCA5A5;
  --zyp-badge-danger-bd: rgba(248, 113, 113, 0.28);
  --zyp-badge-muted-bg: rgba(148, 163, 184, 0.12);
  --zyp-badge-muted-fg: #CBD5E1;
  --zyp-badge-muted-bd: rgba(148, 163, 184, 0.22);
  --zyp-alert-success-bg: rgba(16, 185, 129, 0.14);
  --zyp-alert-success-fg: #6EE7B7;
  --zyp-alert-danger-bg: rgba(239, 68, 68, 0.14);
  --zyp-alert-danger-fg: #FCA5A5;
}

html, body { font-family: "IBM Plex Sans", Inter, system-ui, sans-serif; }
#main, .page-content { color: var(--zyp-text); }

.zyp-logo { display: block; line-height: 0; }
.zyp-logo img { display: block; width: auto; height: auto; object-fit: contain; }
.zyp-logo-sm img { height: 36px; max-height: 36px; }
.zyp-logo-md img { height: 42px; max-height: 42px; max-width: 100%; }
.zyp-logo-lg img { height: 64px; max-height: 64px; max-width: 240px; }

#sidebar .sidebar-wrapper .sidebar-header {
  padding: 1.4rem 1.5rem 1rem;
  min-height: 0;
  overflow: visible;
}
#sidebar .sidebar-wrapper .sidebar-header .logo {
  margin: 0;
  width: 100%;
}
#sidebar .sidebar-wrapper .sidebar-header .logo .zyp-logo,
#sidebar .sidebar-wrapper .sidebar-header .zyp-logo {
  display: block;
  width: 100%;
}
#sidebar .sidebar-wrapper .sidebar-header .logo img,
#sidebar .sidebar-wrapper .sidebar-header .zyp-logo img {
  height: 42px !important;
  max-height: 42px !important;
  max-width: 100% !important;
  width: auto !important;
}
#sidebar .sidebar-wrapper .sidebar-header .sidebar-toggler {
  position: absolute;
  top: 12px;
  right: 12px;
}

html[data-bs-theme="dark"] .logo-for-light { display: none !important; }
html[data-bs-theme="light"] .logo-for-dark { display: none !important; }
html:not([data-bs-theme]) .logo-for-dark { display: none !important; }

.zyp-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--zyp-border);
  background: var(--zyp-card);
  color: var(--zyp-text);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.zyp-theme-toggle i { font-size: 16px; line-height: 1; }
.zyp-theme-toggle:hover { border-color: var(--zyp-blue); color: var(--zyp-blue); }
.zyp-theme-toggle:focus-visible { outline: 2px solid var(--zyp-blue); outline-offset: 2px; }
html[data-bs-theme="dark"] .zyp-when-light { display: none !important; }
html[data-bs-theme="light"] .zyp-when-dark { display: none !important; }
html:not([data-bs-theme]) .zyp-when-dark { display: none !important; }

.zyp-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.zyp-page-head h3 { margin: 0; letter-spacing: -0.03em; }
.zyp-page-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zyp-page-meta { color: var(--zyp-muted); font-size: 13px; }

.card, .zyp-card {
  border-radius: 18px !important;
  border: 1px solid var(--zyp-border) !important;
  box-shadow: var(--zyp-shadow);
  background: var(--zyp-card);
}
.zyp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.zyp-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.zyp-badge,
.badge.badge-pending, .badge.badge-approved, .badge.badge-completed, .badge.badge-active,
.badge.badge-verified, .badge.badge-running, .badge.badge-success, .badge.badge-processing,
.badge.badge-rejected, .badge.badge-blocked, .badge.badge-cancelled, .badge.badge-inactive,
.badge.badge-failed, .badge.badge-expired, .badge.badge-paid, .badge.badge-open, .badge.badge-closed,
.badge.badge-draft {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  background: var(--zyp-badge-muted-bg) !important;
  color: var(--zyp-badge-muted-fg) !important;
}
.zyp-badge-success,
.badge.badge-approved, .badge.badge-completed, .badge.badge-active, .badge.badge-verified,
.badge.badge-running, .badge.badge-success, .badge.badge-paid {
  background: var(--zyp-badge-success-bg) !important;
  color: var(--zyp-badge-success-fg) !important;
  border-color: var(--zyp-badge-success-bd) !important;
}
.zyp-badge-warning,
.badge.badge-pending, .badge.badge-draft {
  background: var(--zyp-badge-warning-bg) !important;
  color: var(--zyp-badge-warning-fg) !important;
  border-color: var(--zyp-badge-warning-bd) !important;
}
.zyp-badge-info,
.badge.badge-processing, .badge.badge-open {
  background: var(--zyp-badge-info-bg) !important;
  color: var(--zyp-badge-info-fg) !important;
  border-color: var(--zyp-badge-info-bd) !important;
}
.zyp-badge-danger,
.badge.badge-rejected, .badge.badge-blocked, .badge.badge-cancelled, .badge.badge-inactive,
.badge.badge-failed, .badge.badge-expired, .badge.badge-closed {
  background: var(--zyp-badge-danger-bg) !important;
  color: var(--zyp-badge-danger-fg) !important;
  border-color: var(--zyp-badge-danger-bd) !important;
}

.zyp-alert {
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 500;
  border: 1px solid transparent;
}
.zyp-alert-success { background: var(--zyp-alert-success-bg); color: var(--zyp-alert-success-fg); }
.zyp-alert-danger { background: var(--zyp-alert-danger-bg); color: var(--zyp-alert-danger-fg); }

.zyp-stat {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--zyp-card);
  border: 1px solid var(--zyp-border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--zyp-shadow);
  height: 100%;
}
.zyp-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.zyp-stat-blue .zyp-stat-icon { background: rgba(37, 99, 235, .12); color: #2563EB; }
.zyp-stat-green .zyp-stat-icon { background: rgba(22, 163, 74, .12); color: #16A34A; }
.zyp-stat-amber .zyp-stat-icon { background: rgba(217, 119, 6, .12); color: #D97706; }
.zyp-stat-red .zyp-stat-icon { background: rgba(220, 38, 38, .12); color: #DC2626; }
.zyp-stat-cyan .zyp-stat-icon { background: rgba(14, 165, 233, .12); color: #0EA5E9; }
html[data-bs-theme="dark"] .zyp-stat-blue .zyp-stat-icon { background: rgba(96, 165, 250, .16); color: #93C5FD; }
html[data-bs-theme="dark"] .zyp-stat-green .zyp-stat-icon { background: rgba(74, 222, 128, .16); color: #86EFAC; }
html[data-bs-theme="dark"] .zyp-stat-amber .zyp-stat-icon { background: rgba(251, 191, 36, .16); color: #FBBF24; }
html[data-bs-theme="dark"] .zyp-stat-red .zyp-stat-icon { background: rgba(248, 113, 113, .16); color: #FCA5A5; }
html[data-bs-theme="dark"] .zyp-stat-cyan .zyp-stat-icon { background: rgba(56, 189, 248, .16); color: #7DD3FC; }
.zyp-stat-label { color: var(--zyp-muted); font-size: 13px; font-weight: 600; }
.zyp-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.zyp-stat-hint { color: var(--zyp-muted); font-size: 12px; margin-top: 2px; }

.zyp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--zyp-bg);
  border: 1px solid var(--zyp-border);
}
.zyp-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--zyp-muted);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.zyp-tab:hover { color: var(--zyp-text); }
.zyp-tab.active { background: var(--zyp-blue); color: #fff; }

.zyp-empty {
  text-align: center;
  color: var(--zyp-muted);
  padding: 28px 12px;
}
.zyp-machine-kicker {
  color: var(--zyp-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.zyp-machine-roi { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.zyp-machine-roi small { font-size: 14px; color: var(--zyp-muted); font-weight: 500; }

.table { color: var(--zyp-text); }
.table thead th { color: var(--zyp-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.btn { cursor: pointer; border-radius: 12px; font-weight: 600; }
.form-control, .form-select { border-radius: 12px; }

.zyp-auth-wrap { position: relative; }
.zyp-auth-toggle { position: absolute; top: 22px; right: 22px; z-index: 6; }
#auth .auth-logo img { height: 72px !important; max-height: 72px !important; width: auto; }
#auth .auth-title { letter-spacing: -0.04em; }

html[data-bs-theme="dark"] #auth {
  background: #07111F;
  color: var(--zyp-text);
}
html[data-bs-theme="dark"] #auth-left { background: #0B1B34; }
html[data-bs-theme="dark"] #auth .auth-title,
html[data-bs-theme="dark"] #auth .auth-subtitle { color: var(--zyp-text); }
html[data-bs-theme="dark"] #auth .form-control {
  background: #12243C;
  border-color: var(--zyp-border);
  color: var(--zyp-text);
}

@media (prefers-reduced-motion: reduce) {
  .zyp-theme-toggle, .zyp-tab, .btn { transition: none; }
}
