:root {
  --bg-primary: #f5f7fb;
  --bg-secondary: #eef2f8;
  --surface-primary: rgba(255, 255, 255, 0.82);
  --surface-secondary: rgba(255, 255, 255, 0.68);
  --surface-strong: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-soft: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.32);
  --brand: #10b981;
  --brand-soft: rgba(16, 185, 129, 0.12);
  --brand-strong: #047857;
  --sky-soft: rgba(14, 165, 233, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-panel: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-hover: 0 26px 70px rgba(15, 23, 42, 0.16);
  --ring-soft: 0 0 0 5px rgba(16, 185, 129, 0.12);
  --panel-border-premium: rgba(148, 163, 184, 0.18);
  --panel-border-hover: rgba(16, 185, 129, 0.24);
}

.dark {
  --bg-primary: #07111f;
  --bg-secondary: #0f172a;
  --surface-primary: rgba(15, 23, 42, 0.76);
  --surface-secondary: rgba(15, 23, 42, 0.62);
  --surface-strong: #111c31;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-soft: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.26);
  --brand: #34d399;
  --brand-soft: rgba(52, 211, 153, 0.12);
  --brand-strong: #6ee7b7;
  --sky-soft: rgba(56, 189, 248, 0.16);
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.28);
  --shadow-panel: 0 24px 60px rgba(2, 6, 23, 0.34);
  --shadow-hover: 0 28px 78px rgba(2, 6, 23, 0.42);
  --ring-soft: 0 0 0 5px rgba(52, 211, 153, 0.12);
  --panel-border-premium: rgba(255, 255, 255, 0.04);
  --panel-border-hover: rgba(52, 211, 153, 0.2);
}

* {
  border-color: var(--border-soft);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

body::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(16, 185, 129, 0.12), transparent 28%),
    radial-gradient(circle at 82% 6%, rgba(56, 189, 248, 0.10), transparent 24%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -2;
}

.dark body::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(16, 185, 129, 0.16), transparent 28%),
    radial-gradient(circle at 82% 6%, rgba(34, 211, 238, 0.14), transparent 24%),
    linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.35));
}

body::after {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-position: center center;
  background-size: 44px 44px;
  content: "";
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  position: fixed;
  z-index: -3;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  background-clip: padding-box;
}

.shell-surface {
  background: var(--surface-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.panel-surface {
  background: var(--surface-primary);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border-premium);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.panel-strong {
  background: var(--surface-strong);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-panel);
}

.glass-pill {
  background: var(--surface-secondary);
  border: 1px solid var(--border-soft);
}

.soft-divider {
  border-color: var(--border-soft);
}

.section-heading {
  color: var(--text-primary);
  font-family: "Sora", sans-serif;
  letter-spacing: -0.03em;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.brand-gradient {
  background-image: linear-gradient(135deg, #10b981 0%, #14b8a6 45%, #38bdf8 100%);
}

.metric-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.metric-card::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  inset: 0;
  opacity: 0.75;
  pointer-events: none;
  position: absolute;
}

.dark .metric-card::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent);
}

.status-dot {
  border-radius: 999px;
  display: inline-flex;
  height: 8px;
  width: 8px;
}

.table-badge,
.status-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.4rem;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.65rem;
}

.badge-success {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.badge-info {
  background: var(--sky-soft);
  color: #0369a1;
}

.dark .badge-info {
  color: #7dd3fc;
}

.badge-warning {
  background: var(--warning-soft);
  color: #b45309;
}

.dark .badge-warning {
  color: #fcd34d;
}

.badge-danger {
  background: var(--danger-soft);
  color: #b91c1c;
}

.dark .badge-danger {
  color: #fca5a5;
}

.progress-track {
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  background-image: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  border-radius: 999px;
}

.ka-sidebar-link {
  align-items: center;
  border-radius: 1rem;
  color: var(--text-secondary);
  display: flex;
  font-size: 0.94rem;
  font-weight: 700;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.ka-sidebar-link:hover {
  background: var(--surface-secondary);
  color: var(--text-primary);
  transform: translateX(2px);
}

.ka-sidebar-link.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(56, 189, 248, 0.10));
  border: 1px solid rgba(16, 185, 129, 0.18);
  color: var(--text-primary);
}

.dark .ka-sidebar-link.active {
  border-color: rgba(110, 231, 183, 0.16);
}

.ka-sidebar-link .badge {
  margin-left: auto;
}

.ka-sub-link {
  align-items: center;
  border-radius: 0.9rem;
  color: var(--text-muted);
  display: flex;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 0.8rem 0.65rem 2.85rem;
  transition: background-color 180ms ease, color 180ms ease;
}

.ka-sub-link:hover,
.ka-sub-link.active {
  background: var(--surface-secondary);
  color: var(--text-primary);
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-section-label,
.sidebar-collapsed .sidebar-footer-copy,
.sidebar-collapsed .sidebar-badge,
.sidebar-collapsed .sidebar-chevron,
.sidebar-collapsed .subnav-group {
  display: none !important;
}

.sidebar-collapsed .ka-sidebar-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .brand-wordmark {
  display: none;
}

.sidebar-collapsed [data-sidebar-root] {
  width: 6.4rem;
}

.page-enter {
  animation: fade-up 0.5s ease both;
}

.page-enter.panel-surface:hover,
.metric-card:hover,
.calendar-day:hover {
  border-color: var(--panel-border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.sparkline-wrap {
  height: 54px;
  position: relative;
}

.file-tile {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.file-tile:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.kanban-column {
  min-height: 420px;
}

.kanban-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.kanban-card:hover {
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px);
}

.calendar-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  min-height: 122px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.geo-map-surface {
  background:
    radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.12), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.12), transparent 26%),
    var(--surface-secondary);
}

.geo-map-point {
  transform: translate(-50%, -50%);
}

.geo-map-point::after {
  animation: pulse-soft 2.6s ease-in-out infinite;
  background: currentColor;
  border-radius: 999px;
  content: "";
  inset: -8px;
  opacity: 0.16;
  position: absolute;
  z-index: -1;
}

.doc-sidebar-link {
  border-left: 2px solid transparent;
  color: var(--text-muted);
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.55rem 0 0.55rem 0.85rem;
}

.doc-sidebar-link:hover,
.doc-sidebar-link.active {
  border-left-color: var(--brand);
  color: var(--text-primary);
}

.auth-card {
  background:
    linear-gradient(140deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.10)),
    var(--surface-primary);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-panel);
}

.focus-ring:focus,
.focus-ring:focus-visible,
input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  box-shadow: var(--ring-soft);
  outline: none;
}

[data-dropdown-menu],
[data-modal],
[data-drawer-panel] {
  display: none;
}

[data-dropdown].open [data-dropdown-menu],
[data-modal].open,
[data-drawer].open [data-drawer-panel] {
  display: block;
}

[data-modal].open {
  display: flex;
}

.drawer-backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dark .drawer-backdrop {
  background: rgba(2, 6, 23, 0.64);
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.22;
    transform: scale(1.16);
  }
}

@media (max-width: 1023px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body::after {
    background-size: 28px 28px;
  }

  .calendar-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
