:root {
  --ink: #121826;
  --muted: #687385;
  --line: #dce3ee;
  --soft-line: rgba(148, 163, 184, 0.28);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --canvas: #eef3f6;
  --nav: #111827;
  --nav-soft: #1f2937;
  --green: #0f766e;
  --green-dark: #115e59;
  --green-soft: #e6f5f2;
  --gold: #b7791f;
  --amber-soft: #fff8e6;
  --blue: #334bc1;
  --blue-soft: #eef2ff;
  --red: #b42318;
  --red-soft: #fff0ef;
  --ok-soft: #e9fbf2;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 10px 28px rgba(17, 24, 39, 0.08);
  --focus: 0 0 0 3px rgba(15, 118, 110, 0.18);
  --radius: 8px;
}

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

.financial-indicator-controls select { min-width: 210px; }
.financial-indicator-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.panel .financial-indicator-note { margin: 0 0 20px; }
.financial-indicator-table { min-width: 980px; }
.financial-indicator-table th,
.financial-indicator-table td { vertical-align: top; white-space: normal; }
.financial-indicator-table th[scope="row"] { min-width: 170px; color: var(--ink); background: transparent; }
.financial-indicator-table td:nth-child(2) { min-width: 200px; max-width: 260px; }
.financial-indicator-table .indicator-explanation { min-width: 260px; max-width: 340px; line-height: 1.5; }
.financial-indicator-table .indicator-value { min-width: 180px; }
.indicator-value strong { white-space: nowrap; }
.indicator-value small,
.indicator-explanation small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.indicator-explanation small { color: #83530f; }
.indicator-importance {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.indicator-importance.standard { background: var(--blue-soft); color: var(--blue); }
.indicator-importance.very-high { background: var(--amber-soft); color: #83530f; }
.indicator-importance.critical { background: var(--red-soft); color: var(--red); }
#financialIndicatorsView .is-pending { color: var(--muted); }
#financialIndicatorsView .is-negative { color: var(--red); }
.financial-indicator-details > summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 750;
  padding: 4px 0;
}
.financial-indicator-details[open] > summary { margin-bottom: 16px; }
.financial-indicator-inputs { display: grid; gap: 20px; }
.financial-indicator-group { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; }
.financial-indicator-group legend { padding: 0 8px; color: var(--green-dark); font-weight: 750; }
.financial-indicator-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.financial-indicator-field-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 650; }
.financial-indicator-field-grid input { width: 100%; min-width: 0; }
.financial-indicator-field-grid small { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
@media (max-width: 1120px) { .financial-indicator-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .financial-indicator-field-grid { grid-template-columns: 1fr; }
  .financial-indicator-controls { width: 100%; }
  .financial-indicator-controls .compact-label { flex: 1; }
  .financial-indicator-controls select { min-width: 0; width: 100%; }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(238, 243, 246, 0.82)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(51, 75, 193, 0.1), transparent 34%),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
select {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  color: #f8fafc;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.99), rgba(15, 23, 42, 0.99)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 44%),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.08);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 38px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  letter-spacing: 0;
}

.brand p {
  margin-top: 3px;
  color: #aab4c4;
  font-size: 12px;
}

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

.nav-tab {
  width: 100%;
  padding: 12px 14px;
  color: #d8dee9;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-tab:hover,
.nav-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 rgba(20, 184, 166, 0.78);
}

.sidebar-summary {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.sidebar-summary span,
.sidebar-summary small {
  display: block;
  color: #b8c2d0;
  font-size: 12px;
}

.sidebar-summary strong {
  display: block;
  margin: 6px 0;
  font-size: 26px;
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 28px;
}

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

.inline-tools {
  justify-content: flex-end;
}

.user-chip,
.save-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.save-chip[data-tone="ok"] {
  color: #166534;
  background: var(--ok-soft);
}

.save-chip[data-tone="warn"] {
  color: #8a4b00;
  background: #fff3c4;
}

.save-chip[data-tone="saving"] {
  color: var(--green-dark);
  background: #e6fffb;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-color: rgba(15, 118, 110, 0.8);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.project-card:hover,
.scenario-card:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: linear-gradient(135deg, #12877e, #0f4f4b);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
}

.danger-button {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffc9c5;
}

.icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--red);
  font-size: 20px;
}

.file-trigger {
  display: inline-flex;
  align-items: center;
}

.link-button {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-panel,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.metric-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric-panel::before {
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 14px;
  content: "";
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 999px;
}

.metric-panel span,
.metric-panel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-panel strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 28px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  overflow: hidden;
  padding: 18px;
}

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

.panel-heading.compact {
  margin-top: 20px;
}

.panel h3 {
  font-size: 16px;
}

.panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.bar-track {
  height: 10px;
  overflow: hidden;
  background: #e6ecf3;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 999px;
}

.selected-project {
  display: grid;
  gap: 10px;
}

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

.summary-line:last-child {
  border-bottom: 0;
}

.project-card strong .pill {
  float: right;
  margin-left: 8px;
}

.lead-score-editor {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.lead-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.lead-score-grid select {
  background: #fff;
  border-color: var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

.pill.ok {
  color: #166534;
  background: var(--ok-soft);
}

.pill.warn {
  color: #8a4b00;
  background: #fff3c4;
}

.pill.bad {
  color: var(--red);
  background: var(--red-soft);
}

.table-scroll {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  padding: 10px 11px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #f8fafc;
  font-size: 12px;
  background: linear-gradient(180deg, #1f2937, #172033);
}

td {
  color: #1f2937;
  font-size: 13px;
}

tbody tr:hover {
  background: #f7fbfb;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

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

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

.project-card {
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.project-card.active {
  border-color: rgba(15, 118, 110, 0.5);
  background: linear-gradient(180deg, #fff, var(--green-soft));
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

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

.project-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wide-field {
  grid-column: span 2;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--amber-soft);
  border: 1px solid #ead79f;
  border-radius: 8px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 84px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--amber-soft);
  border: 1px solid #ead79f;
  border-radius: 8px;
  outline: none;
  resize: vertical;
}

.compact-input {
  width: min(320px, 100%);
  background: #fff;
  border-color: var(--line);
}

.compact-label {
  min-width: 168px;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
}

.project-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.scenario-card {
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.scenario-card:hover {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.scenario-card span,
.scenario-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.scenario-card strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
}

.number-tile {
  padding: 13px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.number-tile strong,
.metric-panel strong {
  letter-spacing: 0;
}

.number-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.number-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.parts-table {
  min-width: 1180px;
}

.company-table {
  min-width: 2300px;
}

.parts-table input,
.parts-table select,
.company-table input {
  min-height: 32px;
}

.company-table td {
  white-space: nowrap;
}

.company-table input {
  min-width: 100px;
}

.company-table td:first-child input {
  min-width: 190px;
}

.formula-box {
  display: grid;
  gap: 10px;
}

.formula-box span {
  padding: 12px;
  color: #263244;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

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

.compact-form {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.form-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.form-message[data-tone="ok"] {
  color: #166534;
}

.form-message[data-tone="bad"] {
  color: var(--red);
}

.form-message[data-tone="saving"] {
  color: var(--green-dark);
}

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

.period-summary-grid,
.goal-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.system-tile,
.empty-state,
.history-item {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.system-tile span,
.history-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.system-tile strong,
.history-item strong {
  display: block;
  margin-top: 4px;
}

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

.goals-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
}

.goal-cards {
  display: grid;
  gap: 14px;
}

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

.okr-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.okr-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.okr-card-head strong,
.okr-card-head span {
  display: block;
}

.okr-card-head span:not(.pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.okr-card textarea {
  min-height: 84px;
}

.okr-items {
  display: grid;
  gap: 12px;
}

.okr-item {
  display: grid;
  gap: 11px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.okr-item.is-done {
  opacity: 0.72;
}

.okr-item.is-done textarea {
  text-decoration: line-through;
}

.okr-item.is-done label:not(.okr-check) {
  text-decoration: line-through;
}

.okr-item-head {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto 32px;
  gap: 10px;
  align-items: center;
}

.okr-check {
  display: inline-flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.okr-check input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

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

.okr-sliders input[type="range"] {
  accent-color: var(--green);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.goal-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.goal-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.goal-card-header strong,
.goal-card-header span {
  display: block;
}

.goal-card-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.goal-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-economics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.goal-economic-tile {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.goal-economic-tile span,
.goal-economic-tile label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.goal-economic-tile strong {
  font-size: 18px;
}

.goal-economic-tile input {
  margin-top: 5px;
}

.goal-economic-tile .pill {
  justify-content: center;
}

.company-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.company-tab {
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

.company-tab.active {
  color: #fff;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  border-color: var(--green-dark);
}

.finance-planning-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin: 4px 0 16px;
}

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

.finance-control-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-company-tabs,
.finance-scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-company-tabs {
  margin: 0;
}

.finance-scenario-tab {
  min-height: 38px;
  padding: 0 13px;
  color: #475569;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.finance-scenario-tab.bad.active {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffc9c5;
}

.finance-scenario-tab.medium.active {
  color: #8a4b00;
  background: #fff3c4;
  border-color: #ead79f;
}

.finance-scenario-tab.good.active {
  color: #166534;
  background: var(--ok-soft);
  border-color: #bdebd1;
}

.goal-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.actions-editor {
  display: grid;
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1fr) 148px 32px;
  gap: 8px;
  align-items: center;
}

.action-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.weekly-action-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.weekly-action-head,
.weekly-action-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 150px 112px 112px 132px 148px 70px 34px;
  gap: 8px;
  align-items: center;
  min-width: 1080px;
}

.weekly-action-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.weekly-action-row {
  padding: 8px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.weekly-action-row .pill {
  justify-content: center;
  width: 100%;
  min-height: 32px;
}

.weekly-action-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  justify-self: center;
  padding: 0;
}

.goal-notes {
  margin-top: 2px;
}

.area-accordion-list,
.metric-accordion-list {
  display: grid;
  gap: 10px;
}

.area-accordion {
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.area-accordion summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.area-accordion summary::-webkit-details-marker {
  display: none;
}

.area-accordion summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
}

.area-accordion[open] summary::before {
  content: "-";
}

.area-accordion summary span {
  flex: 1;
}

.area-accordion summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.area-accordion .weekly-action-table,
.area-accordion .area-table-scroll {
  margin: 0 12px 12px;
}

.metric-card-list {
  display: grid;
  gap: 12px;
  margin: 0 12px 12px;
}

.metric-edit-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.metric-edit-card__head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 34px;
  gap: 10px;
  align-items: end;
}

.metric-name-field input {
  min-height: 42px;
  font-size: 15px;
  font-weight: 800;
  background: #fff;
  border-color: var(--line);
}

.metric-edit-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 1fr) minmax(100px, 0.45fr) minmax(130px, 0.55fr) minmax(150px, 0.65fr);
  gap: 10px;
  align-items: end;
}

.metric-edit-grid input,
.metric-edit-grid select {
  min-height: 36px;
  background: #fff;
  border-color: var(--line);
}

.metric-description-field {
  grid-column: 1 / -1;
}

.metric-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.metric-result-grid .system-tile {
  min-height: 72px;
  padding: 10px 12px;
}

.metric-result-grid .system-tile strong {
  font-size: 18px;
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 8px;
}

.calendar-day {
  min-height: 172px;
  padding: 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.calendar-day > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.calendar-actions {
  display: grid;
  gap: 7px;
}

.calendar-action,
.calendar-empty {
  display: block;
  padding: 7px 8px;
  color: #263244;
  font-size: 12px;
  line-height: 1.35;
  background: var(--blue-soft);
  border: 1px solid #d8defd;
  border-radius: 8px;
}

.calendar-action.done {
  color: #166534;
  text-decoration: line-through;
  background: var(--ok-soft);
  border-color: #bdebd1;
}

.calendar-empty {
  color: var(--muted);
  background: #f8fafc;
  border-color: var(--line);
}

.metrics-table {
  min-width: 1740px;
}

.metric-area-table {
  min-width: 1800px;
}

.metrics-table input,
.metrics-table select,
.finance-table input {
  min-height: 32px;
}

.finance-table {
  min-width: 1640px;
}

.finance-plan-table {
  min-width: 1720px;
}

.monthly-finance-table {
  min-width: 1960px;
}

.finance-month-compare-table {
  min-width: 720px;
}

.finance-plan-table th,
.finance-month-compare-table th {
  text-align: center;
  background: #43b9c0;
}

.finance-plan-table th:first-child,
.finance-plan-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 220px;
}

.finance-plan-table td:first-child {
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.finance-plan-row.section td,
.finance-plan-row.total td,
.finance-month-row.section td {
  color: #fff;
  background: #43b9c0;
  border-color: rgba(15, 23, 42, 0.12);
}

.finance-plan-row.income td,
.finance-month-row.income td {
  background: #e9fbf2;
}

.finance-plan-row.section.income-section td,
.finance-month-row.section.income td {
  color: #fff;
  background: #43b9c0;
  border-color: rgba(15, 23, 42, 0.12);
}

.finance-plan-row.section.income-section .finance-number,
.finance-month-row.section.income .finance-number {
  color: #fff;
}

.finance-plan-row.result td,
.finance-month-row.result td {
  background: #f8fafc;
}

.finance-plan-row.detail td,
.finance-month-row.detail td,
.finance-expense-item td {
  background: #f7fcfc;
}

.finance-expense-item .finance-concept-cell,
.finance-month-row.detail .finance-concept-cell {
  padding-left: 24px;
}

.finance-month-row.detail .finance-concept-cell span {
  color: var(--muted);
  font-weight: 700;
}

.finance-income-total .finance-concept-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-month-row.section .finance-add-row {
  margin-left: 16px;
  vertical-align: middle;
}

.finance-month-row.income-detail .finance-concept-cell {
  padding-left: 24px;
}

.monthly-forecast-grid {
  margin: 8px 0 14px;
}

.finance-concept-cell {
  min-width: 220px;
}

.finance-expense-total .finance-concept-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.expense-name-input {
  min-width: 170px;
  width: 100%;
  border-color: #c9d7e8;
  background: #fff;
}

.finance-add-row {
  flex: 0 0 auto;
  background: #fff;
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.28);
}

.finance-remove-row {
  width: 26px;
  height: 26px;
  margin-left: 8px;
  color: #b42318;
  background: #fff7ed;
  border-color: #fed7aa;
}

.finance-repeat-row {
  min-height: 26px;
  margin-left: 8px;
  padding: 0 8px;
  color: #0f766e;
  background: #e7f6f3;
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: none;
}

.finance-total-cell {
  background: #eef3f6;
}

.monthly-finance-table th:first-child,
.monthly-finance-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
}

.monthly-finance-table th:nth-child(2),
.monthly-finance-table td:nth-child(2) {
  position: sticky;
  left: 190px;
  z-index: 2;
  min-width: 92px;
}

.monthly-finance-table th:first-child,
.monthly-finance-table th:nth-child(2) {
  z-index: 4;
}

.monthly-finance-table td:first-child,
.monthly-finance-table td:nth-child(2) {
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.monthly-finance-table tr:nth-child(even) td:first-child,
.monthly-finance-table tr:nth-child(even) td:nth-child(2) {
  background: #fbfdff;
}

.monthly-finance-table .finance-company-start td {
  border-top: 2px solid rgba(15, 118, 110, 0.28);
}

.finance-company-cell strong {
  color: #0f172a;
}

.finance-month-cell strong,
.finance-month-cell span {
  display: block;
}

.finance-month-cell span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.finance-table input.money-input,
.finance-table input.notes-input,
.finance-table input[data-forecast-field] {
  color: #172033;
  background: #fff;
  border-color: #cad5e3;
}

.finance-table input.money-input {
  min-width: 128px;
  text-align: right;
}

.finance-table input.notes-input {
  min-width: 280px;
}

.finance-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.muted-number {
  color: #526178;
}

.finance-result {
  border-left: 1px solid var(--soft-line);
}

.finance-result.is-positive strong {
  color: #166534;
}

.finance-result.is-negative strong {
  color: var(--red);
}

.reports-table {
  min-width: 1180px;
}

.accounts-table {
  min-width: 1320px;
}

.accounts-table input,
.accounts-table select {
  min-height: 32px;
}

.funnel-board,
.alerts-list,
.priority-list {
  display: grid;
  gap: 12px;
}

.funnel-company,
.alert-item,
.priority-item {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.funnel-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.funnel-steps div {
  padding: 10px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.funnel-steps span,
.alert-item span,
.priority-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.funnel-steps strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.agenda-board,
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.agenda-column,
.pipeline-column {
  min-width: 220px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.agenda-column h4,
.pipeline-column h4 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.agenda-item,
.pipeline-card,
.template-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.agenda-item.bad {
  border-left: 4px solid var(--red);
}

.agenda-item.warn {
  border-left: 4px solid var(--gold);
}

.agenda-item.ok {
  border-left: 4px solid var(--green);
}

.agenda-item span,
.agenda-item small,
.pipeline-card span,
.pipeline-card small,
.pipeline-column > small {
  color: var(--muted);
  font-size: 12px;
}

.pipeline-card {
  cursor: pointer;
}

.pipeline-card:hover {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.template-list {
  display: grid;
  gap: 12px;
}

.template-card {
  position: relative;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) 34px;
}

.template-card .wide-field {
  grid-column: span 2;
}

.alert-item {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--gold);
}

.alert-item.danger {
  border-left-color: var(--red);
}

.alert-item p {
  margin: 0;
  color: #263244;
}

.priority-item {
  display: grid;
  gap: 4px;
}

.crm-layout {
  grid-template-columns: 340px minmax(0, 1fr);
}

.triage-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.triage-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.triage-table {
  min-width: 1180px;
}

.triage-table tr.active-row {
  background: var(--green-soft);
}

.finance-table td,
.reports-table td,
.accounts-table td,
.triage-table td {
  white-space: nowrap;
}

.monthly-finance-table input[data-finance-month-field="notes"] {
  min-width: 240px;
}

.finance-month-compare-table th:first-child,
.finance-month-compare-table td:first-child,
.finance-month-compare-table th:nth-child(2),
.finance-month-compare-table td:nth-child(2) {
  position: static;
  left: auto;
  min-width: 0;
  box-shadow: none;
}

.finance-month-compare-table td:first-child,
.finance-month-compare-table td:nth-child(2) {
  background: inherit;
}

.finance-month-compare-table .finance-month-row.section td:first-child,
.finance-month-compare-table .finance-month-row.section td:nth-child(2) {
  color: #fff;
  background: #43b9c0;
}

.finance-month-compare-table .finance-month-row.section .finance-number {
  color: #fff;
}

.finance-month-compare-table .finance-concept-cell {
  min-width: 260px;
}

.finance-month-compare-table .money-input,
.finance-month-compare-table .notes-input {
  width: 100%;
}

.login-secondary-link {
  justify-content: center;
  text-align: center;
}

.login-register-prompt {
  margin: 2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.login-register-prompt a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(17, 24, 39, 0.96)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.22), transparent 36%),
    linear-gradient(315deg, rgba(51, 75, 193, 0.18), transparent 34%),
    #111827;
}

.login-shell {
  width: min(100%, 440px);
}

.login-card {
  padding: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.login-brand {
  margin-bottom: 24px;
  color: var(--ink);
}

.login-brand p {
  color: var(--muted);
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-copy {
  margin: 8px 0 22px;
  color: var(--muted);
}

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

.login-error {
  margin-bottom: 14px;
  padding: 11px 12px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #ffc9c5;
  border-radius: 8px;
}

/* Premium interface refresh */
:root {
  --ink: #0d1320;
  --muted: #647083;
  --line: #d6deea;
  --soft-line: rgba(129, 145, 169, 0.28);
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --canvas: #edf2f7;
  --nav: #09111f;
  --nav-soft: #131f31;
  --green: #0e7a71;
  --green-dark: #0a5e59;
  --green-soft: #e7f6f3;
  --gold: #9a681f;
  --amber-soft: #fff9ea;
  --blue: #2f48b7;
  --blue-soft: #edf1ff;
  --shadow: 0 22px 60px rgba(9, 17, 31, 0.11);
  --shadow-soft: 0 10px 28px rgba(9, 17, 31, 0.08);
  --focus: 0 0 0 3px rgba(14, 122, 113, 0.18);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(236, 242, 248, 0.96)),
    linear-gradient(135deg, rgba(14, 122, 113, 0.1), transparent 38%),
    linear-gradient(315deg, rgba(47, 72, 183, 0.08), transparent 42%),
    var(--canvas);
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(9, 17, 31, 0.98), rgba(14, 24, 39, 0.98)),
    linear-gradient(145deg, rgba(14, 122, 113, 0.2), transparent 48%),
    var(--nav);
  box-shadow: 16px 0 46px rgba(9, 17, 31, 0.16);
}

.brand {
  flex: 0 0 auto;
  margin-bottom: 30px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.brand-mark {
  background: linear-gradient(135deg, #12a194, #314fc4);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.brand-mark.brand-logo {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.nav-tabs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  gap: 6px;
}

.nav-tabs::-webkit-scrollbar {
  width: 7px;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.nav-tab {
  position: relative;
  min-height: 42px;
  padding: 0 12px 0 16px;
  color: #c9d3e2;
  font-weight: 750;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab:hover,
.nav-tab.active {
  background: rgba(255, 255, 255, 0.095);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 0 #27d0bd, 0 8px 22px rgba(0, 0, 0, 0.1);
}

.sidebar-summary {
  position: static;
  flex: 0 0 auto;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.workspace {
  padding: 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -30px -30px 20px;
  padding: 22px 30px;
  background: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid rgba(214, 222, 234, 0.78);
  backdrop-filter: blur(18px);
}

.eyebrow {
  color: var(--green-dark);
  font-weight: 850;
}

.topbar h2 {
  color: #0c1424;
  font-size: 30px;
  line-height: 1.08;
}

.user-chip,
.save-chip,
.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.company-tab,
.finance-scenario-tab,
.compact-input {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74), 0 8px 22px rgba(9, 17, 31, 0.06);
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  font-weight: 800;
}

.primary-button {
  border-color: rgba(9, 94, 89, 0.82);
  background: linear-gradient(180deg, #129486, #0a5e59);
  box-shadow: 0 12px 26px rgba(14, 122, 113, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ghost-button,
.icon-button,
.link-button {
  background: rgba(255, 255, 255, 0.88);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.project-card:hover,
.scenario-card:hover {
  transform: translateY(-1px);
}

.panel,
.metric-panel {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 251, 253, 0.9)),
    var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.panel-heading {
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(214, 222, 234, 0.72);
}

.panel-heading:only-child {
  border-bottom: 0;
}

.panel h3 {
  color: #111a2b;
  font-size: 17px;
  letter-spacing: 0;
}

.panel p {
  color: #66758b;
  line-height: 1.45;
}

.metric-panel {
  min-height: 136px;
  padding: 18px;
}

.metric-panel::before {
  width: 34px;
  height: 4px;
  background: linear-gradient(90deg, #0e7a71, #b58b34, #2f48b7);
}

.metric-panel span,
.metric-panel small,
.system-tile span,
.number-tile span,
.history-item span {
  color: #66758b;
}

.metric-panel strong {
  color: #0c1424;
  font-size: 29px;
}

.system-tile,
.number-tile,
.goal-card,
.okr-card,
.goal-economic-tile,
.metric-edit-card,
.project-card,
.scenario-card,
.area-accordion,
.calendar-day,
.empty-state,
.history-item,
.lead-score-editor {
  background: linear-gradient(180deg, #fff, #f8fbfd);
  border-color: rgba(129, 145, 169, 0.24);
  box-shadow: 0 10px 24px rgba(9, 17, 31, 0.055);
}

.system-tile strong,
.number-tile strong,
.history-item strong {
  color: #10192a;
}

.table-scroll {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(129, 145, 169, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 32px rgba(9, 17, 31, 0.055);
}

table {
  background: rgba(255, 255, 255, 0.94);
}

th {
  color: #f8fafc;
  font-weight: 850;
  letter-spacing: 0;
  background: linear-gradient(180deg, #162236, #101827);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

td {
  color: #1b2638;
  border-bottom-color: rgba(214, 222, 234, 0.82);
}

tbody tr:nth-child(even) {
  background: #f8fbfd;
}

tbody tr:hover {
  background: #eefaf7;
}

input,
select,
textarea {
  color: #111827;
  background: #fff;
  border-color: #c9d5e5;
  box-shadow: inset 0 1px 2px rgba(9, 17, 31, 0.045);
}

input::placeholder,
textarea::placeholder {
  color: #8a96a8;
}

label {
  color: #5f6f85;
}

.pill {
  font-weight: 850;
}

.pill.ok {
  color: #116338;
  background: #e5f8ee;
}

.pill.warn {
  color: #8a5500;
  background: #fff4d3;
}

.pill.bad {
  color: #b42318;
  background: #fff0ef;
}

.company-tab,
.finance-scenario-tab {
  background: rgba(255, 255, 255, 0.9);
}

.company-tab.active {
  background: linear-gradient(180deg, #129486, #0a5e59);
  box-shadow: 0 10px 24px rgba(14, 122, 113, 0.18);
}

.finance-plan-table th,
.finance-month-compare-table th {
  background: linear-gradient(180deg, #37b8bf, #2b9da4);
}

.finance-plan-row.section td,
.finance-plan-row.total td,
.finance-month-row.section td {
  background: linear-gradient(180deg, #3dbcc3, #2ea3aa);
}

.finance-plan-row.income td,
.finance-month-row.income td {
  background: #e6f8ef;
}

.finance-plan-row.section.income-section td,
.finance-month-row.section.income td {
  color: #fff;
  background: linear-gradient(180deg, #3dbcc3, #2ea3aa);
}

.finance-plan-row.section.income-section .finance-number,
.finance-month-row.section.income .finance-number {
  color: #fff;
}

.finance-plan-row.detail td,
.finance-month-row.detail td,
.finance-expense-item td {
  background: #f4fbfb;
}

.finance-month-compare-table .finance-month-row.section td:first-child,
.finance-month-compare-table .finance-month-row.section td:nth-child(2) {
  background: linear-gradient(180deg, #3dbcc3, #2ea3aa);
}

.bar-track {
  background: #dfe7f1;
  box-shadow: inset 0 1px 2px rgba(9, 17, 31, 0.08);
}

.bar-fill {
  background: linear-gradient(90deg, #0e7a71, #b58b34, #2f48b7);
}

.project-card.active,
.scenario-card:hover {
  border-color: rgba(14, 122, 113, 0.42);
  background: linear-gradient(180deg, #fff, #eefaf7);
}

.login-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

/* Executive premium skin */
:root {
  --ink: #101522;
  --muted: #687489;
  --line: #d7dfeb;
  --soft-line: rgba(121, 138, 161, 0.22);
  --panel: rgba(255, 255, 255, 0.93);
  --panel-strong: #ffffff;
  --canvas: #eef3f6;
  --nav: #15151f;
  --nav-soft: #24212f;
  --green: #0c8a7f;
  --green-dark: #08645f;
  --green-soft: #e4f7f2;
  --gold: #a87520;
  --amber-soft: #fff7df;
  --blue: #3156b7;
  --blue-soft: #edf2ff;
  --red: #b42318;
  --red-soft: #fff0ef;
  --ok-soft: #e7f8ee;
  --shadow: 0 24px 64px rgba(16, 21, 34, 0.12);
  --shadow-soft: 0 10px 26px rgba(16, 21, 34, 0.07);
  --focus: 0 0 0 3px rgba(12, 138, 127, 0.18);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(233, 240, 245, 0.98)),
    repeating-linear-gradient(90deg, rgba(16, 21, 34, 0.025) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(0deg, rgba(16, 21, 34, 0.018) 0 1px, transparent 1px 112px),
    var(--canvas);
}

.sidebar {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(20, 20, 31, 0.99), rgba(31, 28, 43, 0.99)),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 18px 0 52px rgba(27, 31, 43, 0.18);
}

.brand {
  padding: 14px;
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand h1 {
  font-size: 17px;
  font-weight: 850;
}

.brand p {
  color: #b8c4d4;
}

.brand-mark {
  background: linear-gradient(135deg, #12a594, #3156b7 62%, #b7862f);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav-tab {
  min-height: 44px;
  padding: 0 13px 0 15px;
  color: #d5deea;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-tab:hover,
.nav-tab.active {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(18, 165, 148, 0.18), rgba(255, 255, 255, 0.075)),
    rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 3px 0 0 #14b8a6, 0 10px 24px rgba(0, 0, 0, 0.14);
}

.sidebar-summary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.workspace {
  padding: 32px;
}

.topbar {
  margin: -32px -32px 24px;
  padding: 23px 32px;
  background: rgba(247, 250, 252, 0.9);
  border-bottom: 1px solid rgba(203, 213, 225, 0.72);
  box-shadow: 0 10px 30px rgba(16, 21, 34, 0.055);
}

.topbar h2 {
  font-size: 31px;
  font-weight: 860;
}

.eyebrow {
  color: var(--green-dark);
  letter-spacing: 0.08em;
}

.panel,
.metric-panel,
.system-tile,
.number-tile,
.goal-card,
.okr-card,
.goal-economic-tile,
.metric-edit-card,
.project-card,
.scenario-card,
.area-accordion,
.calendar-day,
.empty-state,
.history-item,
.lead-score-editor,
.template-card,
.agenda-column,
.pipeline-column,
.funnel-company,
.alert-item,
.priority-item {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.92)),
    var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel,
.metric-panel {
  box-shadow: var(--shadow);
}

.panel-heading {
  margin: -2px -2px 16px;
  padding: 0 0 15px;
  border-bottom-color: rgba(203, 213, 225, 0.72);
}

.panel h3 {
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

.panel p {
  color: #66758a;
}

.metric-panel::before {
  width: 42px;
  height: 4px;
  background: linear-gradient(90deg, #0c8a7f, #b7862f, #3156b7);
  border-radius: 3px;
}

.metric-panel strong,
.system-tile strong,
.number-tile strong,
.history-item strong {
  color: #101522;
  letter-spacing: 0;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.compact-button,
.company-tab,
.finance-scenario-tab,
.file-trigger,
.link-button {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  border-color: rgba(6, 95, 90, 0.8);
  background: linear-gradient(180deg, #10a194, #08736d);
  box-shadow: 0 12px 26px rgba(12, 138, 127, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.ghost-button,
.icon-button,
.compact-button,
.file-trigger,
.link-button {
  color: #263245;
  background: rgba(255, 255, 255, 0.92);
  border-color: #ccd6e4;
}

.ghost-button:hover,
.icon-button:hover,
.compact-button:hover,
.file-trigger:hover,
.link-button:hover {
  color: #0b625d;
  border-color: rgba(12, 138, 127, 0.42);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(16, 21, 34, 0.08);
}

.danger-button {
  color: #9d2419;
  background: #fff6f4;
  border-color: #f3bbb4;
}

input,
select,
textarea,
.compact-input {
  min-height: 38px;
  color: #111827;
  background: #ffffff;
  border-color: #c7d3e3;
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(16, 21, 34, 0.045), 0 1px 0 rgba(255, 255, 255, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(12, 138, 127, 0.7);
  box-shadow: var(--focus), inset 0 1px 2px rgba(16, 21, 34, 0.04);
}

.table-scroll {
  border-color: rgba(199, 211, 227, 0.8);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 42px rgba(16, 21, 34, 0.07);
}

table {
  background: #ffffff;
}

th {
  height: 46px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(180deg, #1b2536, #131b2a);
}

td {
  height: 48px;
  color: #1f2937;
  border-bottom-color: rgba(215, 223, 235, 0.9);
}

tbody tr:nth-child(even) {
  background: #f8fbfd;
}

tbody tr:hover {
  background: #eef8f6;
}

.finance-plan-table th,
.finance-month-compare-table th {
  background: linear-gradient(180deg, #39b6bf, #278e98);
}

.finance-plan-row.section td,
.finance-plan-row.total td,
.finance-month-row.section td,
.finance-plan-row.section.income-section td,
.finance-month-row.section.income td,
.finance-month-compare-table .finance-month-row.section td:first-child,
.finance-month-compare-table .finance-month-row.section td:nth-child(2) {
  color: #fff;
  background: linear-gradient(180deg, #3dbcc3, #2b9ca5);
  border-bottom-color: rgba(15, 23, 42, 0.12);
}

.finance-plan-row.detail td,
.finance-month-row.detail td,
.finance-expense-item td {
  background: #f3fbfb;
}

.finance-plan-row.result td,
.finance-month-row.result td {
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
}

.finance-number {
  font-weight: 800;
}

.pill {
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.pill.ok {
  color: #0f6b3f;
  background: #e3f7ec;
}

.pill.warn {
  color: #8a5500;
  background: #fff2c6;
}

.pill.bad {
  color: #ad2016;
  background: #fff0ef;
}

.company-tab,
.finance-scenario-tab {
  color: #263245;
  background: rgba(255, 255, 255, 0.92);
  border-color: #ccd6e4;
}

.company-tab.active,
.finance-scenario-tab.active {
  color: #ffffff;
  background: linear-gradient(180deg, #10a194, #08736d);
  border-color: rgba(6, 95, 90, 0.72);
  box-shadow: 0 12px 28px rgba(12, 138, 127, 0.2);
}

.finance-scenario-tab.bad.active {
  background: linear-gradient(180deg, #b84639, #8f2a21);
}

.finance-scenario-tab.good.active {
  background: linear-gradient(180deg, #3156b7, #223f8f);
}

.project-card.active,
.scenario-card:hover,
.area-accordion[open] {
  border-color: rgba(12, 138, 127, 0.38);
  background: linear-gradient(180deg, #ffffff, #edf8f6);
}

.bar-track {
  background: #dde6f0;
}

.bar-fill {
  background: linear-gradient(90deg, #0c8a7f, #b7862f, #3156b7);
}

.login-body {
  background:
    linear-gradient(180deg, rgba(18, 21, 32, 0.88), rgba(24, 25, 38, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px),
    #15151f;
}

.login-card {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 86px rgba(0, 0, 0, 0.34);
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-summary {
    position: static;
    margin-top: 18px;
  }

  .nav-tabs {
    flex: initial;
    overflow: visible;
    padding-right: 0;
  }

  .topbar {
    position: static;
  }

  .nav-tabs {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .split-layout,
  .project-grid,
  .kpi-grid,
  .goals-layout,
  .okr-grid,
  .triage-layout,
  .crm-layout,
  .finance-planning-controls,
  .period-summary-grid,
  .goal-progress-grid {
    grid-template-columns: 1fr;
  }

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

  .goal-economics-grid {
    grid-template-columns: 1fr;
  }

  .agenda-board,
  .pipeline-board,
  .template-card {
    grid-template-columns: 1fr;
  }

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

  .template-card .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 18px;
    padding: 18px;
  }

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

  .nav-tabs,
  .form-grid,
  .project-numbers,
  .goal-field-grid,
  .triage-form,
  .weekly-calendar {
    grid-template-columns: 1fr;
  }

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

  .weekly-action-head {
    display: none;
  }

  .weekly-action-row {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .weekly-action-row input:first-child,
  .weekly-action-row .pill,
  .weekly-action-row input[type="date"] {
    grid-column: span 2;
  }

  .weekly-action-row .icon-button {
    justify-self: end;
  }

  .funnel-steps {
    grid-template-columns: 1fr;
  }

  .metric-edit-card__head,
  .metric-edit-grid,
  .metric-result-grid,
  .okr-item-head,
  .okr-sliders,
  .lead-score-grid {
    grid-template-columns: 1fr;
  }

  .metric-edit-card__head .pill,
  .metric-edit-card__head .icon-button {
    justify-self: start;
  }

  .action-row input[type="date"],
  .action-row .icon-button {
    grid-column: 2;
  }

  .wide-field {
    grid-column: span 1;
  }
}
