@import url("../features/ai-assistant/ai-assistant.css");
@import url("../features/sales-targets.css");
@import url("../features/dashboard.css");
@import url("../features/forecast/forecast.css");
@import url("../features/quotes/quotes.css");
:root {
  color-scheme: light;
  --bg: #eef2ff;
  --surface: #ffffff;
  --surface-muted: #edf1ff;
  --text: #1b2440;
  --muted: #62709a;
  --line: #d7def5;
  --primary: #546be4;
  --primary-dark: #485ed0;
  --accent: #8294f2;
  --green: #4d63d8;
  --red: #b64242;
  --danger: #b64242;
  --panel: #ffffff;
  --brand-50: #f4f6ff;
  --brand-100: #e7ecff;
  --brand-200: #d7defd;
  --brand-300: #b9c5fb;
  --brand-400: #8da0f2;
  --brand-500: #546be4;
  --brand-600: #485ed0;
  --brand-700: #3a4daf;
  --brand-800: #2c3c88;
  --shadow: 0 18px 48px rgba(26, 39, 52, 0.12);
  --radius: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content-max: none;
  --control-height: 38px;
  --field-height: 42px;
  --space-page: 24px;
  --v2-color-bg: #f4f7f8;
  --v2-color-surface: #ffffff;
  --v2-color-surface-raised: #fbfcfd;
  --v2-color-text: #18252f;
  --v2-color-muted: #64727d;
  --v2-color-border: #dbe4e7;
  --v2-color-primary: #245c5a;
  --v2-color-primary-strong: #173f42;
  --v2-color-accent: #4fb3a5;
  --v2-color-warning: #c78a23;
  --v2-color-danger: #b64242;
  --v2-space-1: 4px;
  --v2-space-2: 8px;
  --v2-space-3: 12px;
  --v2-space-4: 16px;
  --v2-space-5: 20px;
  --v2-space-6: 24px;
  --v2-space-8: 32px;
  --v2-radius-sm: 4px;
  --v2-radius-md: 6px;
  --v2-radius-lg: 8px;
  --v2-shadow-card: 0 10px 28px rgba(24, 37, 47, 0.08);
  --v2-shadow-popover: 0 18px 48px rgba(24, 37, 47, 0.16);
  --v2-font-size-xs: 11px;
  --v2-font-size-sm: 12px;
  --v2-font-size-md: 13px;
  --v2-font-size-lg: 16px;
  --v2-font-size-xl: 22px;
  --v2-line-height-tight: 1.2;
  --v2-line-height-body: 1.5;
  font-family: var(--font);
}

:root[data-density="comfortable"] {
  --control-height: 42px;
  --field-height: 46px;
  --space-page: 28px;
}

:root[data-density="compact"] {
  --control-height: 36px;
  --field-height: 40px;
  --space-page: 20px;
}

:root[data-theme="calm"] {
  --brand-50: #f8fafc;
  --brand-100: #eef2f6;
  --brand-200: #dce3ec;
  --brand-300: #c7d1de;
  --brand-400: #8290a3;
  --brand-500: #3f5bd5;
  --brand-600: #344fc0;
  --brand-700: #263b95;
  --brand-800: #1f2d68;
  --v2-color-bg: #f5f7fa;
  --v2-color-surface: #ffffff;
  --v2-color-surface-raised: #f8fafc;
  --v2-color-text: #151a22;
  --v2-color-muted: #626c78;
  --v2-color-border: #dce3ec;
  --v2-color-primary: #3f5bd5;
  --v2-color-primary-strong: #2f45aa;
  --v2-color-accent: #6d7fdb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #111722;
  --surface-muted: #171f2d;
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --line: #283244;
  --panel: #111722;
  --brand-50: #111827;
  --brand-100: #172033;
  --brand-200: #24314a;
  --brand-300: #33466b;
  --brand-400: #6f8dff;
  --brand-500: #5f7cff;
  --brand-600: #4f6af2;
  --brand-700: #9eb0ff;
  --brand-800: #d8e0ff;
  --v2-color-bg: #080b12;
  --v2-color-surface: #111722;
  --v2-color-surface-raised: #172033;
  --v2-color-text: #f4f7fb;
  --v2-color-muted: #9aa7b8;
  --v2-color-border: #283244;
  --v2-color-primary: #5f7cff;
  --v2-color-primary-strong: #405bd8;
  --v2-color-accent: #7aa2ff;
  --v2-color-warning: #fbbf24;
  --v2-color-danger: #f87171;
  --v2-shadow-card: 0 18px 44px rgba(0, 0, 0, 0.38);
  --v2-shadow-popover: 0 22px 54px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

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

.auth-page,
.center-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-page {
  background: linear-gradient(180deg, rgba(10, 22, 49, 0.18), rgba(10, 22, 49, 0.28)), url("../assets/login-background.jpg") center/cover no-repeat;
}

.center-page {
  background: linear-gradient(135deg, var(--brand-50) 0%, #e2e9ff 100%);
}

.auth-panel,
.choice-panel,
.modal {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.auth-page .auth-panel {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  border-color: #d7def5;
  color: #1b2440;
  box-shadow: 0 18px 60px rgba(84, 107, 228, 0.22);
}

.auth-page .login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-page .login-form .btn[type="submit"] {
  width: 100%;
  margin-top: 0;
  align-self: center;
}

.auth-page .login-actions {
  flex: 1;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.auth-page .login-forgot-password {
  appearance: none;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: #7a7a7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: default;
}

.auth-page .login-forgot-password img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  opacity: 0.52;
  pointer-events: none;
}

.auth-page .login-forgot-password:focus-visible {
  outline: 1px solid #b8b8b8;
  outline-offset: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.auth-logo {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: 0 auto 18px;
}

.login-form,
.stack {
  display: grid;
  gap: 14px;
}

.auth-page .login-form .field {
  color: #62709a;
}

.auth-page .login-form .field input,
.auth-page .login-form .field select,
.auth-page .login-form .field textarea {
  background: #ffffff;
  border-color: #d7def5;
  color: #1b2440;
}

.auth-page .login-form .field input::placeholder,
.auth-page .login-form .field textarea::placeholder {
  color: #8792b8;
}

.auth-page .login-form .field input:focus,
.auth-page .login-form .field select:focus,
.auth-page .login-form .field textarea:focus {
  border-color: #546be4;
  outline: 2px solid rgba(84, 107, 228, 0.16);
}

.auth-page .login-form .btn,
.auth-page .login-form .btn.primary {
  background: #546be4;
  border-color: #546be4;
  color: #ffffff;
}

.auth-page .login-form .btn:hover,
.auth-page .login-form .btn:focus-visible {
  background: #485ed0;
  border-color: #485ed0;
  color: #ffffff;
}

:root[data-theme] .auth-page .auth-panel {
  background: rgba(255, 255, 255, 0.92);
  border-color: #d7def5;
  color: #1b2440;
}

:root[data-theme] .auth-page .login-form .field {
  color: #62709a;
}

:root[data-theme] .auth-page .login-form .field input,
:root[data-theme] .auth-page .login-form .field select,
:root[data-theme] .auth-page .login-form .field textarea {
  background: #ffffff;
  border-color: #d7def5;
  color: #1b2440;
}

:root[data-theme] .auth-page .login-form .field input:-webkit-autofill,
:root[data-theme] .auth-page .login-form .field input:-webkit-autofill:hover,
:root[data-theme] .auth-page .login-form .field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #1b2440;
  caret-color: #1b2440;
  border-color: #d7def5;
}

:root[data-theme] .auth-page .login-form .field input::placeholder,
:root[data-theme] .auth-page .login-form .field textarea::placeholder {
  color: #8792b8;
}

:root[data-theme] .auth-page .login-form .btn,
:root[data-theme] .auth-page .login-form .btn.primary {
  background: #546be4;
  border-color: #546be4;
  color: #ffffff;
}

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

.field input,
.field select,
.field textarea {
  min-height: var(--field-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.btn {
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.btn.icon-only {
  width: 38px;
  min-width: 38px;
  padding: 8px;
}

.btn.icon-only > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.btn-icon {
  font-weight: 900;
  line-height: 1;
}

.action-button-icon {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--line);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn.danger {
  background: #fff0f2;
  color: var(--red);
  border-color: #ffd5da;
}

.btn.danger:hover {
  background: #ffe5e9;
}

.error {
  color: var(--red);
  margin: 0;
}

.demo-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.tour-bg {
  background:
    linear-gradient(rgba(246, 247, 249, 0.88), rgba(246, 247, 249, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Crect width='900' height='600' fill='%23eef2f5'/%3E%3Crect x='80' y='70' width='180' height='460' rx='16' fill='%23176b87' opacity='.9'/%3E%3Crect x='290' y='70' width='530' height='80' rx='16' fill='%23ffffff'/%3E%3Crect x='290' y='180' width='245' height='150' rx='16' fill='%23ffffff'/%3E%3Crect x='575' y='180' width='245' height='150' rx='16' fill='%23ffffff'/%3E%3Crect x='290' y='365' width='530' height='165' rx='16' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: cover;
}

.tour-visual {
  min-height: 160px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fafb;
}

.tour-visual span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 800;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 33, 44, 0.24);
  z-index: 20;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header > h2 {
  margin: 0;
}

.modal-close-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #747982;
  background: transparent;
  cursor: pointer;
}

.modal-close-button::before,
.modal-close-button::after {
  content: "";
  grid-area: 1 / 1;
  width: 15px;
  height: 4px;
  background: currentColor;
  transform: rotate(45deg);
}

.modal-close-button::after { transform: rotate(-45deg); }

.modal-close-button:hover,
.modal-close-button:focus-visible {
  background: var(--v2-color-surface-raised);
  color: var(--v2-color-text);
}

.modal-close-button:focus-visible { outline: 2px solid var(--v2-color-primary); }
:root[data-theme="dark"] .modal-close-button { color: #aeb8c9; }

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

.expense-import-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  min-height: 0;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}

.expense-import-modal > .modal-header,
.expense-import-modal > .modal-actions {
  flex-shrink: 0;
}

.expense-import-modal > .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.expense-import-modal [hidden] {
  display: none !important;
}

.ai-modal-scroll-lock {
  overflow: hidden;
}

.ai-assistant-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.ai-assistant-modal-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
  overflow: hidden;
  outline: none;
}

.ai-assistant-modal-overlay.opening {
  animation: aiModalOverlayIn 160ms ease-out both;
}

.ai-assistant-modal-overlay.opening .ai-assistant-modal-dialog {
  animation: aiModalDialogIn 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-assistant-modal-overlay.closing {
  animation: aiModalOverlayOut 140ms ease-in both;
}

.ai-assistant-modal-overlay.closing .ai-assistant-modal-dialog {
  animation: aiModalDialogOut 140ms ease-in both;
}

.ai-assistant-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.ai-assistant-modal-header strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.ai-assistant-modal-body {
  min-height: 0;
  overflow: auto;
}

.ai-assistant-modal-body .ai-assistant-stage {
  width: 100%;
  gap: 18px;
  padding: 22px 24px 28px;
  animation: none;
}

.ai-assistant-modal-body .ai-orb-wrap {
  width: 78px;
  height: 78px;
  margin-bottom: -8px;
  opacity: 1;
  transform: none;
  animation: none;
}

.ai-assistant-modal-body .ai-orb {
  width: 58px;
  height: 58px;
}

.ai-assistant-modal-body .ai-orb-ring {
  inset: -8px;
}

.ai-assistant-modal-body .ai-assistant-hero h1 {
  font-size: clamp(26px, 3vw, 40px);
}

.ai-assistant-modal-body .ai-assistant-hero h1 span,
.ai-assistant-modal-body .ai-assistant-hero h1 strong,
.ai-assistant-modal-body .ai-assistant-prompt-card,
.ai-assistant-modal-body .ai-example-section,
.ai-assistant-modal-body .ai-example-card {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes aiModalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes aiModalOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes aiModalDialogOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-ai-orb,
  .topbar-ai-orb-core,
  .topbar-ai-orb-core::before,
  .topbar-ai-orb-core::after,
  .topbar-ai-orb-ring,
  .ai-assistant-modal-overlay,
  .ai-assistant-modal-dialog {
    animation: none !important;
    transition: none;
  }
}

.form-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 33, 44, 0.34);
}

.form-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.form-dialog-header h2 {
  margin: 0;
}

.form-dialog-body {
  overflow: auto;
  padding: 20px;
}

.form-dialog .stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-dialog .stack .field:has(textarea),
.form-dialog .stack .btn[type="submit"] {
  grid-column: 1 / -1;
}

.form-dialog .stack .btn[type="submit"] {
  justify-self: end;
  min-width: 160px;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

:root[data-sidebar="panel"] .app-shell {
  display: block;
}

:root[data-sidebar="dark"] .sidebar {
  background: #546be4;
  border-right-color: #485ed0;
}

:root[data-sidebar="dark"] .brand,
:root[data-sidebar="dark"] .sidebar nav a {
  color: #d8e0e6;
}

:root[data-sidebar="dark"] .sidebar nav a.active,
:root[data-sidebar="dark"] .sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.sidebar {
  background: #546be4;
  border-right: 1px solid #485ed0;
  width: 68px;
  padding: 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow: hidden auto;
  box-shadow: none;
  transition: width 1296ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 25;
}

.sidebar-expanded .sidebar {
  width: 260px;
}

.sidebar::before {
  display: none;
}

.sidebar::after {
  display: none;
}

.sidebar .brand {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  justify-items: center;
  position: relative;
  overflow: visible;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

.sidebar-expanded .sidebar .brand {
  grid-template-columns: 1fr;
  justify-content: center;
  padding: 0 14px;
}

.brand-logo {
  display: block;
  object-fit: contain;
  transition: opacity 1296ms cubic-bezier(0.22, 1, 0.36, 1), transform 1296ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-logo.full {
  opacity: 0;
  transform: translateX(-16px) scale(0.9);
  width: 100%;
  max-width: 308px;
  height: 56px;
  object-position: center;
  filter: brightness(0) invert(1);
}

.brand-logo.mark {
  width: 36px;
  height: 36px;
}

.brand-mark-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  opacity: 1;
  transform: translateX(0) scale(1);
  margin-left: -21px;
  margin-top: -21px;
  transition: opacity 1296ms cubic-bezier(0.22, 1, 0.36, 1), transform 1296ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-expanded .brand-logo.full {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.sidebar-expanded .brand-mark-wrap {
  opacity: 0;
  transform: translateX(26px) scale(0.76);
  pointer-events: none;
}

.sidebar nav {
  display: grid;
  gap: 0;
  margin-top: 0;
}

.sidebar-nav-v2 {
  padding: 8px 0 16px;
}

.sidebar-group {
  display: grid;
  gap: 2px;
  padding: 6px 0;
}

.sidebar-expanded .sidebar-group {
  padding: 8px 10px;
}

.sidebar-group + .sidebar-group {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-group-title {
  display: none;
  padding: 8px 10px 5px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-expanded .sidebar-group-title {
  display: block;
}

.sidebar-toggle {
  width: 100%;
  height: 28px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #485ed0;
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
}

.sidebar nav a,
.sidebar nav .nav-placeholder {
  min-height: 58px;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 2px;
  color: #e5eff4;
  text-decoration: none;
  border-radius: 0;
  padding: 5px 2px;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
}

.sidebar-expanded .sidebar nav a,
.sidebar-expanded .sidebar nav .nav-placeholder {
  min-height: 42px;
  justify-items: stretch;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  border-radius: 8px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #ffffff;
}

.sidebar nav .nav-placeholder {
  opacity: 0.58;
  cursor: default;
}

.sidebar nav .nav-placeholder-badge {
  display: none;
}

.sidebar-expanded .sidebar nav .nav-placeholder {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.sidebar-expanded .sidebar nav .nav-placeholder-badge {
  display: inline-flex;
  font-size: 10px;
  padding: 2px 6px;
}

.nav-label {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.sidebar-expanded .nav-label {
  grid-template-columns: 24px minmax(0, 1fr);
  justify-items: start;
  gap: 10px;
}

.nav-icon {
  width: 24px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 19px;
  font-weight: 800;
}

.nav-icon-image {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar [data-nav-key="quotes"] .nav-icon-image {
  width: 24px;
  height: 24px;
}

.sidebar-expanded .nav-icon {
  font-size: 18px;
}

.sidebar nav a.active .nav-icon {
  color: #ffffff;
  background: transparent;
}

.workspace {
  min-width: 0;
  margin-left: 68px;
  transition: margin-left 1296ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-expanded .workspace {
  margin-left: 260px;
}

.topbar {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px var(--space-page);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.topbar-ai-orb-button {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.topbar-ai-orb-button:focus-visible {
  outline: 3px solid rgba(84, 107, 228, 0.28);
  outline-offset: 3px;
}

.topbar-ai-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 999px;
  opacity: 0.72;
  filter: saturate(0.34) grayscale(0.48);
  transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
}

.topbar-ai-orb-core {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.88) 0 9%, rgba(218, 232, 245, 0.42) 13%, transparent 25%),
    radial-gradient(circle at 62% 30%, rgba(160, 188, 216, 0.46) 0 13%, transparent 34%),
    radial-gradient(circle at 68% 76%, rgba(69, 84, 112, 0.54) 0 18%, transparent 44%),
    radial-gradient(circle at 22% 78%, rgba(92, 116, 148, 0.42) 0 18%, transparent 46%),
    radial-gradient(circle at 50% 50%, #b9c6d8 0%, #8797ad 48%, #506071 100%);
  box-shadow:
    inset 5px 7px 12px rgba(255, 255, 255, 0.18),
    inset -7px -8px 12px rgba(38, 52, 75, 0.18),
    0 0 12px rgba(84, 107, 228, 0.12);
}

.topbar-ai-orb-core::before,
.topbar-ai-orb-core::after,
.topbar-ai-orb-ring {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.topbar-ai-orb-core::before {
  inset: 8%;
  background:
    radial-gradient(ellipse at 26% 18%, rgba(255, 255, 255, 0.62) 0 10%, transparent 30%),
    radial-gradient(ellipse at 70% 34%, rgba(173, 205, 226, 0.28) 0 12%, transparent 36%),
    radial-gradient(ellipse at 34% 76%, rgba(96, 132, 180, 0.28) 0 18%, transparent 44%);
  filter: blur(2px);
  mix-blend-mode: screen;
  opacity: 0.68;
}

.topbar-ai-orb-core::after {
  inset: 5%;
  background:
    radial-gradient(ellipse at 58% 78%, rgba(41, 50, 72, 0.24) 0 16%, transparent 44%),
    radial-gradient(ellipse at 26% 68%, rgba(88, 122, 158, 0.18) 0 16%, transparent 42%),
    radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(255, 255, 255, 0.14) 72%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(220, 232, 244, 0.12);
}

.topbar-ai-orb-ring {
  inset: 1px;
  background:
    radial-gradient(circle, rgba(112, 139, 176, 0.26), transparent 58%),
    radial-gradient(circle at 35% 30%, rgba(197, 213, 228, 0.18), transparent 44%);
  filter: blur(8px);
}

.topbar-ai-orb-button:hover .topbar-ai-orb,
.topbar-ai-orb-button:focus-visible .topbar-ai-orb {
  opacity: 1;
  filter: saturate(1.08) grayscale(0);
  transform: translateY(-1px) scale(1.04);
}

.topbar-ai-orb-button:hover .topbar-ai-orb-core,
.topbar-ai-orb-button:focus-visible .topbar-ai-orb-core {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.96) 0 8%, rgba(220, 241, 255, 0.48) 12%, transparent 24%),
    radial-gradient(circle at 62% 30%, rgba(117, 211, 255, 0.62) 0 12%, transparent 34%),
    radial-gradient(circle at 68% 76%, rgba(9, 45, 145, 0.76) 0 18%, transparent 44%),
    radial-gradient(circle at 22% 78%, rgba(28, 105, 255, 0.64) 0 18%, transparent 46%),
    radial-gradient(circle at 50% 50%, #63b7ff 0%, #2f79ff 46%, #0a2b76 100%);
  box-shadow:
    inset 5px 7px 12px rgba(255, 255, 255, 0.22),
    inset -7px -8px 12px rgba(5, 24, 84, 0.28),
    0 0 18px rgba(87, 166, 255, 0.38),
    0 0 36px rgba(64, 188, 255, 0.18);
  animation: aiOrbFloat 16s linear infinite, aiOrbGlassShift 8.5s ease-in-out infinite;
}

.topbar-ai-orb-button:hover .topbar-ai-orb-core::before,
.topbar-ai-orb-button:focus-visible .topbar-ai-orb-core::before {
  animation: aiOrbGlassLight 6.2s ease-in-out infinite;
}

.topbar-ai-orb-button:hover .topbar-ai-orb-core::after,
.topbar-ai-orb-button:focus-visible .topbar-ai-orb-core::after {
  animation: aiOrbGlassDepth 7.6s ease-in-out infinite;
}

.topbar-ai-orb-button:hover .topbar-ai-orb-ring,
.topbar-ai-orb-button:focus-visible .topbar-ai-orb-ring {
  background:
    radial-gradient(circle, rgba(91, 169, 255, 0.32), transparent 58%),
    radial-gradient(circle at 35% 30%, rgba(178, 226, 255, 0.24), transparent 44%);
  animation: aiOrbPulse 3.2s ease-in-out infinite;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.themed-top-actions {
  gap: 14px;
}

.theme-switcher {
  position: relative;
}

.theme-switcher-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-700);
  padding: 0;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-switcher-button:hover,
.theme-switcher-button.active {
  background: rgba(84, 107, 228, 0.08);
  color: var(--brand-800);
  transform: translateY(-1px);
}

.theme-trigger-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.topbar-action-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.78;
  filter: brightness(0) saturate(100%) invert(61%);
  transition: opacity 180ms ease, filter 180ms ease;
}

.theme-switcher-button:hover .topbar-action-icon,
.theme-switcher-button.active .topbar-action-icon,
.icon-action:hover .topbar-action-icon {
  opacity: 0.9;
  filter: brightness(0) saturate(100%) invert(53%);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  min-width: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.theme-menu button:hover,
.theme-menu button.active {
  background: rgba(84, 107, 228, 0.08);
}

.icon-action {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-700);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.icon-action:hover {
  background: rgba(84, 107, 228, 0.08);
  color: var(--brand-800);
  transform: translateY(-1px);
}

.icon-action strong {
  position: absolute;
  top: -2px;
  right: -1px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-500);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(84, 107, 228, 0.24);
}

.notification-action,
.logout-action {
  font-size: 18px;
}

.language-switcher {
  position: relative;
}

.language-switcher-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--brand-700);
  cursor: pointer;
  padding: 0;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.language-trigger-flag {
  width: 24px;
  height: 24px;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  padding: 0;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.language-switcher-button:hover {
  background: rgba(84, 107, 228, 0.08);
  color: var(--brand-800);
  transform: translateY(-1px);
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  min-width: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.language-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.language-menu button:hover,
.language-menu button.active {
  background: rgba(84, 107, 228, 0.08);
}

.language-flag {
  width: 28px;
  height: 28px;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  padding: 0;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.24);
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar.topbar-title-hidden .topbar-title {
  visibility: hidden;
  pointer-events: none;
}

.topbar-title span {
  color: var(--muted);
  font-size: 11px;
}

.topbar-title strong {
  font-size: 16px;
}

.global-search-shell {
  flex: 1;
  max-width: 360px;
  min-width: 190px;
  position: relative;
}

.global-search {
  display: block;
  position: relative;
}

.global-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.global-search input {
  width: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--text);
  padding: 7px 14px;
  outline: none;
}

.global-search input:focus {
  border-color: rgba(84, 107, 228, 0.35);
  box-shadow: 0 0 0 4px rgba(84, 107, 228, 0.12);
}

.global-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: var(--brand-50);
}

.search-result strong,
.search-result span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0;
}

.user-profile {
  cursor: default;
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-300));
  color: var(--brand-800);
  font-size: 11px;
  font-weight: 800;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-photo-upload .file-uploader {
  min-width: 180px;
}

.user-photo-upload-preview span {
  font-size: 20px;
  font-weight: 700;
}

.user-name {
  color: var(--text);
  font-weight: 600;
}

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-page);
  padding-bottom: max(var(--space-page), 92px);
  display: grid;
  gap: 18px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.page-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.floating-actions {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-actions .btn {
  min-height: 46px;
  box-shadow: var(--shadow);
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.toolbar-search,
.toolbar-select {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.toolbar-search input,
.toolbar-select select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--text);
  padding: 7px 12px;
  outline: none;
}

.toolbar-search input:focus,
.toolbar-select select:focus {
  border-color: rgba(84, 107, 228, 0.42);
  box-shadow: 0 0 0 4px rgba(84, 107, 228, 0.12);
}

.sync-banner {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  padding: 4px 10px;
  font-size: 12px;
}

.sync-banner.error-banner {
  border-color: #ffd5da;
  background: #fff0f2;
  color: var(--red);
}

.loading-panel {
  min-height: 260px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  margin-bottom: 0;
}

h2 {
  font-size: 17px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.entity-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.entity-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.entity-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
}

.customer-logo.fallback {
  display: grid;
  place-items: center;
  background: var(--brand-100);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.metric-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  color: #ffffff;
  border: 0;
  min-height: 92px;
  box-shadow: var(--shadow);
}

.metric-card span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
}

.metric-card strong {
  font-size: 28px;
}

.metric-card.finance-metric-unavailable strong {
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
}

.metric-card:nth-child(1) {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
}

.metric-card:nth-child(2) {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
}

.metric-card:nth-child(3) {
  background: linear-gradient(135deg, var(--brand-500), #6f86ee);
}

.metric-card:nth-child(4) {
  background: linear-gradient(135deg, #6980eb, #8fa3f4);
}

.metric-card:nth-child(5) {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

:root[data-theme="calm"] .sidebar {
  background: #edf1f5;
  border-right-color: #d7dee8;
  box-shadow: 8px 0 24px rgba(24, 31, 42, 0.06);
}

:root[data-theme="calm"] .sidebar .brand {
  border-bottom-color: #d7dee8;
  color: var(--brand-700);
}

:root[data-theme="calm"] .brand-logo.full {
  filter: brightness(0) saturate(100%) invert(42%) sepia(65%) saturate(1507%) hue-rotate(214deg) brightness(92%) contrast(91%);
}

:root[data-theme="calm"] .brand-logo.mark {
  filter: brightness(0) saturate(100%) invert(42%) sepia(65%) saturate(1507%) hue-rotate(214deg) brightness(92%) contrast(91%);
}

:root[data-theme="calm"] .nav-icon,
:root[data-theme="calm"] .sidebar nav a.active .nav-icon,
:root[data-theme="calm"] .sidebar nav a:hover .nav-icon {
  color: #151a22;
}

:root[data-theme="calm"] .nav-icon-image {
  filter: brightness(0) saturate(100%) invert(9%) sepia(11%) saturate(1308%) hue-rotate(176deg) brightness(96%) contrast(92%);
}

:root[data-theme="calm"] .sidebar-toggle {
  background: #dfe6ef;
  color: #151a22;
  border-bottom-color: #d1dae6;
}

:root[data-theme="calm"] .sidebar-group + .sidebar-group {
  border-top-color: #d7dee8;
}

:root[data-theme="calm"] .sidebar-group-title,
:root[data-theme="calm"] .sidebar nav a,
:root[data-theme="calm"] .sidebar nav .nav-placeholder {
  color: #222a35;
}

:root[data-theme="calm"] .sidebar nav a.active,
:root[data-theme="calm"] .sidebar nav a:hover {
  background: #ffffff;
  color: #111827;
  box-shadow: inset 3px 0 0 var(--brand-600), 0 8px 18px rgba(24, 31, 42, 0.08);
}

:root[data-theme="calm"] .metric-card,
:root[data-theme="calm"] .suite-kpi,
:root[data-theme="calm"] .project-summary-card,
:root[data-theme="calm"] .ceo-kpi-card {
  background: linear-gradient(135deg, #ffffff, #eef2f6);
  border: 1px solid #dce3ec;
  color: #151a22;
}

:root[data-theme="calm"] .metric-card strong,
:root[data-theme="calm"] .suite-kpi strong,
:root[data-theme="calm"] .project-summary-card strong,
:root[data-theme="calm"] .project-summary-card .project-money,
:root[data-theme="calm"] .project-summary-card .project-money--numeric,
:root[data-theme="calm"] .project-summary-card .project-summary-value,
:root[data-theme="calm"] .ceo-kpi-card strong {
  color: #151a22;
}

:root[data-theme="calm"] .project-summary-icon {
  filter: brightness(0) saturate(100%) invert(9%) sepia(11%) saturate(1308%) hue-rotate(176deg) brightness(96%) contrast(92%);
  opacity: 0.2;
}

:root[data-theme="calm"] .metric-card span,
:root[data-theme="calm"] .suite-kpi span,
:root[data-theme="calm"] .suite-kpi small,
:root[data-theme="calm"] .project-summary-card span,
:root[data-theme="calm"] .project-summary-card small,
:root[data-theme="calm"] .ceo-kpi-label,
:root[data-theme="calm"] .ceo-kpi-card small {
  color: #5f6976;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .page,
:root[data-theme="dark"] .content,
:root[data-theme="dark"] .main-content {
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .entity-card,
:root[data-theme="dark"] .v2-card,
:root[data-theme="dark"] .v2-table-shell,
:root[data-theme="dark"] .form-dialog,
:root[data-theme="dark"] .drawer,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .project-grid-card,
:root[data-theme="dark"] .project-detail-modal,
:root[data-theme="dark"] .project-detail-section-card,
:root[data-theme="dark"] .project-items-table-wrap {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .ai-assistant-modal-dialog {
  background: rgba(24, 28, 38, 0.98);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .ai-assistant-modal-header {
  border-bottom-color: var(--line);
}

:root[data-theme="dark"] .sidebar {
  background: #0b1020;
  border-right-color: var(--line);
}

:root[data-theme="dark"] .sidebar .brand,
:root[data-theme="dark"] .sidebar nav a,
:root[data-theme="dark"] .sidebar-group-title,
:root[data-theme="dark"] .sidebar nav .nav-placeholder {
  color: #d8e1f0;
}

:root[data-theme="dark"] .sidebar nav a.active,
:root[data-theme="dark"] .sidebar nav a:hover {
  background: rgba(95, 124, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--brand-500);
}

:root[data-theme="dark"] .brand-logo.full,
:root[data-theme="dark"] .brand-logo.mark {
  filter: none;
}

:root[data-theme="dark"] .theme-menu {
  background: rgba(17, 23, 34, 0.92);
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .theme-switcher-button,
:root[data-theme="dark"] .theme-menu button {
  color: var(--muted);
}

:root[data-theme="dark"] .theme-switcher-button:hover,
:root[data-theme="dark"] .theme-switcher-button.active,
:root[data-theme="dark"] .theme-menu button:hover,
:root[data-theme="dark"] .theme-menu button.active {
  background: rgba(95, 124, 255, 0.16);
  color: #ffffff;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .toolbar-search input,
:root[data-theme="dark"] .toolbar-select select,
:root[data-theme="dark"] .global-search,
:root[data-theme="dark"] .global-search input,
:root[data-theme="dark"] .project-create-field input,
:root[data-theme="dark"] .project-create-field select,
:root[data-theme="dark"] .ceo-range-select select,
:root[data-theme="dark"] .dashboard-product-year-select select {
  background: #0d1320;
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #6f7c91;
}

:root[data-theme="dark"] .field,
:root[data-theme="dark"] .project-filter-field,
:root[data-theme="dark"] .v2-page-header,
:root[data-theme="dark"] .v2-section-header,
:root[data-theme="dark"] .projects-header h1,
:root[data-theme="dark"] .entity-title strong,
:root[data-theme="dark"] .panel-title h2,
:root[data-theme="dark"] .modal-header h2,
:root[data-theme="dark"] .form-dialog-header h2,
:root[data-theme="dark"] .drawer-header h2 {
  color: var(--text);
}

:root[data-theme="dark"] .v2-section-header p,
:root[data-theme="dark"] .v2-page-header p,
:root[data-theme="dark"] .projects-header p,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .empty-state p,
:root[data-theme="dark"] .demo-hint,
:root[data-theme="dark"] .ceo-kpi-label,
:root[data-theme="dark"] .project-summary-card span,
:root[data-theme="dark"] .project-summary-card small {
  color: var(--muted);
}

:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .suite-kpi,
:root[data-theme="dark"] .project-summary-card,
:root[data-theme="dark"] .ceo-kpi-card {
  background: linear-gradient(135deg, #101827, #172033);
  border: 1px solid var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .metric-card strong,
:root[data-theme="dark"] .suite-kpi strong,
:root[data-theme="dark"] .project-summary-card strong,
:root[data-theme="dark"] .project-summary-card .project-money,
:root[data-theme="dark"] .project-summary-card .project-money--numeric,
:root[data-theme="dark"] .project-summary-card .project-summary-value,
:root[data-theme="dark"] .ceo-kpi-card strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .project-summary-icon {
  filter: brightness(0) invert(1);
  opacity: 0.28;
}

:root[data-theme="dark"] .v2-filter-bar,
:root[data-theme="dark"] .project-filter-trigger,
:root[data-theme="dark"] .project-filter-field select,
:root[data-theme="dark"] .project-filter-menu,
:root[data-theme="dark"] .v2-btn-secondary,
:root[data-theme="dark"] .btn.secondary,
:root[data-theme="dark"] .btn.ghost {
  background: #111827;
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .project-filter-option {
  color: var(--text);
}

:root[data-theme="dark"] .project-filter-option:hover,
:root[data-theme="dark"] .project-filter-option.selected,
:root[data-theme="dark"] .project-filter-option.selected .project-filter-check {
  background: rgba(95, 124, 255, 0.16);
}

:root[data-theme="dark"] .project-filter-check {
  background: #0d1320;
  border-color: rgba(158, 176, 255, 0.36);
  color: #c7d2fe;
}

:root[data-theme="dark"] .v2-table,
:root[data-theme="dark"] .data-table,
:root[data-theme="dark"] .projects-table,
:root[data-theme="dark"] .project-items-table,
:root[data-theme="dark"] .mini-table {
  background: var(--surface);
  color: var(--text);
}

:root[data-theme="dark"] .v2-table th,
:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] .projects-table th,
:root[data-theme="dark"] .project-items-table th,
:root[data-theme="dark"] .mini-table-row.header {
  background: #151d2b;
  color: #aeb9ca;
  border-color: var(--line);
}

:root[data-theme="dark"] .v2-table td,
:root[data-theme="dark"] .data-table td,
:root[data-theme="dark"] .projects-table td,
:root[data-theme="dark"] .project-items-table td,
:root[data-theme="dark"] .mini-table-row {
  background: #101722;
  color: var(--text);
  border-color: var(--line);
}

:root[data-theme="dark"] .v2-table tr:hover td,
:root[data-theme="dark"] .data-table tr:hover td,
:root[data-theme="dark"] .project-grid-row:hover td,
:root[data-theme="dark"] .project-items-table tr:hover td {
  background: #172033;
}

:root[data-theme="dark"] .project-detail-tabs,
:root[data-theme="dark"] .project-detail-content,
:root[data-theme="dark"] .tabs,
:root[data-theme="dark"] .tabs span,
:root[data-theme="dark"] .v2-segmented-tabs button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}

:root[data-theme="dark"] .project-detail-tabs button.active,
:root[data-theme="dark"] .tabs span.active,
:root[data-theme="dark"] .v2-segmented-tabs button.active,
:root[data-theme="dark"] .v2-segmented-tabs .btn.primary {
  background: rgba(95, 124, 255, 0.18);
  color: #ffffff;
}

:root[data-theme="dark"] .modal-overlay,
:root[data-theme="dark"] .form-dialog-overlay,
:root[data-theme="dark"] .drawer-overlay {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .btn.danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}

:root[data-theme="dark"] .customer-detail-panel .detail-section,
:root[data-theme="dark"] .customer-detail-panel .mini-table {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .customer-detail-panel .detail-list,
:root[data-theme="dark"] .customer-detail-panel .detail-section h3,
:root[data-theme="dark"] .customer-detail-panel .customer-contact-row span {
  color: var(--text);
}

:root[data-theme="dark"] .badge,
:root[data-theme="dark"] .v2-badge {
  border-color: rgba(148, 163, 184, 0.24);
}

:root[data-theme="dark"] .dashboard-product-card,
:root[data-theme="dark"] .ceo-cash-focus,
:root[data-theme="dark"] .ceo-cash-focus .ceo-money-line,
:root[data-theme="dark"] .ceo-area-chart,
:root[data-theme="dark"] .ceo-combo-chart,
:root[data-theme="dark"] .project-invoice-file-preview,
:root[data-theme="dark"] .customer-logo-upload-preview,
:root[data-theme="dark"] .erp-map-popup-card {
  background: linear-gradient(180deg, #101722, #141d2b);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .dashboard-product-card:hover,
:root[data-theme="dark"] .dashboard-product-card.expanded {
  border-color: rgba(158, 176, 255, 0.48);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .dashboard-product-card-qty,
:root[data-theme="dark"] .dashboard-product-breakdown-qty,
:root[data-theme="dark"] .ceo-money-line.blue strong,
:root[data-theme="dark"] .erp-map-popup-card em {
  color: #9eb0ff;
}

:root[data-theme="dark"] .dashboard-product-breakdown,
:root[data-theme="dark"] .project-invoice-file-preview {
  border-color: var(--line);
}

:root[data-theme="dark"] .erp-map-popup-card strong,
:root[data-theme="dark"] .erp-map-popup-card span,
:root[data-theme="dark"] .erp-map-popup-card small,
:root[data-theme="dark"] .dashboard-product-breakdown-project {
  color: var(--text);
}

:root[data-theme="dark"] .ceo-money-line.green strong {
  color: #86efac;
}

:root[data-theme="dark"] .ceo-money-line.red strong {
  color: #fca5a5;
}

:root[data-theme="dark"] .project-customer-cell,
:root[data-theme="dark"] .project-name-cell,
:root[data-theme="dark"] .project-customer-name,
:root[data-theme="dark"] .table-sort-button {
  color: var(--text);
}

:root[data-theme="dark"] .icon-action.project-row-action,
:root[data-theme="dark"] .icon-action.project-item-action {
  background: #172033;
  color: #d8e1f0;
}

:root[data-theme="dark"] .icon-action.project-row-action:hover,
:root[data-theme="dark"] .icon-action.project-item-action:hover {
  background: #24314a;
  color: #ffffff;
}

:root[data-theme="dark"] .project-kpi-breakdown-modal {
  background: linear-gradient(180deg, #0f1624, #111722);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .project-kpi-breakdown-row {
  background: #101722;
  border-color: var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .project-kpi-breakdown-row:hover {
  background: #172033;
  border-color: rgba(158, 176, 255, 0.38);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .project-kpi-breakdown-title-group h2,
:root[data-theme="dark"] .project-kpi-breakdown-modal .modal-header h2,
:root[data-theme="dark"] .project-kpi-breakdown-main strong,
:root[data-theme="dark"] .project-kpi-breakdown-amount {
  color: var(--text);
}

:root[data-theme="dark"] .project-kpi-breakdown-title-group p,
:root[data-theme="dark"] .project-kpi-breakdown-main span {
  color: var(--muted);
}

:root[data-theme="dark"] .project-detail-modal-overlay .project-detail-modal,
:root[data-theme="dark"] .project-detail-shell,
:root[data-theme="dark"] .project-detail-section-card,
:root[data-theme="dark"] .project-items-content,
:root[data-theme="dark"] .project-items-table-wrap {
  background: #111722;
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .project-detail-modal-overlay {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .project-detail-heading h2,
:root[data-theme="dark"] .project-detail-section-title h3,
:root[data-theme="dark"] .project-detail-financial-item strong,
:root[data-theme="dark"] .project-detail-section-card.finance .project-detail-financial-copy strong,
:root[data-theme="dark"] .project-detail-info-row dd,
:root[data-theme="dark"] .project-detail-placeholder strong {
  color: var(--text);
}

:root[data-theme="dark"] .project-detail-heading p,
:root[data-theme="dark"] .project-detail-tabs button,
:root[data-theme="dark"] .project-detail-financial-item span,
:root[data-theme="dark"] .project-detail-financial-item.secondary span,
:root[data-theme="dark"] .project-detail-section-card.finance .project-detail-financial-copy span,
:root[data-theme="dark"] .project-detail-info-row dt,
:root[data-theme="dark"] .project-detail-placeholder,
:root[data-theme="dark"] .project-detail-placeholder p {
  color: var(--muted);
}

:root[data-theme="dark"] .project-detail-customer-logo,
:root[data-theme="dark"] .project-detail-financial-item.primary,
:root[data-theme="dark"] .project-detail-financial-item.balance,
:root[data-theme="dark"] .project-detail-section-card.finance .project-detail-financial-item.primary,
:root[data-theme="dark"] .project-detail-section-card.finance .project-detail-financial-item.balance,
:root[data-theme="dark"] .project-detail-section-card.finance .project-detail-financial-icon,
:root[data-theme="dark"] .project-detail-placeholder {
  background: #101722;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

:root[data-theme="dark"] .project-detail-finance-secondary,
:root[data-theme="dark"] .project-detail-section-header,
:root[data-theme="dark"] .project-detail-info-row,
:root[data-theme="dark"] .project-items-table td,
:root[data-theme="dark"] .project-items-table tfoot td {
  border-color: var(--line);
}

:root[data-theme="dark"] .project-detail-tabs {
  background: #0f1624;
  border-bottom-color: var(--line);
}

:root[data-theme="dark"] .project-detail-tabs button.active {
  background: transparent;
  color: #ffffff;
}

:root[data-theme="dark"] .project-detail-tabs button.active::after {
  background: var(--brand-500);
}

:root[data-theme="dark"] .project-detail-content {
  background: #0b1020;
}

:root[data-theme="dark"] .project-detail-tab-icon {
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

:root[data-theme="dark"] .project-detail-tabs button.active .project-detail-tab-icon {
  filter: brightness(0) saturate(100%) invert(71%) sepia(84%) saturate(1477%) hue-rotate(194deg) brightness(102%) contrast(101%);
  opacity: 1;
}

:root[data-theme="dark"] .project-detail-financial-icon-image {
  filter: brightness(0) invert(1);
  opacity: 0.88;
}

:root[data-theme="dark"] .project-detail-financial-mini-icon {
  color: #9eb0ff;
}

:root[data-theme="dark"] .project-items-empty-row td {
  color: var(--muted);
}

:root[data-theme="dark"] .customer-logo:not(.fallback),
:root[data-theme="dark"] .project-customer-cell .project-customer-logo:not(.fallback),
:root[data-theme="dark"] .projects-map-panel .projects-map-list .customer-logo:not(.fallback),
:root[data-theme="dark"] .project-detail-customer-logo:not(.fallback),
:root[data-theme="dark"] .project-kpi-breakdown-main .customer-logo:not(.fallback) {
  background: transparent;
  border-color: transparent;
  filter: none;
}

:root[data-theme="dark"] .customer-logo.fallback,
:root[data-theme="dark"] .projects-map-panel .projects-map-list .customer-logo.fallback,
:root[data-theme="dark"] .project-detail-customer-logo.fallback {
  background: #172033;
  border-color: var(--line);
  color: var(--text);
}

.panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.dashboard-grid .wide {
  grid-row: span 2;
}

.dashboard-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.dashboard-widget {
  grid-column: span 4;
  min-height: 100%;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  cursor: grab;
}

.dashboard-widget:hover {
  transform: translateY(-1px);
  border-color: var(--brand-300);
}

.dashboard-widget:active {
  cursor: grabbing;
}

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

.dashboard-widget.wide {
  grid-column: span 6;
}

.dashboard-widget-header {
  align-items: flex-start;
}

.dashboard-widget-title {
  display: grid;
  gap: 8px;
}

.dashboard-widget-title h2 {
  margin: 0;
}

.drag-handle {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

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

.dashboard-customize {
  display: grid;
  gap: 12px;
}

.dashboard-check {
  min-height: 44px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--brand-50);
}

.dashboard-activity-list {
  display: grid;
}

.dashboard-compact-stat {
  min-height: 176px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand-50), #ffffff);
}

.dashboard-compact-stat strong {
  font-size: 52px;
  line-height: 1;
  color: var(--brand-700);
}

.dashboard-compact-stat span {
  color: var(--muted);
  font-size: 13px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin-bottom: 0;
}

.svg-chart {
  min-height: 210px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 42px;
  border-radius: var(--radius);
  padding: 10px;
}

.svg-chart svg {
  width: 100%;
  height: 210px;
  overflow: visible;
}

.trend-chart {
  display: grid;
  gap: 12px;
}

.trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  min-height: 228px;
  gap: 12px;
  padding: 16px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(84, 107, 228, 0.06) calc(100% - 1px));
  background-size: 100% 38px, 16.66% 100%;
}

.trend-chart-column {
  display: grid;
  gap: 10px;
  align-items: end;
}

.trend-chart-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 6px;
  min-height: 180px;
}

.trend-chart-bar {
  display: block;
  border-radius: 8px 8px 2px 2px;
  min-height: 18px;
}

.trend-chart-bar.primary {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
  box-shadow: 0 10px 18px rgba(84, 107, 228, 0.18);
}

.trend-chart-bar.accent {
  background: linear-gradient(180deg, #d7defd, var(--brand-300));
}

.trend-chart-column small {
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.trend-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 11px;
}

.trend-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.trend-chart-legend i.primary {
  background: var(--brand-600);
}

.trend-chart-legend i.accent {
  background: var(--brand-300);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.donut {
  width: 140px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: conic-gradient(var(--brand-500) 0 44%, var(--brand-700) 44% 68%, var(--brand-400) 68% 84%, var(--brand-300) 84% 100%);
  display: grid;
  place-items: center;
}

.donut::before {
  content: "";
  position: absolute;
}

.donut span {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 800;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot,
.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.blue,
.dot-1 {
  background: var(--brand-500);
}

.legend-dot.purple,
.dot-2 {
  background: var(--brand-700);
}

.legend-dot.green,
.dot-3 {
  background: var(--brand-400);
}

.task-panel {
  display: grid;
  align-content: start;
  gap: 8px;
}

.mini-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

:root[data-density="compact"] .panel,
:root[data-density="compact"] .metric-card,
:root[data-density="compact"] .entity-card {
  padding: 14px;
}

.panel.compact {
  min-height: 190px;
}

.activity-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.activity-row time {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e8f3ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.badge.soft {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge.blue,
.badge.neutral {
  background: var(--brand-100);
  color: var(--brand-700);
}

.badge.green {
  background: var(--brand-100);
  color: var(--brand-600);
}

.badge.completed {
  background: rgba(34, 197, 94, 0.82);
  color: #ffffff;
}

.badge.warning {
  background: rgba(245, 158, 11, 0.88);
  color: #ffffff;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.88);
  color: #ffffff;
}

.badge.pink {
  background: var(--brand-200);
  color: var(--brand-800);
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

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

.data-table th {
  color: var(--muted);
  background: var(--brand-50);
  font-size: 11px;
  letter-spacing: 0;
}

.data-table tr {
  cursor: pointer;
}

.data-table tr:hover td {
  background: var(--brand-50);
}

.segmented {
  display: flex;
  gap: 8px;
}

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

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

.report-trend-card,
.report-breakdown-card,
.report-summary-card {
  grid-column: span 4;
}

.report-trend-card-wide {
  grid-column: span 8;
}

.report-trend-rows,
.report-breakdown-list,
.module-coverage-list {
  display: grid;
  gap: 12px;
}

.report-trend-row,
.report-breakdown-row,
.module-coverage-item {
  display: grid;
  gap: 8px;
}

.report-trend-row strong,
.report-breakdown-copy strong,
.module-coverage-item strong {
  font-size: 13px;
}

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

.trend-bar {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

.trend-bar.income {
  background: linear-gradient(90deg, var(--brand-700), var(--brand-500));
}

.trend-bar.expense {
  background: linear-gradient(90deg, var(--brand-400), var(--brand-300));
  color: var(--text);
}

.report-breakdown-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.report-breakdown-copy span,
.report-summary-note,
.module-coverage-item span {
  color: var(--muted);
  font-size: 12px;
}

.report-breakdown-bar-track {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-100);
}

.report-breakdown-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.report-summary-card {
  display: grid;
  gap: 14px;
}

.entity-card {
  padding: 16px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.customer-card-project-metrics {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.customer-card-project-metrics button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.customer-card-project-metrics button span {
  color: var(--muted);
  font-size: 12px;
}

.customer-card-project-metrics button:hover,
.customer-card-project-metrics button:focus-visible {
  background: var(--surface-muted);
  border-color: var(--line);
}

.customer-card-project-metrics button strong {
  white-space: nowrap;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 33, 44, 0.25);
  display: flex;
  justify-content: flex-end;
  z-index: 30;
}

.drawer {
  width: min(100%, 520px);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.drawer.customer-detail-drawer {
  width: min(100%, 676px);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin-bottom: 0;
}

.drawer-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.tabs span {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.tabs span.active {
  color: var(--primary-dark);
  background: var(--brand-100);
}

.detail-list,
.settings-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 8px 14px;
}

.customer-detail-panel {
  display: grid;
  gap: 12px;
}

.detail-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--brand-50);
}

.tax-accrual-summary-section {
  gap: 8px;
  padding: 10px 14px;
}

.tax-accrual-summary-list {
  grid-template-columns: minmax(104px, 0.38fr) minmax(0, 0.62fr) minmax(104px, 0.38fr) minmax(0, 0.62fr);
  gap: 6px 18px;
  align-items: start;
}

.tax-accrual-summary-list dt,
.tax-accrual-summary-list dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}

.tax-accrual-summary-list dd {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .tax-accrual-summary-list {
    grid-template-columns: minmax(104px, 0.42fr) minmax(0, 0.58fr);
  }
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  border: 1px solid #ffd5da;
  border-radius: var(--radius);
  background: var(--brand-50);
}

.detail-actions.customer-detail-actions {
  align-items: center;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
}

.detail-section h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.mini-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.mini-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
}

.mini-table-row:first-child {
  border-top: 0;
}

.mini-table-row.header {
  background: var(--brand-50);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.customer-contacts-table .customer-contact-row {
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.9fr) minmax(150px, 1fr) 132px;
}

.customer-contact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 132px;
  white-space: nowrap;
}

.customer-contact-actions .btn {
  flex: 0 0 auto;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.audit-item:first-child {
  border-top: 0;
}

.audit-item time {
  color: var(--muted);
  font-size: 11px;
}

.archived-panel {
  grid-column: 1 / -1;
}

.archived-list {
  display: grid;
  gap: 8px;
}

.archived-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.archived-item:first-child {
  border-top: 0;
}

.archived-item span,
.archived-item time {
  color: var(--muted);
  font-size: 12px;
}

.notification-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.notification-item {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.notification-item p {
  margin: 0;
  color: var(--muted);
}

.notification-item time {
  color: var(--muted);
  font-size: 12px;
}

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

dd {
  margin: 0;
}

.file-uploader {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.placeholder-list {
  columns: 2;
  color: var(--muted);
}

.settings-users-panel,
.settings-list-panel,
.settings-purchase-invoice-types-panel {
  grid-column: 1 / -1;
}

.settings-inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 0.9fr) auto;
  align-items: end;
  gap: 12px;
}

.module-coverage-panel {
  display: grid;
  gap: 12px;
}

.module-coverage-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-50);
}

/* Settings dashboard layout */
.settings-page-header {
  margin-bottom: 0;
}

.content:has(.settings-page-header) {
  grid-template-columns: minmax(0, 1fr);
}

.settings-metrics-grid {
  gap: 10px;
}

.settings-metrics-grid .metric-card {
  min-height: 82px;
  padding: 14px 16px;
  gap: 6px;
}

.settings-metrics-grid .metric-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.settings-dashboard-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.settings-dashboard-grid > .panel.compact {
  min-width: 0;
  min-height: 0;
  align-self: start;
  padding: 16px;
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-card);
}

.settings-dashboard-grid > .panel.compact > h2,
.settings-dashboard-grid > .panel.compact > .panel-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.settings-dashboard-grid > .panel.compact > h2 + * {
  margin-top: 12px;
}

.settings-system-panel,
.settings-company-panel,
.settings-dashboard-grid > .cal-settings,
.settings-dashboard-grid > .settings-account-security-panel,
.settings-product-services-panel,
.settings-defaults-panel,
.settings-governance-panel,
.settings-purchase-invoice-types-panel {
  grid-column: span 6;
}

.settings-dashboard-grid > .settings-account-security-panel {
  min-width: 0;
}

.settings-account-security-panel :is(select, .btn) {
  min-width: 0;
  max-width: 100%;
}

.settings-account-security-panel .btn {
  white-space: normal;
}

.module-coverage-panel,
.settings-users-panel,
.archived-panel {
  grid-column: 1 / -1;
}

.settings-system-panel,
.settings-company-panel,
.settings-product-services-panel,
.settings-purchase-invoice-types-panel,
.settings-defaults-panel,
.settings-governance-panel {
  align-self: stretch !important;
  height: 100%;
}

.settings-dashboard-grid .panel-title {
  margin-bottom: 12px;
}

.settings-dashboard-grid .settings-list {
  grid-template-columns: minmax(130px, 0.72fr) minmax(0, 1fr);
  gap: 0 16px;
  margin: 0;
}

.settings-dashboard-grid .settings-list dt,
.settings-dashboard-grid .settings-list dd {
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
}

.settings-dashboard-grid .settings-list dt:first-child,
.settings-dashboard-grid .settings-list dt:first-child + dd {
  border-top: 0;
}

.settings-dashboard-grid .settings-list dt {
  color: var(--muted);
}

.settings-dashboard-grid .settings-list dd {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.settings-company-panel .settings-list {
  grid-template-columns: minmax(90px, 0.6fr) minmax(120px, 1fr) minmax(90px, 0.6fr) minmax(120px, 1fr);
  column-gap: 14px;
}

.settings-company-panel .settings-list > :nth-child(-n + 4) {
  border-top: 0;
}

.settings-dashboard-grid .table-wrap {
  border-radius: var(--v2-radius-md);
}

.settings-dashboard-grid .data-table th,
.settings-dashboard-grid .data-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

.settings-product-services-panel .row-actions .btn,
.settings-purchase-invoice-types-panel .row-actions .btn,
.settings-users-panel .row-actions .btn {
  min-height: 27px;
  padding: 4px 8px;
  font-size: 11px;
}

.settings-dashboard-grid .module-coverage-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.settings-dashboard-grid .module-coverage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  background: var(--v2-color-surface-raised);
  border-color: var(--v2-color-border);
  border-radius: var(--v2-radius-md);
}

.settings-dashboard-grid .module-coverage-item strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
}

.settings-dashboard-grid .module-coverage-item span {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--primary-dark);
  font-weight: 700;
  text-align: center;
}

:root[data-theme="dark"] .settings-dashboard-grid .module-coverage-item {
  background: var(--surface-muted);
}

:root[data-theme="dark"] .settings-dashboard-grid .module-coverage-item span {
  color: var(--text);
}

@media (max-width: 1100px) {
  .settings-metrics-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

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

  .settings-dashboard-grid > .panel,
  .settings-dashboard-grid > .cal-settings,
  .settings-dashboard-grid > .settings-account-security-panel {
    grid-column: span 1;
  }

  .module-coverage-panel,
  .settings-users-panel,
  .archived-panel {
    grid-column: 1 / -1 !important;
  }

  .settings-company-panel .settings-list {
    grid-template-columns: minmax(130px, 0.72fr) minmax(0, 1fr);
  }

  .settings-company-panel .settings-list > :nth-child(n) {
    border-top: 1px solid var(--line);
  }

  .settings-company-panel .settings-list > :nth-child(-n + 2) {
    border-top: 0;
  }
}

@media (max-width: 720px) {
  .settings-metrics-grid,
  .settings-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-dashboard-grid > .panel,
  .module-coverage-panel,
  .settings-users-panel,
  .archived-panel {
    grid-column: 1 / -1 !important;
  }

  .settings-dashboard-grid .settings-list {
    grid-template-columns: minmax(112px, 0.65fr) minmax(0, 1fr);
  }

  .settings-dashboard-grid .module-coverage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-dashboard-grid .settings-inline-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-dashboard-grid .settings-inline-form > .btn {
    justify-self: start;
  }
}

@media (max-width: 440px) {
  .settings-dashboard-grid .module-coverage-list {
    grid-template-columns: 1fr;
  }
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions .btn {
  min-height: 30px;
  padding: 6px 9px;
}

.map-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
}

.map-panel {
  min-height: 420px;
}

.map-canvas {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(84, 107, 228, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(84, 107, 228, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(84, 107, 228, 0.14), rgba(141, 160, 242, 0.18));
  background-size: 42px 42px, 42px 42px, 100% 100%;
}

.map-pin {
  position: absolute;
  display: grid;
  min-width: 96px;
  max-width: 140px;
  gap: 2px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.map-pin span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.map-pin strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.map-pin.alert span {
  background: var(--danger);
}

.project-suite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.suite-main,
.suite-side {
  display: grid;
  gap: 14px;
}

.suite-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.suite-kpi {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.suite-kpi:last-child {
  border-right: 0;
}

.suite-kpi span,
.suite-kpi small {
  color: var(--muted);
  font-size: 11px;
}

.suite-kpi strong {
  color: var(--text);
  font-size: 17px;
}

.suite-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
}

.suite-heading h1 {
  font-size: 20px;
  line-height: 1.25;
}

.suite-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.suite-tabs {
  display: inline-flex;
  width: fit-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.suite-tabs button,
.interactive-tabs button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font: inherit;
  cursor: pointer;
}

.suite-tabs button:last-child,
.interactive-tabs button:last-child {
  border-right: 0;
}

.suite-tabs button.active,
.interactive-tabs button.active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 800;
}

.suite-table-panel {
  display: grid;
  gap: 10px;
}

.project-suite .list-toolbar {
  box-shadow: none;
  border-radius: 8px;
  background: var(--surface);
}

.project-suite .table-wrap {
  border-radius: 8px;
  box-shadow: none;
}

.project-suite .data-table th {
  font-size: 11px;
}

.project-suite .data-table td {
  height: 48px;
}

.linkish {
  color: var(--brand-700);
  font-size: 13px;
}

.progress-cell {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.progress-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-100);
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--brand-500);
}

.progress-cell strong {
  color: var(--muted);
  font-size: 12px;
}

.suite-chart-card {
  min-height: 245px;
  padding: 14px;
}

.suite-chart-card .panel-title {
  align-items: flex-start;
}

.donut-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 160px;
  margin: 8px 0 4px;
}

.donut-visual::before {
  content: "";
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(var(--brand-400) 0 50%, var(--brand-600) 50% 75%, var(--brand-800) 75% 100%);
}

.donut-visual::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
}

.donut-visual span {
  position: absolute;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  min-height: 154px;
  gap: 12px;
  padding: 16px 8px 4px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 29px, rgba(84, 107, 228, 0.08) 30px);
}

.bar-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 3px;
}

.bar-group small {
  grid-column: 1 / -1;
  min-height: 28px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.bar {
  display: block;
  border-radius: 2px 2px 0 0;
}

.bar.dark {
  background: var(--brand-700);
}

.bar.light {
  background: var(--brand-400);
}

.interactive-tabs {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-customer-summary {
  display: grid;
  gap: 14px;
}

.project-detail-grid {
  display: grid;
  gap: 16px;
}

.project-overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-50), #ffffff 58%);
}

.project-overview-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.project-overview-copy h3 {
  margin: 0;
  font-size: 21px;
}

.project-overview-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.project-overview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-overview-metric {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.project-overview-metric span,
.related-record-item span,
.related-record-item small {
  color: var(--muted);
}

.project-overview-metric strong {
  font-size: 20px;
}

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

.related-record-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.related-record-item:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  transform: translateY(-1px);
}

.related-record-item strong,
.related-record-item span,
.related-record-item small {
  overflow-wrap: anywhere;
}

.context-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.finance-tabs {
  width: 100%;
}

[data-page="finance"] .finance-expense-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(135px, .7fr)) repeat(5, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

[data-page="finance"] .finance-expense-toolbar .field,
[data-page="finance"] .finance-expense-toolbar .toolbar-search {
  min-width: 0;
}

@media (max-width: 1440px) {
  [data-page="finance"] .finance-expense-toolbar { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

@media (max-width: 760px) {
  [data-page="finance"] .finance-expense-toolbar { grid-template-columns: 1fr; }
}

[data-page="finance"] .finance-table-with-total {
  display: grid;
  gap: 8px;
}

[data-page="finance"] .finance-table-period-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

[data-page="finance"] .finance-table-period-total-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

[data-page="finance"] .finance-table-period-total strong {
  color: var(--text);
}

[data-page="finance"] .finance-excel-export-action {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

[data-page="finance"] .finance-excel-export-button {
  min-height: 32px;
  padding: 6px 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

[data-page="finance"] .finance-excel-export-button .btn-icon {
  color: var(--green);
  font-size: 15px;
  line-height: 1;
}

[data-page="map"] .content {
  max-width: none;
  height: calc(100vh - 58px);
  padding: 0;
  gap: 0;
}

.map-fullscreen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 100%;
  height: 100%;
  background: #eef3f6;
}

.projects-map-workspace {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(219, 228, 231, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(24, 37, 47, 0.08);
}

.projects-screen.projects-map-mode .projects-map-workspace {
  height: calc(100vh - 140px);
}

.map-filter-panel {
  order: 2;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  border-left: 1px solid rgba(218, 228, 234, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 252, 0.95));
  padding: 14px;
  box-shadow: -10px 0 28px rgba(16, 42, 56, 0.08);
}

.map-filter-panel header {
  display: grid;
  gap: 3px;
}

.map-filter-panel h1 {
  margin: 0;
  color: #20313b;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.map-filter-panel p {
  margin: 0;
  color: #72818d;
  font-size: 12px;
  line-height: 1.45;
}

.projects-map-panel-header {
  padding: 2px 2px 4px;
}

.map-filter-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.map-filter-metrics article {
  display: grid;
  gap: 4px;
  min-height: 68px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  padding: 10px 11px;
  box-shadow: var(--shadow);
}

.map-filter-metrics span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 700;
}

.map-filter-metrics strong {
  color: #ffffff;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.map-filter-controls {
  display: grid;
  gap: 10px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
}

.check-field input {
  width: 16px;
  height: 16px;
}

.map-location-list {
  display: grid;
  gap: 8px;
}

.map-location-list button {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  color: #ffffff;
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.map-location-list button:hover {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  box-shadow: 0 14px 24px rgba(54, 87, 196, 0.22);
  transform: translateY(-1px);
}

.map-location-list span,
.map-location-list small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.leaflet-map {
  min-height: 100%;
  height: 100%;
  width: 100%;
  background: #e9f0f3;
}

.map-loading {
  display: grid;
  height: 100%;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
}

.projects-map-panel {
  min-width: 300px;
}

.projects-map-panel .map-filter-metrics article {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  color: #ffffff;
}

.projects-map-panel .map-location-list button {
  background: linear-gradient(135deg, #f8fafc, #eef2f6);
  color: #151a22;
  box-shadow: 0 10px 22px rgba(28, 37, 52, 0.1);
}

.projects-map-panel .map-location-list button:hover {
  background: linear-gradient(135deg, #f5f7fa, #e8edf3);
  box-shadow: 0 14px 24px rgba(28, 37, 52, 0.14);
}

.projects-map-panel .map-location-list span,
.projects-map-panel .map-location-list small {
  color: #343d4a;
}

.projects-map-panel .projects-map-list button strong {
  color: #111827;
}

:root[data-theme="dark"] .projects-map-panel .map-filter-metrics article,
:root[data-theme="dark"] .projects-map-panel .map-location-list button {
  background: linear-gradient(135deg, #0f1724, #151f2d);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .projects-map-panel .map-location-list button:hover {
  background: linear-gradient(135deg, #141f2e, #1b2738);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .projects-map-panel .map-filter-metrics article span,
:root[data-theme="dark"] .projects-map-panel .map-filter-metrics article strong,
:root[data-theme="dark"] .projects-map-panel .map-location-list span,
:root[data-theme="dark"] .projects-map-panel .map-location-list small,
:root[data-theme="dark"] .projects-map-panel .projects-map-list button strong {
  color: #f8fafc;
}

.projects-map-panel .projects-map-list button {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-left: 12px;
}

.project-map-layer-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 2px 0;
}

.project-map-layer-filter {
  display: grid;
  grid-template-columns: 15px 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid rgba(207, 217, 226, 0.9);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  padding: 5px 7px;
  color: #334155;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
}

.project-map-layer-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand-600);
}

.project-map-layer-filter i,
.project-map-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--marker-color);
  box-shadow: 0 0 0 2px #ffffff, 0 2px 6px color-mix(in srgb, var(--marker-color) 38%, transparent);
}

.project-map-layer-filter small {
  color: #64748b;
  font-size: 9px;
}

.project-map-legend {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: calc(100% - 86px);
  min-height: 32px;
  border: 1px solid rgba(215, 227, 232, 0.94);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 10px;
  color: #334155;
  box-shadow: 0 10px 22px rgba(33, 59, 84, 0.12);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.project-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 750;
}

:root[data-theme="dark"] .project-map-layer-filter,
:root[data-theme="dark"] .project-map-legend {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 36, 0.94);
  color: #f8fafc;
}

:root[data-theme="dark"] .project-map-layer-filter small {
  color: #cbd5e1;
}

.projects-map-panel .projects-map-list .customer-logo {
  width: auto;
  max-width: 34px;
  height: 30px;
  justify-self: center;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.projects-map-panel .projects-map-list .customer-logo.fallback {
  width: 30px;
  max-width: 30px;
  border-radius: 6px;
  background: #d8dee8;
  color: #111827;
}

.projects-map-list-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.projects-map-workspace > .leaflet-map {
  order: 1;
}

.projects-map-list button strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.saas-map-marker {
  border: 0;
  padding: 0;
  background: transparent;
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.saas-map-marker::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: rgba(72, 112, 255, 0.24);
  transform: scale(1);
  animation: mapMarkerPulse 2.4s ease-in-out infinite;
}

.saas-map-marker span {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: block;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7dff, #365fe7);
  box-shadow: 0 10px 22px rgba(51, 84, 182, 0.26);
  animation: mapMarkerBreath 2.4s ease-in-out infinite;
}

@keyframes mapMarkerPulse {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(1);
  }
  50% {
    opacity: 0.08;
    transform: scale(1.55);
  }
}

@keyframes mapMarkerBreath {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.86;
    transform: scale(1.08);
  }
}

.maplibregl-canvas {
  outline: none;
}

.maplibregl-ctrl-top-right {
  top: 14px;
  right: 14px;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid #d7e3e8;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(33, 59, 84, 0.12);
}

.maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.96);
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  opacity: 0.72;
}

.maplibregl-popup-content {
  padding: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(33, 59, 84, 0.16);
  color: #385061;
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
}

.maplibregl-popup-content strong {
  color: #1d3445;
  font-size: 13px;
}

.maplibregl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.98) !important;
}

.project-map-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(224, 236, 235, 0.78), rgba(197, 220, 220, 0.88)),
    radial-gradient(circle at 32% 38%, rgba(47, 111, 115, 0.18), transparent 24%),
    radial-gradient(circle at 68% 55%, rgba(49, 87, 183, 0.14), transparent 28%);
}

.project-map-fallback-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.36) 1px, transparent 1px);
  background-size: 56px 56px;
}

.project-map-fallback-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 92px;
  max-width: 132px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d3445;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.project-map-fallback-pin span {
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--marker-color, #2f6f73);
  box-shadow: 0 12px 26px rgba(33, 59, 84, 0.24);
}

.project-map-fallback-pin strong {
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgba(33, 59, 84, 0.12);
}

.project-map-fallback-popup {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 4px;
  min-width: 190px;
  max-width: 240px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: #385061;
  box-shadow: 0 18px 40px rgba(33, 59, 84, 0.16);
  transform: translate(-50%, calc(-100% - 18px));
}

.project-map-fallback-popup strong {
  color: #1d3445;
}

.project-map-fallback-popup em {
  font-style: normal;
  color: #2f6f73;
  font-weight: 700;
}

.project-cluster-marker {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: #3157b7;
  color: #fff;
  box-shadow: 0 12px 24px rgba(32, 51, 96, 0.24);
  font-weight: 850;
}

.project-cluster-marker span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.erp-map-popup-card {
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.erp-map-popup-card strong {
  color: #24384a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.erp-map-popup-card span {
  color: #445b70;
  font-size: 12px;
  font-weight: 700;
}

.erp-map-popup-card small {
  color: #6b7d8f;
  font-size: 11px;
  font-weight: 600;
}

.erp-map-popup-card em {
  margin-top: 2px;
  color: #2f5bdd;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.erp-map-popup-card.target-map-popup em {
  color: #445b70;
  font-weight: 700;
}

.v2-card {
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background: var(--v2-color-surface);
  box-shadow: var(--v2-shadow-card);
}

.v2-page-header,
.v2-section-header {
  color: var(--v2-color-text);
}

.v2-section-header p,
.v2-page-header p {
  color: var(--v2-color-muted);
  line-height: var(--v2-line-height-body);
}

.v2-dashboard-grid,
.v2-kpi-strip {
  gap: var(--v2-space-4);
}

.v2-dashboard-card,
.v2-table-panel {
  overflow: hidden;
}

.v2-kpi-card {
  border-radius: var(--v2-radius-lg);
}

.v2-filter-bar {
  border-color: var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--v2-shadow-card);
}

.v2-table-shell {
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background: var(--v2-color-surface);
  box-shadow: var(--v2-shadow-card);
}

.v2-table {
  color: var(--v2-color-text);
}

.v2-table th {
  color: var(--v2-color-muted);
  font-size: var(--v2-font-size-xs);
  text-transform: uppercase;
}

.customers-grid-table th,
.finance-grid-table th {
  text-transform: none;
}

.v2-table tr:hover td {
  background: #f7faf9;
}

.v2-badge {
  border-radius: 999px;
}

.v2-btn-secondary {
  border-color: var(--v2-color-border);
  background: var(--v2-color-surface-raised);
  color: var(--v2-color-primary-strong);
}

.v2-btn-ghost {
  color: var(--v2-color-muted);
}

.v2-primary-action {
  background: var(--v2-color-primary);
  color: #ffffff;
}

.v2-primary-action:hover {
  background: var(--v2-color-primary-strong);
}

.v2-segmented-tabs {
  gap: var(--v2-space-2);
}

.v2-segmented-tabs button {
  border-radius: var(--v2-radius-md);
}

.v2-segmented-tabs button.active,
.v2-segmented-tabs .btn.primary {
  background: var(--v2-color-primary);
  color: #ffffff;
}

.v2-floating-actions {
  gap: var(--v2-space-3);
}

.finance-expense-actions {
  flex-direction: row;
  align-items: center;
}

.v2-project-suite {
  gap: var(--v2-space-5);
}

.projects-screen {
  display: grid;
  align-content: start;
  gap: 20px;
  min-width: 0;
  padding-bottom: 28px;
}

.projects-screen.projects-map-mode {
  min-height: calc(100vh - 138px);
  height: calc(100vh - 138px);
  grid-template-rows: auto minmax(0, 1fr);
  padding-bottom: 0;
}

.projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.projects-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.projects-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.projects-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.projects-header > div:first-child p {
  display: none;
}

.projects-add-button {
  min-width: 138px;
  background: var(--brand-600);
}

.projects-view-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto 44px auto;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--v2-color-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.projects-view-switch > span {
  position: relative;
  z-index: 1;
}

.projects-view-switch > span.active {
  color: var(--v2-color-text);
}

.projects-view-switch-track {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  width: 44px;
  height: 24px;
  display: block;
  border-radius: 999px;
  background: #c9d0dc;
  box-shadow: inset 0 0 0 1px rgba(91, 103, 122, 0.18);
  transition: background 0.2s ease;
}

.projects-view-switch[aria-pressed="true"] .projects-view-switch-track,
.projects-view-switch[data-view="map"] .projects-view-switch-track {
  background: var(--brand-600);
  box-shadow: inset 0 0 0 1px rgba(58, 77, 175, 0.22);
}

.projects-view-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease;
}

.projects-view-switch[aria-pressed="true"] .projects-view-switch-thumb,
.projects-view-switch[data-view="map"] .projects-view-switch-thumb {
  transform: translateX(20px);
}

.projects-screen .projects-mobile-filter-toggle { display: none; }

.project-list-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 180px)) auto;
  align-items: end;
  justify-content: start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

[data-component="projects-filters"].project-list-filters.v2-filter-bar {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-filter-field {
  position: relative;
  gap: 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.project-filter-details {
  position: relative;
}

.project-filter-details summary {
  list-style: none;
}

.project-filter-details summary::-webkit-details-marker {
  display: none;
}

.project-filter-trigger {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f4f5f8;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.project-filter-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-filter-caret {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.16s ease;
}

.project-filter-details[open] .project-filter-caret {
  transform: rotate(180deg);
}

.project-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--v2-shadow-popover);
}

.project-filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.project-filter-option:hover {
  background: var(--brand-50);
}

.project-filter-option.selected {
  background: rgba(84, 107, 228, 0.08);
}

.project-filter-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(84, 107, 228, 0.22);
  border-radius: 5px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 900;
  background: #ffffff;
}

.project-filter-option.selected .project-filter-check {
  background: rgba(84, 107, 228, 0.12);
  border-color: rgba(84, 107, 228, 0.4);
}

.project-filter-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.project-filter-field select,
.project-filter-trigger {
  min-height: 38px;
  border-color: transparent;
  border-radius: 6px;
  background: #f4f5f8;
  padding: 7px 32px 7px 10px;
  font-size: 12px;
  font-weight: 600;
}

.project-filter-clear {
  min-height: 38px;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.project-summary-card {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  min-height: 92px;
  border: 0;
  border-radius: var(--radius);
  color: #ffffff;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-summary-card--clickable {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.project-summary-card--clickable:hover,
.project-summary-card--clickable:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(54, 88, 214, 0.22);
  filter: saturate(1.03);
  outline: none;
}

.project-summary-icon {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 46px;
  height: 46px;
  object-fit: contain;
  opacity: 0.18;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.project-summary-card > .project-summary-title {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 700;
}

.project-summary-value {
  position: relative;
  z-index: 1;
  color: #ffffff;
  display: inline-grid;
  width: auto;
  min-width: 0;
  justify-self: start;
  justify-items: start;
  text-align: left;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-summary-card .project-money,
.project-summary-card .project-money--numeric,
.project-summary-card .project-summary-value {
  width: auto;
  justify-self: start;
  text-align: left;
}

.project-summary-card small {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-size: 10px;
  text-align: left;
}

.project-summary-gross-value {
  margin-top: -6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.project-summary-card:nth-child(1) {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
}

.project-summary-card:nth-child(2) {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
}

.project-summary-card:nth-child(3) {
  background: linear-gradient(135deg, var(--brand-500), #6f86ee);
}

.project-summary-card:nth-child(4) {
  background: linear-gradient(135deg, #258b7a, #34b3a1);
}

.project-summary-card:nth-child(5) {
  background: linear-gradient(135deg, var(--brand-500), #6f86ee);
}

.project-summary-card:nth-child(6) {
  background: linear-gradient(135deg, var(--brand-500), #6f86ee);
}

.project-money {
  display: grid;
  gap: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.project-money.unavailable {
  color: var(--muted);
}

.project-grid-card {
  min-width: 0;
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.projects-ticker {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(205, 217, 238, 0.9);
  border-radius: 16px;
  padding: 12px 0;
  background: linear-gradient(135deg, rgba(51, 82, 201, 0.98), rgba(101, 127, 232, 0.96));
  box-shadow: 0 14px 34px rgba(56, 83, 176, 0.16);
}

.projects-ticker::before,
.projects-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 1;
  pointer-events: none;
}

.projects-ticker::before {
  left: 0;
  background: linear-gradient(90deg, rgba(60, 89, 205, 1), rgba(60, 89, 205, 0));
}

.projects-ticker::after {
  right: 0;
  background: linear-gradient(270deg, rgba(99, 125, 232, 1), rgba(99, 125, 232, 0));
}

.projects-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding-left: 100%;
  animation: projectsTickerMarquee var(--marquee-duration, 72s) linear infinite;
  will-change: transform;
}

.projects-ticker-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 28px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.projects-ticker-item::after {
  content: "•";
  position: absolute;
  right: -4px;
  color: rgba(255, 255, 255, 0.55);
}

.projects-ticker-item:last-child::after {
  display: none;
}

@keyframes projectsTickerMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.dashboard-ticker {
  position: fixed;
  left: 68px;
  right: 0;
  bottom: 0;
  z-index: 18;
  border-radius: 0;
  margin: 0;
}

.sidebar-expanded .dashboard-ticker {
  left: 260px;
}

.project-kpi-breakdown-overlay {
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(6px);
}

.project-kpi-breakdown-modal {
  position: relative;
  width: min(820px, calc(100vw - 40px));
  max-height: min(78vh, 760px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(205, 215, 235, 0.9);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 24px 80px rgba(33, 52, 95, 0.22);
}

.project-kpi-breakdown-modal .modal-header {
  padding: 22px 24px 16px;
  align-items: flex-start;
}

.project-kpi-breakdown-modal .modal-body {
  min-height: 0;
  overflow: hidden;
  padding: 0 24px 24px;
}

.project-kpi-breakdown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-kpi-breakdown-title-group {
  display: grid;
  gap: 6px;
}

.project-kpi-breakdown-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-500);
}

.project-kpi-breakdown-title-group h2,
.project-kpi-breakdown-modal .modal-header h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.project-kpi-breakdown-title-group p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.project-kpi-breakdown-list {
  display: grid;
  gap: 12px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.project-kpi-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(214, 224, 242, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(69, 95, 168, 0.08);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.project-kpi-breakdown-row:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 224, 242, 0.92);
  box-shadow: 0 16px 32px rgba(24, 31, 42, 0.1);
}

.project-kpi-breakdown-row:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.project-kpi-breakdown-row.is-static {
  cursor: default;
}

.project-kpi-breakdown-row.is-static:hover {
  transform: none;
}

.project-kpi-breakdown-main,
.project-kpi-breakdown-meta {
  display: grid;
  gap: 6px;
}

.project-kpi-breakdown-main {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.project-kpi-breakdown-main .customer-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
}

.project-kpi-breakdown-main-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-kpi-breakdown-main strong {
  font-size: 15px;
  color: var(--text);
}

.project-kpi-breakdown-main span {
  color: var(--muted);
  font-size: 12px;
}

.project-kpi-breakdown-meta {
  justify-items: end;
}

.project-kpi-breakdown-amount {
  font-size: 19px;
  font-weight: 800;
  color: #151a22;
  font-variant-numeric: tabular-nums;
}

.project-kpi-breakdown-row .badge {
  font-size: 11px;
}

@media (max-width: 720px) {
  .project-kpi-breakdown-modal {
    width: min(100vw - 20px, 820px);
    max-height: 82vh;
    border-radius: 20px;
  }

  .project-kpi-breakdown-modal .modal-header,
  .project-kpi-breakdown-modal .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .project-kpi-breakdown-row {
    grid-template-columns: 1fr;
  }

  .project-kpi-breakdown-meta {
    justify-items: start;
  }
}

.project-ledger-table {
  overflow: auto;
  min-height: 0;
}

.projects-table { width: 100%; min-width: 1280px; table-layout: fixed; }

.projects-table th:nth-child(1) { width: 11.5%; }
.projects-table th:nth-child(2) { width: 9.5%; }
.projects-table th:nth-child(3) { width: 7.5%; }
.projects-table th:nth-child(4) { width: 7%; }
.projects-table th:nth-child(5) { width: 6.5%; }
.projects-table th:nth-child(6) { width: 6%; }
.projects-table th:nth-child(7) { width: 6%; }
.projects-table th:nth-child(8) { width: 6%; }
.projects-table th:nth-child(9) { width: 6%; }
.projects-table th:nth-child(10) { width: 7%; }
.projects-table th:nth-child(11) { width: 6%; }
.projects-table th:nth-child(12) { width: 6%; }
.projects-table th:nth-child(13) { width: 6%; }
.projects-table th:nth-child(14) { width: 4%; }
.projects-table th:nth-child(15) { width: 5%; }

.projects-table th,
.projects-table td {
  overflow: hidden;
  padding-left: 14px;
  padding-right: 14px;
  text-overflow: ellipsis;
}

.projects-table th {
  height: 46px;
  border-bottom: 1px solid var(--v2-color-border);
  background: var(--brand-50);
  color: var(--v2-color-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.projects-table th:first-child {
  border-radius: 8px 0 0 8px;
}

.projects-table th:last-child {
  border-radius: 0 8px 8px 0;
}

.projects-table td {
  height: 48px;
  border-bottom-color: var(--v2-color-border);
  color: var(--v2-color-text);
  font-size: 12px;
  white-space: nowrap;
}

.projects-table th:nth-child(1),
.projects-table th:nth-child(2),
.projects-table th:nth-child(3),
.projects-table th:nth-child(4),
.projects-table th:nth-child(5),
.projects-table td:nth-child(1),
.projects-table td:nth-child(2),
.projects-table td:nth-child(3),
.projects-table td:nth-child(4),
.projects-table td:nth-child(5) {
  text-align: left;
}

.projects-table th:nth-child(5),
.projects-table td:nth-child(5) {
  overflow: visible;
  text-align: center;
}

.projects-table th:nth-child(6),
.projects-table th:nth-child(7),
.projects-table th:nth-child(8),
.projects-table th:nth-child(9),
.projects-table th:nth-child(10),
.projects-table th:nth-child(11),
.projects-table th:nth-child(12),
.projects-table td:nth-child(6),
.projects-table td:nth-child(7),
.projects-table td:nth-child(8),
.projects-table td:nth-child(9),
.projects-table td:nth-child(10),
.projects-table td:nth-child(11),
.projects-table td:nth-child(12) {
  text-align: right;
}

.projects-table th:last-child,
.projects-table td:last-child {
  text-align: center;
}

.projects-table th .table-sort-button {
  justify-content: flex-start;
}

.projects-table th:nth-child(6) .table-sort-button,
.projects-table th:nth-child(7) .table-sort-button,
.projects-table th:nth-child(8) .table-sort-button,
.projects-table th:nth-child(9) .table-sort-button,
.projects-table th:nth-child(10) .table-sort-button,
.projects-table th:nth-child(11) .table-sort-button,
.projects-table th:nth-child(12) .table-sort-button {
  justify-content: flex-end;
  text-align: right;
}

.projects-table th:nth-child(5) .table-sort-button {
  justify-content: center;
}

.projects-table th:last-child .table-sort-button {
  justify-content: center;
}

.project-grid-row {
  cursor: default;
}

.project-grid-row:hover td {
  background: #f7f9ff;
}

.projects-table .project-grid-totals-row {
  cursor: default;
}

.projects-table .project-grid-totals-row td {
  height: 46px;
  border-top: 1px solid var(--v2-color-border);
  border-bottom: 0;
  background: var(--v2-color-surface-raised);
  color: var(--v2-color-text);
  font-weight: 800;
}

.projects-table .project-grid-totals-row:hover td {
  background: var(--v2-color-surface-raised);
}

:root[data-theme="dark"] .projects-table .project-grid-totals-row td,
:root[data-theme="dark"] .projects-table .project-grid-totals-row:hover td {
  background: #151d2b;
  color: var(--text);
}

.project-customer-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #111827;
  font-weight: 800;
}

.project-customer-cell .project-customer-logo {
  width: auto;
  max-width: 34px;
  height: 24px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

.project-customer-cell .project-customer-logo.fallback {
  width: 24px;
  max-width: 24px;
  border-radius: 6px;
}

.project-customer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-name-cell {
  color: #111827;
  font-weight: 500;
}

.project-balance-cell {
  position: relative;
  display: block;
  min-width: 0;
  text-align: right;
}

.project-balance-progress {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  display: block;
  width: min(68px, 100%);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.project-balance-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.project-balance-progress.low span {
  background: #ef4444;
}

.project-balance-progress.medium span {
  background: #f97316;
}

.project-balance-progress.high span {
  background: #a3c614;
}

.project-balance-progress.complete span {
  background: #16a34a;
}

.project-money--numeric {
  display: inline-block;
  width: 100%;
  text-align: right;
}

.project-row-actions,
.project-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.icon-action.project-row-action,
.icon-action.project-item-action {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #eef0f3;
  color: #3e4653;
  padding: 0;
  cursor: pointer;
}

.icon-action.project-row-action:hover,
.icon-action.project-item-action:hover {
  background: #dfe5ef;
  color: #2456ad;
}

.icon-action.project-row-action.delete:hover,
.icon-action.project-item-action.delete:hover {
  background: #fde9e9;
  color: #c13f45;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.project-status-badge {
  min-width: 80px;
  justify-content: center;
}

.badge.blue {
  border-color: #d8e2ff;
  background: #4f7df3;
  color: #ffffff;
}

.badge.completed.project-status-badge,
.badge.completed.project-detail-status {
  background: rgba(34, 197, 94, 0.82);
  color: #ffffff;
}

.badge.warning.project-status-badge,
.badge.danger.project-status-badge {
  color: #ffffff;
}

.required-mark {
  color: var(--danger);
  font-style: normal;
}

.project-create-dialog-overlay .form-dialog {
  width: min(820px, calc(100vw - 32px));
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(29, 38, 55, 0.2);
}

.project-create-dialog-overlay .form-dialog-header {
  padding: 28px 36px 18px;
}

.project-create-dialog-overlay .form-dialog-header h2 {
  font-size: 30px;
  letter-spacing: -0.025em;
}

.project-create-dialog-overlay .form-dialog-body {
  padding: 20px 36px 28px;
}

.project-create-form {
  display: grid;
  gap: 22px;
}

.project-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 44px;
}

.project-create-field {
  color: var(--text);
  font-weight: 700;
}

.project-create-field input,
.project-create-field select {
  border-color: #edf0f3;
  border-radius: 3px;
  background: #f5f6f7;
}

.project-create-field input:focus,
.project-create-field select:focus {
  border-color: var(--brand-400);
  background: #ffffff;
  outline: 3px solid rgba(84, 107, 228, 0.12);
}

.project-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.form-validation-summary {
  border: 1px solid #f0c3c3;
  border-radius: 6px;
  background: #fff5f5;
  color: #9d2f2f;
  padding: 10px 12px;
}

.form-validation-summary[hidden] {
  display: none;
}

.form-validation-summary p {
  margin: 2px 0;
}

.form-field-help,
.form-field-warning {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.form-field-help {
  color: var(--muted);
}

.form-field-warning {
  color: var(--v2-color-warning);
}

.form-field-warning[hidden] {
  display: none;
}

.project-detail-modal-overlay {
  z-index: 35;
  padding: 4vh 3vw;
  overflow: hidden;
  background: rgba(24, 33, 44, 0.3);
}

.project-detail-modal-overlay .project-detail-modal {
  position: relative;
  display: grid;
  grid-template-rows: clamp(126px, 18vh, 172px) minmax(0, 1fr);
  width: 70vw;
  height: 76vh;
  max-width: 1040px;
  max-height: 780px;
  border-color: rgba(216, 220, 228, 0.86);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(25, 33, 46, 0.2);
}

.project-detail-modal > .modal-header {
  align-items: center;
  padding: clamp(24px, 3.5vh, 38px) clamp(28px, 3vw, 46px);
  border-bottom: 0;
}

.project-detail-modal > .modal-body {
  display: flex;
  min-height: 0;
  padding: 0 clamp(18px, 2vw, 32px) clamp(18px, 2.6vh, 28px);
  overflow: hidden;
}

.project-detail-header {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: clamp(18px, 1.8vw, 28px);
}

.project-detail-customer-logo {
  width: clamp(72px, 6.5vw, 92px);
  height: clamp(72px, 6.5vw, 92px);
  border: 0;
  border-radius: 50%;
  background: #f2f2f3;
  color: #3f4654;
  font-size: clamp(13px, 1vw, 17px);
}

.project-detail-heading {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.project-detail-heading h2,
.project-detail-heading p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-detail-heading h2 {
  color: #111318;
  font-size: clamp(22px, 1.75vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.project-detail-heading p {
  color: #6c6d72;
  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 650;
  line-height: 1.2;
}

.badge.project-detail-status {
  min-width: clamp(94px, 7.5vw, 116px);
  margin-left: clamp(4px, 0.6vw, 10px);
  border: 0;
  border-radius: 999px;
  background: #2aafb3;
  color: #ffffff;
  padding: 6px 14px;
  font-size: clamp(11px, 0.82vw, 13px);
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.project-detail-modal .modal-close-button,
.project-kpi-breakdown-modal .modal-close-button {
  position: absolute;
  top: 15px;
  right: 16px;
}

.project-detail-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 14px 32px rgba(29, 34, 44, 0.12);
}

.project-detail-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(max-content, 1fr));
  gap: 0;
  align-items: end;
  padding: 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(226, 232, 244, 0.9);
  background: #ffffff;
}

.project-detail-tabs button {
  position: relative;
  border: 0;
  padding: 16px 14px 14px;
  background: transparent;
  color: #6a7487;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.project-detail-tabs button.active {
  color: #416dc8;
}

.project-detail-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: 3px;
  background: #416dc8;
}

.project-detail-tab-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(45%) sepia(7%) saturate(1075%) hue-rotate(182deg) brightness(92%) contrast(86%);
  flex: 0 0 auto;
}

.project-detail-tabs button.active .project-detail-tab-icon {
  filter: brightness(0) saturate(100%) invert(37%) sepia(95%) saturate(1045%) hue-rotate(204deg) brightness(95%) contrast(91%);
}

.project-detail-tab-label {
  display: inline-block;
  font-weight: 500;
}

.project-detail-content {
  display: grid;
  grid-template-columns: minmax(260px, 0.96fr) minmax(320px, 1.08fr) minmax(320px, 1.02fr);
  gap: 16px;
  align-content: start;
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow-y: auto;
  background: #f8fbff;
}

.project-detail-section-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border: 1px solid rgba(229, 236, 246, 0.95);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(64, 96, 168, 0.08);
  overflow: hidden;
}

.project-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(235, 239, 247, 0.95);
}

.project-detail-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-detail-section-title h3 {
  margin: 0;
  color: #243247;
  font-size: 13px;
  font-weight: 800;
}

.project-detail-section-body {
  min-height: 0;
  padding: 14px;
}

.project-detail-finance-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.project-detail-finance-primary,
.project-detail-finance-secondary {
  display: grid;
  gap: 8px;
}

.project-detail-finance-secondary {
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f8;
}

.project-detail-financial-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-detail-financial-item.primary,
.project-detail-financial-item.balance {
  padding: 10px 12px;
  border: 1px solid rgba(235, 239, 247, 0.95);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(75, 103, 170, 0.06);
}

.project-detail-financial-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.project-detail-financial-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
}

.project-detail-financial-icon.primary {
  background: linear-gradient(135deg, #416dc8, #5d89ee);
}

.project-detail-financial-icon.balance {
  background: linear-gradient(135deg, #416dc8, #5d89ee);
}

.project-detail-financial-mini-icon {
  width: 26px;
  color: #416dc8;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.project-detail-financial-item span {
  color: #637087;
  font-size: 10px;
  font-weight: 750;
}

.project-detail-financial-item strong {
  color: #111318;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.project-detail-financial-item.balance span {
  color: #e95f62;
}

.project-detail-financial-item.secondary span {
  color: #556177;
  font-size: 10px;
}

.project-detail-financial-item.secondary strong {
  font-size: 12px;
}

.project-detail-section-card.finance .project-detail-section-body {
  padding: 8px 10px 8px;
  overflow: hidden;
}

.project-detail-section-card.finance .project-detail-finance-primary {
  gap: 4px;
}

.project-detail-section-card.finance .project-detail-financial-item.primary,
.project-detail-section-card.finance .project-detail-financial-item.balance {
  min-height: 58px;
  padding: 6px 10px;
  border-radius: 12px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: #ffffff;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary {
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy span {
  font-size: 10px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy strong {
  font-size: 11px;
  white-space: nowrap;
}

.project-detail-section-card.finance .project-detail-financial-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.project-detail-section-card.finance .project-detail-financial-mini-icon {
  width: 16px;
  font-size: 0;
}

.project-detail-section-card.finance .project-detail-financial-copy span {
  font-size: 10px;
  line-height: 1.18;
}

.project-detail-section-card.finance .project-detail-financial-copy strong {
  font-size: 13px;
  line-height: 1.08;
  white-space: nowrap;
}

.project-detail-section-card.finance .project-detail-financial-item.balance .project-detail-financial-copy span {
  font-size: 10px;
}

.project-detail-section-card.finance .project-detail-financial-item.primary .project-detail-financial-copy,
.project-detail-section-card.finance .project-detail-financial-item.balance .project-detail-financial-copy {
  align-content: center;
}

.project-detail-section-card.finance .project-detail-finance-column {
  gap: 4px;
}

.project-detail-section-card.finance .project-detail-finance-secondary {
  gap: 6px;
  padding-top: 0;
  margin-top: 0;
  align-content: center;
  min-height: 84px;
  justify-items: stretch;
  padding-left: 4px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy span {
  font-size: 9px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy strong {
  font-size: 10px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary {
  width: 92%;
  justify-self: start;
  margin-left: 0;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy {
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 16px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary {
  margin-left: -2px;
}

.project-detail-section-card.finance .project-detail-financial-item.secondary .project-detail-financial-copy {
  gap: 12px;
}

.project-detail-financial-icon-image {
  width: 22px;
  height: 22px;
}

.project-detail-financial-icon-image {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0);
}

.project-detail-financial-svg {
  width: 17px;
  height: 17px;
  color: currentColor;
}

.project-detail-financial-svg.mini {
  width: 14px;
  height: 14px;
}

.project-detail-info-column {
  display: grid;
  align-content: start;
  gap: 0;
  margin: 0;
}

.project-detail-info-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(236, 240, 247, 0.96);
}

.project-detail-info-row:last-child {
  border-bottom: 0;
}

.project-detail-info-row dt,
.project-detail-info-row dd {
  margin: 0;
  color: #22252b;
  line-height: 1.28;
}

.project-detail-info-row dt {
  color: #677589;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}

.project-detail-info-row dd {
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: break-word;
  text-align: right;
}

.project-detail-placeholder {
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0 clamp(12px, 1vw, 18px) clamp(12px, 1.6vh, 18px);
  padding: 26px;
  border-radius: 12px;
  background: #ffffff;
  text-align: center;
  color: var(--muted);
}

.project-detail-placeholder strong {
  color: var(--text);
  font-size: 17px;
}

.project-detail-placeholder p {
  margin: 8px 0 0;
}

.project-items-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  margin: 0 clamp(12px, 1vw, 18px) clamp(12px, 1.6vh, 18px);
  padding: clamp(12px, 1.5vh, 18px);
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
}

.project-items-table-wrap {
  min-height: 0;
  overflow: auto;
}

.tax-payments-content {
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 10px;
}

.tax-payments-content .project-detail-section-heading {
  margin: 0;
}

.project-items-table {
  width: 100%;
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
  color: #17191e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.project-items-table th {
  height: 46px;
  padding: 10px 12px;
  border: 0;
  background: #ececed;
  color: #17191e;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.project-items-table th:first-child {
  border-radius: 9px 0 0 9px;
}

.project-items-table th:last-child {
  border-radius: 0 9px 9px 0;
  text-align: right;
}

.project-items-table td {
  height: 44px;
  padding: 9px 12px;
  border-bottom: 1px solid #dedfe2;
  text-align: left;
  white-space: nowrap;
}

.project-items-table td:not(:first-child),
.project-items-table th:not(:first-child) {
  text-align: right;
}

.project-items-table td:nth-child(2),
.project-items-table th:nth-child(2) {
  text-align: left;
}

.project-items-table tfoot td {
  border-bottom: 0;
  font-weight: 850;
}

.project-items-table tfoot td:first-child {
  text-align: right;
}

.project-items-table tfoot .project-items-footer-value {
  text-align: right !important;
}

.project-items-table tfoot .project-items-footer-actions {
  width: 76px;
}

.project-items-empty-row td {
  height: 110px;
  color: var(--muted);
  text-align: center !important;
}

.project-items-add-row {
  display: flex;
  justify-content: flex-end;
}

.project-items-add-button {
  min-width: 86px;
}

.project-item-form input[type="number"] {
  font-variant-numeric: tabular-nums;
}

.project-invoices-table {
  min-width: 980px;
}

.project-invoices-table th:last-child,
.project-invoices-table td:last-child {
  width: 110px;
}

.project-invoices-table td:first-child,
.project-invoices-table th:first-child,
.project-invoices-table td:nth-child(2),
.project-invoices-table th:nth-child(2) {
  text-align: left;
}

.project-collections-table {
  min-width: 760px;
}

.project-collections-table td:first-child,
.project-collections-table th:first-child,
.project-collections-table td:nth-child(2),
.project-collections-table th:nth-child(2) {
  text-align: left;
}

.project-collections-table th:last-child,
.project-collections-table td:last-child {
  width: 110px;
}

.purchase-payments-table {
  min-width: 0;
}

.purchase-payments-table th:last-child,
.purchase-payments-table td:last-child {
  width: 96px;
  min-width: 96px;
}

.purchase-payments-table .project-item-actions {
  justify-content: flex-end;
}

.purchase-invoices-table th:last-child,
.purchase-invoices-table td:last-child {
  width: 58px;
}

.purchase-grid-actions {
  gap: 4px;
}

.icon-action.purchase-grid-action {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 10px;
}

.project-invoice-form {
  gap: 14px;
}

.project-invoice-upload {
  display: grid;
  gap: 10px;
}

.project-invoice-file-preview {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #f7f8fa;
  color: #4c5260;
  font-size: 12px;
  font-weight: 600;
}

.customer-logo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
}

.customer-logo-upload-preview {
  width: 72px;
  height: 72px;
  display: grid;
  flex: 0 0 72px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #f1f3f6;
  color: var(--muted);
  font-weight: 800;
}

.customer-logo-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-logo-upload .file-uploader {
  flex: 1;
}

@media (max-width: 820px) {
  .project-detail-modal-overlay {
    padding: 12px;
  }

  .project-detail-modal-overlay .project-detail-modal {
    width: 100%;
    height: calc(100vh - 24px);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .project-detail-modal > .modal-header {
    padding: 28px 22px 24px;
  }

  .project-detail-modal > .modal-body {
    padding: 0 12px 12px;
  }

  .project-detail-customer-logo {
    width: 74px;
    height: 74px;
    font-size: 14px;
  }

  .project-detail-heading h2 {
    font-size: 23px;
  }

  .project-detail-heading p {
    font-size: 15px;
  }

  .project-detail-status {
    min-width: auto;
    padding: 6px 13px;
  }

  .project-detail-tabs {
    display: flex;
    gap: 0;
    padding: 0 12px;
  }

  .project-detail-tabs button {
    flex: 0 0 auto;
    padding: 18px 16px 16px;
    font-size: 15px;
  }

  .project-detail-content {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px;
  }

  .project-items-content {
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .project-detail-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
  }

  .project-detail-status {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }

  .project-detail-modal .modal-close-button,
  .project-kpi-breakdown-modal .modal-close-button {
    top: 15px;
    right: 15px;
  }

  .project-detail-info-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .project-detail-info-row-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 20px;
  }
}

.v2-aside-stack {
  display: grid;
  gap: var(--v2-space-4);
}

.v2-map-shell {
  background: var(--v2-color-bg);
}

.v2-map-panel {
  border-right: 1px solid var(--v2-color-border);
}

.v2-map-canvas {
  background: #e9f0ef;
}

.v2-list-stack {
  gap: var(--v2-space-2);
}

.v2-settings-grid {
  gap: var(--v2-space-3);
}

.ceo-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-4);
}

.ceo-dashboard-header h1 {
  margin: 0;
  font-size: var(--v2-font-size-xl);
}

.ceo-dashboard-header p {
  margin: var(--v2-space-1) 0 0;
}

.ceo-dashboard-filters {
  display: inline-grid;
  grid-template-columns: minmax(160px, 220px) auto;
  align-items: end;
  gap: var(--v2-space-2);
  padding: var(--v2-space-2);
}

.ceo-range-select > span {
  display: none;
}

.ceo-range-select select {
  min-height: 36px;
  border-radius: var(--v2-radius-md);
}

.ceo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ceo-kpi-card {
  position: relative;
  min-height: 122px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--v2-space-2);
  padding: var(--v2-space-4);
  overflow: hidden;
  border: 0;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.ceo-kpi-icon {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.28);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.ceo-kpi-label {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--v2-font-size-sm);
  font-weight: 700;
}

.ceo-kpi-card strong {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 22px;
  line-height: var(--v2-line-height-tight);
}

.ceo-kpi-card small {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--v2-font-size-xs);
}

.ceo-kpi-card small.positive {
  color: rgba(255, 255, 255, 0.88);
}

.ceo-kpi-card small.negative {
  color: rgba(255, 255, 255, 0.88);
}

.ceo-kpi-card.tone-blue {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
}

.ceo-kpi-card.tone-green {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
}

.ceo-kpi-card.tone-red {
  background: linear-gradient(135deg, var(--brand-500), #6f86ee);
}

.ceo-side-stack {
  display: grid;
  gap: var(--v2-space-4);
  align-content: stretch;
}

.ceo-dashboard-middle,
.ceo-dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: var(--v2-space-4);
  align-items: stretch;
}

.dashboard-product-panel {
  margin-top: var(--v2-space-4);
}

.dashboard-product-toolbar {
  display: flex;
  align-items: center;
  gap: var(--v2-space-2);
  margin-bottom: var(--v2-space-3);
}

.dashboard-product-toolbar-label {
  color: var(--v2-color-muted);
  font-size: var(--v2-font-size-sm);
  font-weight: 700;
}

.dashboard-product-year-select {
  max-width: 120px;
}

.dashboard-product-year-select > span {
  display: none;
}

.dashboard-product-year-select select {
  min-height: 34px;
  border-radius: var(--v2-radius-md);
}

.dashboard-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--v2-space-3);
}

.dashboard-product-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--v2-space-2);
  border: 1px solid var(--v2-color-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  color: var(--v2-color-text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(24, 37, 47, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-product-card:hover {
  border-color: #bdd0f8;
  box-shadow: 0 14px 28px rgba(54, 99, 235, 0.08);
  transform: translateY(-1px);
}

.dashboard-product-card.expanded {
  border-color: #9db7f6;
  box-shadow: 0 16px 32px rgba(54, 99, 235, 0.1);
}

.dashboard-product-card-copy {
  display: grid;
  gap: var(--v2-space-2);
  min-width: 0;
}

.dashboard-product-card-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.dashboard-product-card-qty {
  color: #3259da;
  font-size: 22px;
  line-height: 1.1;
}

.dashboard-product-card-image {
  width: 53px;
  height: 43px;
  object-fit: contain;
  justify-self: end;
  align-self: center;
}

.dashboard-product-breakdown {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #e7edf2;
}

.dashboard-product-breakdown-row {
  display: grid;
  gap: 2px;
}

.dashboard-product-breakdown-project {
  font-size: 13px;
  font-weight: 700;
}

.dashboard-product-breakdown-customer {
  color: var(--v2-color-muted);
  font-size: 11px;
}

.dashboard-product-breakdown-qty {
  color: #1f3040;
  font-size: 12px;
}

.ceo-panel {
  min-width: 0;
  padding: var(--v2-space-4);
  display: grid;
  gap: var(--v2-space-3);
}

.ceo-panel.wide {
  min-height: 280px;
}

.ceo-trend-panel {
  gap: 6px;
}

.ceo-panel.compact {
  min-height: auto;
}

.ceo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-3);
}

.ceo-panel-header h2 {
  margin: 0;
  color: var(--v2-color-text);
  font-size: var(--v2-font-size-lg);
}

.ceo-money-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-3);
  min-height: 34px;
  color: var(--v2-color-muted);
}

.ceo-cash-focus {
  display: grid;
  gap: var(--v2-space-2);
  padding: var(--v2-space-2);
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
}

.ceo-cash-focus .ceo-money-line {
  min-height: 40px;
  padding: 0 var(--v2-space-2);
  border-radius: var(--v2-radius-md);
  background: #ffffff;
}

.ceo-money-line strong {
  color: var(--v2-color-text);
}

.ceo-money-line.green strong {
  color: #15845f;
}

.ceo-money-line.red strong {
  color: var(--v2-color-danger);
}

.ceo-money-line.blue strong {
  color: #2f5bdd;
}

.ceo-area-chart,
.ceo-combo-chart {
  min-height: 170px;
  display: grid;
  align-items: end;
  gap: var(--v2-space-2);
  padding: var(--v2-space-3);
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background:
    linear-gradient(var(--v2-color-border) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff, #f8fbfb);
  background-size: 100% 42px, 100% 100%;
}

.ceo-area-chart {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ceo-area-chart span {
  display: grid;
  align-items: end;
  justify-items: center;
  min-height: 26px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, rgba(54, 99, 235, 0.88), rgba(54, 99, 235, 0.18));
  transform: scaleY(0);
  transform-origin: bottom center;
  opacity: 0.3;
}

.ceo-area-chart.is-animated span {
  animation: dashboardBarRise 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ceo-area-chart.is-animated span:nth-child(1) { animation-delay: 40ms; }
.ceo-area-chart.is-animated span:nth-child(2) { animation-delay: 100ms; }
.ceo-area-chart.is-animated span:nth-child(3) { animation-delay: 160ms; }
.ceo-area-chart.is-animated span:nth-child(4) { animation-delay: 220ms; }
.ceo-area-chart.is-animated span:nth-child(5) { animation-delay: 280ms; }
.ceo-area-chart.is-animated span:nth-child(6) { animation-delay: 340ms; }

@keyframes dashboardBarRise {
  from {
    transform: scaleY(0);
    opacity: 0.3;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.ceo-area-chart small,
.ceo-combo-chart small {
  color: var(--v2-color-muted);
  font-size: 10px;
  transform: translateY(18px);
}

.ceo-chart-legend {
  display: flex;
  gap: var(--v2-space-4);
  color: var(--v2-color-muted);
  font-size: var(--v2-font-size-sm);
  margin-top: -2px;
}

.ceo-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--v2-space-2);
}

.ceo-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.ceo-chart-legend i.sales {
  background: #3663eb;
}

.ceo-chart-legend i.collection {
  background: #7ea0ff;
}

.ceo-combo-chart {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: column;
}

.ceo-line-chart {
  min-height: 226px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0;
}

.ceo-line-chart-canvas {
  width: 100%;
  height: 210px;
  display: block;
}

.ceo-line-chart-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 4px;
}

.ceo-line-chart-labels small {
  color: var(--v2-color-muted);
  font-size: 10px;
  text-align: center;
}

.ceo-combo-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  justify-items: center;
  gap: 5px;
}

.ceo-combo-group .bar {
  width: 100%;
  min-height: 12px;
  border-radius: 7px 7px 2px 2px;
}

.ceo-combo-group .sales {
  background: linear-gradient(180deg, #4872f4, #214bc8);
}

.ceo-combo-group .collection {
  background: linear-gradient(180deg, #54cfa0, #20946f);
}

.ceo-combo-group small {
  grid-column: 1 / -1;
}

.operation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--v2-space-2);
}

.operation-summary-item {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: var(--v2-space-3);
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-lg);
  background: #f8fbfb;
}

.operation-summary-item strong {
  color: var(--v2-color-text);
  font-size: 22px;
  line-height: var(--v2-line-height-tight);
}

.operation-summary-item span {
  color: var(--v2-color-muted);
  font-size: var(--v2-font-size-xs);
  font-weight: 700;
}

.ceo-alert-list,
.ceo-activity-list {
  display: grid;
  gap: var(--v2-space-2);
}

.ceo-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--v2-space-3);
  padding: var(--v2-space-2);
  border-radius: var(--v2-radius-md);
  background: #f8fbfb;
  color: var(--v2-color-text);
}

.ceo-alert span:last-child {
  line-height: var(--v2-line-height-body);
}

.ceo-alert.tone-red {
  background: #fff7f7;
}

.ceo-alert.tone-orange {
  background: #fffaf0;
}

.ceo-alert.tone-blue,
.ceo-alert.tone-purple {
  background: #f5f8ff;
}

.ceo-receivable-list {
  display: grid;
  gap: var(--v2-space-2);
}

.ceo-receivable-list button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--v2-space-2);
  border: 1px solid var(--v2-color-border);
  border-radius: var(--v2-radius-md);
  background: #ffffff;
  color: var(--v2-color-text);
  padding: var(--v2-space-2);
  text-align: left;
  cursor: pointer;
}

.ceo-receivable-list button:hover {
  background: #f7faf9;
}

.ceo-receivable-list span,
.ceo-receivable-list strong {
  min-width: 0;
  font-size: var(--v2-font-size-xs);
}

.ceo-receivable-party {
  grid-column: 1;
  grid-row: 1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ceo-receivable-meta {
  grid-column: 1;
  grid-row: 2;
  color: var(--v2-color-muted);
}

.ceo-receivable-list strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
}

.ceo-activity-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--v2-space-3);
  width: 100%;
  border: 0;
  border-radius: var(--v2-radius-md);
  background: transparent;
  color: var(--v2-color-text);
  padding: var(--v2-space-2);
  text-align: left;
  cursor: pointer;
}

.ceo-activity-list button:hover {
  background: #f7faf9;
}

.ceo-activity-list button:not(:last-child) {
  border-bottom: 1px solid var(--v2-color-border);
}

.ceo-activity-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ceo-activity-list small,
.ceo-activity-list time {
  color: var(--v2-color-muted);
  font-size: var(--v2-font-size-xs);
}

@media (max-width: 980px) {
  .project-summary-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .project-list-filters {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    width: 100%;
  }

  .sidebar {
    height: 100vh;
  }

  .metrics-grid,
  .dashboard-grid,
  .dashboard-board,
  .reports-board,
  .project-suite,
  .map-layout,
  .settings-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-widget,
  .dashboard-widget.wide {
    grid-column: span 1;
  }

  .report-trend-card,
  .report-trend-card-wide,
  .report-breakdown-card,
  .report-summary-card {
    grid-column: span 1;
  }

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

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

  .project-suite {
    grid-template-columns: 1fr;
  }

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

  .ceo-dashboard-middle,
  .ceo-dashboard-bottom {
    grid-template-columns: 1fr;
  }

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

  .project-overview-hero {
    grid-template-columns: 1fr;
  }

  .map-fullscreen {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .projects-screen.projects-map-mode {
    min-height: calc(100vh - 126px);
    height: auto;
  }

  .projects-map-workspace {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .projects-header {
    align-items: stretch;
    flex-direction: column;
  }

  .projects-add-button {
    width: 100%;
  }

  .project-list-filters,
  .project-summary-grid,
  .project-create-grid {
    grid-template-columns: 1fr;
  }

  .project-create-dialog-overlay .form-dialog-header,
  .project-create-dialog-overlay .form-dialog-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .content {
    padding: 14px 14px 92px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar,
  .page-header,
  .activity-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .topbar-ai-orb-button {
    position: relative;
    align-self: auto;
    width: 34px;
    height: 34px;
    transform: none;
    order: initial;
  }

  .topbar-ai-orb {
    width: 29px;
    height: 29px;
  }

  .topbar-ai-orb-core {
    width: 24px;
    height: 24px;
  }

  .ai-assistant-modal-overlay {
    padding: 12px;
  }

  .ai-assistant-modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .top-actions,
  .page-header,
  .ceo-dashboard-header,
  .modal-actions {
    justify-content: flex-start;
  }

  .ceo-dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ceo-dashboard-filters {
    grid-template-columns: 1fr;
  }

  .ceo-kpi-grid,
  .ceo-dashboard-middle,
  .ceo-dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .sidebar nav,
  .metrics-grid,
  .dashboard-grid,
  .dashboard-board,
  .reports-board,
  .suite-kpis,
  .context-filter-bar,
  .list-toolbar,
  .settings-grid,
  .card-grid,
  .language-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-widget,
  .dashboard-widget.wide,
  .dashboard-widget.full,
  .dashboard-metrics-widget,
  .project-overview-metrics {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

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

  .suite-actions {
    display: flex;
    justify-content: flex-start;
  }

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

  .floating-actions {
    right: 14px;
    bottom: 14px;
  }

  .map-fullscreen {
    grid-template-columns: 1fr;
  }

  .map-filter-panel {
    max-height: 42vh;
  }

  .projects-map-workspace {
    height: calc(100vh - 210px);
    min-height: 520px;
  }

  .leaflet-map {
    min-height: 58vh;
  }

  .workspace,
  .sidebar-expanded .workspace {
    margin-left: 68px;
  }

  .sidebar-expanded .sidebar {
    box-shadow: 12px 0 28px rgba(21, 35, 93, 0.28);
  }
}

/* Customer portfolio cards match the compact customer overview reference. */
.customer-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

@media(max-width:760px) {
  .customer-card-grid { grid-template-columns: minmax(0, 1fr); }
}

.entity-card.customer-summary-card {
  padding: 15px 18px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(33, 53, 92, .04);
}
.customer-card-header { display:flex; align-items:center; gap:18px; min-height:70px; margin-bottom:14px; }
.customer-card-header .customer-logo { width:72px; height:70px; flex:0 0 72px; object-fit:contain; padding:3px; border:0; border-radius:0; background:var(--surface); box-sizing:border-box; }
.customer-card-identity { display:grid; gap:8px; min-width:0; flex:1; }
.customer-card-identity > strong { font-size:18px; font-weight:800; line-height:1.25; }
.customer-card-location { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; }
.customer-card-icon { width:21px; height:21px; object-fit:contain; opacity:.65; }
.customer-card-location .customer-card-icon { width:16px; height:16px; }
.customer-card-header .badge { align-self:flex-start; margin-top:4px; padding:5px 12px; min-height:26px; font-size:11px; white-space:nowrap; }
.customer-card-header .badge::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:8px; }
.customer-card-header .badge.completed { color:#218747; background:#dcfce7; }
.customer-card-contract { display:grid; width:100%; gap:4px; text-align:left; border:0; border-block:1px solid var(--line); padding:10px 0; background:transparent; color:var(--text); cursor:pointer; font:inherit; }
.customer-card-contract > span { font-size:12px; color:var(--muted); }
.customer-card-contract > strong { font-size:27px; font-weight:850; line-height:1.2; font-variant-numeric:tabular-nums; }
.customer-card-footer { display:grid; grid-template-columns:1fr 1.2fr 38px; gap:14px; align-items:center; padding-top:11px; }
.customer-card-stat { display:flex; align-items:center; gap:10px; padding:0; border:0; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; min-width:0; }
.customer-card-stat + .customer-card-stat { border-left:1px solid var(--line); padding-left:22px; }
.customer-card-stat > .customer-card-icon { width:34px; height:34px; padding:7px; box-sizing:border-box; border-radius:8px; background:var(--surface-muted); }
.customer-card-stat-copy { display:grid; gap:3px; }
.customer-card-stat-copy > span { font-size:11px; color:var(--muted); }
.customer-card-stat-copy > strong { font-size:15px; font-weight:800; }
.customer-card-open { display:grid; place-items:center; width:38px; height:36px; padding:8px; border:0; border-radius:50%; background:#eff6ff; cursor:pointer; }
.customer-card-open .customer-card-icon { opacity:1; filter: invert(38%) sepia(98%) saturate(2900%) hue-rotate(213deg); }
.customer-card-contract:hover strong,.customer-card-stat:hover strong { color:var(--primary); }
.customer-summary-card button:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
:root[data-theme="dark"] .customer-summary-card .customer-card-icon { filter:invert(1); }
@media(max-width:600px) {
  .customer-card-header { gap:10px; flex-wrap:wrap; }
  .customer-card-header .customer-logo { width:56px; height:56px; flex-basis:56px; }
  .customer-card-identity > strong { font-size:16px; }
  .customer-card-contract > strong { font-size:24px; }
  .customer-card-footer { gap:8px; }
  .customer-card-stat + .customer-card-stat { padding-left:10px; }
}

.customer-row-list { display:grid; gap:8px; }
.customer-summary-row { position:relative; display:grid; grid-template-columns:minmax(300px, 2.1fr) minmax(120px, .85fr) minmax(220px, 1.2fr) minmax(160px, 1fr) 40px; align-items:center; gap:0; min-height:108px; padding:14px 20px 14px 28px; border:1px solid var(--line); border-radius:11px; background:var(--surface); cursor:pointer; overflow:hidden; }
.customer-summary-row::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:var(--primary); opacity:0; }
.customer-summary-row:hover::before,.customer-summary-row:focus-within::before { opacity:1; }
.customer-row-identity { display:flex; align-items:center; gap:30px; padding-right:20px; min-width:0; }
.customer-row-identity .customer-logo { width:80px; height:78px; flex:0 0 80px; object-fit:contain; border:0; border-radius:0; background:transparent; }
.customer-row-copy { display:grid; justify-items:start; gap:5px; min-width:0; }
.customer-row-copy > strong { font-size:18px; line-height:1.25; font-weight:800; }
.customer-row-copy > span:not(.badge) { color:var(--muted); font-size:14px; }
.customer-row-copy .badge { min-height:26px; padding:4px 11px; font-size:12px; }
.customer-row-copy .badge::before { content:""; width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:7px; }
.customer-row-copy .badge.completed { background:#50cc82; color:#fff; }
.customer-row-metric { display:grid; align-content:center; gap:9px; min-height:62px; padding:0 32px; border:0; border-left:1px solid var(--line); background:transparent; text-align:left; font:inherit; color:var(--text); cursor:pointer; }
.customer-row-metric > span { font-size:14px; color:var(--muted); white-space:nowrap; }
.customer-row-metric > strong { font-size:24px; font-weight:800; white-space:nowrap; font-variant-numeric:tabular-nums; }
.customer-row-open { display:grid; place-items:center; width:36px; height:36px; padding:8px; border:0; background:transparent; cursor:pointer; }
.customer-row-metric:hover strong { color:var(--primary); }
.customer-summary-row button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
:root[data-theme="dark"] .customer-row-open img { filter:invert(1); }
@media(max-width:1200px) {
  .customer-summary-row { grid-template-columns:minmax(240px, 1.6fr) .65fr 1.2fr .8fr 32px; padding-inline:18px; }
  .customer-row-identity { gap:14px; }
  .customer-row-metric { padding-inline:16px; }
  .customer-row-metric > strong { font-size:20px; }
}
@media(max-width:850px) {
  .customer-summary-row { grid-template-columns:1fr 1fr 36px; gap:14px; }
  .customer-row-identity { grid-column:1 / -1; }
  .customer-row-metric { border:0; padding:0; min-height:48px; }
  .customer-row-metric > span { white-space:normal; font-size:12px; }
  .customer-row-open { grid-column:3; grid-row:2 / 4; }
}

/* Customer details use the active theme's surfaces, borders, and accents. */
.drawer.customer-detail-drawer { width:min(100%, 780px); }
.customer-detail-drawer .drawer-body { background:var(--bg); padding:22px; }
.customer-detail-panel { gap:16px; }
.customer-detail-hero { display:grid; grid-template-columns:1fr auto; gap:20px; padding:22px; background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.customer-detail-identity { display:flex; align-items:center; gap:18px; min-width:0; }
.customer-detail-identity .customer-logo { width:76px; height:76px; flex:0 0 76px; object-fit:contain; background:transparent; border:0; border-radius:0; }
.customer-detail-heading { display:grid; justify-items:start; gap:8px; min-width:0; }
.customer-detail-heading h2 { margin:0; font-size:23px; line-height:1.25; overflow-wrap:anywhere; }
.customer-detail-heading p { margin:0; color:var(--muted); font-size:13px; }
.customer-detail-hero .customer-detail-actions { align-self:start; flex-wrap:wrap; }
.customer-detail-metrics { grid-column:1/-1; display:grid; grid-template-columns:.8fr 1.5fr 1fr; border-top:1px solid var(--line); padding-top:18px; gap:14px; }
.customer-detail-metrics button { display:grid; align-content:start; gap:8px; min-width:0; padding:8px 0; border:0; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.customer-detail-metrics button + button { border-left:1px solid var(--line); padding-left:16px; }
.customer-detail-metrics span { color:var(--muted); font-size:11px; }
.customer-detail-metrics strong { font-size:19px; font-weight:800; overflow-wrap:anywhere; }
.customer-detail-metrics button:hover strong { color:var(--primary); }
.customer-detail-panel .detail-section { background:var(--surface); border-radius:12px; padding:18px; gap:16px; }
.customer-detail-panel .detail-section h3 { font-size:14px; font-weight:750; padding-bottom:12px; border-bottom:1px solid var(--line); }
.customer-detail-panel .detail-list { margin:0; row-gap:0; }
.customer-detail-panel .detail-list dt,.customer-detail-panel .detail-list dd { padding:10px 0; margin:0; border-bottom:1px solid var(--line); font-size:13px; overflow-wrap:anywhere; }
.customer-detail-panel .detail-list dt { color:var(--muted); }
.customer-detail-panel .detail-list dt:nth-last-child(2),.customer-detail-panel .detail-list dd:last-child { border-bottom:0; }
.customer-detail-panel .empty-state { padding:20px; background:var(--surface-muted); border:0; border-radius:8px; }
.customer-detail-projects { display:grid; gap:8px; }
.customer-detail-project { display:flex; align-items:center; gap:12px; width:100%; padding:12px 14px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); text-align:left; font:inherit; cursor:pointer; }
.customer-detail-project > div { display:grid; gap:5px; flex:1; min-width:0; }
.customer-detail-project strong { font-size:13px; overflow-wrap:anywhere; }
.customer-detail-project > div > span { color:var(--muted); font-size:12px; }
.customer-detail-project > img { width:18px; height:18px; opacity:.5; }
.customer-detail-project:hover { background:var(--surface-muted); border-color:var(--primary); }
.customer-detail-panel button:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
:root[data-theme="dark"] .customer-detail-project > img { filter:invert(1); }
@media(max-width:600px) {
  .customer-detail-drawer .drawer-body { padding:12px; }
  .customer-detail-hero { padding:16px; gap:16px; grid-template-columns:1fr; }
  .customer-detail-heading h2 { font-size:20px; }
  .customer-detail-hero .customer-detail-actions { justify-content:flex-start; }
  .customer-detail-metrics { grid-template-columns:1fr; gap:0; }
  .customer-detail-metrics button { display:flex; justify-content:space-between; align-items:center; gap:12px; }
  .customer-detail-metrics button + button { padding-left:0; border-left:0; border-top:1px solid var(--line); }
  .customer-detail-metrics strong { font-size:17px; }
  .customer-detail-project { flex-wrap:wrap; }
}

.customer-files-table { overflow-x:auto; }
.customer-files-table .mini-table-row { grid-template-columns:minmax(150px, 1.5fr) minmax(100px, 1fr) 90px 130px; min-width:540px; }
.customer-file-actions { display:flex; gap:6px; }
.customer-file-actions button { padding:6px 10px; font-size:12px; }
.customer-file-actions button:disabled { opacity:.45; cursor:not-allowed; }

.projects-header-actions .report-download-button,
.sales-targets-header-actions .report-download-button {
  background: #355ac5;
  color: #fff;
  border: 0;
  box-shadow: none;
}
.projects-header-actions .report-download-button:hover,
.sales-targets-header-actions .report-download-button:hover { background: #2949a6; }
.report-download-button .action-button-icon { width: 18px; height: 18px; object-fit: contain; }

.project-summary-detail-lines { display: grid; gap: 3px; }
.project-summary-detail-lines .project-summary-gross-value { display: block; margin: 0; }

.project-kpi-balance-sections { display: grid; gap: 24px; }
.project-kpi-balance-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 10px; border-radius: 10px; background: var(--surface-muted); }
.project-kpi-balance-section-header h3 { margin: 0; font-size: 16px; }
.project-kpi-balance-section-header strong { color: var(--primary); font-variant-numeric: tabular-nums; }

.finance-metric-clickable { cursor: pointer; }
.finance-metric-clickable:hover { filter: brightness(1.06); }
.finance-metric-clickable:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.finance-kpi-detail-modal { width: min(1000px, 96vw); }
.finance-kpi-detail-total { display: block; padding: 16px 0; text-align: right; font-size: 18px; }

.project-files-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; align-self: start; }
.project-files-panel > h3 { margin: 0; font-size: 16px; }
.project-files-panel > .form-error:empty { display: none; }
.project-files-upload { display: flex; justify-content: flex-end; }
.project-files-upload > input[hidden] { display: none; }

html:has(.finance-kpi-detail-overlay),
body:has(.finance-kpi-detail-overlay) { overflow: hidden; }
.finance-kpi-detail-overlay { overscroll-behavior: contain; overflow: hidden; }
.finance-kpi-detail-modal {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}
.finance-kpi-detail-modal > .modal-header { flex: 0 0 auto; }
.finance-kpi-detail-modal > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

[data-page="finance"] .finance-collection-toolbar { display: grid; grid-template-columns: minmax(200px, 1.5fr) repeat(2, minmax(150px, 1fr)) minmax(200px, 1.4fr) minmax(120px, .8fr); gap: 10px; align-items: end; }
[data-page="finance"] .finance-collection-toolbar .field { min-width: 0; }
@media (max-width: 1000px) { [data-page="finance"] .finance-collection-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { [data-page="finance"] .finance-collection-toolbar { grid-template-columns: 1fr; } }

.projects-table th,.projects-table td{padding-left:8px;padding-right:8px}
.projects-table th:nth-child(13),.projects-table td:nth-child(13){text-align:right}
.projects-table th:nth-child(13) .table-sort-button{justify-content:flex-end;text-align:right}
.projects-table th .table-sort-button{white-space:normal;line-height:1.25}

.projects-table th:nth-child(14),.projects-table td:nth-child(14){text-align:right}
.projects-table th:nth-child(14) .table-sort-button{justify-content:flex-end;text-align:right}

html:has(.project-kpi-breakdown-overlay),
body:has(.project-kpi-breakdown-overlay) { overflow: hidden; }
.project-kpi-breakdown-overlay { overflow: hidden; overscroll-behavior: contain; }
.project-kpi-breakdown-modal { overflow: hidden; }
.project-kpi-breakdown-modal .modal-body { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.project-kpi-breakdown-modal .project-kpi-breakdown-list { max-height: none; overflow: visible; }

.finance-tabs.v2-segmented-tabs > button {
  font-weight: 700;
}

@media (hover: none) and (pointer: coarse) {
  .ios-home-screen #app { padding-block-start: 20px; }

  /* Apply to scroll containers and dialogs appended directly to the document. */
  html, body, body * {
    touch-action: manipulation;
    touch-action: pan-x pan-y;
  }

  body :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea) {
    font-size: max(16px, 1em);
  }
}

@media (display-mode: standalone) and (hover: none) and (pointer: coarse) {
  #app { padding-block-start: 20px; }
}
