:root {
  /* --primary: #18181b; */
  --primary: #0B3A75;
  --primary-light: #27272a;
  --secondary: #f3f4f6;
  /* --danger: #ef4444; */
  --danger: #1F7B1E;
  --danger-dark: #b91c1c;
  --bg: #fff;
  --surface: #f7f7f8;
  --white: #fff;
  --border: #e5e7eb;
  --text: #18181b;
  --text-light: #6b7280;
  --shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.06);
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 0.01em;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
}

.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-container {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-container img {
  width: 200px;
  height: auto;
}

.login-form {
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border: 1px solid var(--border);
  align-items: center;
}

.login-form h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-form label {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.login-form input {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px #18181b22;
}

.login-form button {
  padding: 0.9rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px 0 #18181b0a;
}

.login-form button:hover {
  background: var(--primary-light);
  color: var(--white);
  box-shadow: 0 4px 16px 0 #18181b11;
}

#login-error {
  color: var(--danger);
  font-size: 0.95rem;
  text-align: center;
  margin-top: -0.5rem;
}

.dashboard-container {
  min-height: 100vh;
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg);
  box-sizing: border-box;
  width: 100%;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1.5px solid var(--border);
}

.dashboard-header h2 {
  color: var(--text);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}


.logout-btn {
  padding: 0.85rem 1.7rem;
  background: var(--danger);
  color: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background var(--transition), color var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 2px 8px 0 #18181b0a;
}

.logout-btn:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 16px 0 #18181b11;
}

.dashboard-content {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Botones */
.btn-primary {
  padding: 0.85rem 1.7rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 2px 8px 0 #18181b0a;

  text-decoration: none;

  text-align: center;
}


.btn-primary:hover {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary {
  padding: 0.85rem 1.7rem;
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 2px 8px 0 #18181b0a;

     text-decoration: none;
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
  border: 1.5px solid var(--primary);
}

.btn-small {
  padding: 0.35rem 0.9rem;
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: 0.35rem;
  font-size: 0.98rem;
  cursor: pointer;
  margin-right: 0.5rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition),
    box-shadow var(--transition);
}

.btn-small:hover {
  background: var(--primary);
  color: var(--white);
  border: 1.5px solid var(--primary);
}

.btn-danger {
  background: var(--white);
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
}

/* Table Styles */
.table-section {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.table-section h3 {
  margin-bottom: 1.2rem;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
}

.filter-input {
  width: 100%;
  max-width: 320px;
  padding: 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
}

/* Contenedor de tabla con scroll horizontal */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 1.05rem;
  min-width: 600px;
  box-sizing: border-box;
  table-layout: auto;
  background: var(--white);
}

.data-table th,
.data-table td {
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 200px;
}

.data-table th {
  background: var(--surface);
  font-weight: 700;
  color: var(--text-light);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tbody tr:hover {
  background: var(--secondary);
  transition: background 0.15s;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Form Styles */
.form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 2rem;
  box-sizing: border-box;
  width: 100%;
  overflow: auto;
}

.form {
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border: 1px solid var(--border);
  align-items: center;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

.form h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  width: 100%;
}

.form label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 1rem;
}

.form input,
.form select,
.form textarea {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px #18181b22;
}

.form textarea {
  resize: vertical;
  min-height: 100px;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-light);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

.form-actions button {
  flex: 1;
}

#form-message,
#edit-form-message,
#edit-reporte-message {
  text-align: center;
  font-weight: 500;
  margin-top: 1rem;
  font-size: 1rem;
}

/* Filters */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filters select,
.filters input {
  padding: 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
}

/* Modal styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(24, 24, 27, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s;
  overflow: auto;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 320px;
  max-width: 95vw;
  position: relative;
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.close {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition);
}
.close:hover {
  color: var(--danger);
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-container {
    padding: 1rem;
  }
  .form-container {
    padding: 1rem;
  }
  .form {
    padding: 1.5rem 0.7rem;
  }
  .modal-content {
    padding: 1.5rem 0.7rem;
  }
  .data-table {
    min-width: 500px;
  }
  .data-table th,
  .data-table td {
    padding: 0.8rem 0.6rem;
    max-width: 150px;
  }
}

@media (max-width: 768px) {
  .table-section {
    padding: 1rem;
  }
  .data-table {
    min-width: 450px;
    font-size: 0.95rem;
  }
  .data-table th,
  .data-table td {
    padding: 0.7rem 0.5rem;
    max-width: 120px;
  }
}

@media (max-width: 600px) {
  html,
  body {
    width: 100vw;
    overflow-x: hidden;
  }
  .dashboard-container {
    margin-top: 50px;
    padding: 0.5rem;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .dashboard-header {
    display: flex;
    align-items: flex-start;
    align-items: center;
    gap: 0.7rem;
    padding-bottom: 0.5rem;
  }

   .dashboard-header h2 img{
    width: 40px;
    height: auto;
    margin-right: 0.5rem;
   }


  .dashboard-header h2 {
    font-size: 1.1rem;
    text-align: left;
  }
  .logout-btn {
    width: 150px;
    font-size: 1rem;
    padding: 0.7rem 0;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .dashboard-content {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }
  .actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
  }


  .btn-primary,
  .btn-secondary {
    width: 50%;
    font-size: 1rem;
    padding: 1rem 0;
  }


  .table-section {
    padding: 0.5rem 0.2rem;
    box-shadow: none;
    border: none;
    background: transparent;
    max-width: 100vw;
    overflow: hidden;
  }
  .table-section h3 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
  }


  /* TABLA RESPONSIVA COMO CARDS */
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .data-table thead {
    display: none;
  }
  .data-table {
    min-width: unset;
    border: none;
  }
  .data-table tr {
    margin-bottom: 1.2rem;
    background: var(--surface);
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px 0 #0001;
    padding: 1rem 0.7rem;
    border: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
  }
  .data-table td {
    padding: 0.5rem 0.3rem;
    text-align: left;
    position: relative;
    font-size: 0.98rem;
    border: none;
    border-bottom: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    max-width: unset;
  }
  .data-table td:last-child {
    border-bottom: none;
  }
  .data-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.93rem;
  }
  /* FORMULARIOS */
  .form-container {
    padding: 0.5rem;
    min-height: unset;
    width: 100vw;
    box-sizing: border-box;
    overflow: auto;
  }
  .form {
    padding: 1.2rem 0.5rem;
    max-width: 100vw;
    border-radius: 0.7rem;
    box-shadow: none;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
  }
  .form h2 {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
  }
  .form-group {
    margin-bottom: 0.5rem;
  }
  .form input,
  .form select,
  .form textarea {
    font-size: 1rem;
    padding: 0.8rem 0.7rem;
  }
  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .form-actions button {
    width: 100%;
    font-size: 1rem;
    padding: 1rem 0;
  }
  /* MODAL */
  .modal-content {
    max-width: 100vw;
    border-radius: 0.7rem;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
  }
  .close {
    right: 2rem;
    top: 2rem;
    font-size: 1.5rem;
  }
}

@media (max-width: 400px) {
  .data-table th,
  .data-table td {
    padding: 0.5rem 0.3rem;
    font-size: 0.9rem;
  }
  .table-section {
    padding: 0.3rem 0.1rem;
  }
}

/* Animación para el modal */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
