* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #0b0d12;
  color: #f7f7fb;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(111, 74, 255, 0.16), transparent 35%),
    #0b0d12;
}

button,
input {
  font: inherit;
}

.page-header {
  border-bottom: 1px solid #272b35;
  padding: 38px 24px 30px;
}

.page-header > div,
.page-shell {
  width: min(1250px, 100%);
  margin: 0 auto;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.subtitle {
  max-width: 820px;
  color: #afb4c2;
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 8px;
  color: #bdaeff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-shell {
  padding: 28px 24px 70px;
}

.flash,
.write-mode {
  margin-bottom: 18px;
  border: 1px solid;
  border-radius: 12px;
  padding: 14px 16px;
}

.flash-success {
  border-color: #2f6b4e;
  background: #102a20;
}

.flash-warning {
  border-color: #796628;
  background: #2c260f;
}

.flash-error,
.write-mode-enabled {
  border-color: #7a3341;
  background: #32141b;
}

.write-mode-disabled {
  border-color: #454c59;
  background: #1c2028;
  color: #c5cad5;
}

.square-status-card,
.sync-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
  border: 1px solid #37415b;
  border-radius: 17px;
  background: linear-gradient(135deg, #171b27, #12151c);
  padding: 22px;
}

.square-status-card p,
.sync-card p {
  margin: 8px 0 0;
  color: #aeb4c2;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.primary-button,
.secondary-button,
.square-button,
.danger-button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  background: #7957ff;
  color: white;
}

.square-button {
  background: #d5ff54;
  color: #11140b;
  white-space: nowrap;
}

.secondary-button {
  border: 1px solid #3b404c;
  background: #171a21;
  color: #f7f7fb;
}

.danger-button {
  background: #d7425b;
  color: white;
}

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

.safety-note,
.audit-note {
  color: #9ca2b0;
  font-size: 0.9rem;
}

.program-card {
  margin-bottom: 22px;
  border: 1px solid #2a2f39;
  border-radius: 17px;
  background: rgba(22, 25, 32, 0.9);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

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

.program-count {
  color: #8f96a6;
  font-size: 0.88rem;
}

.capacity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.capacity-field,
.sync-form label {
  display: grid;
  gap: 8px;
  color: #d8dbe4;
  font-size: 0.9rem;
}

.capacity-field input,
.sync-form input[type="text"] {
  width: 100%;
  border: 1px solid #373d49;
  border-radius: 10px;
  background: #0f1218;
  color: white;
  padding: 12px 13px;
  font-size: 1rem;
}

.capacity-field input:focus,
.sync-form input:focus {
  outline: 2px solid #7957ff;
  outline-offset: 1px;
}

details {
  border-top: 1px solid #2a2f39;
  padding-top: 16px;
}

summary {
  cursor: pointer;
  color: #c8bcff;
  font-weight: 700;
}

.difference-count {
  margin-left: 8px;
  border-radius: 999px;
  background: #2c260f;
  color: #f3db76;
  padding: 3px 8px;
  font-size: 0.72rem;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

th,
td {
  border-bottom: 1px solid #2a2f39;
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #9ca2b0;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quantity-column {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

code {
  color: #d7ceff;
}

.status {
  display: inline-block;
  border: 1px solid;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-match {
  border-color: #2f6b4e;
  background: #102a20;
  color: #9ce2bd;
}

.status-mismatch {
  border-color: #796628;
  background: #2c260f;
  color: #f3db76;
}

.status-missing {
  border-color: #7a3341;
  background: #32141b;
  color: #ffadb9;
}

.status-not_refreshed {
  border-color: #454c59;
  background: #22262e;
  color: #b8beca;
}

.sync-card {
  align-items: flex-start;
  border-color: #56333c;
}

.sync-form {
  width: min(430px, 100%);
  display: grid;
  gap: 13px;
}

.acknowledgement {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px !important;
  line-height: 1.4;
}

.acknowledgement input {
  margin-top: 3px;
}

.styles-card {
  border-style: dashed;
  color: #c8cbd4;
}

@media (max-width: 760px) {
  .program-heading,
  .toolbar,
  .square-status-card,
  .sync-card {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    padding-top: 28px;
  }
}
