:root {
  --bg: #ffffff;
  --card: #ffffff;
  --muted: #475569;
  --text: #0f172a;
  --primary: #0f766e;
  --primary-600: #0d5f59;
  --ring: #22c55e33;
  --border: #e2e8f0;
  --surface: #f8fafc;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.container.wide {
  max-width: 1200px;
}
.h1,
h1 {
  font-size: 2rem;
  margin: 0 0 1rem;
}
.menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.card {
  background: var(--card);
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--border);
}
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid.small {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
/* Single-column helper for forms */
.grid.single {
  grid-template-columns: 1fr;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
}
input,
textarea,
select {
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.info {
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.button {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
}
.button:hover {
  background: var(--primary-600);
}
.button.secondary {
  background: #334155;
  color: #e5e7eb;
}
.button.secondary:hover {
  background: #1f2937;
}
.link {
  color: var(--muted);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
.hidden {
  display: none;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin: 1rem 0;
  gap: 1rem;
}
.table-wrapper {
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: #0f172a;
}
th {
  position: sticky;
  top: 0;
  background: var(--surface);
}
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none;
  }
}

/* Header / Branding */
.site-header {
  background: #fff;
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo {
  height: 48px;
  width: auto;
  display: block;
}
.titles {
  display: flex;
  flex-direction: column;
}
.app-title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: #0f172a;
}
.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: #0f172a;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}
.site-nav a:hover {
  background: #f1f5f9;
}

/* Layout tweaks */
main.container {
  padding-top: 1.25rem;
}
.card form,
.card .grid {
  width: 100%;
}
.card.narrow {
  max-width: 720px;
  margin: 0 auto;
}
.menu {
  flex-wrap: wrap;
}

/* Responsive forms */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-direction: column;
  }
  .app-title {
    font-size: 1.1rem;
  }
}

/* Responsive table: keep horizontal scroll on small screens */
@media (max-width: 768px) {
  th,
  td {
    font-size: 0.9rem;
    padding: 0.5rem;
  }
}

/* Home (index) layout */
.home-wrapper {
  min-height: calc(100dvh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2.5rem;
  padding-top: 2.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0;
  color: #0f172a;
  margin-bottom: 100px;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  border-radius: 9999px;
  padding: 1.1rem 2rem;
  min-width: min(90vw, 520px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08),
    inset 0 -2px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.cta.green {
  background: #0f766e;
}
.cta.green:hover {
  background: #0d5f59;
}
.cta.red {
  background: #b91c1c;
}
.cta.red:hover {
  background: #991b1b;
}
.brand-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.brand-card img {
  height: 54px;
  width: auto;
  display: block;
}
.footer-link {
  position: fixed;
  right: 14px;
  bottom: 12px;
  color: #334155;
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-link:hover {
  text-decoration: underline;
}

/* Entrada (registro) layout */
.brand-top {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}
.brand-top .brand-card {
  padding: 0.75rem 1.25rem;
}
.page-subtitle {
  text-align: center;
  color: #222;
  margin: 0.5rem 0 1rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.95rem;
}
.form-hero-title {
  text-align: center;
  color: #0f766e;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin: 0 0 1.25rem;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

/* Labels e inputs estilo "pill" */
.label-up {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: #111;
}
input.pill,
textarea.pill,
select.pill {
  padding: 1rem 1.25rem;
  border-radius: 28px;
  border: 2px solid #6b7280; /* gris medio */
  background: #fff;
  outline: none;
  font-size: 1rem;
}
textarea.pill {
  border-radius: 18px;
}
input.pill:focus,
textarea.pill:focus,
select.pill:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* Barra de acciones inferior */
.actions.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b91c1c;
  color: #fff;
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-direction: column;
  gap: 2px;
}
.btn-home:hover {
  background: #991b1b;
}
.btn-home .emoji {
  font-size: 50px;
  line-height: normal;
  margin-top: -17px;
}
.btn-home small {
  display: block;
  font-size: 0.75rem;
  color: #fff;
  margin-top: -10px;
  line-height: 1;
}

.btn-cta {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.btn-cta .cta {
  min-width: min(60vw, 480px);
}
