:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
}

.buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #2563eb;
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #6b7280;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.field {
  display: grid;
  gap: 0.5rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font: inherit;
}

input[type="search"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f9fafb;
  font-weight: 700;
}

tr:hover {
  background: #eff6ff;
  cursor: pointer;
}

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

.error {
  color: #b91c1c;
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}

/* Login page specific styles */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page .container {
  max-width: 400px;
  width: 100%;
}

.login-page .card {
  padding: 2rem;
}

.login-page .field {
  margin-bottom: 1rem;
}

.login-page .error {
  font-size: 0.9rem;
}

/* Lista page specific styles */
.modal-overlay,
#create-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 1.5rem;
  z-index: 50;
}

..modal-overlay .modal-card,
#create-panel .modal-card {
  width: min(100%, 640px);
  max-height: min(100vh, 900px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.dashboard {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1rem;
}

.summary {
  padding: 1rem;
  border-radius: 1rem;
  background: #f9fafb;
}

.summary strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
}

.summary span {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-field label {
  min-width: 140px;
  text-align: right;
  font-size: 0.95rem;
  white-space: nowrap;
}

.modal-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Responsive styles */
@media (max-width: 720px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

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

  table {
    min-width: 100%;
  }
}