
/* ========================================
   ENCICAR CONTROL
   HOJA DE ESTILOS PRINCIPAL
   ======================================== */

:root {
  --nav: #172b46;
  --side: #243c5d;
  --bg: #f1f5f9;
  --line: #dbe2ea;
  --blue: #2563eb;
  --text: #1e293b;
  --green: #168257;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.hidden {
  display: none !important;
}

/* ENCABEZADO */

header {
  background: var(--nav);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ESTRUCTURA PRINCIPAL */

.layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

/* MENU LATERAL */

nav {
  width: 230px;
  flex-shrink: 0;
  background: var(--side);
  padding: 12px;
}

nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  margin-bottom: 5px;
}

nav button:hover {
  background: #365678;
}

main {
  flex: 1;
  min-width: 0;
  padding: 22px;
}

/* BOTONES */

button {
  background: var(--blue);
  border: 0;
  color: white;
  padding: 11px 15px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.93);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary {
  background: #64748b;
}

/* TARJETAS */

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

/* LOGIN */

.login {
  max-width: 420px;
  margin: 10vh auto;
}

/* FORMULARIOS */

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin: 6px 0 13px;
  font-family: inherit;
}

label {
  font-size: 13px;
  font-weight: bold;
}

h2,
h3 {
  margin-top: 0;
}

.muted {
  color: #64748b;
}

/* CUADRICULAS */

.grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(160px, 1fr));
  gap: 13px;
}

.value {
  font-size: 29px;
  font-weight: bold;
  margin-top: 8px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  flex: 1;
  min-width: 170px;
}

/* TABLAS */

.tablewrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  background: #f8fafc;
}

/* MENSAJES */

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #dbeafe;
  margin-bottom: 15px;
}

.notice.error {
  background: #fee2e2;
  color: #991b1b;
}

/* ESTADOS DE ORDENES */

.status {
  padding: 5px 9px;
  border-radius: 14px;
  background: #e2e8f0;
  font-size: 12px;
}

.status.realizada {
  background: #dcfce7;
  color: #166534;
}

.status.reprogramada {
  background: #fef3c7;
  color: #92400e;
}

.status.programada {
  background: #dbeafe;
  color: #1e40af;
}

.status.pendiente {
  background: #fee2e2;
  color: #991b1b;
}

/* HISTORIAL */

.historial-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  margin: 10px 0;
}

/* ENCICAR BOT */

.chat {
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

/* ADAPTACION A CELULARES */

@media (max-width: 750px) {
  .layout {
    flex-direction: column;
  }

  nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  nav button {
    width: auto;
    white-space: nowrap;
  }

  main {
    padding: 12px;
  }

  .card {
    padding: 15px;
  }
}
