/* Dialer 360 — global dark theme. Activated by html[data-theme="dark"] */
html[data-theme="dark"] {
  color-scheme: dark;
  --d360-bg: #0b0e14;
  --d360-surface: #16181d;
  --d360-surface-2: #1c1f26;
  --d360-text: #f5f5f5;
  --d360-muted: #b0b4be;
  --d360-border: #2a2f3a;
  --d360-yellow: #f5c400;
  --d360-yellow-hover: #d4a800;
  --d360-yellow-soft: rgba(245, 196, 0, 0.16);
  --d360-yellow-border: rgba(245, 196, 0, 0.4);
  --d360-on-yellow: #171717;
  --pg-bg: #0b0e14;
  --pg-border: #2a2f3a;
  --rp-bg: #0b0e14;
  --rp-border: #2a2f3a;
  --ru-bg: #0b0e14;
  --ru-border: #2a2f3a;
  --aup-bg: #0b0e14;
  --aup-glass: #16181d;
  --aup-border: #2a2f3a;
  --bs-body-bg: #0b0e14;
  --bs-body-color: #f5f5f5;
  --bs-secondary-bg: #16181d;
  --bs-tertiary-bg: #1c1f26;
  --bs-border-color: #2a2f3a;
  --bs-light: #1c1f26;
  --bs-light-rgb: 28, 31, 38;
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] body.portal-genz,
html[data-theme="dark"] body.rate-portal-theme,
html[data-theme="dark"] body.ru-theme,
html[data-theme="dark"] body.aup-app,
html[data-theme="dark"] body.portal-genz:has(.pg-selector-page) {
  background: #0b0e14 !important;
  background-image: none !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.portal-genz:has(.pg-selector-page) .pg-bg,
html[data-theme="dark"] body.portal-genz:has(.pg-selector-page) .pg-bg__blob,
html[data-theme="dark"] body.portal-genz:has(.pg-selector-page) .pg-bg__mesh,
html[data-theme="dark"] body.portal-genz:has(.pg-selector-page) .pg-bg__grid,
html[data-theme="dark"] .pg-pkt-clock__glow {
  display: none !important;
  opacity: 0 !important;
  background: none !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .responsive-heading,
html[data-theme="dark"] .pg-hero__title,
html[data-theme="dark"] .pg-hero__title-gradient,
html[data-theme="dark"] .pg-login-title,
html[data-theme="dark"] .sidebar-brand,
html[data-theme="dark"] .sidebar-brand .sidebar-brand-text,
html[data-theme="dark"] .aup-brand-title,
html[data-theme="dark"] .ru-brand-wrap .top-nav-brand,
html[data-theme="dark"] .top-nav-brand,
html[data-theme="dark"] .text-3d-hero,
html[data-theme="dark"] .hero-title,
html[data-theme="dark"] .font-display,
html[data-theme="dark"] .pg-card__title,
html[data-theme="dark"] .pg-feature__text strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="dark"] .pg-hero__subtitle,
html[data-theme="dark"] .pg-hero-lead,
html[data-theme="dark"] .rp-page-lead,
html[data-theme="dark"] .pg-login-sub,
html[data-theme="dark"] .pg-card__desc,
html[data-theme="dark"] .pg-card__status,
html[data-theme="dark"] .pg-premium-footer__copy,
html[data-theme="dark"] .pg-feature__text span,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .footer .text-muted {
  color: #b0b4be !important;
}

html[data-theme="dark"] .pg-card__inner {
  background: linear-gradient(160deg, rgba(22, 24, 29, 0.92), rgba(22, 24, 29, 0.72)) !important;
  border: 1px solid #2a2f3a !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="dark"] .pg-card__inner::before {
  background: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .pg-card:hover .pg-card__inner {
  border-color: rgba(245, 196, 0, 0.45) !important;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(245, 196, 0, 0.22) !important;
}

html[data-theme="dark"] .pg-chip {
  color: #f5f5f5 !important;
  background: rgba(245, 196, 0, 0.14) !important;
  border-color: rgba(245, 196, 0, 0.35) !important;
}

html[data-theme="dark"] .pg-card__pin {
  color: #8b93a7;
}

html[data-theme="dark"] .pg-card__pin:hover,
html[data-theme="dark"] .pg-card__pin:focus-visible,
html[data-theme="dark"] .pg-card__pin.is-pinned {
  color: #f5c400;
}

html[data-theme="dark"] .pg-card__status-dot,
html[data-theme="dark"] .pg-card__status--ok .pg-card__status-dot {
  background: #22c55e !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55) !important;
}

html[data-theme="dark"] .pg-card__status--down .pg-card__status-dot {
  background: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55) !important;
}

html[data-theme="dark"] .pg-premium-footer {
  border-top-color: #2a2f3a !important;
}

html[data-theme="dark"] body.portal-genz .pg-login-card,
html[data-theme="dark"] body.portal-genz .pg-login-panel {
  background: rgba(22, 24, 29, 0.88) !important;
  border: 1px solid #2a2f3a !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .input-group-addon,
html[data-theme="dark"] body.rate-portal-theme .input-group-text,
html[data-theme="dark"] body.portal-genz .input-group-text,
html[data-theme="dark"] body.ru-theme .input-group-text,
html[data-theme="dark"] body.aup-app .input-group-text {
  background: #1c1f26 !important;
  border: 1px solid #2a2f3a !important;
  color: #f5c400 !important;
}

html[data-theme="dark"] .input-group-text i,
html[data-theme="dark"] .input-group-text svg {
  color: #f5c400 !important;
  background: transparent !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
  background-color: #16181d !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.portal-genz .pg-login-card .form-control,
html[data-theme="dark"] body.portal-genz .pg-login-card .input-group-text,
html[data-theme="dark"] body.rate-portal-theme .form-control:not([type="file"]),
html[data-theme="dark"] body.rate-portal-theme .form-select,
html[data-theme="dark"] body.ru-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] body.ru-theme textarea,
html[data-theme="dark"] body.ru-theme select,
html[data-theme="dark"] body.aup-app input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body.aup-app textarea,
html[data-theme="dark"] body.aup-app select,
html[data-theme="dark"] body.aup-app .form-control,
html[data-theme="dark"] body.aup-app .form-select,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control:not([type="file"]),
html[data-theme="dark"] .form-select {
  background: #1c1f26 !important;
  border: 1px solid #2a2f3a !important;
  color: #f5f5f5 !important;
  color-scheme: dark;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #8b93a7 !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar,
html[data-theme="dark"] body.rate-portal-theme .sidebar-header,
html[data-theme="dark"] body.rate-portal-theme .sidebar-footer {
  background: #12141a !important;
  border-color: #2a2f3a !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-toggle,
html[data-theme="dark"] body.rate-portal-theme .sidebar-mobile-toggle {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-divider {
  background: #2a2f3a !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-link {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-link:hover {
  background: rgba(245, 196, 0, 0.14) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-link.active {
  background: #f5c400 !important;
  color: #171717 !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-link.active i {
  color: #171717 !important;
}

html[data-theme="dark"] body.rate-portal-theme .sidebar-user,
html[data-theme="dark"] body.rate-portal-theme .text-muted,
html[data-theme="dark"] body.rate-portal-theme .rp-page-lead {
  color: #b0b4be !important;
}

html[data-theme="dark"] body.rate-portal-theme .card,
html[data-theme="dark"] body.rate-portal-theme .card-header,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-card,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-tile,
html[data-theme="dark"] body.rate-portal-theme .rp-dashboard-card,
html[data-theme="dark"] body.rate-portal-theme .list-group-item,
html[data-theme="dark"] body.rate-portal-theme .rp-activity-item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.rate-portal-theme .form-label,
html[data-theme="dark"] body.rate-portal-theme h1,
html[data-theme="dark"] body.rate-portal-theme h2,
html[data-theme="dark"] body.rate-portal-theme h3,
html[data-theme="dark"] body.rate-portal-theme h4,
html[data-theme="dark"] body.rate-portal-theme h5,
html[data-theme="dark"] body.rate-portal-theme .card-body,
html[data-theme="dark"] body.rate-portal-theme .table,
html[data-theme="dark"] body.rate-portal-theme td,
html[data-theme="dark"] body.rate-portal-theme th,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-value,
html[data-theme="dark"] body.rate-portal-theme .rp-section-title {
  color: #f5f5f5 !important;
  -webkit-text-fill-color: #f5f5f5 !important;
}

html[data-theme="dark"] body.rate-portal-theme .rp-stat-label {
  color: #b0b4be !important;
}

html[data-theme="dark"] body.rate-portal-theme .table,
html[data-theme="dark"] body.rate-portal-theme .table-dark,
html[data-theme="dark"] table,
html[data-theme="dark"] .table {
  --bs-table-bg: #16181d !important;
  --bs-table-color: #f5f5f5 !important;
  --bs-table-striped-bg: #1c1f26 !important;
  --bs-table-hover-bg: #22262f !important;
  background: #16181d !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .footer,
html[data-theme="dark"] body.rate-portal-theme .footer,
html[data-theme="dark"] body.portal-genz .footer,
html[data-theme="dark"] body.aup-app .footer,
html[data-theme="dark"] body.ru-theme .footer {
  background: #0b0e14 !important;
  color: #b0b4be !important;
  border-top-color: #2a2f3a !important;
}

html[data-theme="dark"] .footer .text-muted,
html[data-theme="dark"] body.rate-portal-theme .footer .text-muted,
html[data-theme="dark"] body.portal-genz .footer .text-muted {
  color: #b0b4be !important;
}

html[data-theme="dark"] body.ru-theme .top-nav,
html[data-theme="dark"] body.aup-app .top-nav,
html[data-theme="dark"] body.aup-app nav.top-nav {
  background: #12141a !important;
  border-bottom-color: #2a2f3a !important;
}

html[data-theme="dark"] body.ru-theme .top-nav a,
html[data-theme="dark"] body.aup-app .top-nav a {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.ru-theme,
html[data-theme="dark"] body.aup-app,
html[data-theme="dark"] body.ru-theme p,
html[data-theme="dark"] body.ru-theme label,
html[data-theme="dark"] body.ru-theme span,
html[data-theme="dark"] body.aup-app p,
html[data-theme="dark"] body.aup-app label,
html[data-theme="dark"] body.aup-app td,
html[data-theme="dark"] body.aup-app th {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.ru-theme .stat-card,
html[data-theme="dark"] body.ru-theme .glass-card,
html[data-theme="dark"] body.ru-theme .control-panel,
html[data-theme="dark"] body.ru-theme .card,
html[data-theme="dark"] body.ru-theme .panel,
html[data-theme="dark"] body.aup-app .stat-card,
html[data-theme="dark"] body.aup-app .glass-card,
html[data-theme="dark"] body.aup-app .complaint-card,
html[data-theme="dark"] body.aup-app .card,
html[data-theme="dark"] body.aup-app .panel,
html[data-theme="dark"] body.ru-theme table,
html[data-theme="dark"] body.aup-app table,
html[data-theme="dark"] body.ru-theme .modal-content,
html[data-theme="dark"] body.aup-app .modal-content,
html[data-theme="dark"] body.aup-app .aup-stat-card,
html[data-theme="dark"] body.ru-theme .ru-stat-card,
html[data-theme="dark"] body.aup-app .neon-card .card-header,
html[data-theme="dark"] body.ru-theme .card-header,
html[data-theme="dark"] body.aup-app .card-header,
html[data-theme="dark"] .neon-card {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.aup-app thead,
html[data-theme="dark"] body.ru-theme thead,
html[data-theme="dark"] body.aup-app th,
html[data-theme="dark"] body.aup-app .aup-complaints-table thead th,
html[data-theme="dark"] body.ru-theme table thead th {
  background: #1c1f26 !important;
  color: #f5c400 !important;
}

html[data-theme="dark"] body.aup-app .aup-logs-terminal,
html[data-theme="dark"] body.ru-theme .logs-terminal,
html[data-theme="dark"] body.aup-app .aup-logs-box,
html[data-theme="dark"] body.ru-theme .logs-box {
  background: #12141a !important;
  color: #f5f5f5 !important;
  border-color: #2a2f3a !important;
}

html[data-theme="dark"] body.portal-genz .pg-portal-card,
html[data-theme="dark"] body.portal-genz .pg-portal-card.pg-tool-card,
html[data-theme="dark"] body.portal-genz .neon-card {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38) !important;
}

html[data-theme="dark"] body.portal-genz .pg-portal-card .card-title,
html[data-theme="dark"] body.portal-genz .pg-hero-title,
html[data-theme="dark"] body.portal-genz .pg-portal-card.pg-tool-card .form-label,
html[data-theme="dark"] body.portal-genz .pg-tool-table-wrap thead th,
html[data-theme="dark"] body.portal-genz .pg-tool-table-wrap tbody td {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.portal-genz .pg-hero-lead,
html[data-theme="dark"] body.portal-genz .pg-portal-card .card-text {
  color: #b0b4be !important;
}

html[data-theme="dark"] body.portal-genz .pg-portal-card.pg-tool-card .form-control,
html[data-theme="dark"] body.portal-genz .pg-portal-card.pg-tool-card input[type="file"] {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.portal-genz .pg-plf-nav-btn {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.portal-genz .pg-plf-nav-btn:hover {
  background: #f5c400 !important;
  border-color: #f5c400 !important;
  color: #171717 !important;
}

html[data-theme="dark"] .alert,
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .alert-warning {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .alert-danger {
  background: rgba(185, 28, 28, 0.18) !important;
  border-color: rgba(239, 90, 111, 0.35) !important;
  color: #ffcdd4 !important;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0b0e14 !important;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  border-color: #0b0e14 !important;
}

html[data-theme="dark"] * {
  scrollbar-color: #f5c400 #0b0e14;
}

/* Theme toggle — viewport-fixed, above the PKT clock */
.pg-theme-toggle {
  position: fixed !important;
  top: 16px !important;
  right: 22px !important;
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e5e5e0;
  background: #ffffff;
  color: #171717;
  font-family: Inter, "DM Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
}

.pg-theme-toggle:hover {
  border-color: #f5c400;
  background: #fff8d6;
}

html[data-theme="dark"] .pg-theme-toggle {
  background: #16181d;
  border-color: #2a2f3a;
  color: #f5f5f5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .pg-theme-toggle:hover {
  border-color: #f5c400;
  background: #2a2400;
  color: #f5c400;
}

html[data-theme="dark"] .pg-admin-console-btn {
  background: #16181d;
  border-color: #f5c400;
  color: #f5f5f5 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .pg-admin-console-btn i {
  color: #f5c400;
}

html[data-theme="dark"] .pg-admin-console-btn:hover {
  background: #2a2400;
  color: #f5c400 !important;
}

html[data-theme="dark"] .pg-pkt-clock {
  background: #16181d;
  border-color: #2a2f3a;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .pg-pkt-clock__day {
  color: #f5c400;
}

html[data-theme="dark"] .pg-pkt-clock__date {
  color: #b0b4be;
}

html[data-theme="dark"] .pg-pkt-clock__time {
  color: #ffffff;
}

/* FAS portal */
html[data-theme="dark"] .fp-root {
  --bg: #0b0e14;
  --panel: #16181d;
  --panel2: #1c1f26;
  --border: #2a2f3a;
  --text: #f5f5f5;
  --sub: #b0b4be;
  --muted: #8b93a7;
  --green: #3ecf8e;
  --green-dim: rgba(62, 207, 142, 0.14);
  --amber: #e8b84b;
  --amber-dim: rgba(232, 184, 75, 0.14);
  --red: #ef5a6f;
  --red-dim: rgba(239, 90, 111, 0.14);
  --blue: #f5c400;
  --accent: #f5c400;
  --accent-hover: #d4a800;
  --on-yellow: #171717;
  background: #0b0e14;
  color: #f5f5f5;
}

html[data-theme="dark"] .fp-h1,
html[data-theme="dark"] .fp-sec-title,
html[data-theme="dark"] .fp-card-title,
html[data-theme="dark"] .fp-kpi .val {
  color: #ffffff;
}

html[data-theme="dark"] .fp-alert {
  background: rgba(245, 196, 0, 0.12);
  border-color: rgba(245, 196, 0, 0.35);
  color: #f5f5f5;
}

html[data-theme="dark"] .fp-alert b {
  color: #ffffff;
}

html[data-theme="dark"] .fp-settings-btn,
html[data-theme="dark"] .fp-back {
  background: #16181d;
  border-color: #2a2f3a;
  color: #ffffff;
}

html[data-theme="dark"] .fp-success {
  background: rgba(62, 207, 142, 0.14);
  border-color: rgba(62, 207, 142, 0.35);
  color: #3ecf8e;
}

html[data-theme="dark"] .fp-cmp-split {
  background: #16181d;
  border-color: #2a2f3a;
}

html[data-theme="dark"] .fp-cmp-divider {
  background: #2a2f3a;
}

html[data-theme="dark"] .fp-cmp-cal-label input {
  background: #1c1f26;
  border-color: #2a2f3a;
  color: #ffffff;
  color-scheme: dark;
}

html[data-theme="dark"] .fp-compare-tab {
  background: #16181d;
  border-color: #f5c400;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}
html[data-theme="dark"] a.fp-compare-tab.fp-tab-on,
html[data-theme="dark"] .fp-compare-tab:hover,
html[data-theme="dark"] .fp-print-btn {
  background: #f5c400;
  color: #171717;
  -webkit-text-fill-color: #171717;
}

html[data-theme="dark"] .fp-lock-btn {
  color: #171717;
}

html[data-theme="dark"] .fp-dropzone {
  background: #1c1f26;
}

html[data-theme="dark"] .fp-table tbody tr:hover {
  background: #1c1f26;
}

html[data-theme="dark"] .fp-pct-track,
html[data-theme="dark"] .fp-bar-stack {
  background: #232a38;
}

html[data-theme="dark"] .fp-class-average {
  background-color: #232a38;
  color: #d5d8e0;
  -webkit-text-fill-color: #d5d8e0;
}

/* Common SPA / Tailwind light tokens */
html[data-theme="dark"] .bg-\[\#f5f5f3\],
html[data-theme="dark"] [class~="bg-[#f5f5f3]"] {
  background-color: #0b0e14 !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .glass-panel,
html[data-theme="dark"] .glass-card,
html[data-theme="dark"] .glass-card-sm,
html[data-theme="dark"] .glass-ambient,
html[data-theme="dark"] .glass-3d,
html[data-theme="dark"] .nav-premium,
html[data-theme="dark"] .kpi-pill {
  background: #16181d !important;
  background-color: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .text-neutral-900,
html[data-theme="dark"] .text-neutral-800,
html[data-theme="dark"] .text-black,
html[data-theme="dark"] .text-neutral-100 {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .text-neutral-600,
html[data-theme="dark"] .text-neutral-500,
html[data-theme="dark"] .text-neutral-400,
html[data-theme="dark"] .hero-subtitle {
  color: #b0b4be !important;
}

html[data-theme="dark"] .border-neutral-200,
html[data-theme="dark"] .border-neutral-300,
html[data-theme="dark"] .border-neutral-700 {
  border-color: #2a2f3a !important;
}

html[data-theme="dark"] .upload-zone,
html[data-theme="dark"] .upload-premium {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .input-field,
html[data-theme="dark"] .select-premium {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .btn-secondary {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.rate-portal-theme .js-dashboard-clear-btn,
html[data-theme="dark"] body.rate-portal-theme .btn-outline-danger,
html[data-theme="dark"] .btn-outline-danger {
  background: #0b0e14 !important;
  border-color: #2a2f3a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body.rate-portal-theme .js-dashboard-clear-btn i,
html[data-theme="dark"] body.rate-portal-theme .btn-outline-danger i,
html[data-theme="dark"] .btn-outline-danger i {
  color: #ffffff !important;
}

html[data-theme="dark"] body.rate-portal-theme .js-dashboard-clear-btn:hover,
html[data-theme="dark"] body.rate-portal-theme .btn-outline-danger:hover,
html[data-theme="dark"] .btn-outline-danger:hover {
  background: #16181d !important;
  border-color: #f5c400 !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  .pg-theme-toggle span {
    display: none;
  }
  .pg-theme-toggle {
    padding: 9px 11px;
    right: 14px !important;
    top: 12px !important;
  }
  .pg-pkt-clock {
    top: 58px;
    right: 0;
    min-width: 0;
    padding: 10px 12px 9px;
  }
  .pg-pkt-clock__time {
    font-size: 20px;
  }
}

/* AUP + AI Rapto standalone pages */
html[data-theme="dark"] body.aup-app,
html[data-theme="dark"] body.ru-theme {
  background: #0b0e14 !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.aup-app .neon-text,
html[data-theme="dark"] body.aup-app .neon-text:not(.aup-brand-title),
html[data-theme="dark"] body.aup-app h1,
html[data-theme="dark"] body.aup-app h2,
html[data-theme="dark"] body.aup-app .aup-brand-title,
html[data-theme="dark"] body.ru-theme .neon-text,
html[data-theme="dark"] body.ru-theme h1,
html[data-theme="dark"] body.ru-theme h2,
html[data-theme="dark"] body.ru-theme .ru-brand-wrap .top-nav-brand,
html[data-theme="dark"] body.ru-theme .top-nav-brand {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="dark"] body.aup-app .text-muted,
html[data-theme="dark"] body.ru-theme .text-muted,
html[data-theme="dark"] body.aup-app p,
html[data-theme="dark"] body.ru-theme p,
html[data-theme="dark"] body.aup-app .aup-eyebrow,
html[data-theme="dark"] body.ru-theme .ru-eyebrow {
  color: #b0b4be !important;
}

html[data-theme="dark"] body.aup-app .aup-stat-card,
html[data-theme="dark"] body.ru-theme .ru-stat-card {
  background: #16181d !important;
  border: 1px solid #2a2f3a !important;
  color: #f5f5f5 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body.aup-app .aup-stat-card__value,
html[data-theme="dark"] body.aup-app .aup-stat-card__label,
html[data-theme="dark"] body.ru-theme .ru-stat-card__value,
html[data-theme="dark"] body.ru-theme .ru-stat-card__label {
  color: #ffffff !important;
}

html[data-theme="dark"] body.aup-app .neon-card,
html[data-theme="dark"] body.ru-theme .neon-card,
html[data-theme="dark"] body.aup-app .neon-card .card-header,
html[data-theme="dark"] body.ru-theme .card-header {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.aup-app .aup-stat-card__icon--violet,
html[data-theme="dark"] body.aup-app .aup-stat-card__icon--amber,
html[data-theme="dark"] body.aup-app .aup-stat-card__icon--cyan,
html[data-theme="dark"] body.ru-theme .ru-stat-card__icon--cyan,
html[data-theme="dark"] body.ru-theme .ru-stat-card__icon--violet,
html[data-theme="dark"] body.ru-theme .ru-stat-card__icon--rose {
  background: #2a2400 !important;
  color: #f5c400 !important;
  border-color: #5c4d00 !important;
}

html[data-theme="dark"] body.ru-theme .ru-category-table,
html[data-theme="dark"] body.ru-theme .ru-category-table tbody td,
html[data-theme="dark"] body.ru-theme .ru-client-table,
html[data-theme="dark"] body.aup-app table,
html[data-theme="dark"] body.aup-app td {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] body.ru-theme .ru-category-table thead th,
html[data-theme="dark"] body.aup-app table thead th {
  background: #1c1f26 !important;
  color: #f5c400 !important;
}

html[data-theme="dark"] .ic-stat-card,
html[data-theme="dark"] .ic-stat-card .ic-stat-value,
html[data-theme="dark"] .ic-stat-card .ic-stat-label,
html[data-theme="dark"] .ic-stat-card .ic-stat-meta {
  color: #ffffff !important;
}

html[data-theme="dark"] .error,
html[data-theme="dark"] .error * {
  color: #ffffff !important;
}

html[data-theme="dark"] .workflow-icon {
  background: #1c1f26 !important;
  border-color: #2a2f3a !important;
  color: #b0b4be !important;
}

html[data-theme="dark"] .workflow-icon.active,
html[data-theme="dark"] .workflow-icon.done {
  background: #f5c400 !important;
  border-color: #f5c400 !important;
  color: #0a0a0a !important;
}

html[data-theme="dark"] .info-strip,
html[data-theme="dark"] .info-strip p {
  background: #16181d !important;
  border-color: #2a2f3a !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .info-strip strong {
  color: #ffffff !important;
}

html[data-theme="dark"] .info-strip code {
  background: #0b0e14 !important;
  color: #f5c400 !important;
}

html[data-theme="dark"] .upload-premium.is-active {
  border-color: #f5c400 !important;
}

html[data-theme="dark"] .btn-primary:disabled {
  background: #2a2f3a !important;
  border-color: #2a2f3a !important;
  color: #8b8f98 !important;
}

html[data-theme="dark"] body.rate-portal-theme .rp-stat-card::after {
  display: none !important;
  content: none !important;
  height: 0 !important;
  background: none !important;
}

html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--cyan,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--mint,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--violet {
  --rp-stat-accent: #f5c400 !important;
}

html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--cyan,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--mint,
html[data-theme="dark"] body.rate-portal-theme .rp-stat-card--violet {
  border-color: rgba(245, 196, 0, 0.28) !important;
}

html[data-theme="dark"] .rdm-root {
  --bg: #0b0e14;
  --panel: #16181d;
  --panel2: #1c1f26;
  --border: #2a2f3a;
  --text: #f5f5f5;
  --sub: #b0b4be;
  --muted: #8b93a7;
  --accent: #f5c400;
  --accent-hover: #d4a800;
  --on-yellow: #171717;
  --danger: #ef5a6f;
  --danger-bg: rgba(239, 90, 111, 0.14);
  --ok: #3ecf8e;
  --ok-bg: rgba(62, 207, 142, 0.14);
  --warn: #f5c400;
  --warn-bg: rgba(245, 196, 0, 0.14);
  background: #0b0e14;
  color: #f5f5f5;
}

html[data-theme="dark"] body:has(.rdm-root) {
  background: #0b0e14;
  color: #f5f5f5;
}

html[data-theme="dark"] .rdm-root input[type="text"],
html[data-theme="dark"] .rdm-root input[type="number"],
html[data-theme="dark"] .rdm-root select {
  background: #16181d;
  color: #f5f5f5;
  border-color: #2a2f3a;
  color-scheme: dark;
}

html[data-theme="dark"] .rdm-root th,
html[data-theme="dark"] .rdm-root td {
  color: #f5f5f5;
}

html[data-theme="dark"] button.rdm-primary {
  background: #f5c400;
  border-color: #f5c400;
  color: #171717;
  -webkit-text-fill-color: #171717;
}

html[data-theme="dark"] input[type="file"]::file-selector-button,
html[data-theme="dark"] input[type="file"]::-webkit-file-upload-button,
html[data-theme="dark"] .form-control[type="file"]::file-selector-button,
html[data-theme="dark"] .form-control[type="file"]::-webkit-file-upload-button {
  background: #f5c400 !important;
  background-color: #f5c400 !important;
  color: #0a0a0a !important;
  border: 1px solid #f5c400 !important;
  font-weight: 600 !important;
}
