:root {
  color-scheme: dark;
  --bg: #090b0f;
  --panel: rgba(17, 20, 26, 0.84);
  --panel-solid: #11141a;
  --panel-2: rgba(28, 34, 45, 0.9);
  --panel-3: #242b36;
  --line: rgba(148, 163, 184, 0.28);
  --line-soft: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #a9b4c4;
  --faint: #718096;
  --primary: #ffffff;
  --primary-ink: #080a0f;
  --success: #5eead4;
  --warning: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --violet: #a78bfa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(94, 234, 212, 0.08), transparent 26%),
    linear-gradient(245deg, rgba(96, 165, 250, 0.1), transparent 28%),
    linear-gradient(180deg, #0d1016 0%, var(--bg) 42%, #07080c 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
  font-size: 20px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(17, 20, 26, 0.94), rgba(9, 11, 15, 0.88));
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 34px;
  z-index: 10;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand img {
  width: 74px;
  height: 50px;
  object-fit: cover;
  border-radius: 12px;
  background: #050505;
  object-position: center;
  padding: 4px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 12px 30px rgba(94, 234, 212, 0.12);
}

.brand strong,
h1,
h2,
h3 {
  font-family: Geist, Inter, sans-serif;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span,
.sidebar-footer span,
.kicker,
.metric span,
.modal-header p,
#view-kicker {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-button,
.icon-button,
.stage-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.nav-item {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(var(--success), var(--info));
  opacity: 0;
  transform: translateX(-4px);
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary);
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.14), rgba(96, 165, 250, 0.06));
  border-color: rgba(94, 234, 212, 0.28);
  transform: translateX(2px);
}

.nav-item.active::before {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.1), rgba(167, 139, 250, 0.08));
}

.shell {
  min-height: 100vh;
  margin-left: 264px;
  padding: 28px 32px 42px;
}

.topbar {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  animation: slideIn 420ms ease both;
}

#view-kicker,
h1 {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(94, 234, 212, 0.12);
}

.topbar-actions,
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  height: 42px;
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 20, 26, 0.72);
  color: var(--muted);
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search:focus-within {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
}

.search input,
label input,
label select,
label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 11, 15, 0.78);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

label input:focus,
label select:focus,
label textarea:focus {
  border-color: rgba(94, 234, 212, 0.62);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.1);
  background: rgba(13, 16, 22, 0.96);
}

.search input {
  border: 0;
  background: transparent;
}

.primary-button,
.ghost-button,
.icon-button,
.stage-button {
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  padding: 0 16px;
  border: 1px solid rgba(94, 234, 212, 0.62);
  background: linear-gradient(135deg, var(--success), var(--info));
  color: var(--primary-ink);
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(94, 234, 212, 0.16);
}

.ghost-button,
.stage-button {
  padding: 0 14px;
  border-color: var(--line);
  background: rgba(17, 20, 26, 0.78);
}

.icon-button {
  width: 42px;
  border-color: var(--line);
  background: rgba(17, 20, 26, 0.78);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.stage-button:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.42);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.stage-button:active,
.nav-item:active {
  transform: translateY(1px) scale(0.99);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeLift 280ms ease both;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.two-columns {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: start;
}

.card,
.metric,
.kanban-column,
.profile-panel {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 20, 26, 0.86), rgba(12, 15, 21, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.card::before,
.metric::before,
.kanban-column::before,
.profile-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 34%);
  opacity: 0.28;
}

.card,
.profile-panel {
  padding: 20px;
}

.metric {
  padding: 18px;
  min-height: 132px;
  transition: transform 180ms ease, border-color 180ms ease;
  animation: cardIn 360ms ease both;
}

.metric:nth-child(1) { animation-delay: 20ms; }
.metric:nth-child(2) { animation-delay: 70ms; }
.metric:nth-child(3) { animation-delay: 120ms; }
.metric:nth-child(4) { animation-delay: 170ms; }

.metric::after {
  content: "";
  position: absolute;
  inset: auto 18px 14px 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--info));
}

.metric:nth-child(2)::after {
  background: linear-gradient(90deg, var(--info), var(--violet));
}

.metric:nth-child(3)::after {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

.metric:nth-child(4)::after {
  background: linear-gradient(90deg, var(--violet), var(--success));
}

.metric:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 234, 212, 0.3);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-family: Geist, Inter, sans-serif;
  font-size: clamp(24px, 2.3vw, 34px);
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.card-header,
.list-row,
.client-row,
.event-row,
.pipeline-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.card-header {
  margin-bottom: 16px;
}

.card h2,
.card h3,
.profile-panel h2,
.kanban-column h3 {
  margin: 0;
  font-size: 18px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}

.table th,
.table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.table tr {
  transition: background 140ms ease;
}

.table tbody tr:hover {
  background: rgba(94, 234, 212, 0.055);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.badge.success { color: var(--success); }
.badge.warning { color: var(--warning); }
.badge.danger { color: var(--danger); }
.badge.info { color: var(--info); }

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

.overdue-row {
  background: rgba(255, 156, 146, 0.06);
}

.finance-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.finance-tab {
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 20, 26, 0.76);
  color: var(--muted);
  white-space: nowrap;
  transition: 160ms ease;
}

.finance-tab.active,
.finance-tab:hover {
  background: linear-gradient(135deg, var(--success), var(--info));
  color: var(--primary-ink);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(94, 234, 212, 0.14);
}

.finance-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.finance-filters {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.finance-filters label {
  min-width: 180px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  animation: fadeLift 260ms ease both;
}

.alert-item.danger {
  border-color: rgba(255, 156, 146, 0.42);
}

.alert-item.warning {
  border-color: rgba(243, 198, 107, 0.42);
}

.report-bars {
  display: grid;
  gap: 12px;
}

.report-row {
  display: grid;
  grid-template-columns: 130px minmax(160px, 1fr) 140px;
  gap: 12px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--info), var(--violet));
  animation: growBar 640ms ease both;
}

@keyframes fadeLift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes growBar {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-height: 560px;
  padding: 14px;
}

.kanban-column h3 {
  display: flex;
  justify-content: space-between;
  color: var(--text);
}

.pipeline-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(9, 11, 15, 0.74);
  transition: transform 160ms ease, border-color 160ms ease;
}

.pipeline-card:hover {
  transform: translateY(-3px);
  border-color: rgba(96, 165, 250, 0.36);
}

.pipeline-card strong {
  display: block;
}

.pipeline-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.stage-actions {
  display: flex;
  gap: 8px;
}

.stage-button {
  width: 34px;
  height: 32px;
  padding: 0;
}

.client-row,
.event-row,
.list-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.client-row:last-child,
.event-row:last-child,
.list-row:last-child {
  border-bottom: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.16), rgba(96, 165, 250, 0.18));
  color: var(--primary);
  font-weight: 800;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity strong {
  display: block;
}

.identity span,
.event-row span,
.pipeline-card span {
  color: var(--muted);
  font-size: 13px;
}

.profile {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.profile-hero {
  display: grid;
  gap: 14px;
}

.profile-hero .avatar {
  width: 74px;
  height: 74px;
  font-size: 26px;
}

.profile-field {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.profile-field span {
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  border-left: 2px solid var(--line);
  padding: 0 0 0 14px;
}

.timeline-item strong {
  display: block;
}

.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 20, 26, 0.98), rgba(9, 11, 15, 0.96));
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.modal form {
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 4px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

label input,
label select,
label textarea {
  min-height: 42px;
  padding: 10px 12px;
}

label textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.06), rgba(96, 165, 250, 0.04));
}

@media (max-width: 1100px) {
  .sidebar {
    width: 82px;
    padding: 18px 12px;
  }

  .brand div,
  .nav-item:not(.active) {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .shell {
    margin-left: 82px;
    padding: 22px;
  }

  .metrics,
  .two-columns,
  .profile {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-template-columns: repeat(5, 260px);
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav {
    display: flex;
  }

  .sidebar-footer {
    display: none;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
