* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #222;
  background: #f8f9fa;
  margin: 0;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
  background: linear-gradient(90deg, #3b82f6, #0d6efd);
  color: #fff;
  border-bottom-left-radius: 0.6rem;
  border-bottom-right-radius: 0.6rem;
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.site-header .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.site-header .nav-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Layout */
.main-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr 1fr 0.9fr;
  }
}

/* Cards */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.05);
  padding: 1rem;
}

/* Form */
.form-card h2 {
  margin-bottom: 0.5rem;
}

.form-card form .form-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-card form .form-control {
  transition: box-shadow 0.15s ease;
}

.form-card form .form-control:focus {
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.form-card #formAlert {
  min-width: 200px;
}

button#addBtn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #0d6efd;
  color: #fff;
}

.form-card button#addBtn:hover {
  filter: brightness(0.95);
}

button#resetBtn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid #6c757d;
  color: #6c757d;
}

/* Tabla de contactos */
.contacts-card h2 {
  margin: 0;
}

.contacts-card #searchInput {
  max-width: 240px;
}

.contacts-card table th {
  font-weight: 600;
}

.contacts-card table td {
  vertical-align: middle;
}

.contacts-card table .action-btns {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}

/* Sección Acerca */
.about-card {
  grid-column: 1 / -1;
}

/* Footer */
.site-footer {
  margin-top: 1.5rem;
  background: transparent;
}

.site-footer small {
  color: #6c757d;
}

/* Responsive */
@media (max-width: 576px) {
  .main-grid {
    padding: 0.6rem;
  }
  .site-header .container {
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
  }
}

/* Utilidades */
.badge-empty {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  background: #e9ecef;
  color: #6c757d;
  font-size: 0.8rem;
}

.table-responsive {
  overflow: auto;
}

small.note {
  font-size: 0.85rem;
  color: #5b6268;
}

.hidden {
  display: none !important;
}

:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.p-2 {
  padding: 0.5rem;
}
