:root {
  /* =========================
     ScopeFlow Design Tokens
     ========================= */
  --sf-bg: #f6fafb;
  --sf-bg-soft: #eef8fa;
  --sf-bg-strong: #e7f3f6;

  --sf-white: #ffffff;
  --sf-surface: rgba(255, 255, 255, 0.86);
  --sf-surface-strong: rgba(255, 255, 255, 0.96);
  --sf-surface-muted: rgba(240, 248, 250, 0.88);
  --sf-glass: rgba(255, 255, 255, 0.64);

  --sf-text: rgba(7, 39, 65, 0.88);
  --sf-title: rgba(7, 39, 65, 0.98);
  --sf-muted: rgba(7, 39, 65, 0.62);
  --sf-faint: rgba(7, 39, 65, 0.46);

  --sf-border: rgba(133, 170, 184, 0.30);
  --sf-border-soft: rgba(133, 170, 184, 0.18);
  --sf-border-strong: rgba(42, 167, 184, 0.42);

  --sf-accent: #2aa7b8;
  --sf-accent-strong: #348adc;
  --sf-accent-deep: #127b8c;
  --sf-accent-soft: rgba(42, 167, 184, 0.12);
  --sf-accent-gradient: linear-gradient(135deg, #2aa7b8 0%, #348adc 100%);

  --sf-warm: #ffbb00;
  --sf-warm-deep: #f97316;
  --sf-warm-soft: rgba(255, 187, 0, 0.14);
  --sf-warm-gradient: linear-gradient(135deg, #ffbb00 0%, #f97316 100%);

  --sf-success: #1fb874;
  --sf-success-deep: #12945c;
  --sf-success-gradient: linear-gradient(135deg, #1fb874 0%, #72c38f 100%);

  --sf-danger: #ef4444;
  --sf-danger-deep: #dc2626;
  --sf-danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  --sf-purple: #7c3aed;
  --sf-purple-soft: rgba(124, 58, 237, 0.12);

  --sf-radius-xs: 10px;
  --sf-radius-sm: 14px;
  --sf-radius-md: 18px;
  --sf-radius-lg: 24px;
  --sf-radius-xl: 30px;
  --sf-radius-2xl: 36px;
  --sf-pill: 999px;

  --sf-shadow-xs: 0 6px 14px rgba(7, 39, 65, 0.035);
  --sf-shadow-sm: 0 12px 28px rgba(7, 39, 65, 0.055);
  --sf-shadow-md: 0 20px 48px rgba(7, 39, 65, 0.078);
  --sf-shadow-lg: 0 30px 72px rgba(7, 39, 65, 0.115);
  --sf-shadow-accent: 0 18px 42px rgba(42, 167, 184, 0.20);
  --sf-shadow-warm: 0 18px 42px rgba(255, 187, 0, 0.18);
  --sf-shadow-danger: 0 18px 42px rgba(239, 68, 68, 0.20);

  --sf-sidebar-width: 304px;
  --sf-mobile-header-height: 68px;
  --sf-main-pad: clamp(18px, 2.4vw, 36px);
  --sf-gap: clamp(14px, 1.45vw, 22px);
  --sf-card-pad: clamp(18px, 1.6vw, 26px);

  --sf-divider: linear-gradient(
    90deg,
    rgba(42, 167, 184, 0.46) 0%,
    rgba(52, 138, 220, 0.26) 48%,
    rgba(255, 187, 0, 0.34) 100%
  );
}

/* =========================
   Reset / Base
   ========================= */

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

html,
body {
  min-width: 320px;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Afacad", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--sf-text);
  background:
    radial-gradient(circle at 0 0, rgba(122, 215, 223, 0.23), transparent 31%),
    radial-gradient(circle at 100% 14%, rgba(52, 138, 220, 0.13), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(255, 187, 0, 0.16), transparent 26%),
    linear-gradient(135deg, #f9fcfd 0%, #eef8fa 48%, #f8fbfb 100%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42, 167, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 167, 184, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 74%);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--sf-title);
  font-weight: 950;
  letter-spacing: -0.035em;
}

p {
  color: var(--sf-muted);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden],
.view-panel[hidden],
.sf-tab-panel[hidden] {
  display: none !important;
}

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

.single-column {
  grid-template-columns: 1fr !important;
}

.view-panel {
  display: block;
  width: 100%;
  min-width: 0;
  animation: sfViewIn 0.24s ease both;
}

.sf-tab-panel:not([hidden]) {
  display: grid;
  gap: 18px;
  animation: sfViewIn 0.2s ease both;
}

/* =========================
   Scrollbars / Utilities
   ========================= */

.list-scroll-zone,
.split-list,
.sf-modal-card-wide,
.sf-tabs,
.intelligence-grid {
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 167, 184, 0.38) transparent;
}

.list-scroll-zone::-webkit-scrollbar,
.split-list::-webkit-scrollbar,
.sf-modal-card-wide::-webkit-scrollbar,
.sf-tabs::-webkit-scrollbar,
.intelligence-grid::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.list-scroll-zone::-webkit-scrollbar-thumb,
.split-list::-webkit-scrollbar-thumb,
.sf-modal-card-wide::-webkit-scrollbar-thumb,
.sf-tabs::-webkit-scrollbar-thumb,
.intelligence-grid::-webkit-scrollbar-thumb {
  background: rgba(42, 167, 184, 0.32);
  border-radius: var(--sf-pill);
}

.list-scroll-zone::-webkit-scrollbar-track,
.split-list::-webkit-scrollbar-track,
.sf-modal-card-wide::-webkit-scrollbar-track,
.sf-tabs::-webkit-scrollbar-track,
.intelligence-grid::-webkit-scrollbar-track {
  background: transparent;
}

.list-scroll-zone {
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.list-scroll-zone-md { max-height: 460px; }
.list-scroll-zone-lg { max-height: 560px; }

/* =========================
   Buttons
   ========================= */

.btn {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--sf-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--sf-text);
  background: var(--sf-surface-strong);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--sf-shadow-xs);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sf-shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.64;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.btn-primary {
  color: #fff;
  background: var(--sf-accent-gradient);
  border-color: rgba(42, 167, 184, 0.24);
  box-shadow: var(--sf-shadow-accent);
}

.btn-primary:hover {
  box-shadow: 0 24px 54px rgba(42, 167, 184, 0.27);
}

.btn-ghost {
  color: var(--sf-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
  border-color: var(--sf-border);
}

.btn-ghost:hover {
  color: var(--sf-accent-deep);
  border-color: rgba(42, 167, 184, 0.34);
}

.btn-danger {
  color: #fff;
  background: var(--sf-danger-gradient);
  border-color: rgba(220, 38, 38, 0.42);
  box-shadow: var(--sf-shadow-danger);
}

.btn-danger:hover {
  box-shadow: 0 24px 54px rgba(239, 68, 68, 0.28);
}

.btn-success,
#openChangeModalBtn,
#changeSubmit,
#projectSubmit,
#createClientSubmit {
  color: #fff;
  background: linear-gradient(135deg, var(--sf-success) 0%, var(--sf-success-deep) 100%);
  border-color: rgba(18, 148, 92, 0.26);
  box-shadow: 0 18px 42px rgba(31, 184, 116, 0.24);
}

.btn-success:hover,
#openChangeModalBtn:hover,
#changeSubmit:hover,
#projectSubmit:hover,
#createClientSubmit:hover {
  box-shadow: 0 24px 54px rgba(31, 184, 116, 0.30);
}

.btn-block {
  width: 100%;
}

/* =========================
   Forms / Messages
   ========================= */

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

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  color: var(--sf-title);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid rgba(133, 170, 184, 0.36);
  border-radius: var(--sf-radius-md);
  color: var(--sf-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 252, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), var(--sf-shadow-xs);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group input,
.form-group select {
  min-height: 56px;
  padding: 0 16px;
}

.form-group textarea {
  min-height: 136px;
  padding: 15px 16px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(7, 39, 65, 0.38);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: rgba(42, 167, 184, 0.36);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: rgba(52, 138, 220, 0.56);
  box-shadow: 0 0 0 4px rgba(52, 138, 220, 0.12), var(--sf-shadow-sm);
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-message {
  display: none;
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: var(--sf-radius-md);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 800;
}

.auth-message.is-error {
  display: block;
  color: #a62f2f;
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.auth-message.is-success {
  display: block;
  color: #166534;
  background: rgba(31, 184, 116, 0.12);
  border: 1px solid rgba(31, 184, 116, 0.24);
}

/* =========================
   Auth Pages
   ========================= */

.app-auth-body {
  min-height: 100vh;
}

.auth-layout {
  width: min(calc(100% - 40px), 1200px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  gap: 24px;
  align-items: stretch;
}

.auth-panel {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-2xl);
  box-shadow: var(--sf-shadow-md);
}

.auth-panel-brand {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.20), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 246, 249, 0.86));
}

.auth-panel-form {
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sf-surface-strong);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sf-muted);
  font-size: 15px;
  font-weight: 800;
}

.auth-back-link:hover {
  color: var(--sf-accent);
}

.auth-back-link svg {
  width: 16px;
  height: 16px;
}

.auth-logo {
  width: auto;
  height: 40px;
  display: block;
}

.auth-brand-lockup {
  margin-top: 18px;
}

.auth-eyebrow,
.auth-kicker,
.topbar-kicker,
.intelligence-kicker,
.sf-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--sf-accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-eyebrow,
.topbar-kicker {
  min-height: 28px;
  padding: 6px 11px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-soft);
  border: 1px solid rgba(42, 167, 184, 0.16);
}

.auth-eyebrow {
  margin-top: 20px;
  min-height: 38px;
  padding: 8px 14px;
}

.auth-eyebrow svg {
  width: 16px;
  height: 16px;
}

.auth-panel-brand h1 {
  margin-top: 30px;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 0.98;
}

.auth-panel-brand p {
  margin-top: 20px;
  max-width: 580px;
  font-size: 20px;
}

.auth-feature-list {
  margin-top: 34px;
  display: grid;
  gap: 14px;
}

.auth-feature-item {
  min-height: 58px;
  padding: 16px 18px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sf-muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--sf-shadow-sm);
}

.auth-feature-item svg {
  width: 18px;
  height: 18px;
  color: var(--sf-accent);
  flex: 0 0 auto;
}

.auth-form-wrap {
  width: min(100%, 430px);
}

.auth-heading {
  margin-bottom: 26px;
}

.auth-heading h2 {
  margin-top: 10px;
  font-size: 38px;
  line-height: 1;
}

.auth-heading p {
  margin-top: 14px;
  font-size: 17px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-footer-note {
  margin-top: 18px;
  color: var(--sf-muted);
  font-size: 15px;
}

.auth-footer-note a {
  color: var(--sf-accent);
  font-weight: 900;
}

/* =========================
   Mobile Header / Navigation
   ========================= */

.mobile-nav-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.mobile-app-header,
.mobile-nav-backdrop {
  display: none;
}

.mobile-app-header {
  position: sticky;
  top: 0;
  z-index: 1600;
  height: var(--sf-mobile-header-height);
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 250, 0.88));
  border-bottom: 1px solid rgba(42, 167, 184, 0.18);
  box-shadow: var(--sf-shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mobile-brand {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(42, 167, 184, 0.18);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--sf-accent-soft);
  box-shadow: 0 10px 24px rgba(42, 167, 184, 0.12);
  flex: 0 0 auto;
}

.mobile-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.mobile-view-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  justify-items: center;
  text-align: center;
}

.mobile-view-meta strong {
  max-width: 100%;
  color: var(--sf-title);
  font-size: 18px;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-btn {
  width: 44px;
  height: 44px;
  padding: 12px;
  border: 1px solid rgba(42, 167, 184, 0.30);
  border-radius: 17px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: var(--sf-accent-gradient);
  box-shadow: var(--sf-shadow-accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  border-radius: var(--sf-pill);
  background: #fff;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.mobile-nav-toggle:checked ~ .mobile-app-header .mobile-menu-btn span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle:checked ~ .mobile-app-header .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle:checked ~ .mobile-app-header .mobile-menu-btn span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1490;
  background: rgba(7, 39, 65, 0.34);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mobile-nav-toggle:checked ~ .mobile-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   App Layout
   ========================= */

.app-body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: var(--sf-sidebar-width) minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  width: var(--sf-sidebar-width);
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid rgba(42, 167, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(122, 215, 223, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 249, 0.78));
  box-shadow: 16px 0 50px rgba(7, 39, 65, 0.045);
  align-self: flex-start;
  z-index: 1200;
}

.aside-content {
  height: 100%;
  padding-right: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-brand {
  padding: 8px 10px 4px;
}

.sidebar-logo {
  width: auto;
  height: 38px;
  display: block;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-link {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--sf-radius-md);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(7, 39, 65, 0.72);
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link span {
  min-width: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-link:hover {
  transform: translateX(2px);
  color: var(--sf-accent-deep);
  background: rgba(42, 167, 184, 0.10);
  border-color: rgba(42, 167, 184, 0.16);
}

.sidebar-link.is-active {
  transform: translateX(3px);
  color: #fff;
  background: var(--sf-accent-gradient);
  border-color: rgba(42, 167, 184, 0.26);
  box-shadow: var(--sf-shadow-accent);
}

.sidebar-link.is-active span {
  font-weight: 950;
}

.sidebar-note {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(42, 167, 184, 0.20);
  border-radius: var(--sf-radius-lg);
  color: var(--sf-muted);
  background:
    radial-gradient(circle at top right, rgba(255, 187, 0, 0.14), transparent 48%),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--sf-shadow-sm);
}

.sidebar-note strong {
  display: block;
  color: var(--sf-title);
  font-size: 17px;
}

.sidebar-note p {
  margin-top: 10px;
  font-size: 15px;
}

.app-main {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: var(--sf-main-pad);
  overflow-x: clip;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  margin: calc(var(--sf-main-pad) * -1) calc(var(--sf-main-pad) * -1) 22px;
  padding: 18px var(--sf-main-pad) 16px;
  background: linear-gradient(180deg, rgba(248, 252, 253, 0.92), rgba(248, 252, 253, 0.78));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(7, 39, 65, 0.045);
}

.app-topbar-shell {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.app-topbar-left {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
}

.app-topbar-title-wrap {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.app-title {
  font-size: clamp(32px, 3vw, 48px);
  line-height: 0.96;
}

.app-topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-user-box {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.current-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sf-accent-deep);
  background: linear-gradient(180deg, rgba(42, 167, 184, 0.14), rgba(52, 138, 220, 0.10));
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(42, 167, 184, 0.10);
}

.current-user-meta {
  display: grid;
  gap: 2px;
}

.current-user-meta strong {
  color: var(--sf-title);
  font-size: 15px;
  line-height: 1.1;
}

.current-user-meta span {
  color: var(--sf-muted);
  font-size: 13px;
  line-height: 1.2;
}

.topbar-logout-btn {
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: var(--sf-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--sf-muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: var(--sf-shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.topbar-logout-btn:hover {
  transform: translateY(-1px);
  color: var(--sf-title);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--sf-shadow-sm);
}

.topbar-logout-btn svg {
  width: 16px;
  height: 16px;
}

body[data-active-view="projectDetailsViewPanel"] .app-topbar,
body[data-active-view="clientProjectDetailsView"] .app-topbar {
  padding-top: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

body[data-active-view="projectDetailsViewPanel"] .app-title,
body[data-active-view="clientProjectDetailsView"] .app-title {
  font-size: clamp(28px, 2.25vw, 40px);
}

/* =========================
   Mode Switcher
   ========================= */

.app-mode-switcher {
  padding: 12px;
  border: 1px solid rgba(42, 167, 184, 0.20);
  border-radius: 26px;
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 251, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), var(--sf-shadow-sm);
}

.app-mode-option {
  width: 100%;
  min-height: 66px;
  padding: 12px 13px;
  border: 1px solid rgba(133, 170, 184, 0.26);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: rgba(7, 39, 65, 0.72);
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--sf-shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.app-mode-option:hover {
  transform: translateY(-1px);
  color: var(--sf-accent-deep);
  border-color: rgba(42, 167, 184, 0.34);
  box-shadow: var(--sf-shadow-sm);
}

.app-mode-option.is-active {
  color: #fff;
  background: var(--sf-accent-gradient);
  border-color: rgba(42, 167, 184, 0.32);
  box-shadow: var(--sf-shadow-accent);
}

.app-mode-option[data-mode-switch="client"].is-active {
  background: var(--sf-warm-gradient);
  border-color: rgba(249, 115, 22, 0.32);
  box-shadow: var(--sf-shadow-warm);
}

.app-mode-option svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 15px;
  color: var(--sf-accent);
  background: rgba(42, 167, 184, 0.12);
}

.app-mode-option.is-active svg {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.app-mode-option span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.app-mode-option strong {
  font-size: 15px;
  line-height: 1.05;
  font-weight: 950;
}

.app-mode-option small {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 850;
  opacity: 0.78;
}

/* =========================
   Headings / Sections
   ========================= */

.workspace-panel-head,
.section-head-compact,
.project-section-toolbar,
.scope-breakdown-head,
.intelligence-section-head {
  position: relative;
  margin: 0 0 20px;
  padding: 0 0 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.workspace-panel-head::after,
.section-head-compact::after,
.project-section-toolbar::after,
.scope-breakdown-head::after,
.intelligence-section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sf-divider);
}

.workspace-panel-head h2 {
  margin-top: 8px;
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1.04;
}

.workspace-panel-head p,
.scope-breakdown-head p,
.intelligence-section-copy p,
.analytics-card-copy,
.client-chart-card p {
  margin-top: 10px;
  color: var(--sf-muted);
  font-size: 15px;
  line-height: 1.65;
}

.section-head-compact h3,
.project-section-toolbar h3,
.split-details-head h4 {
  font-size: clamp(20px, 1.8vw, 25px);
  line-height: 1.12;
}

.client-hero-copy h3,
.scope-breakdown-head h3,
.intelligence-section-copy h3,
.project-details-header h3 {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.06;
}

.section-head-note {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(52, 138, 220, 0.18);
  border-radius: var(--sf-pill);
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: var(--sf-accent-gradient);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: var(--sf-shadow-accent);
}

/* =========================
   Surfaces / Cards
   ========================= */

.workspace-panel {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-top: var(--sf-gap);
  padding: clamp(18px, 2vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 34px;
  background:
    radial-gradient(circle at 96% 0%, rgba(122, 215, 223, 0.16), transparent 28%),
    radial-gradient(circle at 2% 100%, rgba(255, 187, 0, 0.10), transparent 24%),
    rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 46px rgba(7, 39, 65, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.analytics-shell-panel {
  background:
    radial-gradient(circle at top right, rgba(42, 167, 184, 0.20), transparent 30%),
    radial-gradient(circle at bottom left, rgba(255, 187, 0, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 248, 251, 0.58));
}

.workspace-panel-body {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.workspace-info,
.dashboard-card,
.project-card,
.change-card,
.analytics-card,
.client-chart-card,
.client-progress-card,
.analytics-mini,
.split-details,
.sf-modal-card,
.pro-log-card,
.scope-breakdown-card,
.scope-breakdown-highlight,
.client-hero-card,
.intelligence-card,
.intelligence-shell,
.intelligence-priority-card,
.scope-breakdown-shell {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-xl);
  box-shadow: var(--sf-shadow-md);
}

.workspace-info {
  position: relative;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 250, 0.94));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.workspace-info:hover,
.dashboard-card:hover,
.project-card:hover,
.scope-breakdown-card:hover,
.intelligence-card:hover,
.analytics-card:hover,
.client-chart-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sf-shadow-lg);
}

.workspace-info-warm {
  border-color: rgba(255, 187, 0, 0.28);
  background:
    radial-gradient(circle at top right, rgba(255, 187, 0, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 248, 250, 0.94));
  box-shadow: var(--sf-shadow-warm);
}

.workspace-info p,
.workspace-info li {
  color: var(--sf-muted);
  font-size: 16px;
  line-height: 1.7;
}

.workspace-info ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.workspace-info + .workspace-info,
.workspace-info + .details-bottom-stack,
.details-bottom-stack + .workspace-info,
.details-bottom-stack + .details-bottom-stack {
  margin-top: 8px;
}

.empty-state-card {
  padding: 20px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-lg);
  color: var(--sf-muted);
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--sf-shadow-sm);
}

.empty-state-card strong {
  display: block;
  color: var(--sf-title);
  font-size: 18px;
  font-weight: 950;
}

.empty-state-card p {
  margin-top: 10px;
}

/* =========================
   Dashboard
   ========================= */

.dashboard-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sf-gap);
  margin-top: var(--sf-gap);
  align-items: stretch;
}

.dashboard-card {
  position: relative;
  overflow: hidden;
  grid-column: span 4;
  min-height: 205px;
  padding: var(--sf-card-pad);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 215, 223, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 251, 0.94));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
}

.dashboard-card:nth-child(2n)::before,
.dashboard-card:nth-child(5n)::before {
  background: var(--sf-warm-gradient);
}

.dashboard-card-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--sf-accent-gradient);
  box-shadow: var(--sf-shadow-accent);
  flex: 0 0 auto;
}

.dashboard-card-icon-warm {
  background: var(--sf-warm-gradient);
  box-shadow: var(--sf-shadow-warm);
}

.dashboard-card-icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-card-label {
  display: block;
  color: var(--sf-faint);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-card-value {
  display: block;
  margin-top: 10px;
  color: var(--sf-title);
  font-size: clamp(30px, 2.7vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 950;
}

.dashboard-card-note {
  display: block;
  max-width: 36ch;
  margin-top: auto;
  padding-top: 10px;
  color: var(--sf-muted);
  font-size: 15px;
  line-height: 1.55;
}

/* =========================
   Projects / Cards / Badges
   ========================= */

.projects-list,
.recent-changes-list,
.project-changes-list,
.audit-pro-list,
.request-pro-list {
  display: grid;
  gap: var(--sf-gap);
}

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

.project-card,
.change-card {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 1.8vw, 28px);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.95));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card::before,
.change-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
}

.project-card.is-selected {
  outline: 2px solid rgba(42, 167, 184, 0.22);
  border-color: var(--sf-border-strong);
  box-shadow: 0 24px 58px rgba(42, 167, 184, 0.14);
}

.project-card-head,
.change-card-head,
.project-details-header,
.pro-log-head,
.split-details-head,
.scope-breakdown-card-head,
.intelligence-card-head,
.analytics-card-head,
.client-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-card h3 {
  font-size: clamp(23px, 2vw, 30px);
  line-height: 1.08;
}

.project-card-subline {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--sf-muted);
  font-size: 14px;
}

.project-card-subline span:not(.pro-badge):not(.status-pill) {
  font-weight: 700;
}

.status-pill,
.pro-badge,
.intelligence-level-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--sf-pill);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), var(--sf-shadow-xs);
}

.status-pill {
  min-height: 29px;
  padding: 5px 10px;
  color: #fff;
  background: var(--sf-accent-gradient);
  border: 1px solid rgba(42, 167, 184, 0.20);
  font-size: 12px;
  text-transform: lowercase;
}

.pro-badge {
  padding: 7px 11px;
  border: 1px solid transparent;
  font-size: 0.82rem;
}

.pro-badge-neutral {
  color: #fff;
  background: var(--sf-accent-gradient);
  border-color: rgba(42, 167, 184, 0.25);
}

.pro-badge-warning {
  color: #fff;
  background: var(--sf-warm-gradient);
  border-color: rgba(255, 187, 0, 0.34);
}

.pro-badge-success {
  color: #fff;
  background: var(--sf-success-gradient);
  border-color: rgba(31, 184, 116, 0.30);
}

.pro-badge-danger {
  color: #fff;
  background: var(--sf-danger-gradient);
  border-color: rgba(239, 68, 68, 0.30);
}

.project-card-actions-row {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.project-card-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.project-card .mini-stat {
  grid-column: span 2;
}

.project-card-grid-compact {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat,
.overview-item {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(133, 170, 184, 0.26);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.10), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
  box-shadow: var(--sf-shadow-xs);
}

.mini-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
}

.mini-stat span,
.overview-item span,
.analytics-mini span {
  display: block;
  color: var(--sf-faint);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-stat strong,
.overview-item strong,
.analytics-mini strong {
  display: block;
  margin-top: 8px;
  color: var(--sf-title);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.project-scope-preview {
  position: relative;
  margin-top: 16px;
  max-height: 140px;
  overflow: hidden;
  padding: 15px 16px;
  border: 1px solid rgba(133, 170, 184, 0.28);
  border-radius: var(--sf-radius-md);
  color: var(--sf-muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 251, 0.68));
  line-height: 1.65;
  white-space: pre-wrap;
}

.project-scope-preview-full {
  margin-top: 0;
  max-height: none;
}

.project-overview-grid,
.project-inline-meta,
.overview-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

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

.project-inline-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =========================
   Project Details / Tabs
   ========================= */

#projectDetailsView,
#clientProjectDetailsContent {
  width: 100%;
  max-width: none;
  margin: 0;
}

.project-details-view,
.project-details-shell {
  display: grid;
  gap: 14px;
}

.project-sticky-head {
  position: sticky;
  top: 84px;
  z-index: 70;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--sf-border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 215, 223, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 250, 0.86));
  box-shadow: var(--sf-shadow-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.project-details-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

#detailsProjectName,
#clientDetailsProjectName {
  margin-bottom: 5px;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.02;
}

.project-details-header .project-card-subline {
  margin-top: 6px;
}

.project-details-header .project-card-actions-row {
  margin-top: 0;
  align-items: center;
}

.project-details-header .btn {
  min-height: 46px;
  padding-inline: 18px;
  border-radius: 16px;
}

.active-project-hint,
#clientDetailsOwnerMeta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  margin-top: 10px;
  padding: 6px 11px;
  border: 1px solid rgba(42, 167, 184, 0.20);
  border-radius: var(--sf-pill);
  color: var(--sf-accent-deep);
  background: var(--sf-accent-soft);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-active-view="projectDetailsViewPanel"] .workspace-panel,
body[data-active-view="clientProjectDetailsView"] .workspace-panel {
  margin-top: 8px;
}

body[data-active-view="projectDetailsViewPanel"] #projectDetailsSection > .workspace-panel-head,
body[data-active-view="clientProjectDetailsView"] #clientProjectDetailsView > .workspace-panel > .workspace-panel-head {
  display: none;
}

.sf-project-metrics-disclosure {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-lg);
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 215, 223, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(239, 248, 250, 0.64));
  box-shadow: var(--sf-shadow-sm);
}

.sf-project-metrics-disclosure summary {
  min-height: 68px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.sf-project-metrics-disclosure summary::-webkit-details-marker {
  display: none;
}

.sf-project-metrics-disclosure summary span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sf-project-metrics-disclosure summary strong {
  color: var(--sf-title);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 950;
}

.sf-project-metrics-disclosure summary small {
  color: var(--sf-muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.sf-project-metrics-disclosure summary em {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--sf-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--sf-accent-gradient);
  font-style: normal;
  font-size: 12px;
  font-weight: 950;
  box-shadow: var(--sf-shadow-accent);
}

.sf-project-metrics-disclosure[open] summary em {
  background: var(--sf-warm-gradient);
  font-size: 0;
}

.sf-project-metrics-disclosure[open] summary em::after {
  content: "Zwiń";
  font-size: 12px;
}

.sf-project-metrics-disclosure .project-card-grid-compact {
  padding: 0 18px 18px;
}

.sf-tabs {
  width: 100%;
  padding: 5px;
  border: 1px solid rgba(133, 170, 184, 0.22);
  border-radius: var(--sf-radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  background: linear-gradient(180deg, rgba(218, 223, 228, 0.18), rgba(255, 255, 255, 0.34));
}

.sf-tab-btn {
  position: relative;
  flex: 1 1 0;
  min-width: max-content;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(133, 170, 184, 0.34);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--sf-muted);
  background: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sf-tab-btn:hover {
  transform: translateY(-1px);
  color: var(--sf-accent-deep);
  background: rgba(255, 255, 255, 0.96);
}

.sf-tab-btn.is-active {
  color: #fff;
  background: var(--sf-accent-gradient);
  border-color: rgba(42, 167, 184, 0.24);
  box-shadow: var(--sf-shadow-accent);
}

.sf-tab-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--sf-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--sf-warm-gradient);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.sf-tab-btn.is-active .sf-tab-count {
  color: var(--sf-warm-deep);
  background: #fff;
}

/* =========================
   Split Views / Decisions
   ========================= */

.details-bottom-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.split-view,
.split-view-solo {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 1fr);
  gap: var(--sf-gap);
  align-items: stretch;
}

.split-list {
  min-width: 0;
  max-height: min(66vh, 680px);
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 10px;
}

.split-details {
  min-width: 0;
  min-height: min(66vh, 680px);
  padding: clamp(18px, 1.5vw, 24px);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.95));
}

.split-list-item {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(133, 170, 184, 0.26);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.split-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 167, 184, 0.28);
  box-shadow: var(--sf-shadow-sm);
}

.split-list-item.is-active {
  border-color: rgba(42, 167, 184, 0.34);
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(240, 250, 252, 0.98), rgba(245, 248, 252, 0.96));
  box-shadow: 0 12px 26px rgba(42, 167, 184, 0.10);
}

.split-list-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.split-list-item.is-active::before {
  opacity: 1;
}

.split-list-item-title {
  color: var(--sf-title);
  font-size: 15.5px;
  font-weight: 950;
  line-height: 1.25;
}

.split-list-item-meta,
.split-details-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--sf-muted);
  font-size: 13px;
}

.split-list-item-sub {
  margin-top: 8px;
  color: var(--sf-muted);
  font-size: 13px;
  line-height: 1.45;
}

.split-details-head {
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.split-details-head h4 {
  font-size: clamp(22px, 2vw, 30px);
}

.split-details-section {
  margin-top: 12px;
}

.split-details-section-title,
.before-after-box span,
.reason-box span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: var(--sf-pill);
  color: #fff;
  background: var(--sf-accent-gradient);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.split-details-description,
.before-after-box,
.reason-box {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(133, 170, 184, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.92));
  box-shadow: var(--sf-shadow-xs);
}

.split-details-description,
.before-after-box p,
.reason-box p {
  color: var(--sf-text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.before-after-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.reason-box {
  border-color: rgba(255, 187, 0, 0.24);
  background:
    radial-gradient(circle at top right, rgba(255, 187, 0, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.98), rgba(255, 244, 221, 0.94));
}

.reason-box span {
  background: var(--sf-warm-gradient);
}

.decision-note-box,
.change-card-actions,
.split-decision-box {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.decision-note-box label,
.split-decision-box label {
  font-size: 14px;
  font-weight: 850;
}

.decision-note-box textarea,
.split-decision-box textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  color: var(--sf-text);
  background: rgba(255, 255, 255, 0.95);
  resize: vertical;
}

.change-card-actions,
.split-decision-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.change-row {
  padding: 17px 18px;
  border: 1px solid var(--sf-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--sf-shadow-sm);
}

.change-row-main {
  display: grid;
  gap: 6px;
}

.change-row-main strong {
  font-size: 17px;
}

.change-row-main span,
.change-row-meta {
  color: var(--sf-muted);
  font-size: 14px;
}

.change-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   Client / Account Assignment
   ========================= */

.project-client-box {
  margin-top: 20px;
}

.assigned-client-info {
  padding: 15px 16px;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-md);
  color: var(--sf-muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 248, 251, 0.68));
}

.assigned-client-info strong {
  display: block;
  color: var(--sf-title);
  font-size: 17px;
}

.assigned-client-info p {
  margin-top: 8px;
}

.assign-client-form {
  margin-top: 16px;
}

.client-divider {
  height: 1px;
  margin: 22px 0 18px;
  background: var(--sf-divider);
}

.assign-client-subsection h4 {
  font-size: 18px;
  line-height: 1.2;
}

.assign-client-copy {
  margin-top: 10px;
  font-size: 15px;
}

/* =========================
   Taxonomy Controls
   ========================= */

.taxonomy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: stretch;
}

.taxonomy-plus-btn {
  width: 48px;
  min-width: 48px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(42, 167, 184, 0.24);
  border-radius: 17px;
  color: var(--sf-accent-strong);
  background: linear-gradient(180deg, rgba(240, 250, 252, 0.98), rgba(247, 250, 252, 0.94));
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--sf-shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.taxonomy-plus-btn:hover {
  transform: translateY(-1px);
  color: var(--sf-accent);
  border-color: rgba(42, 167, 184, 0.38);
  box-shadow: var(--sf-shadow-sm);
}

.taxonomy-inline-wrap {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(42, 167, 184, 0.18);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(240, 250, 252, 0.98), rgba(247, 250, 252, 0.94));
}

.taxonomy-inline-wrap input {
  width: 100%;
}

/* =========================
   Audit Logs
   ========================= */

.pro-log-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.95));
}

.pro-log-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--sf-accent-gradient);
}

.pro-log-head {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pro-log-head h4 {
  font-size: 1rem;
}

.pro-log-meta {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--sf-muted);
  font-size: 0.92rem;
}

/* =========================
   Analytics / Charts
   ========================= */

.analytics-summary-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analytics-mini {
  position: relative;
  overflow: hidden;
  height: 100%;
  padding: 17px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.94));
}

.analytics-mini::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
}

.analytics-mini:nth-child(2n)::before {
  background: var(--sf-warm-gradient);
}

.analytics-mini strong {
  font-size: 1.25rem;
}

.analytics-grid,
.client-dashboard-grid {
  width: 100%;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sf-gap);
}

.analytics-card,
.client-chart-card {
  grid-column: span 6;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.94));
  animation: sfFadeUp 0.45s ease both;
}

.analytics-card.wide,
.client-chart-card.wide {
  grid-column: span 12;
}

.analytics-card-head {
  margin-bottom: 14px;
}

.analytics-card-head h3,
.client-chart-card h3 {
  font-size: 1.08rem;
}

.analytics-canvas-wrap,
.client-chart-wrap {
  position: relative;
  min-height: 310px;
}

.analytics-canvas-wrap canvas,
.client-chart-wrap canvas {
  width: 100% !important;
  height: 310px !important;
}

/* =========================
   Client Dashboard
   ========================= */

.client-hero-card {
  padding: clamp(22px, 2.4vw, 34px);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.22), transparent 32%),
    radial-gradient(circle at bottom left, rgba(255, 187, 0, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.96));
  box-shadow: var(--sf-shadow-lg);
}

.client-hero-top {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.client-hero-copy h3 {
  font-size: clamp(30px, 3vw, 46px);
}

.client-hero-copy p {
  margin-top: 14px;
  max-width: 820px;
  font-size: 18px;
}

.client-hero-card .analytics-summary-row {
  margin-top: 16px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.client-hero-card .analytics-mini {
  min-height: 110px;
  padding: 18px 20px;
  border-radius: var(--sf-radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.client-hero-card .analytics-mini strong {
  margin-top: 8px;
  font-size: 1.8rem;
  line-height: 1;
}

.client-progress-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.client-progress-card {
  height: 100%;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
}

.client-progress-head {
  margin-bottom: 12px;
  align-items: center;
}

.client-progress-head strong {
  font-size: 1.08rem;
  line-height: 1.2;
}

.client-progress-meta {
  color: var(--sf-muted);
  font-size: 0.98rem;
  font-weight: 850;
}

.client-progress-bar,
.scope-progress-bar {
  position: relative;
  width: 100%;
  height: 14px;
  margin-bottom: 12px;
  border-radius: var(--sf-pill);
  overflow: hidden;
  background: rgba(133, 170, 184, 0.24);
}

.client-progress-fill,
.scope-progress-fill {
  height: 100%;
  border-radius: var(--sf-pill);
  transition: width 0.35s ease;
}

.client-progress-fill-cost,
.scope-progress-fill-warm {
  background: var(--sf-warm-gradient);
}

.client-progress-fill-hours,
.scope-progress-fill-cool {
  background: var(--sf-accent-gradient);
}

.client-progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--sf-muted);
  font-size: 0.96rem;
}

#clientDashboardView .dashboard-card {
  grid-column: span 4;
  min-height: 210px;
}

#clientDashboardProjectSelect {
  width: 100%;
  min-height: 56px;
  appearance: none;
  padding: 14px 52px 14px 16px;
  border: 1px solid rgba(133, 170, 184, 0.32);
  border-radius: 19px;
  color: var(--sf-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
  font-weight: 750;
  box-shadow: var(--sf-shadow-sm);
  cursor: pointer;
}

.form-group:has(#clientDashboardProjectSelect) {
  position: relative;
}

.form-group:has(#clientDashboardProjectSelect)::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 2px solid rgba(15, 23, 42, 0.48);
  border-bottom: 2px solid rgba(15, 23, 42, 0.48);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

/* =========================
   Intelligence / Breakdown
   ========================= */

.intelligence-stack {
  margin-top: var(--sf-gap);
  display: grid;
  gap: 20px;
}

.intelligence-shell,
.intelligence-priority-card,
.scope-breakdown-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2vw, 30px);
  border-radius: 34px;
}

.intelligence-shell,
.scope-breakdown-shell,
.intelligence-priority-card {
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.22), transparent 34%),
    radial-gradient(circle at bottom left, rgba(255, 187, 0, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.96));
}

.intelligence-kicker {
  min-height: 35px;
  padding: 7px 12px;
  border: 1px solid rgba(52, 138, 220, 0.18);
  border-radius: var(--sf-pill);
  color: #fff;
  background: var(--sf-accent-gradient);
  box-shadow: var(--sf-shadow-accent);
}

.intelligence-grid,
.intelligence-loading-grid,
.scope-breakdown-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sf-gap);
}

.intelligence-card,
.scope-breakdown-card {
  position: relative;
  overflow: hidden;
  padding: 21px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.96));
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.intelligence-card::before,
.scope-breakdown-card::before,
.intelligence-priority-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: var(--sf-pill);
  background: var(--sf-accent-gradient);
}

.intelligence-card-head {
  margin-bottom: 16px;
}

.intelligence-card-head h3 {
  font-size: 18px;
  line-height: 1.2;
}

.intelligence-score-box {
  min-width: 88px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.intelligence-score,
.scope-breakdown-percent {
  color: var(--sf-title);
  font-size: 34px;
  line-height: 0.95;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.intelligence-level-pill {
  min-height: 30px;
  padding: 5px 11px;
  color: #fff;
  font-size: 12px;
}

.intelligence-level-pill.is-stable { background: var(--sf-success-gradient); }
.intelligence-level-pill.is-watch { background: var(--sf-warm-gradient); }
.intelligence-level-pill.is-risk { background: var(--sf-accent-gradient); }
.intelligence-level-pill.is-critical { background: var(--sf-danger-gradient); }

.intelligence-headline {
  color: var(--sf-text);
  font-size: 15px;
  line-height: 1.68;
}

.intelligence-metrics {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.intelligence-metric-row,
.scope-subcategory-row {
  padding: 11px 13px;
  border: 1px solid var(--sf-border-soft);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, rgba(218, 223, 228, 0.12), rgba(255, 255, 255, 0.72));
}

.intelligence-metric-row span,
.scope-subcategory-row span {
  color: var(--sf-muted);
  font-size: 14px;
}

.intelligence-metric-row strong,
.scope-subcategory-row strong {
  color: var(--sf-title);
  font-size: 14px;
  font-weight: 900;
}

.intelligence-recommendation {
  position: relative;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid rgba(255, 187, 0, 0.24);
  border-radius: var(--sf-radius-md);
  background:
    radial-gradient(circle at top right, rgba(255, 187, 0, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.98), rgba(255, 244, 221, 0.92));
  box-shadow: var(--sf-shadow-xs);
}

.intelligence-recommendation span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: var(--sf-pill);
  color: #fff;
  background: var(--sf-warm-gradient);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intelligence-recommendation p {
  color: var(--sf-text);
}

.intelligence-toggle-btn {
  margin-top: 12px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 187, 0, 0.36);
  border-radius: var(--sf-pill);
  color: #fff;
  background: var(--sf-warm-gradient);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--sf-shadow-warm);
}

.scope-breakdown-shell {
  margin-top: var(--sf-gap);
}

.scope-breakdown-head p {
  max-width: 760px;
}

.scope-breakdown-highlight {
  min-width: 220px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 187, 0, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 246, 230, 0.94));
}

.scope-breakdown-highlight span {
  display: block;
  color: var(--sf-accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scope-breakdown-highlight strong {
  display: block;
  margin-top: 10px;
  color: var(--sf-title);
  font-size: 20px;
  line-height: 1.15;
}

.scope-breakdown-highlight em {
  display: block;
  margin-top: 8px;
  color: var(--sf-title);
  font-size: 30px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.scope-breakdown-card-head {
  margin-bottom: 14px;
}

.scope-breakdown-card-head h4 {
  color: var(--sf-title);
  font-size: 18px;
  line-height: 1.2;
}

.scope-breakdown-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--sf-muted);
  font-size: 13px;
}

.scope-progress-bar {
  margin-bottom: 0;
}

.scope-subcategory-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

/* =========================
   Modals
   ========================= */

.sf-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sf-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sf-modal-card {
  width: min(100%, 520px);
  padding: 24px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(122, 215, 223, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 248, 250, 0.96));
  box-shadow: 0 34px 92px rgba(15, 23, 42, 0.24), 0 10px 28px rgba(15, 23, 42, 0.10);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s ease;
}

.sf-modal.is-open .sf-modal-card {
  transform: translateY(0) scale(1);
}

.sf-modal-kicker {
  margin-bottom: 8px;
  color: var(--sf-danger);
}

.sf-modal-card h3 {
  margin-bottom: 10px;
  font-size: 1.38rem;
}

.sf-modal-card > p {
  margin-bottom: 18px;
}

.sf-modal-project-box {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--sf-radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 248, 250, 0.72));
}

.sf-modal-project-box strong {
  display: block;
  margin-bottom: 6px;
}

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

.sf-modal-card-wide,
#editProjectModal .sf-modal-card {
  width: min(100%, 840px) !important;
  max-height: min(92vh, 900px);
  overflow: auto;
}

#changeRequestModal .sf-modal-card-wide {
  max-height: min(88vh, 920px);
}

/* =========================
   Skeletons
   ========================= */

.skeleton-card {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  border: 1px solid var(--sf-border-soft);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 250, 0.92));
}

.skeleton-card::after,
.skeleton-line::after,
.skeleton-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.55) 55%, transparent 100%);
  transform: translateX(-120%);
  animation: sfSkeletonSweep 1.4s linear infinite;
}

.skeleton-pad { padding: 18px; }
.skeleton-stack { display: grid; gap: 12px; }

.skeleton-line,
.skeleton-pill {
  position: relative;
  overflow: hidden;
  background: rgba(218, 223, 228, 0.5);
}

.skeleton-line {
  height: 14px;
  border-radius: var(--sf-pill);
}

.skeleton-line.lg { height: 20px; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-30 { width: 30%; }

.skeleton-pill {
  width: 96px;
  height: 28px;
  border-radius: var(--sf-pill);
}

.skeleton-grid-2,
.skeleton-grid-3 {
  display: grid;
  gap: 14px;
}

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

.split-details.is-loading {
  min-height: 300px;
}

/* =========================
   Animations
   ========================= */

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

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

@keyframes sfSkeletonSweep {
  to { transform: translateX(120%); }
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1440px) {
  .projects-list { grid-template-columns: 1fr; }

  .project-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-card .mini-stat { grid-column: span 1; }
}

@media (max-width: 1320px) {
  .project-card-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .dashboard-card,
  #dashboardView .dashboard-card,
  #clientDashboardView .dashboard-card {
    grid-column: span 6;
  }

  .split-view,
  .split-view-solo {
    grid-template-columns: minmax(280px, 0.44fr) minmax(0, 1fr);
  }

  .client-hero-card .analytics-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .auth-layout,
  .workspace-panel-body,
  .split-view,
  .split-view-solo {
    grid-template-columns: 1fr;
  }

  .split-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .split-details {
    min-height: auto;
  }
}

@media (max-width: 980px) {
  .app-topbar { top: var(--sf-mobile-header-height); }
  .app-topbar-shell { align-items: center; }

  .topbar-logout-btn span { display: none; }
  .topbar-logout-btn { width: 42px; min-width: 42px; padding: 0; }

  .analytics-card,
  .analytics-card.wide,
  .client-chart-card,
  .client-chart-card.wide {
    grid-column: span 12;
  }

  .analytics-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .project-card-grid,
  .form-grid,
  .project-card-grid-compact,
  .before-after-grid,
  .project-inline-meta,
  .project-overview-grid,
  .scope-breakdown-list,
  .intelligence-grid,
  .intelligence-loading-grid {
    grid-template-columns: 1fr;
  }

  .project-details-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .project-card-actions-row { justify-content: stretch; }
  .project-card-actions-row .btn { width: 100%; }

  .project-sticky-head { position: static; }

  .list-scroll-zone,
  .list-scroll-zone-md,
  .list-scroll-zone-lg {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .client-progress-grid { grid-template-columns: 1fr; }

  .sf-tabs { justify-content: flex-start; }
  .sf-tab-btn { flex: 0 0 auto; }
}

@media (max-width: 860px) {
  body:has(#mobileNavToggle:checked) { overflow: hidden; }

  .mobile-app-header { display: flex; }
  .mobile-nav-backdrop { display: block; }

  .app-shell {
    display: block;
    min-height: calc(100vh - var(--sf-mobile-header-height));
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1500;
    width: min(92vw, 360px);
    max-width: calc(100vw - 18px);
    height: 100vh;
    padding: 18px 16px;
    transform: translateX(-104%);
    transition: transform 0.25s ease;
    box-shadow: 30px 0 70px rgba(7, 39, 65, 0.18);
  }

  .mobile-nav-toggle:checked ~ .app-shell .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-logo { height: 32px; }
  .sidebar-link { min-height: 48px; }
  .sidebar-link span { font-size: 14px; overflow-wrap: anywhere; }

  .app-main { padding: 14px; }
  .app-topbar { display: none; }

  .workspace-panel {
    margin-top: 14px;
    padding: 15px;
    border-radius: 26px;
  }

  .workspace-panel-head,
  .section-head-compact,
  .project-section-toolbar,
  .scope-breakdown-head,
  .intelligence-section-head {
    margin-bottom: 15px;
    padding-bottom: 12px;
  }

  .workspace-panel-head h2,
  .client-hero-copy h3,
  .scope-breakdown-head h3,
  .intelligence-section-copy h3,
  .project-details-header h3 {
    font-size: 24px;
    line-height: 1.08;
  }

  .dashboard-grid,
  #clientDashboardView .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 14px;
  }

  .dashboard-card,
  #dashboardView .dashboard-card,
  #clientDashboardView .dashboard-card {
    grid-column: span 1;
    min-height: auto;
    padding: 17px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
  }

  .dashboard-card-icon {
    grid-row: span 3;
    width: 46px;
    height: 46px;
    margin-bottom: 0;
    border-radius: 15px;
  }

  .dashboard-card-value {
    margin-top: 4px;
    font-size: 28px !important;
  }

  .dashboard-card-note {
    margin-top: 6px;
    padding-top: 0;
    font-size: 13.5px;
  }

  #clientDashboardView .dashboard-grid .dashboard-card:nth-child(n + 7) {
    display: none;
  }

  .workspace-info,
  .intelligence-shell,
  .intelligence-priority-card,
  .scope-breakdown-shell,
  .client-hero-card {
    padding: 18px;
    border-radius: 24px;
  }

  .project-card,
  .change-card {
    padding: 17px;
    border-radius: 25px;
  }

  .project-card-head,
  .project-details-header,
  .change-card-head {
    display: grid;
    gap: 14px;
  }

  .project-card h3,
  .project-details-header h3 {
    font-size: 22px;
  }

  .project-card-grid,
  .project-card-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stat {
    min-height: 92px;
    padding: 13px;
    border-radius: 18px;
  }

  .project-sticky-head {
    position: static;
    padding: 13px;
    border-radius: 22px;
    gap: 10px;
  }

  #detailsProjectName,
  #clientDetailsProjectName {
    font-size: 24px;
  }

  .sf-project-metrics-disclosure summary {
    min-height: 50px;
    padding: 10px 14px;
  }

  .sf-project-metrics-disclosure summary strong { font-size: 15px; }
  .sf-project-metrics-disclosure summary small { font-size: 12.5px; }

  .sf-tabs {
    width: calc(100% + 4px);
    margin-inline: -2px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 5px;
    scroll-snap-type: x mandatory;
  }

  .sf-tab-btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 13px;
    font-size: 14px;
    scroll-snap-align: start;
  }

  .split-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 12px;
    padding: 2px 2px 12px;
    scroll-snap-type: x mandatory;
  }

  .split-list-item {
    min-width: min(86vw, 350px);
    scroll-snap-align: start;
  }

  .split-details {
    padding: 15px;
  }

  .before-after-grid { grid-template-columns: 1fr; }

  .before-after-box,
  .reason-box,
  .split-details-description {
    padding: 13px;
    border-radius: 17px;
  }

  .intelligence-card {
    min-width: min(82vw, 360px);
    padding: 17px;
    border-radius: 22px;
    scroll-snap-align: start;
  }

  .intelligence-card-head h3 { font-size: 16px; }
  .intelligence-score { font-size: 28px; }
  .intelligence-score-box { min-width: 70px; }

  .intelligence-headline,
  .intelligence-recommendation p,
  .intelligence-metric-row span,
  .intelligence-metric-row strong {
    font-size: 13px;
  }

  .intelligence-recommendation {
    max-height: 126px;
    overflow: hidden;
  }

  .intelligence-recommendation.is-expanded {
    max-height: none;
  }

  .analytics-summary-row,
  .client-hero-card .analytics-summary-row,
  .client-progress-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .analytics-grid,
  .client-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .analytics-card,
  .analytics-card.wide,
  .client-chart-card,
  .client-chart-card.wide {
    grid-column: span 1;
    padding: 18px;
    border-radius: 24px;
  }

  .analytics-canvas-wrap,
  .client-chart-wrap {
    min-height: 250px;
  }

  .analytics-canvas-wrap canvas,
  .client-chart-wrap canvas {
    height: 250px !important;
  }

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

  .form-actions,
  .sf-modal-actions,
  .project-card-actions-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-actions .btn,
  .sf-modal-actions .btn,
  .project-card-actions-row .btn {
    width: 100%;
  }

  .form-group input,
  .form-group select {
    min-height: 50px;
  }

  .btn {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
  }

  .client-hero-copy h3 { font-size: 27px; }
  .client-hero-copy p { font-size: 15px; }

  .sf-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .sf-modal-card {
    width: 100% !important;
    max-height: 92vh;
    overflow: auto;
    padding: 20px;
    border-radius: 28px 28px 18px 18px;
  }
}

@media (max-width: 640px) {
  .auth-layout {
    width: min(calc(100% - 24px), 1200px);
    padding: 12px 0;
  }

  .auth-panel-brand,
  .auth-panel-form {
    padding: 20px;
  }

  .auth-panel-brand h1 { font-size: 36px; }
  .auth-panel-brand p { font-size: 17px; }
  .auth-heading h2 { font-size: 32px; }

  .taxonomy-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .taxonomy-plus-btn {
    width: 44px;
    min-width: 44px;
    height: 50px;
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .app-sidebar { width: min(94vw, 350px); }
  .mobile-view-meta strong { max-width: 56vw; font-size: 16px; }
  .app-main { padding: 12px; }
  .workspace-panel { padding: 12px; border-radius: 23px; }

  .dashboard-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }

  .dashboard-card-icon {
    width: 42px;
    height: 42px;
  }

  .project-card-grid,
  .project-card-grid-compact {
    grid-template-columns: 1fr;
  }

  .mini-stat { min-height: auto; }
  .split-list-item { min-width: 86vw; }
  .intelligence-card,
  .intelligence-loading-grid .skeleton-card { min-width: 84vw; }

  .sf-project-metrics-disclosure summary {
    grid-template-columns: 1fr;
  }

  .sf-project-metrics-disclosure summary em {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .mobile-app-header { padding-inline: 10px; }
  .mobile-brand { width: 40px; height: 40px; border-radius: 15px; }
  .mobile-menu-btn { width: 42px; height: 42px; border-radius: 15px; }
  .dashboard-card-value { font-size: 23px !important; }

  .workspace-panel-head h2,
  .client-hero-copy h3,
  .scope-breakdown-head h3,
  .intelligence-section-copy h3,
  .project-details-header h3 {
    font-size: 22px;
  }
}

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

/* =========================
   PROJECTS VIEW — SINGLE PROJECT STATE
   ========================= */

.projects-list.projects-list-single {
  grid-template-columns: minmax(420px, 0.92fr) minmax(360px, 1fr);
  align-items: stretch;
}

.projects-list.projects-list-single .project-card {
  min-height: 100%;
}

.projects-companion-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: clamp(24px, 2.2vw, 34px);
  border-radius: 34px;
  border: 1px solid rgba(133, 170, 184, 0.28);
  background:
    radial-gradient(circle at 100% 0%, rgba(122, 215, 223, 0.24), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(255, 187, 0, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.94));
  box-shadow:
    0 22px 52px rgba(7, 39, 65, 0.078),
    0 8px 22px rgba(7, 39, 65, 0.042),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.projects-companion-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 58%, var(--accent-warm) 100%);
}

.projects-companion-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(42, 167, 184, 0.12);
  border: 1px solid rgba(42, 167, 184, 0.18);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.projects-companion-card h3 {
  max-width: 620px;
  margin-top: 18px;
  font-size: clamp(28px, 2.4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--title);
}

.projects-companion-card > p {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.7;
}

.projects-companion-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.projects-companion-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 248, 250, 0.76));
  border: 1px solid rgba(133, 170, 184, 0.24);
  box-shadow:
    0 12px 28px rgba(7, 39, 65, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.projects-companion-item > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(42, 167, 184, 0.18);
}

.projects-companion-item:nth-child(2) > span {
  background: linear-gradient(135deg, var(--add-green) 0%, var(--add-green-strong) 100%);
}

.projects-companion-item:nth-child(3) > span {
  background: var(--warm-gradient);
}

.projects-companion-item strong {
  display: block;
  color: var(--title);
  font-size: 17px;
  line-height: 1.18;
  font-weight: 950;
}

.projects-companion-item p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

.projects-companion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.projects-companion-actions .btn {
  min-height: 52px;
}

@media (max-width: 1440px) {
  .projects-list.projects-list-single {
    grid-template-columns: minmax(420px, 0.9fr) minmax(360px, 1fr);
  }
}

@media (max-width: 1120px) {
  .projects-list.projects-list-single {
    grid-template-columns: 1fr;
  }

  .projects-companion-card {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .projects-companion-card {
    padding: 18px;
    border-radius: 24px;
  }

  .projects-companion-card h3 {
    font-size: 24px;
  }

  .projects-companion-card > p {
    font-size: 14.5px;
  }

  .projects-companion-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .projects-companion-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .projects-list.projects-list-single {
    grid-template-columns: 1fr;
  }

  .projects-companion-item {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 14px;
  }

  .projects-companion-item > span {
    width: 34px;
    height: 34px;
    border-radius: 13px;
  }
}