/* ==========================================================================
   Project Tracker — Unified Design System, Persistent Sidebar & Gear Motion
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --pt-bg: #080d19;
  --pt-bg-elevated: #0d1425;
  --pt-surface: #111b30;
  --pt-surface-2: #16233d;
  --pt-surface-hover: #1c2c4c;
  --pt-glass: rgba(15, 23, 42, 0.72);
  --pt-glass-strong: rgba(13, 20, 37, 0.92);

  --pt-border: rgba(148, 163, 184, 0.14);
  --pt-border-strong: rgba(148, 163, 184, 0.24);
  --pt-border-accent: rgba(56, 189, 248, 0.36);

  --pt-text: #f1f5f9;
  --pt-text-secondary: #cbd5e1;
  --pt-muted: #8b9bb4;
  --pt-subtle: #64748b;

  --pt-accent: #38bdf8;
  --pt-accent-strong: #0284c7;
  --pt-accent-soft: rgba(56, 189, 248, 0.12);
  --pt-indigo: #818cf8;
  --pt-success: #22c55e;
  --pt-warning: #f59e0b;
  --pt-danger: #f43f5e;

  --pt-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --pt-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --pt-sidebar-w: 268px;
  --pt-sidebar-collapsed-w: 76px;
  --pt-mobile-bar-h: 60px;

  --pt-radius-sm: 8px;
  --pt-radius: 14px;
  --pt-radius-lg: 18px;

  --pt-shadow-sm: 0 4px 14px rgba(2, 6, 23, 0.28);
  --pt-shadow: 0 14px 36px rgba(2, 6, 23, 0.44);
  --pt-shadow-lg: 0 24px 60px rgba(2, 6, 23, 0.62);

  /* Align legacy CSS custom properties across all pages */
  --bg: var(--pt-bg);
  --surface: var(--pt-bg-elevated);
  --card: var(--pt-surface);
  --border: var(--pt-border);
  --border-strong: var(--pt-border-strong);
  --text: var(--pt-text);
  --muted: var(--pt-muted);
  --accent: var(--pt-accent);
  --accent-strong: var(--pt-accent-strong);
  --success: var(--pt-success);
  --warning: var(--pt-warning);
  --danger: var(--pt-danger);
  --bar-bg: rgba(15, 23, 42, 0.85);
  --radius: var(--pt-radius);
  --shadow: var(--pt-shadow);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--pt-bg);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--pt-font) !important;
  color: var(--pt-text);
  background:
    radial-gradient(960px 540px at 14% -8%, rgba(56, 189, 248, 0.11), transparent 58%),
    radial-gradient(760px 460px at 92% 4%, rgba(129, 140, 248, 0.08), transparent 58%),
    linear-gradient(180deg, #0a1020 0%, var(--pt-bg) 100%) !important;
  background-attachment: fixed !important;
  margin: 0;
  min-height: 100vh;
}

/* Remove distracting legacy neon/wireframe backdrop layers */
body::before,
body::after,
main::before {
  display: none !important;
  content: none !important;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 13, 25, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.36);
}

/* ==========================================================================
   Persistent Sidebar Shell Layout
   ========================================================================== */

body.pt-has-sidebar {
  padding-left: var(--pt-sidebar-w) !important;
  transition: padding-left 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

body.pt-has-sidebar.pt-sidebar-collapsed {
  padding-left: var(--pt-sidebar-collapsed-w) !important;
}

/* Hide legacy duplicate topbars when the persistent sidebar is active */
body.pt-has-sidebar #agyRbacTopbar,
body.pt-has-sidebar nav.topbar {
  display: none !important;
}

/* Persistent Sidebar */
#ptSidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--pt-sidebar-w);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 21, 38, 0.97) 0%, rgba(9, 14, 26, 0.99) 100%);
  border-right: 1px solid var(--pt-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 4px 0 32px rgba(2, 6, 23, 0.45);
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}

body.pt-sidebar-collapsed #ptSidebar {
  width: var(--pt-sidebar-collapsed-w);
}

/* Brand Header inside Sidebar */
.pt-sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--pt-border);
  min-height: 68px;
}

.pt-sb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
  color: var(--pt-text);
}

.pt-sb-logo-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.12));
  border: 1px solid var(--pt-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.14);
}

.pt-sb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.16s ease;
}

.pt-sb-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--pt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-sb-brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pt-accent);
  margin-top: 1px;
  white-space: nowrap;
}

.pt-sb-collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--pt-border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--pt-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

.pt-sb-collapse-btn:hover {
  color: var(--pt-text);
  border-color: var(--pt-border-strong);
  background: var(--pt-surface-2);
}

.pt-sb-collapse-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.24s ease;
}

body.pt-sidebar-collapsed .pt-sb-brand-text {
  display: none;
}

body.pt-sidebar-collapsed .pt-sb-header {
  flex-direction: column;
  padding: 14px 10px 12px;
  gap: 10px;
}

body.pt-sidebar-collapsed .pt-sb-collapse-btn svg {
  transform: rotate(180deg);
}

/* Sidebar Scrollable Nav */
.pt-sb-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pt-sb-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pt-sb-group-label {
  padding: 0 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pt-subtle);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pt-sb-group-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pt-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.pt-sb-group-toggle:hover {
  color: var(--pt-text-secondary);
  background: rgba(148, 163, 184, 0.06);
}

.pt-sb-group-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.pt-sb-group.is-collapsed .pt-sb-group-toggle svg {
  transform: rotate(-90deg);
}

.pt-sb-group.is-collapsed .pt-sb-sublist {
  display: none;
}

body.pt-sidebar-collapsed .pt-sb-group-label,
body.pt-sidebar-collapsed .pt-sb-group-toggle {
  display: none;
}

body.pt-sidebar-collapsed .pt-sb-group + .pt-sb-group {
  padding-top: 10px;
  border-top: 1px solid var(--pt-border);
}

/* Nav Links */
.pt-sb-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--pt-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pt-sb-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pt-sb-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--pt-text);
}

.pt-sb-link:hover svg {
  opacity: 1;
}

.pt-sb-link.is-active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.06));
  color: #e0f2fe;
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.28);
}

.pt-sb-link.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pt-accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.65);
}

.pt-sb-link.is-active svg {
  color: var(--pt-accent);
  opacity: 1;
}

.pt-sb-link-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.pt-sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

body.pt-sidebar-collapsed .pt-sb-link {
  justify-content: center;
  padding: 10px;
}

body.pt-sidebar-collapsed .pt-sb-link-label,
body.pt-sidebar-collapsed .pt-sb-badge {
  display: none;
}

/* Collapsed tooltip */
body.pt-sidebar-collapsed .pt-sb-link[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--pt-sidebar-collapsed-w) + 10px);
  padding: 6px 11px;
  border-radius: 8px;
  background: #0f172a;
  color: var(--pt-text);
  border: 1px solid var(--pt-border-strong);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: var(--pt-shadow);
  pointer-events: none;
}

/* Sidebar Footer */
.pt-sb-footer {
  padding: 12px 10px 14px;
  border-top: 1px solid var(--pt-border);
  background: rgba(8, 13, 25, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-sb-sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--pt-border);
  font-size: 0.74rem;
  color: var(--pt-muted);
}

.pt-sb-sync-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

body.pt-sidebar-collapsed .pt-sb-sync-row {
  justify-content: center;
  padding: 6px;
}

body.pt-sidebar-collapsed .pt-sb-sync-text {
  display: none;
}

.pt-sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(17, 27, 48, 0.75);
  border: 1px solid var(--pt-border);
}

.pt-sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.pt-sb-user-meta {
  min-width: 0;
  flex: 1;
}

.pt-sb-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--pt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-sb-user-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--pt-muted);
}

.pt-sb-role-pill {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pt-sb-role-pill.is-admin {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pt-sb-role-pill.is-user {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.pt-sb-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pt-sb-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid var(--pt-border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--pt-text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pt-sb-action-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.pt-sb-action-btn:hover {
  border-color: var(--pt-border-accent);
  color: var(--pt-text);
  background: var(--pt-surface-2);
}

.pt-sb-action-btn.is-danger {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.28);
  background: rgba(244, 63, 94, 0.08);
}

.pt-sb-action-btn.is-danger:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #ffe4e6;
}

body.pt-sidebar-collapsed .pt-sb-user {
  justify-content: center;
  padding: 6px;
}

body.pt-sidebar-collapsed .pt-sb-user-meta {
  display: none;
}

body.pt-sidebar-collapsed .pt-sb-footer-actions {
  grid-template-columns: 1fr;
}

body.pt-sidebar-collapsed .pt-sb-action-btn span {
  display: none;
}

/* Mobile Header & Drawer Backdrop */
#ptMobileBar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--pt-mobile-bar-h);
  z-index: 8900;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(10, 16, 30, 0.92);
  border-bottom: 1px solid var(--pt-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.pt-mb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pt-mb-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--pt-border);
  background: var(--pt-surface);
  color: var(--pt-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.pt-mb-menu-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.pt-mb-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--pt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-mb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#ptSidebarBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8950;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

#ptSidebarBackdrop.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 1024px) {
  body.pt-has-sidebar,
  body.pt-has-sidebar.pt-sidebar-collapsed {
    padding-left: 0 !important;
    padding-top: var(--pt-mobile-bar-h) !important;
  }

  #ptMobileBar {
    display: flex;
  }

  #ptSidebar {
    width: var(--pt-sidebar-w) !important;
    transform: translateX(-100%);
  }

  body.pt-mobile-nav-open #ptSidebar {
    transform: translateX(0);
  }

  body.pt-sidebar-collapsed .pt-sb-brand-text,
  body.pt-sidebar-collapsed .pt-sb-link-label,
  body.pt-sidebar-collapsed .pt-sb-user-meta,
  body.pt-sidebar-collapsed .pt-sb-sync-text,
  body.pt-sidebar-collapsed .pt-sb-action-btn span,
  body.pt-sidebar-collapsed .pt-sb-group-label,
  body.pt-sidebar-collapsed .pt-sb-group-toggle {
    display: revert;
  }

  body.pt-sidebar-collapsed .pt-sb-header {
    flex-direction: row;
    padding: 16px 14px 14px;
  }

  body.pt-sidebar-collapsed .pt-sb-link {
    justify-content: flex-start;
    padding: 9px 11px;
  }

  body.pt-sidebar-collapsed .pt-sb-footer-actions {
    grid-template-columns: 1fr 1fr;
  }

  .pt-sb-collapse-btn {
    display: none;
  }
}

/* ==========================================================================
   Signature Precision Gear Animation System (Present on Every Page)
   ========================================================================== */

.pt-gear-svg {
  display: block;
  overflow: visible;
}

.pt-gear-primary {
  transform-origin: 22px 24px;
  animation: pt-gear-cw 22s linear infinite;
}

.pt-gear-secondary {
  transform-origin: 42.5px 38.5px;
  animation: pt-gear-ccw 14.666s linear infinite;
}

/* Active syncing / loading cadence — crisp, energetic, smooth */
.is-syncing .pt-gear-primary,
.pt-gear-active .pt-gear-primary {
  animation-duration: 2.4s;
}

.is-syncing .pt-gear-secondary,
.pt-gear-active .pt-gear-secondary {
  animation-duration: 1.6s;
}

.is-syncing .pt-gear-svg,
.pt-gear-active .pt-gear-svg {
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.55));
}

@keyframes pt-gear-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pt-gear-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* Top subtle progress bar during loading / page transitions */
#ptTopProgress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: linear-gradient(90deg, transparent, var(--pt-accent), var(--pt-indigo), var(--pt-accent), transparent);
  background-size: 200% 100%;
  animation: pt-progress-flow 1.4s linear infinite;
}

#ptTopProgress.is-active {
  opacity: 1;
}

@keyframes pt-progress-flow {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Subtle Page-Transition / Initial Load Gear Pill Overlay */
#ptPageLoader {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 13, 25, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

#ptPageLoader.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pt-loader-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--pt-border-accent);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.65), 0 0 28px rgba(56, 189, 248, 0.14);
  color: var(--pt-text);
  font-family: var(--pt-font);
}

.pt-loader-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pt-loader-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pt-text);
}

.pt-loader-sub {
  font-size: 0.74rem;
  color: var(--pt-muted);
}

/* Always-present subtle floating Gear Telemetry Pill on standalone/public pages
   (and live sync indicator on all pages) */
#ptGearStatusPill {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  background: rgba(13, 21, 38, 0.84);
  border: 1px solid var(--pt-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.38);
  color: var(--pt-muted);
  font-family: var(--pt-font);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

#ptGearStatusPill.is-syncing {
  border-color: var(--pt-border-accent);
  color: #e0f2fe;
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.5), 0 0 18px rgba(56, 189, 248, 0.18);
}

/* Subtle architectural gear watermark for standalone/auth/status pages */
.pt-gear-watermark {
  position: fixed;
  right: -60px;
  bottom: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
  color: var(--pt-accent);
}

.pt-gear-watermark .pt-gear-primary {
  animation-duration: 64s;
}
.pt-gear-watermark .pt-gear-secondary {
  animation-duration: 42.67s;
}

/* ==========================================================================
   Shared Enterprise Polish Across All Pages
   ========================================================================== */

.panel,
.log-card,
.summary-card,
.kpi-card,
.manager-controls {
  background: linear-gradient(180deg, rgba(22, 35, 61, 0.58), rgba(15, 23, 42, 0.88)) !important;
  border: 1px solid var(--pt-border) !important;
  box-shadow: var(--pt-shadow-sm) !important;
}

.kpi-value,
.summary-card .value,
.metric-value,
.progress-value .percent {
  font-variant-numeric: tabular-nums;
}

.input,
.select,
.select-input,
.filter-select {
  background: rgba(9, 14, 26, 0.85) !important;
  border: 1px solid var(--pt-border-strong) !important;
  color: var(--pt-text) !important;
  border-radius: 10px;
  font-family: var(--pt-font);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus,
.select:focus,
.select-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--pt-accent) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16) !important;
}

.btn {
  font-family: var(--pt-font);
  transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--pt-accent);
  outline-offset: 2px;
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .pt-gear-primary,
  .pt-gear-secondary,
  #ptTopProgress {
    animation: none !important;
  }
  #ptSidebar,
  body.pt-has-sidebar,
  #ptPageLoader {
    transition: none !important;
  }
}

/* Print Cleanliness — Never print sidebar, mobile bar, or gear overlays */
@media print {
  body.pt-has-sidebar,
  body.pt-has-sidebar.pt-sidebar-collapsed {
    padding-left: 0 !important;
    padding-top: 0 !important;
  }
  #ptSidebar,
  #ptMobileBar,
  #ptSidebarBackdrop,
  #ptPageLoader,
  #ptTopProgress,
  #ptGearStatusPill,
  .pt-gear-watermark {
    display: none !important;
    visibility: hidden !important;
  }
}
