:root {
  --bg: #180026;
  --bg-2: #250033;
  --panel: #100019;
  --panel-2: #21002e;
  --panel-3: #2c063c;
  --ink: #f6ecff;
  --muted: #bda7cb;
  --border: rgba(255, 255, 255, 0.11);
  --cyan: #28f4ff;
  --cyan-soft: rgba(40, 244, 255, 0.16);
  --pink: #ff4fd8;
  --orange: #ff9f32;
  --red: #ff1f3f;
  --green: #31d982;
  --blue: #38a8ff;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 79, 216, 0.16), transparent 32%),
    linear-gradient(135deg, #12001d 0%, #250034 54%, #07000d 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body[data-theme="light"] {
  --bg: #f5fbff;
  --bg-2: #e9f7ff;
  --panel: #ffffff;
  --panel-2: #f4f9ff;
  --panel-3: #e7f1ff;
  --ink: #142033;
  --muted: #5f6c82;
  --border: rgba(30, 48, 78, 0.16);
  --cyan: #008fa8;
  --cyan-soft: rgba(0, 143, 168, 0.14);
  --pink: #ca2f8f;
  --orange: #f08522;
  --red: #e70f32;
  --green: #139a62;
  --blue: #227ee8;
  --shadow: rgba(65, 84, 118, 0.18);
  background: linear-gradient(135deg, #eefcff 0%, #f7f3ff 48%, #fff8ed 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ui-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  position: relative;
  overflow: visible;
}

.icon-btn::after,
.side-dock.collapsed .dock-btn::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 80;
  width: max-content;
  max-width: 220px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid rgba(40, 244, 255, 0.35);
  color: #f6ecff;
  background: rgba(8, 0, 14, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.icon-btn:hover::after,
.icon-btn:focus-visible::after,
.side-dock.collapsed .dock-btn:hover::after,
.side-dock.collapsed .dock-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.estimate-actions .icon-btn::after {
  top: calc(100% + 8px);
  bottom: auto;
  transform: translate(-50%, -4px);
}

.estimate-actions .icon-btn:hover::after,
.estimate-actions .icon-btn:focus-visible::after {
  transform: translate(-50%, 0);
}

.screen {
  min-height: 100vh;
}

.login-screen {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
  align-items: stretch;
}

.brand-panel,
.auth-panel,
.app-panel,
.visual-container,
.side-dock,
.toolbar-container,
.mini-card {
  background: linear-gradient(145deg, rgba(31, 0, 44, 0.96), rgba(10, 0, 17, 0.94));
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px var(--shadow);
}

.brand-panel {
  border-radius: 8px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 30px;
  color: var(--cyan);
}

.brand-cube {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #12001d;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  box-shadow: 0 0 28px rgba(40, 244, 255, 0.28);
}

.brand-panel h1 {
  margin: 76px 0 18px;
  font-size: 48px;
  line-height: 1.02;
}

.brand-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.metric {
  min-height: 90px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 22px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.auth-panel {
  border-radius: 8px;
  padding: 26px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}

.tab-btn,
.toolbar-btn,
.dock-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.tab-btn:hover,
.toolbar-btn:hover,
.dock-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 244, 255, 0.48);
}

.tab-btn.active,
.toolbar-btn.active {
  color: #07111a;
  background: linear-gradient(135deg, var(--cyan), #7bffcf);
  border-color: transparent;
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  outline: 0;
  padding: 0 12px;
}

.field input:focus,
.field select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkline input {
  width: 16px;
  height: 16px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  color: #100019;
  font-weight: 900;
  border-color: transparent;
}

.secondary-btn {
  background: rgba(40, 244, 255, 0.13);
}

.danger-btn {
  background: rgba(255, 49, 85, 0.12);
  border-color: rgba(255, 49, 85, 0.32);
}

.ghost-btn {
  background: transparent;
}

.auth-note,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.legal-links a {
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.legal-links a:hover {
  text-decoration: underline;
}

.invite-banner {
  border-radius: 8px;
  border: 1px solid rgba(40, 244, 255, 0.35);
  background: var(--cyan-soft);
  padding: 12px;
  margin-bottom: 18px;
  color: var(--ink);
}

.app-screen {
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(11, 0, 18, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand-mark {
  font-size: 22px;
}

.topbar .brand-cube {
  width: 34px;
  height: 34px;
}

.search {
  flex: 1;
  max-width: 520px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 0 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #12001d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.app-layout.side-dock-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.main-stage {
  min-width: 0;
}

.welcome-card {
  min-height: calc(100vh - 106px);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 54px);
  background:
    linear-gradient(160deg, rgba(255, 79, 216, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(29, 0, 42, 0.96), rgba(5, 0, 11, 0.96));
  border: 1px solid var(--border);
}

.eyebrow {
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.welcome-card h1,
.section-title {
  margin: 12px 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.04;
}

.welcome-card p {
  width: min(700px, 100%);
  color: var(--muted);
  line-height: 1.65;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.mini-card {
  min-height: 130px;
  border-radius: 8px;
  padding: 18px;
}

.mini-card .value {
  font-size: 30px;
  font-weight: 900;
  color: var(--cyan);
  margin-top: 10px;
}

.side-dock {
  border-radius: 8px;
  padding: 14px;
  align-self: start;
  position: sticky;
  z-index: 30;
  top: 88px;
  min-height: calc(100vh - 106px);
  max-height: calc(100vh - 106px);
  overflow: visible;
}

.side-dock.collapsed {
  padding: 10px;
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 8px 8px 12px;
}

.dock-title-icon {
  display: grid;
  place-items: center;
  color: var(--cyan);
}

.dock-collapse-btn {
  flex: 0 0 auto;
}

.dock-actions {
  display: grid;
  gap: 10px;
}

.dock-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  position: relative;
  overflow: visible;
}

.dock-btn .ui-icon {
  color: var(--cyan);
}

.side-dock.collapsed .dock-title {
  justify-content: center;
  margin: 4px 0 12px;
}

.side-dock.collapsed .dock-label {
  display: none;
}

.side-dock.collapsed .dock-head {
  display: grid;
  justify-items: center;
}

.side-dock.collapsed .dock-btn,
.side-dock.collapsed .dock-collapse-btn {
  justify-content: center;
  width: 48px;
  min-width: 48px;
  padding: 0;
}

.side-dock.collapsed .dock-btn::after {
  left: calc(100% + 10px);
  top: 50%;
  bottom: auto;
  z-index: 120;
  transform: translate(-4px, -50%);
}

.side-dock.collapsed .dock-btn:hover::after,
.side-dock.collapsed .dock-btn:focus-visible::after {
  transform: translate(0, -50%);
}

.dock-btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}

.primary-btn[disabled],
.secondary-btn[disabled],
.danger-btn[disabled],
.ghost-btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.toolbar-container {
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.module-toolbar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.module-instruction-btn {
  flex: 0 0 auto;
  color: var(--cyan);
}

.toolbar-btn {
  padding: 0 14px;
}

.toolbar-btn.locked {
  opacity: 0.58;
  cursor: pointer;
}

.toolbar-btn.locked:hover {
  border-color: rgba(255, 77, 109, 0.65);
}

.visual-container {
  min-height: calc(100vh - 190px);
  border-radius: 8px;
  padding: 16px;
  overflow: hidden;
}

.visual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.visual-head h2 {
  margin: 0 0 4px;
}

.gantt-head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.year-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.year-picker select {
  min-height: 30px;
  border-radius: 8px;
  color: var(--ink);
  background: #14001f;
  border: 1px solid var(--border);
  padding: 0 8px;
  outline: 0;
}

.year-picker select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.gantt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.gantt-shell {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.gantt-months,
.gantt-weeks,
.gantt-row {
  display: grid;
  min-width: var(--timeline-width);
}

.gantt-header-wrap {
  display: grid;
  grid-template-columns: 230px 1fr;
  position: sticky;
  top: 0;
  z-index: 8;
  background: #12001d;
}

.gantt-left-head {
  display: grid;
  place-items: center;
  min-height: 82px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--cyan);
  font-weight: 900;
}

.gantt-months {
  grid-template-columns: repeat(var(--cols), minmax(var(--col-width), var(--col-width)));
}

.gantt-weeks {
  grid-template-columns: repeat(var(--cols), minmax(var(--col-width), var(--col-width)));
}

.month-cell,
.week-cell {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  padding: 4px;
}

.week-cell {
  color: var(--muted);
  min-height: 42px;
  font-weight: 700;
}

.gantt-shell.zoom-year .month-cell {
  min-height: 34px;
  font-size: 11px;
  padding: 3px;
}

.gantt-shell.zoom-year .week-cell {
  min-height: 32px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.gantt-shell.zoom-year .bar-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size:
    calc(var(--col-width) * 4) 100%,
    var(--col-width) 100%;
}

.gantt-row {
  grid-template-columns: 230px minmax(var(--timeline-width), 1fr);
  border-bottom: 1px solid var(--border);
}

.project-name-btn {
  width: 100%;
  min-height: 74px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(5, 0, 11, 0.75);
  border-right: 1px solid var(--border);
  cursor: pointer;
}

.project-name-btn strong {
  display: block;
  margin-bottom: 5px;
}

.project-name-btn span {
  color: var(--muted);
  font-size: 12px;
}

.bar-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(var(--col-width), var(--col-width)));
  grid-template-rows: 34px 34px;
  align-content: center;
  gap: 8px 0;
  padding: 12px 0;
  min-height: 92px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: var(--col-width) 100%;
}

.track {
  grid-column: 1 / -1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  height: 34px;
  margin: 0 8px;
  align-self: center;
  box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.2);
}

.track.planned {
  grid-row: 1;
}

.track.actual {
  grid-row: 2;
}

.bar {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  height: 34px;
  margin: 0 8px;
  padding: 4px;
  border-radius: 999px;
  overflow: hidden;
  align-self: center;
  background: linear-gradient(90deg, var(--bar-start), var(--bar-end));
  box-shadow: 0 10px 24px var(--bar-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.88);
  opacity: 0.85;
  pointer-events: none;
  z-index: 3;
}

.bar-percent {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bar-meter {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: inset 0 1px 7px rgba(0, 0, 0, 0.12);
}

.bar-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, var(--bar-start), var(--bar-end));
  box-shadow: 0 0 16px var(--bar-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: width 180ms ease;
}

.bar.complete .bar-fill {
  border-radius: 999px;
}

.bar.planned {
  grid-row: 1;
}

.bar.actual {
  grid-row: 2;
}

.blue {
  background: var(--blue);
}

.orange {
  background: var(--orange);
}

.red {
  background: var(--red);
}

.green {
  background: var(--green);
}

.bar.blue {
  --bar-start: #217fc5;
  --bar-end: #34d2e5;
  --bar-glow: rgba(56, 168, 255, 0.24);
}

.bar.orange {
  --bar-start: #ff4a25;
  --bar-end: #ff8c38;
  --bar-glow: rgba(255, 159, 50, 0.28);
}

.bar.red {
  --bar-start: #8f001c;
  --bar-end: #ff1838;
  --bar-glow: rgba(255, 24, 56, 0.38);
}

.bar.green {
  --bar-start: #168a78;
  --bar-end: #32c5ad;
  --bar-glow: rgba(49, 217, 130, 0.25);
}

.today-line {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--pink);
  box-shadow: 0 0 15px rgba(255, 79, 216, 0.7);
  transform: translateX(-1px);
  z-index: 5;
}

.today-line span {
  position: absolute;
  top: -4px;
  left: 6px;
  white-space: nowrap;
  color: var(--pink);
  font-size: 11px;
  font-weight: 900;
}

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

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

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

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: var(--ink);
}

tfoot td {
  color: var(--cyan);
  background: rgba(40, 244, 255, 0.08);
  font-weight: 900;
}

.swa-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.swa-project-bar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.swa-project-picker,
.swa-project-type {
  min-height: 48px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.swa-project-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  min-width: min(460px, 100%);
}

.swa-project-picker span,
.swa-project-type span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.swa-project-picker select {
  min-width: min(280px, 58vw);
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink);
  background: #14001f;
  border: 1px solid var(--border);
  padding: 0 10px;
  outline: 0;
}

.swa-project-picker select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.swa-project-type {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 14px;
  min-width: 220px;
}

.swa-project-type strong {
  color: var(--cyan);
}

.swa-table-wrap {
  max-height: 64vh;
}

.swa-table {
  min-width: 1780px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.swa-table th {
  text-align: center;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(40, 244, 255, 0.075);
}

.swa-table td {
  min-width: 118px;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.swa-table tbody td:first-child,
.swa-table tfoot td:first-child,
.swa-table thead tr:first-child th:first-child {
  min-width: 280px;
  position: sticky;
  left: 0;
  z-index: 6;
  background: #12001d;
  box-shadow: 10px 0 0 #12001d, 11px 0 0 rgba(40, 244, 255, 0.24);
}

.swa-table thead tr:first-child th:first-child {
  z-index: 9;
}

.swa-table thead tr:first-child th {
  border-bottom-color: rgba(40, 244, 255, 0.44);
}

.swa-table tbody tr:hover td {
  background: rgba(40, 244, 255, 0.045);
}

.swa-table tbody tr:hover td:first-child {
  background: #12001d;
}

.swa-table tbody td:nth-child(6),
.swa-table tbody td:nth-child(9),
.swa-table tbody td:nth-child(12),
.swa-table tbody td:nth-child(15),
.swa-table thead tr:nth-child(2) th:nth-child(5),
.swa-table thead tr:nth-child(2) th:nth-child(8),
.swa-table thead tr:nth-child(2) th:nth-child(11),
.swa-table thead tr:nth-child(2) th:nth-child(14) {
  border-right-color: rgba(40, 244, 255, 0.42);
}

.swa-table tfoot td {
  border: 1px solid rgba(40, 244, 255, 0.35);
}

.swa-input {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  outline: 0;
  padding: 0 8px;
}

.swa-input.description {
  min-width: 250px;
}

.swa-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.swa-input[disabled] {
  opacity: 0.8;
}

.swa-add-row td {
  background: rgba(255, 255, 255, 0.025);
}

.swa-sheet-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.sheet-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  border-bottom: 0;
  cursor: pointer;
}

.sheet-tab-group {
  display: inline-flex;
  align-items: stretch;
}

.sheet-tab-group .sheet-tab {
  border-radius: 8px 0 0 0;
}

.sheet-delete {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 0 8px 0 0;
  color: var(--ink);
  background: rgba(255, 31, 63, 0.13);
  border: 1px solid rgba(255, 31, 63, 0.32);
  border-bottom: 0;
  border-left: 0;
  cursor: pointer;
}

.sheet-delete:hover {
  background: rgba(255, 31, 63, 0.24);
}

.sheet-tab.active,
.sheet-tab-group.active .sheet-tab {
  color: #07111a;
  background: linear-gradient(135deg, var(--cyan), #7bffcf);
  border-color: transparent;
  font-weight: 900;
}

.sheet-tab-group.active .sheet-delete {
  border-color: transparent;
}

.estimate-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.estimate-title-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.estimate-title-field,
.estimate-template-picker,
.estimate-store-filter,
.price-store-field,
.price-store-picker,
.estimate-summary {
  min-height: 58px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.estimate-title-field {
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.estimate-template-picker,
.estimate-store-filter,
.price-store-picker {
  min-width: 220px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 8px 10px;
}

.price-store-bar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.price-store-field {
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.estimate-title-field span,
.estimate-template-picker span,
.estimate-store-filter span,
.price-store-field span,
.price-store-picker span,
.estimate-summary span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-title-field input,
.estimate-template-picker input,
.price-store-field input,
.estimate-store-filter select,
.price-store-picker select {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  color: var(--ink);
  background: #14001f;
  border: 1px solid var(--border);
  outline: 0;
  padding: 0 10px;
}

.estimate-title-field input:focus,
.estimate-template-picker input:focus,
.price-store-field input:focus,
.estimate-store-filter select:focus,
.price-store-picker select:focus,
.estimate-input:focus,
.price-input:focus,
.template-title-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.estimate-summary {
  min-width: 250px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 14px;
}

.estimate-summary strong {
  color: var(--cyan);
  font-size: 24px;
  white-space: nowrap;
}

.estimate-table-wrap,
.price-list-table-wrap,
.estimate-template-wrap {
  border-color: var(--border);
}

.estimate-table,
.price-list-table {
  min-width: 1040px;
}

.estimate-template-table {
  min-width: 940px;
}

.estimate-input,
.price-input,
.template-title-input {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  outline: 0;
  padding: 0 8px;
}

.estimate-input.description,
.price-input.description {
  min-width: 260px;
}

.estimate-total-cell {
  color: var(--cyan);
  font-weight: 900;
  white-space: nowrap;
}

.estimate-add-row td {
  background: rgba(255, 255, 255, 0.025);
}

.estimate-template-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 54%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 54px var(--shadow);
}

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

.estimate-row-actions .secondary-btn,
.estimate-row-actions .ghost-btn {
  min-height: 32px;
  padding: 0 10px;
}

.estimate-v2-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(320px, 1.08fr);
  gap: 12px;
  margin-bottom: 12px;
}

.estimate-v2-takeoff-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.estimate-v2-upload-panel,
.estimate-v2-summary-panel,
.estimate-v2-file-card,
.estimate-v2-text-panel {
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.estimate-v2-upload-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.estimate-v2-field,
.estimate-v2-upload {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.estimate-v2-structural-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.estimate-v2-chb-inputs,
.estimate-v2-concrete-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.estimate-v2-field span,
.estimate-v2-upload span,
.estimate-v2-file-card span,
.estimate-v2-metric span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-v2-field select,
.estimate-v2-field input,
.estimate-v2-upload input {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink);
  background: #14001f;
  border: 1px solid var(--border);
  outline: 0;
  padding: 8px 10px;
}

.estimate-v2-field select:focus,
.estimate-v2-field input:focus,
.estimate-v2-upload input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.estimate-v2-summary-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px;
}

.estimate-v2-summary-panel-wide {
  margin-bottom: 12px;
}

.estimate-v2-tool-strip,
.estimate-v2-takeoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.estimate-v2-tool-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.estimate-v2-tool-group.icon-btn,
.estimate-v2-tool-members .icon-btn,
.estimate-v2-takeoff-actions .icon-btn,
.estimate-v2-zoom-controls .icon-btn {
  width: 44px;
  min-width: 44px;
}

.estimate-v2-tool-group.active-group {
  color: #07111a;
  background: linear-gradient(135deg, var(--cyan), #7bffcf);
  border-color: transparent;
  font-weight: 900;
}

.estimate-v2-tool-members {
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
}

.estimate-v2-group-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-v2-drawing-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
}

.estimate-v2-snap-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 900;
}

.estimate-v2-snap-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.estimate-v2-field.compact-field {
  gap: 4px;
}

.estimate-v2-tool-strip .active-tool {
  color: #07111a;
  background: linear-gradient(135deg, var(--cyan), #7bffcf);
  border-color: transparent;
  font-weight: 900;
}

.estimate-v2-metric {
  min-width: 0;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.estimate-v2-metric strong {
  min-width: 0;
  max-width: 100%;
  color: var(--cyan);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.estimate-v2-file-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto);
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.estimate-v2-file-card div {
  display: grid;
  gap: 5px;
}

.estimate-v2-file-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.estimate-v2-table-wrap {
  border-color: var(--border);
}

.estimate-v2-plan-placeholder {
  margin-bottom: 12px;
}

.estimate-v2-plan-shell {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 12px;
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.estimate-v2-plan-shell.full-pdf-ui {
  position: fixed;
  top: 160px;
  right: 18px;
  bottom: 18px;
  left: 306px;
  z-index: 28;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #050009;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.app-layout.side-dock-collapsed .estimate-v2-plan-shell.full-pdf-ui {
  left: 114px;
}

.estimate-v2-full-pdf-head {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 0, 14, 0.82);
  backdrop-filter: blur(10px);
}

.estimate-v2-full-pdf-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-plan-toolbar,
.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-file-card,
.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-page-controls {
  display: none;
}

.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-plan-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #050009;
}

.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-plan-surface {
  margin: 0 auto;
}

.estimate-v2-plan-shell.full-pdf-ui .estimate-v2-plan-placeholder {
  flex: 1 1 auto;
  min-height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.estimate-v2-plan-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  margin: -2px -2px 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.12), rgba(255, 79, 216, 0.06)),
    rgba(15, 0, 28, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.estimate-v2-plan-toolbar-top {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 10px;
}

.estimate-v2-layer-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
}

.estimate-v2-layer-panel summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-v2-layer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.estimate-v2-layer-group-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.estimate-v2-layer-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.estimate-v2-layer-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  text-transform: none;
}

.estimate-v2-layer-group summary small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.estimate-v2-layer-list-nested {
  margin-top: 10px;
}

.estimate-v2-layer-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 900;
}

.estimate-v2-layer-toggle input {
  accent-color: var(--cyan);
}

.estimate-v2-plan-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.estimate-v2-plan-control-row > * {
  min-width: 0;
}

.estimate-v2-plan-control-row .estimate-v2-drawing-controls {
  flex: 1 1 360px;
}

.estimate-v2-zoom-controls {
  flex: 1 1 260px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.estimate-v2-plan-control-row .estimate-v2-takeoff-actions {
  flex: 1 1 360px;
}

.estimate-v2-plan-toolbar button {
  white-space: nowrap;
}

.estimate-v2-full-pdf-btn {
  border-color: rgba(40, 244, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(40, 244, 255, 0.12) inset;
}

.estimate-v2-full-pdf-btn.active-full-pdf {
  color: #12001d;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  border-color: transparent;
}

.estimate-v2-zoom-controls span {
  min-width: 52px;
  text-align: right;
  color: var(--cyan);
}

.estimate-v2-plan-status-card {
  margin-bottom: 10px;
}

.estimate-v2-page-controls {
  display: grid;
  grid-template-columns: max-content minmax(280px, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.estimate-v2-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.estimate-v2-plan-active-controls {
  justify-self: end;
  width: min(100%, 760px);
}

.estimate-v2-plan-active-controls > .estimate-v2-field,
.estimate-v2-plan-active-controls .estimate-v2-chb-inputs,
.estimate-v2-plan-active-controls .estimate-v2-concrete-inputs {
  margin: 0;
}

.estimate-v2-plan-stage {
  overflow: auto;
  max-height: 680px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.estimate-v2-plan-surface {
  position: relative;
  min-width: 720px;
}

.estimate-v2-plan-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.estimate-v2-plan-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.estimate-v2-click-catcher {
  fill: transparent;
}

.estimate-v2-snap-grid,
.estimate-v2-grid-line {
  pointer-events: none;
}

.estimate-v2-grid-line {
  fill: none;
  stroke: rgba(40, 244, 255, 0.28);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.estimate-v2-shape {
  fill: none;
  stroke: var(--takeoff-color);
  stroke-width: 6;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.estimate-v2-shape.selected {
  stroke-width: 9;
  filter: drop-shadow(0 0 10px rgba(255, 79, 216, 0.78));
}

.estimate-v2-shape.area {
  fill: color-mix(in srgb, var(--takeoff-color) 24%, transparent);
}

.estimate-v2-shape.count,
.estimate-v2-active-point {
  fill: var(--takeoff-color);
  stroke: #ffffff;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.estimate-v2-active-point {
  cursor: grab;
  pointer-events: auto;
}

.estimate-v2-active-point:active {
  cursor: grabbing;
}

.estimate-v2-active-line {
  fill: none;
  stroke: var(--takeoff-color);
  stroke-width: 4;
  stroke-dasharray: 10 8;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.estimate-v2-measure-label {
  pointer-events: none;
}

.estimate-v2-measure-label rect {
  fill: rgba(7, 0, 13, 0.82);
  stroke: rgba(40, 244, 255, 0.68);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.estimate-v2-measure-label.active-label rect {
  stroke: rgba(255, 255, 255, 0.88);
  stroke-dasharray: 4 3;
}

.estimate-v2-measure-label text {
  fill: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-anchor: middle;
}

.estimate-v2-takeoff-table tr.editing-row td {
  background: rgba(255, 79, 216, 0.12);
}

.estimate-v2-takeoff-table tfoot td {
  font-weight: 900;
}

.estimate-v2-takeoff-table [data-estimate-v2-row-total],
.estimate-v2-takeoff-table [data-estimate-v2-takeoff-total] {
  max-width: 170px;
  color: var(--cyan);
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.estimate-v2-structural-panel {
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.estimate-v2-structural-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.estimate-v2-structural-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.estimate-v2-structural-card span,
.estimate-v2-structural-card small {
  color: var(--muted);
}

.estimate-v2-structural-card span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-v2-structural-card strong {
  color: var(--cyan);
  font-size: 22px;
  line-height: 1.1;
}

.estimate-v2-structural-card small {
  line-height: 1.35;
}

.estimate-v2-structural-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.estimate-v2-table {
  min-width: 1260px;
}

.estimate-v2-table td strong,
.estimate-v2-table td small {
  display: block;
}

.estimate-v2-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.estimate-v2-quantity-fields {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(70px, 0.75fr);
  gap: 6px;
}

.estimate-v2-notes {
  min-width: 280px;
  min-height: 74px;
  resize: vertical;
  padding-top: 8px;
  line-height: 1.4;
}

.estimate-v2-text-panel {
  margin-top: 12px;
  padding: 14px;
}

.estimate-v2-region-panel {
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 58%),
    rgba(255, 255, 255, 0.045);
}

.estimate-v2-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.estimate-v2-region-card {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.estimate-v2-region-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.estimate-v2-region-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.estimate-v2-region-card pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  color: var(--ink);
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
}

.compact-head {
  margin-bottom: 10px;
}

.estimate-v2-text-panel h3 {
  margin: 4px 0 0;
}

.estimate-v2-text-panel pre {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  line-height: 1.55;
}

.ghost-btn.danger {
  color: var(--red);
  border-color: rgba(255, 31, 63, 0.32);
  background: rgba(255, 31, 63, 0.08);
}

.compact-btn {
  min-height: 32px;
  padding: 0 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 0 8px;
  color: #13001d;
  font-size: 12px;
  font-weight: 900;
}

.modal-root:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 0, 8, 0.72);
}

.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #220031, #07000d);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55);
  animation: pop-in 160ms ease-out;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.modal-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-body {
  padding: 18px;
}

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

.instruction-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.instruction-card strong {
  display: block;
  color: var(--cyan);
  margin-bottom: 6px;
}

.instruction-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.operations-instruction-modal {
  width: min(860px, 100%);
}

.instruction-flow {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(40, 244, 255, 0.06);
}

.instruction-flow > strong {
  color: var(--cyan);
  font-size: 11px;
  text-transform: uppercase;
}

.instruction-flow > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.instruction-flow span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(40, 244, 255, 0.3);
  border-radius: 6px;
  color: var(--ink);
  background: var(--cyan-soft);
  font-size: 12px;
  font-weight: 900;
}

.instruction-flow i {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

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

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

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

.account-row,
.risk-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 340px;
  border-radius: 8px;
  border: 1px solid rgba(40, 244, 255, 0.35);
  background: #12001d;
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
}

.premium-access-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  transform: translate(-50%, -50%);
  min-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  border: 1px solid rgba(40, 244, 255, 0.45);
  background: linear-gradient(135deg, #12001d, #2e0745 52%, #081a2a);
  color: var(--ink);
  padding: 22px 28px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  animation: premium-pop 180ms ease-out;
}

@keyframes premium-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 360px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 20px;
}

.operations-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.operations-kpi,
.operations-panel,
.operations-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.operations-kpi {
  min-width: 0;
  padding: 14px;
}

.operations-kpi span,
.operations-card small {
  color: var(--muted);
}

.operations-kpi strong {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operations-kpi.good strong {
  color: var(--green);
}

.operations-kpi.risk strong {
  color: var(--red);
}

.operations-panel {
  padding: 14px;
  margin-top: 14px;
}

.operations-panel h3,
.operations-card h3 {
  margin: 4px 0;
}

.operations-panel-head,
.operations-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.operations-panel-head {
  margin-bottom: 12px;
}

.operations-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.operations-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.operations-table th,
.operations-table td {
  padding: 11px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.operations-table th {
  color: var(--cyan);
  background: rgba(40, 244, 255, 0.08);
  font-size: 12px;
  text-transform: uppercase;
}

.operations-table td small,
.operations-table td strong {
  display: block;
}

.operations-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.procurement-request-table {
  min-width: 1320px;
}

.procurement-project-filter {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.procurement-project-filter label,
.procurement-project-filter-result {
  display: grid;
  gap: 5px;
}

.procurement-project-filter label > span,
.procurement-project-filter-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.procurement-project-filter input {
  width: 100%;
  min-height: 42px;
}

.procurement-project-filter-result {
  min-width: 150px;
}

.procurement-project-filter-result strong {
  color: var(--cyan);
}

.operations-table .procurement-project-group td {
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(40, 244, 255, 0.14), rgba(81, 246, 181, 0.08));
}

.procurement-project-summary {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(130px, 1fr));
  align-items: center;
  gap: 12px;
}

.procurement-project-summary > div {
  min-width: 0;
}

.procurement-project-summary span,
.procurement-project-summary strong {
  display: block;
}

.procurement-project-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.procurement-project-summary strong {
  margin-top: 3px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.workflow-select {
  min-width: 138px;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-weight: 800;
}

.workflow-select.green {
  color: var(--green);
  background: rgba(49, 217, 130, 0.12);
}

.workflow-select.red {
  color: var(--red);
  background: rgba(255, 31, 63, 0.12);
}

.workflow-select.orange {
  color: var(--orange);
  background: rgba(255, 159, 50, 0.14);
}

.workflow-select.blue {
  color: var(--blue);
  background: rgba(56, 168, 255, 0.12);
}

.operations-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.operations-card {
  padding: 14px;
}

.operations-card p {
  margin: 8px 0;
}

.analytics-title-row {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.analytics-kpi,
.analytics-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.055), transparent 58%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 44px var(--shadow);
}

.analytics-kpi {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  padding: 13px;
  overflow: hidden;
}

.analytics-kpi span,
.analytics-kpi small {
  color: var(--muted);
}

.analytics-kpi span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-kpi strong {
  overflow: hidden;
  color: var(--cyan);
  font-size: 24px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-kpi small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-kpi.good strong {
  color: var(--green);
}

.analytics-kpi.risk strong {
  color: var(--red);
}

.analytics-kpi.money strong {
  color: var(--blue);
}

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

.analytics-panel {
  min-width: 0;
  min-height: 310px;
  padding: 14px;
  overflow: hidden;
}

.analytics-panel-wide {
  grid-column: span 2;
}

.analytics-panel-head {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}

.analytics-panel-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.analytics-panel-head .eyebrow {
  color: var(--muted);
  font-size: 10px;
}

.analytics-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 18px;
}

.analytics-vertical-chart,
.analytics-grouped-chart {
  height: 226px;
  display: grid;
  grid-template-columns: repeat(12, minmax(32px, 1fr));
  align-items: stretch;
  gap: 6px;
  padding-top: 6px;
  overflow-x: auto;
}

.analytics-column {
  min-width: 32px;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr) 20px;
  align-items: end;
  gap: 4px;
  text-align: center;
}

.analytics-column-value {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-column-bar {
  width: min(42px, 80%);
  height: var(--bar-height);
  min-height: 0;
  justify-self: center;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #8da8ff, #5268ca);
  box-shadow: 0 8px 20px rgba(82, 104, 202, 0.28);
}

.analytics-vertical-chart.risk .analytics-column-bar {
  background: linear-gradient(180deg, #ff7993, #e82d51);
  box-shadow: 0 8px 20px rgba(232, 45, 81, 0.24);
}

.analytics-column small,
.analytics-group small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.analytics-chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.analytics-chart-legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
}

.analytics-chart-legend .billed,
.analytics-group-bar.billed {
  background: linear-gradient(180deg, #8da8ff, #5268ca);
}

.analytics-chart-legend .collected,
.analytics-group-bar.collected {
  background: linear-gradient(180deg, #5ff1c0, #18a675);
}

.analytics-group {
  min-width: 32px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 20px;
  gap: 4px;
  text-align: center;
}

.analytics-group-bars {
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
}

.analytics-group-bar {
  width: min(18px, 42%);
  height: var(--bar-height);
  border-radius: 4px 4px 1px 1px;
}

.analytics-ranked-list {
  display: grid;
  gap: 14px;
}

.analytics-ranked-item {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.analytics-ranked-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-ranked-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranked-meta strong {
  color: var(--ink);
}

.analytics-ranked-track {
  height: 13px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-ranked-track span {
  width: var(--rank-width);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #5268ca, #8da8ff);
}

.analytics-donut-wrap {
  min-height: 220px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.analytics-donut {
  width: 160px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: var(--analytics-donut);
  box-shadow: 0 18px 38px var(--shadow);
}

.analytics-donut::after {
  content: "";
  position: absolute;
  inset: 35px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.analytics-donut > span {
  display: grid;
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 27px;
  font-weight: 900;
  text-align: center;
}

.analytics-donut > span small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.analytics-donut-legend {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.analytics-donut-legend div {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-donut-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--legend-color);
}

.analytics-donut-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-donut-legend strong {
  color: var(--ink);
}

.analytics-watch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analytics-watch-item {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.analytics-watch-item.risk {
  border-left-color: var(--red);
}

.analytics-watch-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.analytics-watch-item > div:last-child {
  justify-items: end;
}

.analytics-watch-item strong,
.analytics-watch-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-watch-item span {
  color: var(--muted);
  font-size: 11px;
}

.analytics-watch-item.risk > div:last-child span,
.analytics-status-text.red {
  color: var(--red);
}

.analytics-status-text.green {
  color: var(--green);
}

.analytics-status-text.orange {
  color: var(--orange);
}

.analytics-status-text.blue {
  color: var(--blue);
}

.dashboard-filters {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-filter select {
  min-height: 30px;
  min-width: 150px;
  border-radius: 8px;
  color: var(--ink);
  background: #14001f;
  border: 1px solid var(--border);
  padding: 0 8px;
  outline: 0;
}

.dashboard-filter select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-kpi,
.dashboard-panel {
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.075), transparent 54%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 54px var(--shadow);
}

.dashboard-kpi {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
}

.dashboard-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-kpi strong {
  color: var(--cyan);
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi .money-value {
  font-size: clamp(19px, 1.65vw, 27px);
}

.dashboard-kpi.risk strong {
  color: var(--red);
}

.dashboard-kpi.good strong {
  color: var(--green);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-panel {
  padding: 16px;
}

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

.dashboard-panel-head h3 {
  margin: 6px 0 0;
}

.dashboard-panel-head > strong {
  color: var(--cyan);
  font-size: 28px;
  line-height: 1;
}

.status-chart-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 18px;
}

.status-pie {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--pie);
  box-shadow: 0 18px 45px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.status-pie::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
}

.status-pie span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.pie-legend strong {
  color: var(--ink);
}

.risk-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.risk-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.risk-project-name {
  display: grid;
  gap: 4px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.risk-project-name span {
  color: var(--muted);
  font-size: 12px;
}

.risk-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.billing-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(40, 244, 255, 0.28);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 14px;
}

.dashboard-table-wrap {
  border-color: var(--border);
}

.dashboard-table {
  min-width: 1080px;
}

.dashboard-project-link {
  min-height: 34px;
  padding: 0 10px;
  text-align: left;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  gap: 14px;
}

.settings-panel {
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(40, 244, 255, 0.08), transparent 52%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 54px var(--shadow);
  padding: 18px;
}

.settings-panel h3 {
  margin: 8px 0 0;
}

.settings-panel-headline {
  display: grid;
  gap: 6px;
}

.google-drive-panel {
  display: grid;
  gap: 16px;
}

.google-drive-status {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.google-drive-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.google-drive-status strong {
  color: var(--ink);
  font-size: 18px;
}

.google-drive-status small {
  color: var(--muted);
}

.google-drive-status.connected {
  border-color: rgba(47, 222, 121, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 222, 121, 0.08);
}

.google-drive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.google-drive-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 14px;
}

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

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.theme-option {
  min-height: 82px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  padding: 12px;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.theme-option:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 244, 255, 0.48);
}

.theme-option.active {
  border-color: var(--cyan);
  background: var(--cyan-soft);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

.theme-option strong,
.theme-option small {
  display: block;
}

.theme-option small {
  color: var(--muted);
  margin-top: 4px;
}

.theme-preview {
  width: 54px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.dark-preview {
  background:
    linear-gradient(135deg, rgba(40, 244, 255, 0.9), rgba(255, 79, 216, 0.9)) 9px 9px / 26px 8px no-repeat,
    linear-gradient(145deg, #250034, #07000d);
}

.light-preview {
  background:
    linear-gradient(135deg, rgba(0, 143, 168, 0.9), rgba(202, 47, 143, 0.85)) 9px 9px / 26px 8px no-repeat,
    linear-gradient(135deg, #eefcff, #fff8ed);
}

body[data-theme="light"] .brand-panel,
body[data-theme="light"] .auth-panel,
body[data-theme="light"] .app-panel,
body[data-theme="light"] .visual-container,
body[data-theme="light"] .side-dock,
body[data-theme="light"] .toolbar-container,
body[data-theme="light"] .mini-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 255, 0.88));
}

body[data-theme="light"] .topbar {
  background: rgba(250, 254, 255, 0.92);
  backdrop-filter: blur(14px);
}

body[data-theme="light"] .icon-btn::after,
body[data-theme="light"] .side-dock.collapsed .dock-btn::after {
  color: #ffffff;
  background: rgba(20, 32, 51, 0.97);
  border-color: rgba(0, 143, 168, 0.48);
  box-shadow: 0 12px 30px rgba(20, 32, 51, 0.3);
}

body[data-theme="light"] .welcome-card {
  background:
    linear-gradient(135deg, rgba(0, 143, 168, 0.14), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 255, 0.88));
}

body[data-theme="light"] .metric,
body[data-theme="light"] .gantt-toolbar,
body[data-theme="light"] .gantt-shell,
body[data-theme="light"] .swa-project-picker,
body[data-theme="light"] .swa-project-type,
body[data-theme="light"] .dashboard-filter,
body[data-theme="light"] .dashboard-kpi,
body[data-theme="light"] .dashboard-panel,
body[data-theme="light"] .estimate-title-field,
body[data-theme="light"] .estimate-template-picker,
body[data-theme="light"] .estimate-store-filter,
body[data-theme="light"] .price-store-field,
body[data-theme="light"] .price-store-picker,
body[data-theme="light"] .estimate-summary,
body[data-theme="light"] .estimate-v2-upload-panel,
body[data-theme="light"] .estimate-v2-summary-panel,
body[data-theme="light"] .estimate-v2-file-card,
body[data-theme="light"] .estimate-v2-plan-shell,
body[data-theme="light"] .estimate-v2-plan-toolbar,
body[data-theme="light"] .estimate-v2-layer-panel,
body[data-theme="light"] .estimate-v2-structural-panel,
body[data-theme="light"] .estimate-v2-structural-card,
body[data-theme="light"] .estimate-v2-region-panel,
body[data-theme="light"] .estimate-v2-region-card,
body[data-theme="light"] .estimate-v2-text-panel,
body[data-theme="light"] .estimate-template-panel,
body[data-theme="light"] .risk-item,
body[data-theme="light"] .settings-panel,
body[data-theme="light"] .account-row,
body[data-theme="light"] .risk-row,
body[data-theme="light"] .operations-kpi,
body[data-theme="light"] .operations-panel,
body[data-theme="light"] .operations-card,
body[data-theme="light"] .procurement-project-filter,
body[data-theme="light"] .analytics-kpi,
body[data-theme="light"] .analytics-panel,
body[data-theme="light"] .analytics-watch-item,
body[data-theme="light"] .operations-table .procurement-project-group td,
body[data-theme="light"] .sheet-tab {
  background: rgba(255, 255, 255, 0.68);
}

body[data-theme="light"] .tab-btn,
body[data-theme="light"] .toolbar-btn,
body[data-theme="light"] .dock-btn,
body[data-theme="light"] .secondary-btn,
body[data-theme="light"] .ghost-btn,
body[data-theme="light"] .theme-option {
  background: rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .secondary-btn {
  background: rgba(0, 143, 168, 0.12);
}

body[data-theme="light"] .tab-btn.active,
body[data-theme="light"] .toolbar-btn.active,
body[data-theme="light"] .sheet-tab.active,
body[data-theme="light"] .sheet-tab-group.active .sheet-tab {
  color: #07111a;
  background: linear-gradient(135deg, var(--cyan), #7bffcf);
  border-color: transparent;
}

body[data-theme="light"] .theme-option.active {
  background: var(--cyan-soft);
  border-color: var(--cyan);
}

body[data-theme="light"] .field input,
body[data-theme="light"] .field select,
body[data-theme="light"] .search,
body[data-theme="light"] .year-picker select,
body[data-theme="light"] .swa-project-picker select,
body[data-theme="light"] .dashboard-filter select,
body[data-theme="light"] .swa-input,
body[data-theme="light"] .estimate-title-field input,
body[data-theme="light"] .estimate-template-picker input,
body[data-theme="light"] .estimate-store-filter select,
body[data-theme="light"] .price-store-field input,
body[data-theme="light"] .price-store-picker select,
body[data-theme="light"] .estimate-v2-field select,
body[data-theme="light"] .estimate-v2-field input,
body[data-theme="light"] .estimate-v2-upload input,
body[data-theme="light"] .estimate-input,
body[data-theme="light"] .price-input,
body[data-theme="light"] .template-title-input {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(30, 48, 78, 0.18);
}

body[data-theme="light"] .year-picker {
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme="light"] .status-pie::after {
  background: #ffffff;
}

body[data-theme="light"] .analytics-donut::after {
  background: #ffffff;
}

body[data-theme="light"] .analytics-panel-head {
  border-bottom-color: rgba(30, 48, 78, 0.18);
}

body[data-theme="light"] .analytics-ranked-track {
  background: rgba(30, 48, 78, 0.1);
}

body[data-theme="light"] .gantt-header-wrap,
body[data-theme="light"] .gantt-left-head,
body[data-theme="light"] .swa-table tbody td:first-child,
body[data-theme="light"] .swa-table tfoot td:first-child,
body[data-theme="light"] .swa-table thead tr:first-child th:first-child {
  background: #f8fcff;
  box-shadow: 10px 0 0 #f8fcff, 11px 0 0 rgba(0, 143, 168, 0.18);
}

body[data-theme="light"] .project-name-btn {
  background: rgba(255, 255, 255, 0.76);
}

body[data-theme="light"] .gantt-shell.zoom-year .bar-grid {
  background-image:
    linear-gradient(to right, rgba(30, 48, 78, 0.18) 1px, transparent 1px),
    linear-gradient(to right, rgba(30, 48, 78, 0.08) 1px, transparent 1px);
}

body[data-theme="light"] .bar-grid {
  background-image: linear-gradient(to right, rgba(30, 48, 78, 0.1) 1px, transparent 1px);
}

body[data-theme="light"] .track {
  background: rgba(30, 48, 78, 0.06);
}

body[data-theme="light"] th {
  background: rgba(0, 143, 168, 0.1);
}

body[data-theme="light"] tfoot td {
  background: rgba(0, 143, 168, 0.12);
}

body[data-theme="light"] .swa-table {
  border-color: rgba(30, 48, 78, 0.3);
}

body[data-theme="light"] .swa-table th {
  border-color: rgba(30, 48, 78, 0.24);
  background: rgba(0, 143, 168, 0.1);
}

body[data-theme="light"] .swa-table td {
  border-color: rgba(30, 48, 78, 0.18);
}

body[data-theme="light"] .swa-table tbody tr:hover td {
  background: rgba(0, 143, 168, 0.06);
}

body[data-theme="light"] .swa-table tbody tr:hover td:first-child {
  background: #f8fcff;
}

body[data-theme="light"] .estimate-v2-metric,
body[data-theme="light"] .estimate-v2-structural-card {
  background: rgba(255, 255, 255, 0.58);
}

body[data-theme="light"] .estimate-v2-text-panel pre {
  background: rgba(255, 255, 255, 0.62);
}

body[data-theme="light"] .estimate-v2-region-card pre {
  background: rgba(255, 255, 255, 0.46);
}

body[data-theme="light"] .swa-add-row td {
  background: rgba(30, 48, 78, 0.035);
}

body[data-theme="light"] .estimate-add-row td {
  background: rgba(30, 48, 78, 0.035);
}

body[data-theme="light"] .modal-backdrop {
  background: rgba(20, 32, 51, 0.34);
}

body[data-theme="light"] .modal,
body[data-theme="light"] .toast {
  background: linear-gradient(145deg, #ffffff, #eff8ff);
}

body[data-theme="light"] .toast {
  box-shadow: 0 16px 40px rgba(65, 84, 118, 0.2);
}

body[data-theme="light"] .premium-access-notice {
  background: linear-gradient(135deg, #ffffff, #eff8ff 55%, #eaf1ff);
  color: #102033;
  box-shadow: 0 24px 70px rgba(65, 84, 118, 0.24);
}

@media (max-width: 920px) {
  .login-shell,
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-layout.side-dock-collapsed {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
  }

  .side-dock {
    position: static;
    order: -1;
    min-height: auto;
    max-height: none;
  }

  .dashboard-grid,
  .dashboard-kpi-grid,
  .dashboard-layout,
  .status-chart-wrap,
  .operations-kpi-grid,
  .analytics-kpi-grid,
  .analytics-dashboard-grid,
  .analytics-watch-list,
  .estimate-v2-grid,
  .estimate-v2-takeoff-grid,
  .estimate-v2-structural-inputs,
  .form-grid,
  .access-grid,
  .theme-options {
    grid-template-columns: 1fr;
  }

  .analytics-panel-wide {
    grid-column: auto;
  }

  .analytics-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .analytics-donut-legend {
    width: min(100%, 320px);
  }

  .risk-item {
    grid-template-columns: 1fr;
  }

  .dashboard-filters {
    justify-content: stretch;
  }

  .dashboard-filter {
    width: 100%;
  }

  .estimate-title-field {
    grid-template-columns: 1fr;
  }

  .price-store-field {
    grid-template-columns: 1fr;
  }

  .estimate-summary {
    width: 100%;
  }

  .estimate-v2-summary-panel,
  .estimate-v2-file-card,
  .estimate-v2-drawing-controls,
  .estimate-v2-page-controls,
  .estimate-v2-plan-toolbar-top,
  .estimate-v2-plan-control-row {
    grid-template-columns: 1fr;
  }

  .estimate-v2-plan-active-controls {
    justify-self: stretch;
  }

  .estimate-v2-plan-control-row {
    flex-direction: column;
    align-items: stretch;
  }

  .procurement-project-summary {
    grid-template-columns: 1fr 1fr;
  }

  .procurement-project-filter {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .procurement-project-filter-result {
    min-width: 0;
  }

  .estimate-v2-plan-shell.full-pdf-ui {
    top: 148px;
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .app-layout.side-dock-collapsed .estimate-v2-plan-shell.full-pdf-ui {
    left: 10px;
  }

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

  .dashboard-filter select {
    flex: 1;
  }

  .risk-meta {
    justify-items: start;
  }

  .topbar {
    flex-wrap: wrap;
  }
}
