body:not(.v2-contracts-active) #v2-contracts-root {
  display: none;
}

body.v2-contracts-active .main-shell > main.workspace:not(.v2-workspace) {
  display: none !important;
}

body.v2-contracts-active .sidebar nav button[data-v2-nav] {
  background: #111827;
  color: #fff;
}

.v2-workspace {
  gap: 18px;
}

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

.v2-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.v2-layout.list-only {
  grid-template-columns: 1fr;
}

.v2-builder,
.v2-list,
.v2-reminders-panel {
  overflow: hidden;
}

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

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

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

.v2-form label,
.v2-milestone label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.v2-form label span,
.v2-milestone label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.v2-form input,
.v2-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d8dee9;
  border-radius: 6px;
  color: #0f172a;
  font: inherit;
  padding: 9px 10px;
}

.v2-form .wide {
  grid-column: span 2;
}

.v2-rule-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.v2-rule-panel h3 {
  color: #0f172a;
  font-size: 15px;
  margin: 0 0 12px;
}

.v2-rule-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.v2-rule-head h3 {
  margin: 0;
}

.v2-rule-panel.hidden {
  display: none;
}

.v2-milestones {
  display: grid;
  gap: 12px;
}

.v2-milestone {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 1fr) 80px 120px 150px 84px;
  gap: 10px;
  align-items: end;
}

.v2-remove-milestone {
  align-self: end;
}

.v2-actions,
.v2-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.v2-preview {
  max-height: 280px;
  overflow: auto;
}

.v2-alert {
  border-radius: 6px;
  font-size: 13px;
  margin: 0 0 8px;
  padding: 9px 10px;
}

.v2-alert.danger {
  background: #fef2f2;
  color: #991b1b;
}

.v2-alert.warning {
  background: #fffbeb;
  color: #92400e;
}

.v2-contract-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
}

.v2-contract-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.v2-contract-card h3 {
  color: #0f172a;
  font-size: 16px;
  margin: 4px 0;
}

.v2-contract-card p {
  color: #64748b;
  margin: 0;
}

.v2-contract-card .v2-os-meta {
  font-size: 12px;
}

.v2-contract-card > div > span,
.v2-table small {
  color: #64748b;
  display: block;
  font-size: 12px;
}

.v2-contract-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.v2-contract-card dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.v2-contract-card dd {
  color: #0f172a;
  margin: 2px 0 0;
}

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

.v2-table th,
.v2-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.v2-table th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

.v2-table td {
  color: #0f172a;
  font-size: 14px;
}

.v2-table button {
  white-space: nowrap;
}

.v2-reminder-row td {
  background: #eef6ff;
  border-bottom: 1px solid #cfe3ff;
  padding: 8px 12px;
}

.v2-inline-reminder {
  align-items: center;
  color: #1e3a8a;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px;
  line-height: 1.35;
}

.v2-inline-reminder strong {
  color: #0f172a;
}

.v2-projection-notice {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  color: #1e3a8a;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.v2-dialog-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 50;
}

.v2-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 14px;
  max-width: 720px;
  padding: 18px;
  width: min(100%, 720px);
}

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

.v2-dialog-head span,
.v2-dialog-copy {
  color: #64748b;
}

.v2-dialog-head h2 {
  color: #0f172a;
  font-size: 22px;
  margin: 4px 0 0;
}

.v2-dialog-copy {
  margin: 0;
}

@media (max-width: 1100px) {
  .v2-layout,
  .v2-form-grid,
  .v2-form-grid.compact,
  .v2-contract-card dl {
    grid-template-columns: 1fr;
  }

  .v2-form .wide {
    grid-column: auto;
  }

  .v2-milestone {
    grid-template-columns: 1fr;
  }
}
