/* SnitchOS brand overrides on top of Paces compiled CSS.
   Keep this file small — most styling should come from the SCSS build. */

/* Brand palette override: matte sage green on slate. The compiled
   vendors.min.css still ships Paces' indigo primary, so we re-paint the
   CSS custom properties at :root + the dark-mode equivalent. The green
   reads as steady, observant — workforce visibility without the alarm. */
:root {
  --bs-primary: #83AB77;
  --bs-primary-rgb: 131, 171, 119;
  --bs-primary-text-emphasis: #5A7A4F;
  --bs-primary-bg-subtle: #ECF2EA;
  --bs-primary-border-subtle: #C7D9C0;
  --theme-primary: #83AB77;
  --theme-primary-rgb: 131, 171, 119;
  --theme-link-color: #5A7A4F;
  --theme-link-hover-color: #486540;
  /* Used by .btn-primary, badges, focus rings, navlink-active, etc. */
  --bs-link-color: #5A7A4F;
  --bs-link-hover-color: #486540;
  --bs-focus-ring-color: rgba(131, 171, 119, 0.35);
}
[data-bs-theme="dark"] {
  --bs-primary: #9DC18F;
  --bs-primary-rgb: 157, 193, 143;
  --theme-primary: #9DC18F;
  --bs-link-color: #B5D2A8;
  --bs-link-hover-color: #CFE3C5;
}
.btn-primary {
  --bs-btn-bg: #83AB77;
  --bs-btn-border-color: #83AB77;
  --bs-btn-hover-bg: #6E9362;
  --bs-btn-hover-border-color: #6E9362;
  --bs-btn-active-bg: #5A7A4F;
  --bs-btn-active-border-color: #5A7A4F;
  --bs-btn-disabled-bg: #83AB77;
  --bs-btn-disabled-border-color: #83AB77;
}
.text-primary { color: #83AB77 !important; }
.bg-primary { background-color: #83AB77 !important; }
.border-primary { border-color: #83AB77 !important; }

/* Self-hosted Inter Variable. Codex pass-04 [L3]: previously we pulled from
   rsms.me, which is a supply-chain + privacy risk for a security/monitoring
   product. The woff2 is ~340 KB and lives at /static/css/fonts/inter-variable.woff2. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("./fonts/inter-variable.woff2") format("woff2-variations");
}

/* Productivity category badges (used in classification + activity views) */
.badge-productive   { background:#D1FAE5; color:#065F46; }
.badge-neutral      { background:#FEF3C7; color:#92400E; }
.badge-unproductive { background:#FEE2E2; color:#991B1B; }
[data-bs-theme="dark"] .badge-productive   { background:#064E3B; color:#A7F3D0; }
[data-bs-theme="dark"] .badge-neutral      { background:#78350F; color:#FDE68A; }
[data-bs-theme="dark"] .badge-unproductive { background:#7F1D1D; color:#FECACA; }

/* Audit-row outcome tints */
.audit-row.audit-failure td { background: rgba(239, 68, 68, 0.05); }
.audit-row.audit-denied  td { background: rgba(245, 158, 11, 0.05); }
[data-bs-theme="dark"] .audit-row.audit-failure td { background: rgba(239, 68, 68, 0.12); }
[data-bs-theme="dark"] .audit-row.audit-denied  td { background: rgba(245, 158, 11, 0.12); }

/* RMM-bundle callout card uses brand-primary side-stripe */
.card.rmm-card { border-left: 3px solid var(--theme-primary); }

/* Tight key-value layout for tenant details */
dl.kv { display: grid; grid-template-columns: 11rem 1fr; column-gap: 1rem; row-gap: 0.4rem; margin-bottom: 0; }
dl.kv dt { color: var(--theme-secondary-color); font-weight: 500; }
dl.kv dd { margin: 0; }

/* Make the topbar logo line up nicely with the sidenav width */
.logo-topbar { min-width: 220px; }
@media (max-width: 991px) { .logo-topbar { min-width: auto; } }

/* ---------------------------------------------------------------------
   Real-time visibility widget
   --------------------------------------------------------------------- */

.rt-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    text-transform: capitalize;
}
.rt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rt-active  { background:#D1FAE5; color:#065F46; }
.rt-active  .rt-dot { background:#10B981; animation: rt-pulse 1.4s ease-in-out infinite; box-shadow:0 0 0 0 rgba(16,185,129,0.6); }
.rt-idle    { background:#FEF3C7; color:#92400E; }
.rt-idle    .rt-dot { background:#F59E0B; }
.rt-away    { background:#E2E8F0; color:#475569; }
.rt-away    .rt-dot { background:#94A3B8; }
.rt-offline { background:#F1F5F9; color:#64748B; }
.rt-offline .rt-dot { background:#CBD5E1; }
[data-bs-theme="dark"] .rt-active  { background:#064E3B; color:#A7F3D0; }
[data-bs-theme="dark"] .rt-idle    { background:#78350F; color:#FDE68A; }
[data-bs-theme="dark"] .rt-away    { background:#1E293B; color:#94A3B8; }
[data-bs-theme="dark"] .rt-offline { background:#0F172A; color:#64748B; }

@keyframes rt-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.rt-cat-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.rt-cat-productive   { background:#10B981; }
.rt-cat-neutral      { background:#F59E0B; }
.rt-cat-unproductive { background:#EF4444; }

.rt-refresh-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-green, #83AB77);
    margin-left: 0.3rem;
    animation: rt-pulse 1.4s ease-in-out infinite;
    vertical-align: middle;
}

.rt-table td { vertical-align: middle; }

.rt-schedule-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}
.rt-in-schedule     { background:#ECF2EA; color:#5A7A4F; }
.rt-out-of-schedule { background:#F1F5F9; color:#64748B; }
[data-bs-theme="dark"] .rt-in-schedule     { background:rgba(131,171,119,0.2); color:#9DC18F; }
[data-bs-theme="dark"] .rt-out-of-schedule { background:#1E293B; color:#94A3B8; }

.rt-adh-good { color:#065F46; font-weight:700; }
.rt-adh-warn { color:#92400E; font-weight:700; }
.rt-adh-bad  { color:#991B1B; font-weight:700; }
[data-bs-theme="dark"] .rt-adh-good { color:#A7F3D0; }
[data-bs-theme="dark"] .rt-adh-warn { color:#FDE68A; }
[data-bs-theme="dark"] .rt-adh-bad  { color:#FECACA; }
.rt-summary { font-size: 0.92rem; }
