/* ==========================================================================
   Metalex - restyle de Mesa de Servicio (osTicket, portal de clientes)
   Se carga DESPUES de theme.css/print.css, a proposito, para sobrescribir
   sin tocar los archivos originales de osTicket (mas facil de actualizar).
   Paleta identica a MetOne / consulta-hcm.
   ========================================================================== */

/* Roboto alojada localmente (self-hosted) -- el CSP del sitio bloquea
   hojas de estilo/fuentes externas (fonts.googleapis.com). */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-400.woff2") format("woff2"),
       url("../fonts/roboto-400.woff") format("woff");
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/roboto-500.woff2") format("woff2"),
       url("../fonts/roboto-500.woff") format("woff");
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/roboto-700.woff2") format("woff2"),
       url("../fonts/roboto-700.woff") format("woff");
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/roboto-900.woff2") format("woff2"),
       url("../fonts/roboto-900.woff") format("woff");
}

:root {
  --mx-verde-oscuro: #00573D;
  --mx-verde-oscuro-2: #003d2a;
  --mx-verde: #53af32;
  --mx-verde-acento: #96bc2f;
  --mx-verde-acento-hover: #85a72a;
  --mx-gris-boton: #d3d7d9;
  --mx-gris-boton-hover: #c3c8cb;
  --mx-gris-texto: #353b3f;
  --mx-tabla-header: #d9dfe2;
  --mx-tabla-header-borde: #aab2b6;
  --mx-tabla-header-borde-lateral: #cad1d5;
  --mx-tabla-celda-borde-lateral: #ecf0f2;
  --mx-tabla-fila-par: #f5f8f9;
  --mx-tabla-hover: #e6ebed;
  --mx-tabla-borde: #e7eef0;
  --mx-borde-input: #cdd9e2;
  --mx-placeholder: #8c99a4;
  --mx-verde-fondo-login: #013a29;
}

/* ---- Base / tipografia ---- */
body {
  background: #eef2f1 !important;
  color: var(--mx-gris-texto);
  font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
}
body, input, select, textarea {
  font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--mx-gris-texto);
}
a, .link {
  color: var(--mx-verde-oscuro);
}
a:hover, .link:hover {
  border-bottom: 1px dotted var(--mx-verde-oscuro);
}

/* ---- Contenedor: de 840px fijo a fluido y responsive ---- */
#container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: hidden;
}
@media (max-width: 1140px) {
  #container { border-radius: 0; }
  body { background: #fff !important; }
}

/* ---- Header ---- */
#header {
  height: auto;
  min-height: 71px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 3px solid var(--mx-verde-oscuro);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
/* float ya no aplica dentro de un contenedor flex: usamos order explicito
   para que el logo quede a la izquierda y "Iniciar sesion" a la derecha,
   igual que antes. */
#header #logo {
  order: 1;
}
#header .pull-right {
  order: 2;
}
#header #logo img {
  max-height: 48px;
  max-width: 260px;
}
#header p {
  width: auto;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--mx-gris-texto);
}
#header .pull-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
#header .pull-right a {
  color: var(--mx-verde-oscuro);
  font-weight: 600;
}

/* ---- Navegacion (tabs superiores) ---- */
#nav {
  margin: 0;
  padding: 6px 16px;
  height: auto;
  background: #f5f8f7;
  border-top: none;
  border-bottom: 2px solid var(--mx-tabla-borde);
  box-shadow: none;
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#nav li {
  margin: 2px 0;
}
#nav li a {
  height: 32px;
  line-height: 32px;
  padding: 0 14px 0 34px;
  margin-left: 0;
  color: var(--mx-verde-oscuro);
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}
#nav li a.active,
#nav li a:hover {
  background-color: var(--mx-verde-acento);
  color: #fff;
}

/* ---- Contenido ---- */
#content {
  padding: 24px;
  margin: 0;
  min-height: 300px;
}
#footer {
  padding: 16px 0;
}

/* ---- Botones ---- */
.button,
.button:visited,
input[type="submit"],
input[type="button"] {
  background-color: var(--mx-verde-acento) !important;
  color: #fff !important;
  border: none;
  border-radius: 5px;
  box-shadow: none;
  text-shadow: none;
  border-bottom: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
}
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--mx-verde-acento-hover) !important;
}
/* Botones secundarios (ej. "Restablecer" del formulario de ticket) */
input[type="reset"] {
  background-color: var(--mx-gris-boton) !important;
  color: var(--mx-gris-texto) !important;
  border: none;
  border-radius: 5px;
  box-shadow: none;
  text-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
}
input[type="reset"]:hover {
  background-color: var(--mx-gris-boton-hover) !important;
}
.blue.button,
.blue.button:visited {
  background-color: var(--mx-verde-oscuro) !important;
}
.blue.button:hover {
  background-color: var(--mx-verde-oscuro-2) !important;
}

/* ---- Inputs / formularios ---- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
  border: 2px solid var(--mx-borde-input);
  border-radius: 4px;
  padding: 7px 10px;
  background: #fff;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--mx-verde-oscuro);
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: var(--mx-placeholder);
}

/* ---- Login del portal cliente ---- */
#clientLogin {
  border: 1px solid var(--mx-tabla-borde);
  border-radius: 8px;
  box-shadow: none;
  background-color: #f6f8f7;
}
#clientLogin input[type=submit] {
  padding: 8px 18px;
}

/* ---- Tablas ---- */
#content table[width] {
  width: 100% !important;
}
table.custom-data th {
  background: var(--mx-tabla-header);
  border-bottom: 2px solid var(--mx-tabla-header-borde);
  color: var(--mx-gris-texto);
}
table.custom-data tr:nth-child(even) {
  background: var(--mx-tabla-fila-par);
}
table.custom-data tr:hover {
  background: var(--mx-tabla-hover);
}

/* ==========================================================================
   Responsive - el tema original no tenia ningun @media, era 100% fijo.
   ========================================================================== */
@media (max-width: 768px) {
  #header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  #header .pull-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  #content {
    padding: 16px;
  }
  #reply textarea {
    width: 100% !important;
  }
  table.custom-data,
  table.custom-data thead,
  table.custom-data tbody,
  table.custom-data tr {
    display: block;
    width: 100%;
  }
}

/* ---- Formulario de creacion de ticket: tabla fija de 800px -> fluida ---- */
*, *::before, *::after {
  box-sizing: border-box;
}
#ticketForm > table {
  width: 100% !important;
}
@media (max-width: 700px) {
  #ticketForm > table,
  #ticketForm > table tbody,
  #ticketForm > table tr,
  #ticketForm > table td {
    display: block;
    width: 100% !important;
  }
  #ticketForm > table {
    table-layout: auto;
  }
  #ticketForm td textarea,
  #clientLogin td textarea,
  #ticketForm div textarea,
  #clientLogin div textarea {
    width: 100% !important;
  }
  #ticketForm select,
  #ticketForm input[type="text"],
  #ticketForm input[type="email"] {
    width: 100%;
  }
}
img {
  max-width: 100%;
  height: auto;
}

/* ---- Evitar scroll horizontal de toda la pagina (contenido admin/paginas
   con anchos fijos que no controlamos desde aqui) ---- */
html, body {
  overflow-x: hidden;
  width: 100%;
}
#content, #content * {
  max-width: 100%;
}

/* ---- Login del portal cliente: estructura real es .login-box (40%,
   display:table-cell) + un segundo div "soy un agente" (tambien table-cell).
   En movil los apilamos y quitamos el icono de candado de fondo. ---- */
@media (max-width: 700px) {
  #clientLogin {
    background-size: 28px 28px !important;
    background-position: center 14px !important;
    padding: 16px !important;
  }
  #clientLogin > div {
    display: block !important;
  }
  #clientLogin .login-box {
    display: block !important;
    width: 100% !important;
    box-shadow: none !important;
    padding: 36px 0 0 0 !important;
  }
  #clientLogin .login-box + div {
    display: block !important;
    padding: 16px 0 0 0 !important;
  }
  #clientLogin input[type="text"],
  #clientLogin input[type="password"] {
    width: 100% !important;
  }
}
