:root {
  --admin-bg: #f4f6f2;
  --admin-panel: #ffffff;
  --admin-border: #d7ddd1;
  --admin-ink: #1b1f1d;
  --admin-muted: #5b655b;
  --admin-accent: #0a6a5b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.admin-body {
  font-family: "Archivo", sans-serif;
  background: linear-gradient(135deg, #eef1ea 0%, #f7f8f4 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-x: hidden;
}

.admin-shell {
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Override dashboard shell styles for admin */
.admin-shell.app-box {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background-color: transparent;
  width: 100%;
  max-width: 100vw;
}

.admin-header.header-box {
  position: relative;
  min-height: 56px;
  height: auto;
  border-bottom: none;
  font-family: "Archivo", sans-serif;
  text-align: left;
  z-index: 1;
}

.admin-shell .logo-div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-shell .product-naam {
  font-size: 20px;
  padding: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #111815;
  color: #f4f6f2;
  width: 100%;
}

.admin-header .product-naam {
  color: #f4f6f2;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-label {
  font-size: 14px;
  color: #cfd6cc;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--admin-bg);
  width: 100%;
  min-width: 0;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  background: #1a221e;
  overflow-y: auto;
  min-width: 0;
}

.admin-nav-item {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: #cfd6cc;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.admin-nav-item.active {
  background: #0f7b67;
  color: #ffffff;
}

.admin-content {
  padding: 18px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  min-height: 0;
  min-width: 0;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  min-width: 0;
}

.admin-card {
  background: var(--admin-panel);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 12px 30px rgba(15, 20, 15, 0.06);
}

.admin-card.admin-card-scroll {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.admin-card.admin-card-scroll .admin-card-body {
  overflow-y: auto;
  padding-right: 6px;
}

.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-card-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--admin-ink);
}

.admin-card-body {
  color: var(--admin-muted);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.admin-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--admin-muted);
}

.admin-filter input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: #ffffff;
}

.admin-filter select,
.admin-filter textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: #ffffff;
  font-family: "Archivo", sans-serif;
  resize: vertical;
}

/* .admin-filter-wide {
  flex: 1 1 260px;
  min-width: 240px;
} */

.admin-table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e3e8df;
  text-align: left;
  vertical-align: top;
  /* word-break: break-word; */
}

.admin-table th {
  color: var(--admin-ink);
  font-weight: 700;
}

.admin-table-filters input {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
}

.admin-table-auto {
  table-layout: auto;
}

.admin-updates-table .col-date,
.admin-updates-table .col-version,
.admin-updates-table .col-package {
  white-space: nowrap;
  width: 1%;
}

.admin-updates-table .col-actions {
  white-space: nowrap;
  width: 1%;
}

.admin-updates-table .col-description {
  white-space: normal;
}

.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.admin-table th .sort-indicator {
  margin-left: 6px;
  font-size: 11px;
  color: var(--admin-muted);
}

.admin-table input,
.admin-table textarea,
.admin-table select {
  width: 100%;
  min-width: 80px;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  font-family: "Archivo", sans-serif;
  font-size: 12px;
}

.admin-table input[type="checkbox"] {
  width: auto;
  min-width: 0;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf5f1;
  color: #0f7b67;
  font-weight: 600;
  font-size: 12px;
}

.admin-pill.admin-action {
  background: #e5efff;
  color: #1d4ed8;
  border: none;
  cursor: pointer;
}

.admin-pill.admin-danger {
  background: #fde8e8;
  color: #b42318;
  border: none;
  cursor: pointer;
}

.admin-pill.admin-muted {
  background: #eef1f4;
  color: #52606d;
  border: none;
  cursor: pointer;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.status-icon.ok {
  background: #e7f6ec;
  color: #027a48;
  border: 1px solid #b7e4c7;
}

.status-icon.no {
  background: #fdecec;
  color: #b42318;
  border: 1px solid #f5b5b5;
}

.admin-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e6ebe2;
}

.admin-status-row:last-child {
  border-bottom: none;
}

.admin-status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #edf5f1;
  color: #0f7b67;
}

.admin-status.error {
  background: #fff4e5;
  color: #b54708;
}

.admin-status.down {
  background: #fde8e8;
  color: #b42318;
}

.admin-update {
  padding: 8px 0;
  border-bottom: 1px solid #e6ebe2;
}

.admin-update:last-child {
  border-bottom: none;
}

.admin-update-title {
  font-weight: 600;
  color: var(--admin-ink);
}

.admin-update-meta {
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-warning {
  color: #b42318;
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-metric-bar {
  position: relative;
  height: 18px;
  border-radius: 10px;
  background: #e6ebe2;
  overflow: hidden;
  min-width: 140px;
}

.admin-metric-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #7ad08d, #2c9a5a);
}

.admin-metric-bar span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  line-height: 18px;
  padding-left: 8px;
  color: #1d2b1e;
}

.admin-metrics-table td {
  vertical-align: middle;
}

.admin-subtitle {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-update-muted {
  background: rgba(0, 0, 0, 0.03);
  padding: 8px 10px;
  border-radius: 8px;
}

.admin-log-output {
  background: #0f1311;
  color: #e8efe4;
  padding: 16px;
  border-radius: 12px;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}

.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.admin-login-card {
  background: #ffffff;
  padding: 28px 30px;
  border-radius: 18px;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-login-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
}

.admin-login-error {
  color: #b42318;
  font-size: 13px;
  min-height: 16px;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
  }

  .admin-nav-item {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .admin-shell .product-naam {
    display: none;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .admin-header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-content {
    padding: 14px 12px;
  }

  .admin-card {
    padding: 12px;
  }

  .admin-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-filter {
    width: 100%;
  }

  .admin-filter-wide {
    min-width: 0;
  }

  .admin-table {
    font-size: 12px;
    table-layout: auto;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 6px;
  }

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

  .admin-pill {
    font-size: 11px;
  }

  .admin-metric-bar {
    min-width: 100px;
  }

  .admin-login-card {
    width: min(320px, 92vw);
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    margin-bottom: 12px;
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 10px 12px;
  }

  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: none;
    border-bottom: 1px dashed #e3e8df;
    padding: 6px 0;
  }

  .admin-table td:last-child {
    border-bottom: none;
  }

  .admin-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--admin-muted);
    flex: 0 0 45%;
  }

  .admin-table td > * {
    max-width: 55%;
  }

  .admin-table td > input,
  .admin-table td > select,
  .admin-table td > textarea {
    width: 100%;
  }

  .admin-table td > input[type="checkbox"] {
    width: auto;
    max-width: none;
  }

  .admin-actions {
    width: 100%;
    align-items: stretch;
  }

  .admin-actions .admin-pill {
    width: 100%;
    text-align: center;
  }

  .admin-nav {
    max-height: 96px;
  }
}
