:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #fff;
  --line: #d9e1e8;
  --text: #101828;
  --muted: #667085;
  --primary: #0b7a75;
  --primary-dark: #075e59;
  --primary-soft: #e7f6f4;
  --danger: #b42318;
  --success: #087443;
  --warning: #b54708;
  --shadow: 0 16px 44px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
a {
  font: inherit;
}

.admin-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
}

.login-card,
.panel,
.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(420px, 100%);
  padding: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 19px;
  line-height: 1.25;
}

.brand-row p,
.panel-head span,
.metric-grid span,
.message {
  color: var(--muted);
}

form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

label {
  color: #344054;
  font-size: 14px;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.14);
}

button,
nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #addad5;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

form button {
  margin-top: 8px;
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

button:hover,
nav a:hover {
  color: #fff;
  background: var(--primary-dark);
}

.message {
  min-height: 22px;
  margin-top: 12px;
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

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

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.metric-grid article {
  min-height: 96px;
  padding: 16px;
}

.metric-grid span {
  display: block;
  font-size: 13px;
  font-weight: 750;
}

.metric-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.panel {
  margin-top: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 210px;
  padding: 18px;
}

.trend-day {
  display: grid;
  gap: 8px;
  align-content: end;
  min-width: 0;
}

.bar-stack {
  display: grid;
  align-items: end;
  height: 128px;
  padding: 0 8px;
}

.bar {
  display: block;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
  background: var(--primary);
}

.bar.jobs {
  background: #3478f6;
}

.trend-label,
.trend-value {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-value {
  color: #344054;
  font-weight: 750;
}

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

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f4;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #344054;
  background: #f8fafb;
  font-weight: 800;
}

td {
  color: #475467;
}

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

.status.success {
  color: var(--success);
  background: #e8f7ef;
}

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

.status.running,
.status.pending {
  color: var(--warning);
  background: #fff4e6;
}

.pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
}

.pager span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 960px) {
  .metric-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .admin-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 14px;
  }

  .metric-grid,
  .admin-grid,
  .trend-chart {
    grid-template-columns: 1fr;
  }

  .trend-chart {
    min-height: 0;
  }
}
