:root {
  --blue: #2563eb;
  --blue-soft: #eef6ff;
  --green: #14b8a6;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --bg: #f4f7fb;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .76), rgba(30, 64, 175, .64)),
    url("https://www.sistemarepara.com/bg-login.webp") center/cover fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  background: #e2e8f0;
  color: #334155;
}

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

button.ghost {
  background: var(--blue-soft);
  color: var(--blue);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(100%, 410px);
  margin: 7vh auto;
  padding: 34px 32px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  text-align: center;
}

.login-card h1 {
  margin: 0;
  color: var(--blue);
  font-size: 32px;
}

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

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

.login-card small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
}

.app {
  width: min(100%, 1240px);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  color: var(--blue);
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
  overflow-x: auto;
  background: white;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.tabs button.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.view {
  display: none;
  padding: 24px;
}

.view.active {
  display: block;
}

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

.toolbar h2 {
  margin: 0;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  width: min(100%, 260px);
}

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

.card,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.card {
  padding: 16px;
}

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

.card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #fbfdff;
  font-size: 12px;
  text-transform: uppercase;
}

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

.actions button {
  padding: 7px 9px;
  font-size: 12px;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #dcfce7;
  color: #166534;
}

.status.warn {
  background: #fef3c7;
  color: #92400e;
}

.status.bad {
  background: #fee2e2;
  color: #991b1b;
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .62);
}

.modal-wrap[hidden] {
  display: none;
}

.modal {
  width: min(100%, 560px);
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px;
  background: white;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .28);
}

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

.modal h2 {
  margin: 0;
}

.modal .icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

#modalBody {
  padding: 20px;
}

#modalBody form {
  display: grid;
  gap: 12px;
}

#modalBody label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%) translateY(12px);
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .95);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

@media (max-width: 850px) {
  .shell {
    padding: 0;
  }

  .app {
    min-height: 100vh;
    border-radius: 0;
  }

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

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

@media (max-width: 520px) {
  .view,
  .topbar {
    padding: 16px;
  }

  .grid,
  .two {
    grid-template-columns: 1fr;
  }

  .login-card {
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    display: grid;
    align-content: center;
  }
}
