:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --sidebar: #111827;
  --sidebar2: #182235;
  --text: #152033;
  --muted: #6b7280;
  --line: #e5e9f0;
  --primary: #1f66e5;
  --primary2: #1853bc;
  --success: #16815d;
  --danger: #d13f4d;
  --warning: #c97a10;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

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

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      circle at 20% 20%,
      #e4edff,
      transparent 35%
    ),
    var(--bg);
}

.login-card {
  width: min(420px, 92vw);
  background: white;
  padding: 42px;
  border-radius: 20px;
  box-shadow:
    0 24px 70px rgba(20,40,80,.14);
}

.login-card h1 {
  margin:
    24px 0 8px;
  font-size: 26px;
}

.login-card p {
  margin:
    0 0 28px;
  color: var(--muted);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 26px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 19px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin:
    16px 0 7px;
}

input,
select {
  width: 100%;
  border:
    1px solid #d8dde7;
  border-radius: 10px;
  padding:
    11px 12px;
  outline: none;
  background: white;
}

input:focus,
select:focus {
  border-color:
    var(--primary);
  box-shadow:
    0 0 0 3px
    rgba(31,102,229,.12);
}

.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 9px;
  padding:
    10px 16px;
  font-weight: 650;
}

.primary {
  background:
    var(--primary);
  color: white;
}

.primary:hover {
  background:
    var(--primary2);
}

.secondary {
  background: white;
  border:
    1px solid var(--line);
  color: var(--text);
}

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

.full {
  width: 100%;
}

.login-card .primary {
  margin-top: 22px;
}

.error-text {
  color:
    var(--danger);
  font-size: 13px;
  margin-top: 12px;
}

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

.sidebar {
  width: 245px;
  background:
    linear-gradient(
      180deg,
      var(--sidebar),
      var(--sidebar2)
    );
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset:
    0 auto 0 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding:
    24px 20px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  margin-top: 2px;
  font-size: 11px;
  color: #aeb9cc;
}

nav {
  padding:
    8px 12px;
  flex: 1;
}

nav button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding:
    11px 13px;
  margin-bottom: 4px;
  text-align: left;
  background: transparent;
  color: #bfc9d9;
}

nav button:hover,
nav button.active {
  background:
    rgba(255,255,255,.09);
  color: white;
}

.sidebar-footer {
  padding:
    18px;
  border-top:
    1px solid
    rgba(255,255,255,.08);
}

#currentUser {
  font-size: 12px;
  color: #c5cede;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.main {
  flex: 1;
  margin-left: 245px;
  min-width: 0;
}

.topbar {
  height: 84px;
  background: white;
  border-bottom:
    1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:
    0 30px;
}

.topbar h2 {
  margin: 0;
  font-size: 21px;
}

.topbar p {
  margin:
    4px 0 0;
  color:
    var(--muted);
  font-size: 12px;
}

#content {
  padding:
    28px 30px;
}

.cards {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(170px,1fr)
    );
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background:
    var(--panel);
  border:
    1px solid var(--line);
  border-radius:
    var(--radius);
  padding: 20px;
}

.metric-label {
  color:
    var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 750;
}

.panel {
  background: white;
  border:
    1px solid var(--line);
  border-radius:
    var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-header {
  padding:
    17px 20px;
  border-bottom:
    1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse:
    collapse;
  white-space:
    nowrap;
}

th,
td {
  padding:
    12px 16px;
  text-align: left;
  border-bottom:
    1px solid #eef1f5;
  font-size: 12px;
}

th {
  background:
    #fafbfd;
  color:
    #667085;
  font-size: 11px;
  text-transform:
    uppercase;
  letter-spacing:
    .035em;
}

td.wrap {
  white-space: normal;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding:
    4px 8px;
  font-size: 10px;
  font-weight: 700;
}

.badge.completed,
.badge.active,
.badge.success {
  background:
    #e8f7f1;
  color:
    var(--success);
}

.badge.failed,
.badge.disabled {
  background:
    #fff0f1;
  color:
    var(--danger);
}

.badge.processing {
  background:
    #e9f1ff;
  color:
    var(--primary);
}

.badge.queued,
.badge.retry_wait,
.badge.pending {
  background:
    #fff6e7;
  color:
    var(--warning);
}

.actions {
  display: flex;
  gap: 7px;
}

.actions button {
  border:
    1px solid var(--line);
  background: white;
  border-radius: 7px;
  padding:
    6px 9px;
  font-size: 11px;
}

.toolbar {
  display: flex;
  justify-content:
    flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    rgba(10,20,35,.45);
  z-index: 99;
  padding: 20px;
}

.modal-card {
  width:
    min(620px,96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: white;
  border-radius: 16px;
  box-shadow:
    0 30px 100px
    rgba(0,0,0,.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:
    18px 22px;
  border-bottom:
    1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
}

#modalBody {
  padding:
    20px 22px 24px;
}

.icon-button {
  border: 0;
  background: transparent;
  font-size: 26px;
  color: #758094;
}

.form-grid {
  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap:
    0 14px;
}

.form-actions {
  display: flex;
  justify-content:
    flex-end;
  gap: 8px;
  margin-top: 22px;
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background:
    #172033;
  color: white;
  border-radius: 10px;
  padding:
    12px 16px;
  box-shadow:
    0 12px 40px
    rgba(0,0,0,.18);
  z-index: 200;
  font-size: 13px;
}

.small-muted {
  color:
    var(--muted);
  font-size: 11px;
}

@media (max-width: 850px) {

  .sidebar {
    width: 190px;
  }

  .main {
    margin-left: 190px;
  }

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