:root {
  color-scheme: light dark;
  --bg-start: #f8fafc;
  --bg-mid: #eff6ff;
  --bg-end: #e0e7ff;
  --card-bg: rgba(255, 255, 255, 0.94);
  --border: rgba(15, 23, 42, 0.12);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --button-start: #0ea5e9;
  --button-end: #4f46e5;
  --error: #be123c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 34%),
    linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(56px);
  z-index: 0;
}

body::before {
  width: 360px;
  height: 360px;
  left: -120px;
  top: -80px;
  background: rgba(125, 211, 252, 0.36);
}

body::after {
  width: 420px;
  height: 420px;
  right: -160px;
  bottom: -140px;
  background: rgba(165, 180, 252, 0.38);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-shell {
  width: min(480px, 100%);
}

.login-hero,
.login-panel {
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
}

.login-panel {
  border-radius: 24px;
  background: var(--card-bg);
  padding: 28px 28px 24px;
  backdrop-filter: blur(18px);
  position: relative;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 96px;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 65%);
  pointer-events: none;
  border-radius: 24px 24px 0 0;
}

.panel-logo-wrap {
  width: 224px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.panel-overline {
  margin-top: 18px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: #0369a1;
  position: relative;
  z-index: 1;
}

.login-panel h2 {
  margin: 10px 0 0;
  font-size: 1.6rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.panel-copy {
  margin-top: 10px;
  color: var(--text-subtle);
  text-align: center;
  position: relative;
  z-index: 1;
}

.card {
  width: min(760px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.1);
  padding: 18px;
}

.app-shell {
  display: grid;
  gap: 14px;
}

.app-topbar {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.84);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 72px;
  height: auto;
  flex-shrink: 0;
}

.app-overline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #0369a1;
}

.app-copy {
  margin-top: 3px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-badge {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.app-section-card {
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.card-header p {
  color: var(--text-muted);
}

.form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 1rem;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
}

input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--button-start), var(--button-end));
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.button-secondary {
  color: #334155;
  background: #e2e8f0;
}

.button-secondary:hover {
  filter: none;
  background: #cbd5e1;
}

button:disabled {
  opacity: 0.86;
  cursor: not-allowed;
}

button:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.submit-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.9s linear infinite;
}

.spinner circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 62;
  stroke-dashoffset: 46;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toolbar {
  display: flex;
  gap: 8px;
}

.status-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.status-item {
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  padding: 10px 11px;
  background: #f8fafc;
}

.status-grid h3 {
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 4px;
}

.status-item p {
  font-weight: 700;
  color: #0f172a;
}

.json-box {
  margin-top: 10px;
  background: #0b1020;
  color: #d6e3ff;
  border-radius: 10px;
  padding: 12px;
  max-height: 300px;
  overflow: auto;
}

.section-header {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-header-stacked {
  align-items: flex-start;
  flex-wrap: wrap;
}

.meta-text {
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 0.86rem;
}

.clientes-toolbar {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: min(100%, 520px);
}

.search-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.search-form input {
  flex: 1;
  min-width: min(100%, 260px);
  padding: 10px 12px;
  font-size: 0.92rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.page-label {
  min-width: 78px;
  color: var(--text-subtle);
  font-size: 0.86rem;
  text-align: center;
}

.chip-grid {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid #d1dae8;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.82rem;
  background: #f1f5f9;
  color: #334155;
}

.table-wrap {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #f8fafc;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  background: #eaf2ff;
  color: #334155;
}

.message {
  margin-top: 12px;
  font-size: 0.94rem;
}

.error {
  color: var(--error);
}

.panel-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 920px) {
  .login-shell {
    width: min(460px, 100%);
  }

  .login-panel {
    padding: 22px;
  }

  .app-brand {
    align-items: flex-start;
  }

  .app-logo {
    width: 56px;
  }

  .search-form {
    justify-content: stretch;
  }

  .pagination-controls {
    justify-content: stretch;
  }

  .page-label {
    width: 100%;
  }

  .search-form button,
  .search-form input,
  .pagination-controls button {
    width: 100%;
  }
}

