:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #eef1f4;
  --text: #1f2933;
  --muted: #667085;
  --border: #d9dee5;
  --green: #18794e;
  --green-soft: #e4f4ec;
  --blue: #2364aa;
  --blue-soft: #e7f0fb;
  --red: #b42318;
  --red-soft: #fde8e6;
  --amber: #a15c07;
  --amber-soft: #fff2d6;
  --violet: #6f42c1;
  --violet-soft: #efe8fb;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(245, 246, 248, 0.95)),
    repeating-linear-gradient(90deg, rgba(35, 100, 170, 0.08) 0 1px, transparent 1px 80px);
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #202a36;
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.login-panel h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 38px);
}

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

.login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 100, 170, 0.14);
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background: #ffffff;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
}

.sidebar-brand strong {
  display: block;
  font-size: 16px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.side-nav button:hover,
.side-nav button.active {
  background: var(--surface-muted);
  color: var(--text);
}

.logout-button {
  margin-top: auto;
}

.content {
  min-width: 0;
  padding: 24px;
}

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

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.env-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.stat-card {
  min-height: 98px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  font-size: 28px;
}

.stat-icon,
.action-icon,
.activity-status,
.modal-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.stat-icon,
.action-icon {
  width: 42px;
  height: 42px;
}

.accent-green .stat-icon,
.accent-green .action-icon {
  background: var(--green-soft);
  color: var(--green);
}

.accent-blue .stat-icon,
.accent-blue .action-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.accent-red .stat-icon,
.accent-red .action-icon {
  background: var(--red-soft);
  color: var(--red);
}

.accent-amber .stat-icon,
.accent-amber .action-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.accent-violet .stat-icon,
.accent-violet .action-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 12px;
  margin-bottom: 24px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 38px;
}

.actions-board {
  display: grid;
  gap: 26px;
}

.action-section {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading span {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.action-card {
  min-height: 236px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(31, 41, 51, 0.04);
}

.action-card.disabled {
  opacity: 0.62;
}

.action-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.priority {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.action-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tag-row {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
}

.tag-row span {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.btn,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
}

.btn svg,
.icon-button svg,
.env-pill svg,
.side-nav svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-primary,
.btn-action {
  background: #202a36;
  color: #fff;
}

.btn-primary:hover,
.btn-action:hover {
  background: #121922;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
}

.btn-action {
  width: 100%;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.activity-panel {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.activity-item strong {
  display: block;
  font-size: 14px;
}

.activity-item span {
  color: var(--muted);
  font-size: 13px;
}

.activity-status {
  width: 34px;
  height: 34px;
}

.activity-item.ok .activity-status {
  background: var(--green-soft);
  color: var(--green);
}

.activity-item.error .activity-status {
  background: var(--red-soft);
  color: var(--red);
}

.empty-copy,
.empty-state {
  color: var(--muted);
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.empty-state svg {
  width: 30px;
  height: 30px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 25, 34, 0.42);
}

.modal {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-icon {
  width: 46px;
  height: 46px;
  background: var(--red-soft);
  color: var(--red);
}

.modal h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.modal p {
  margin-bottom: 0;
  color: var(--muted);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast-success {
  border-color: rgba(24, 121, 78, 0.3);
}

.toast-error {
  border-color: rgba(180, 35, 24, 0.35);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .action-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .side-nav button {
    min-width: 0;
  }

  .logout-button {
    margin-top: 0;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 620px) {
  .pin-row,
  .modal-actions,
  .stats-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  .env-pill {
    max-width: 100%;
  }
}


/* H&H visual refresh */
:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-muted: #f2f5f7;
  --text: #18212f;
  --muted: #5d6b7c;
  --border: #d4dce5;
  --shadow: 0 14px 36px rgba(24, 33, 47, 0.09);
}

body {
  background:
    linear-gradient(180deg, #f8fafb 0%, #eef2f5 42%, #e9eef3 100%);
}

.login-screen {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(238,242,245,0.86)),
    repeating-linear-gradient(45deg, rgba(35,100,170,0.07) 0 1px, transparent 1px 34px);
}

.login-panel {
  border-color: #cfd8e3;
  box-shadow: 0 22px 70px rgba(24, 33, 47, 0.14);
}

.brand-mark {
  width: 54px;
  height: 54px;
  background: #192230;
  color: #ffffff;
  font-size: 14px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.dashboard {
  grid-template-columns: 282px 1fr;
}

.sidebar {
  background: #151d29;
  border-right: 0;
  color: #ffffff;
  box-shadow: 12px 0 32px rgba(24, 33, 47, 0.08);
}

.sidebar .eyebrow,
.sidebar .side-nav button,
.sidebar .logout-button {
  color: #aab6c5;
}

.sidebar-brand strong {
  color: #ffffff;
}

.side-nav button {
  min-height: 44px;
  padding: 0 12px;
}

.side-nav button:hover,
.side-nav button.active {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.logout-button.btn-secondary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: #ffffff;
}

.content {
  padding: 30px;
}

.topbar {
  min-height: 84px;
  align-items: flex-end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
}

.env-pill,
.icon-button,
.toolbar input,
.toolbar select {
  box-shadow: 0 1px 0 rgba(24, 33, 47, 0.04);
}

.stats-grid {
  margin-top: 18px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 104px;
  border-color: #d9e1ea;
  box-shadow: 0 1px 0 rgba(24, 33, 47, 0.04);
}

.stat-card strong {
  font-size: 30px;
}

.toolbar {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
}

.action-section {
  gap: 14px;
}

.section-heading h2 {
  font-size: 19px;
}

.action-card {
  position: relative;
  overflow: hidden;
  min-height: 252px;
  border-color: #d9e1ea;
  border-top: 3px solid var(--accent-color, #2364aa);
  box-shadow: 0 1px 0 rgba(24, 33, 47, 0.04);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(24, 33, 47, 0.12);
}

.action-card.accent-green { --accent-color: var(--green); }
.action-card.accent-blue { --accent-color: var(--blue); }
.action-card.accent-red { --accent-color: var(--red); }
.action-card.accent-amber { --accent-color: var(--amber); }
.action-card.accent-violet { --accent-color: var(--violet); }

.action-card h3 {
  font-size: 19px;
}

.btn-action {
  background: var(--accent-color, #202a36);
}

.accent-green .btn-action { background: var(--green); }
.accent-blue .btn-action { background: var(--blue); }
.accent-red .btn-action { background: var(--red); }
.accent-amber .btn-action { background: var(--amber); }
.accent-violet .btn-action { background: var(--violet); }

.btn-action:hover {
  filter: brightness(0.92);
}

.activity-panel {
  padding-top: 4px;
}

.activity-item {
  border-color: #d9e1ea;
}

.modal {
  width: min(500px, 100%);
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.7);
}

.param-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.param-form label {
  display: grid;
  gap: 6px;
}

.param-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.param-form input {
  background: #ffffff;
}

@media (max-width: 820px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    box-shadow: none;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    min-height: 0;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .param-form {
    grid-template-columns: 1fr;
  }
}
