/* ==========================================================================
   DARISMAT — hoja de estilos compartida (extraída de la demo).
   Se usa en layouts.app (mobile) y layouts.desktop (Planta/Perito/Pueblo/Erp).
   Paleta canónica (§0 del contrato):
     primary #EB6123 · primary-light #F4854D · primary-dark #C44E18
     danger #DC2626 · success #16A34A · info #0284C7
   ========================================================================== */

:root {
  --primary: #EB6123;
  --primary-light: #F4854D;
  --primary-dark: #C44E18;
  --danger: #DC2626;
  --success: #16A34A;
  --info: #0284C7;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: #f3f4f6;
  color: #1a1a1a;
}

/* Layout desktop: sidebar fija + contenido scrolleable. */
.desktop-shell { display: flex; height: 100vh; overflow: hidden; }

.desktop-sidebar {
  width: 200px;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.desktop-sidebar::-webkit-scrollbar { width: 3px; }
.desktop-sidebar::-webkit-scrollbar-thumb { background: rgba(235, 97, 35, .3); border-radius: 2px; }

.desktop-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f3f4f6; }

/* Items de navegación del sidebar. */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, .5);
  text-decoration: none;
}
.nav-item:hover { background: rgba(235, 97, 35, .1); color: #fff; }
.nav-item.active { background: rgba(235, 97, 35, .15); color: #fff; border-left-color: var(--primary); font-weight: 600; }
.nav-item .material-symbols-outlined { font-size: 16px; }

/* Tarjetas de estadística. */
.stat-card { background: #fff; border-radius: 10px; padding: 12px; border: 1px solid #e5e7eb; }
.stat-card h4 { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: #888; font-weight: 600; margin: 0; }
.stat-card .val { font-size: 20px; font-weight: 800; color: #1a1a1a; margin: 1px 0; }

/* Tablas. */
.t-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.t-table thead th {
  background: #f0f2f5; padding: 6px 8px; text-align: left; font-weight: 600;
  color: #555; font-size: 9px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid #ddd; position: sticky; top: 0; z-index: 2;
}
.t-table tbody td { padding: 6px 8px; border-bottom: 1px solid #eee; color: #333; }
.t-table tbody tr:hover { background: #FFF8F5; }

/* Badges y chips. */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.role-chip { display: inline-flex; padding: 1px 8px; border-radius: 6px; font-size: 9px; font-weight: 800; letter-spacing: .03em; }

/* Botones. */
.btn-primary {
  display: inline-flex; align-items: center; gap: 4px; background: var(--primary);
  color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-size: 11px;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 4px; background: #fff;
  color: #444; border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 12px;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Inputs/select base. */
input[type="text"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 10px;
  font-size: 12px; font-family: 'Inter', sans-serif; outline: none; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(235, 97, 35, .12); }

/* Barra "online" inferior/superior de cada perfil. */
.online-bar {
  display: flex; align-items: center; gap: 8px; padding: 5px 16px;
  background: #fff; border-bottom: 1px solid #eee; font-size: 10px; color: #666; font-weight: 600;
}

/* QR mock (cuadro damero). */
.qr-box { background: repeating-conic-gradient(#333 0% 25%, #fff 0% 50%) 50% / 10px 10px; border-radius: 6px; border: 3px solid #333; }

/* Badge "Nuevo" en línea. */
.new-badge-inline { background: var(--primary); color: #fff; font-size: 7px; font-weight: 800; padding: 1px 5px; border-radius: 999px; margin-left: 5px; vertical-align: middle; }
.new-badge { background: var(--primary); color: #fff; font-size: 8px; font-weight: 800; padding: 1px 6px; border-radius: 999px; margin-right: 4px; }

/* Modales. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 10000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 16px; max-width: 500px; width: 92%; max-height: 84vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0, 0, 0, .3); }

/* Pantallas conmutables por jQuery dentro de un mismo controlador (SPA-lite). */
.d-screen { display: none; height: 100%; }
.d-screen.active { display: block; }

/* Toast (lo crea showToast por JS, esta clase es de respaldo). */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 20px; border-radius: 12px;
  font-size: 12px; font-weight: 600; z-index: 99999; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
