
:root {
  --color-primary: #005f99;    /* azul oscuro anillo exterior */
  --color-secondary: #00a6c9;  /* celeste interior */
  --color-accent: #f4a024;     /* color huemul */
  --color-green: #009b5a;      /* pradera */
  --color-bg: #f5f7fa;
  --radius-xl: 18px;
  --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.18);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #e0f4ff, #f9fbff);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.app-shell--narrow {
  max-width: 460px;
  grid-template-columns: 1fr;
}

.app-hero {
  position: relative;
  padding: 28px 28px 32px;
  background: linear-gradient(145deg, var(--color-primary), #001f3f);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-hero-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-hero-logo img {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  object-fit: contain;
  background: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  font-size: 11px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.4);
}

.app-hero h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

.app-hero p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.app-hero-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  opacity: 0.95;
}

.chip {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.4);
}

/* Right pane / content */

.app-main {
  padding: 24px 28px 26px;
  overflow: auto;
  max-height: 80vh;
}

.app-main-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 6px;
}

.app-main-header h2 {
  margin: 0;
  font-size: 18px;
}

.app-main-header small {
  font-size: 11px;
  color: #64748b;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.field label {
  font-weight: 600;
  color: #0f172a;
}

.field small {
  font-size: 11px;
  color: #64748b;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  background: #f8fafc;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background: white;
}

select[multiple] {
  min-height: 110px;
}

.button-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.16s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: white;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
  background: white;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
}

.btn:disabled {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed rgba(148, 163, 184, 0.7);
  color: #475569;
}

.divider {
  margin: 16px 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

/* Output / resultado */

.result-panel {
  margin-top: 10px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 14px 16px 18px;
  max-height: 360px;
  overflow: auto;
  font-size: 13px;
}

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

.result-section {
  margin-top: 10px;
}

.result-section h4 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}

.result-section p,
.result-section ul {
  margin: 0 0 4px;
}

.result-section ul {
  padding-left: 18px;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.45);
  margin-bottom: 6px;
}

/* Login & admin tables */

.login-card {
  padding: 22px 24px 24px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.login-subtitle {
  margin: 0 0 12px;
  font-size: 12px;
  color: #64748b;
}

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

.table th,
.table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.table th {
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
}

/* Chips for roles */
.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

/* Small screens */
@media (max-width: 880px) {
  body {
    padding: 16px;
  }
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 780px;
  }
  .app-hero {
    border-radius: 24px 24px 0 0;
  }
  .app-main {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
