* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d4c4 100%);
  min-height: 100vh;
  color: #4a4a4a;
}

.screen {
  display: flex;
}

.screen.hidden {
  display: none;
}

/* LOGIN */
#login-screen {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 300px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #d4a5a5;
  font-size: 28px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-box input {
  padding: 12px;
  border: 1px solid #e6d5c8;
  border-radius: 6px;
  font-size: 14px;
}

.login-box button {
  padding: 12px;
  background: #d4a5a5;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.login-box button:hover {
  background: #c89999;
}

/* APP */
#app-screen {
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

header {
  background: white;
  padding: 15px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-bottom: 2px solid #e6d5c8;
}

header h1 {
  color: #d4a5a5;
  font-size: 24px;
  margin-bottom: 12px;
}

.header-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.header-buttons button {
  padding: 8px 14px;
  background: #f0e0d8;
  border: 1px solid #e6d5c8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #4a4a4a;
  transition: background 0.3s;
}

.header-buttons button:hover {
  background: #e6d5c8;
}

.header-buttons button:last-child {
  background: #e8b4b4;
  color: white;
  border-color: #d4a5a5;
}

.header-buttons button:last-child:hover {
  background: #d4a5a5;
}

.screen-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.screen-content.hidden {
  display: none;
}

/* FORMULARIO */
.form-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-section h2 {
  color: #d4a5a5;
  margin-bottom: 15px;
  font-size: 18px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e6d5c8;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #d4a5a5;
  box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.1);
}

.select-group {
  display: flex;
  gap: 8px;
}

.select-group select {
  flex: 1;
}

.select-group button {
  padding: 10px 12px;
  background: #d4a5a5;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.select-group button:hover {
  background: #c89999;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #d4a5a5;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #c89999;
}

/* LISTA */
.list-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.list-section h2 {
  color: #d4a5a5;
  margin-bottom: 15px;
  font-size: 18px;
}

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

table th {
  background: #f0e0d8;
  padding: 10px;
  text-align: left;
  font-weight: 600;
  color: #4a4a4a;
  border-bottom: 2px solid #e6d5c8;
}

table td {
  padding: 10px;
  border-bottom: 1px solid #e6d5c8;
}

table tr:hover {
  background: #faf5f1;
}

table button {
  padding: 6px 10px;
  background: #e8b4b4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
}

table button:hover {
  background: #d4a5a5;
}

/* GESTIÓN */
.manage-section {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.manage-section input {
  flex: 1;
  padding: 10px;
  border: 1px solid #e6d5c8;
  border-radius: 6px;
  font-size: 14px;
}

.manage-section button {
  padding: 10px 16px;
  background: #d4a5a5;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.manage-section button:hover {
  background: #c89999;
}

/* MODALES */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 400px;
}

.modal-content h3 {
  color: #d4a5a5;
  margin-bottom: 15px;
  font-size: 18px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e6d5c8;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.modal-buttons {
  display: flex;
  gap: 8px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.modal-buttons button:first-child {
  background: #d4a5a5;
  color: white;
}

.modal-buttons button:first-child:hover {
  background: #c89999;
}

.modal-buttons button:last-child {
  background: #e6d5c8;
  color: #4a4a4a;
}

.modal-buttons button:last-child:hover {
  background: #d4b9b0;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .form-section,
  .list-section,
  .manage-section {
    padding: 15px;
  }

  header {
    padding: 12px 15px;
  }

  header h1 {
    font-size: 20px;
  }

  .header-buttons {
    font-size: 12px;
  }

  .header-buttons button {
    padding: 6px 10px;
  }

  table {
    font-size: 12px;
  }

  table th,
  table td {
    padding: 8px;
  }

  table button {
    padding: 4px 8px;
    font-size: 11px;
  }
}
