
/* =====================================
   FÁBRICA DE CROQUETAS — RIKIRICÓN
   ===================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  background: #f3f6f4;
  color: #21352b;
  line-height: 1.5;
}

/* =====================================
   ENCABEZADO PANORÁMICO
   ===================================== */

header.brand-header {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #ffffff;
  border: 0;
  overflow: hidden;
  line-height: 0;
}

.brand-banner {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
}

/* =====================================
   CONTENIDO PRINCIPAL
   ===================================== */

main {
  max-width: 950px;
  margin: 24px auto;
  padding: 0 16px;
}

/* PANTALLAS PRINCIPALES */

#login,
#dashboard,
#passwordRecovery {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
}

[hidden] {
  display: none !important;
}

h2 {
  margin-top: 0;
}

h3 {
  margin: 12px 0 16px;
  color: #174b34;
}

/* =====================================
   FORMULARIOS
   ===================================== */

label {
  display: block;
  margin: 18px 0 7px;
  font-weight: 600;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid #c9d4cc;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  color: #21352b;
  background: white;
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #176b46;
  outline-offset: 2px;
  border-color: #176b46;
}

/* =====================================
   BOTONES
   ===================================== */

button {
  background: #176b46;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

button:active {
  opacity: 0.8;
}

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

#loginForm button,
#recoveryForm button {
  width: 100%;
  margin-top: 20px;
}

#forgotPasswordButton {
  background: #e7efea;
  color: #176b46;
}

/* =====================================
   NAVEGACIÓN
   ===================================== */

nav {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

nav button {
  width: 100%;
}

/* =====================================
   MÓDULOS
   ===================================== */

#moduleContent {
  padding: 24px;
  margin: 16px 0;
  background: #fff5e8;
  border-radius: 12px;
}

#moduleContent:empty {
  display: none;
}

#moduleContent > p {
  margin-bottom: 20px;
}

/* =====================================
   PRODUCCIÓN
   ===================================== */

#productionForm {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-bottom: 30px;
}

#productionForm label {
  margin-top: 16px;
}

#productionForm input,
#productionForm textarea {
  width: 100%;
}

#productionForm button {
  align-self: flex-start;
  margin-top: 22px;
  margin-bottom: 12px;
}

#productionForm [role="status"] {
  margin: 8px 0 0;
  font-weight: 600;
  color: #176b46;
  overflow-wrap: anywhere;
}

/* =====================================
   TABLAS E HISTORIALES
   ===================================== */

#moduleContent table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

#moduleContent th,
#moduleContent td {
  padding: 13px 12px;
  border-bottom: 1px solid #e0e8e2;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

#moduleContent th {
  background: #870c15;
  color: white;
  font-weight: 600;
}

#moduleContent tr:last-child td {
  border-bottom: none;
}

#moduleContent tbody tr:nth-child(even) {
  background: #f3f6f4;
}

/* =====================================
   IDENTIDAD VISUAL RIKIRICÓN
   ===================================== */

#dashboard h2,
#moduleContent h3 {
  color: #790d12;
}

nav button,
#productionForm button {
  background: linear-gradient(
    135deg,
    #870c15,
    #b01820
  );
}

nav button:hover,
#productionForm button:hover {
  background: #69080e;
}

/* =====================================
   CIERRE DE SESIÓN
   ===================================== */

#logoutButton {
  background: #58665d;
  margin-top: 8px;
}

/* =====================================
   MENSAJES
   ===================================== */

#loginMessage,
#recoveryMessage,
#passwordValidation {
  line-height: 1.5;
}

#loginMessage {
  color: #a43b30;
}

/* =====================================
   ADAPTACIÓN A IPAD
   ===================================== */

@media (max-width: 850px) {

  main {
    margin: 18px auto;
  }

  #moduleContent {
    padding: 20px;
  }

}

/* =====================================
   ADAPTACIÓN A TELÉFONOS
   ===================================== */

@media (max-width: 600px) {

  main {
    margin: 14px auto;
    padding: 0 10px;
  }

  #login,
  #dashboard,
  #passwordRecovery {
    padding: 18px;
    border-radius: 12px;
  }

  nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #moduleContent {
    padding: 16px;
  }

  #productionForm button {
    width: 100%;
  }

  #moduleContent table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #moduleContent th,
  #moduleContent td {
    min-width: 85px;
    white-space: nowrap;
  }

  #moduleContent th:last-child,
  #moduleContent td:last-child {
    min-width: 160px;
    white-space: normal;
  }

}



/* RIKIRICÓN V2 */
.v2-tabs{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0;}
.v2-tabs button{width:auto;padding:10px 12px;font-size:14px;}
.v2-tabs .v2-selected{background:#174b34;color:white;}
.v2-table-wrap{overflow-x:auto;margin:12px 0 24px;}
.v2-table-wrap table{min-width:550px;}
