:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --panel-soft: #eef4f2;
  --text: #1e2d2b;
  --muted: #637371;
  --line: #d8e2df;
  --primary: #0f766e;
  --primary-dark: #0b514d;
  --accent: #c58a2d;
  --danger: #b42318;
  --ok: #15803d;
  --shadow: 0 12px 32px rgba(20, 42, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
select,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: #173532;
  color: white;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-logo {
  width: 56px;
  height: 44px;
  object-fit: contain;
  padding: 0;
}

.brand small {
  display: block;
  color: #bed0cd;
  margin-top: 3px;
}

.menu {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  text-align: left;
  color: #e6f0ee;
  background: transparent;
  cursor: pointer;
}

.menu button:hover,
.menu button.active {
  background: rgba(255, 255, 255, 0.12);
}

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

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.profile-picker {
  display: grid;
  gap: 6px;
  min-width: 230px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.alert {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: white;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  cursor: pointer;
}

button.secondary {
  background: var(--panel-soft);
  color: var(--text);
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--panel-soft);
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 12px;
}

.card strong {
  font-size: 1.55rem;
}

.content {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--panel-soft);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.status.danger {
  background: #fff1f0;
  color: var(--danger);
}

.status.ok {
  background: #edfdf3;
  color: var(--ok);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

dialog {
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialog-form header,
.dialog-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.dialog-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.form-message {
  min-height: 22px;
  color: var(--danger);
}

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

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

  .cards {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

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

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

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

  .cards,
  .dialog-fields {
    grid-template-columns: 1fr;
  }

  .profile-picker {
    min-width: 0;
  }
}
