﻿/* =========================
   VARIABLES GLOBALES
========================= */

:root {
  --color-principal: #147696;
  --color-hover: #418F9E;
  --softsys-primary: var(--color-principal);
  --softsys-primary-hover: var(--color-hover);

  --color-header: #1F1F1F;
  --color-bg: #f4f6f5;
  --color-texto: #1f1f1f;

  --radius: 16px;
}

/* =========================
   RESET
========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--color-bg);
  color: var(--color-texto);
}

/* =========================
   ELEMENTOS GENERALES
========================= */

button {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: all .2s ease;
}

button:active {
  transform: scale(.97);
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-family: inherit;
}

input:focus {
  border-color: var(--color-principal);
  outline: none;
}

/* =========================
   TOPBAR GLOBAL
========================= */

.topbar {
  background: var(--color-principal);
  color: white;

  width: 100vw;             
  margin-left: calc(-50vw + 50%); 

  padding: 16px 20px;     

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

body {
  margin: 0;
  overflow-x: hidden;
}

.titulo {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}

/* =========================
   HEADER GLOBAL SIMPLE
========================= */

.softsys-page-header {
  background: var(--softsys-primary, var(--empresa-color, var(--color-principal, #087c91)));
  color: #fff;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.softsys-page-back {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 8px 14px;
  border-radius: 18px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-weight: 600;
}

.softsys-page-back:hover {
  background: rgba(255, 255, 255, 0.28);
}

.softsys-page-center {
  min-width: 0;
  text-align: center;
}

.softsys-page-title {
  display: block;
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
}

.softsys-page-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.softsys-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .softsys-page-header {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 10px;
  }

  .softsys-page-center {
    text-align: left;
    order: 1;
  }

  .softsys-page-actions {
    justify-content: flex-start;
  }
}

/* =========================
   BOTON VOLVER
========================= */

.btn-volver {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
}

.btn-volver:hover {
  background: rgba(255,255,255,0.3);
}

/* =========================
   MODAL GLOBAL
========================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: white;
  padding: 24px;
  border-radius: 20px;
  width: min(420px, 90vw);
  text-align: center;

  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-actions .btn-eliminar {
  background: #d32f2f !important;
  color: white;
}

.modal-actions button {
  flex: 1;
  height: 42px;
}

/* BOTONES */

.btn-cancelar {
  background: #ccc;
}

.btn-cancelar:hover {
  background: #bbb;
}

.btn-salir {
  background: #d32f2f;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(77, 58, 58, 0.4);
}

.btn-salir:hover {
  background: #b71c1c;
}

/* =========================
   UTILIDADES
========================= */

.hidden {
  display: none;
}

/* =========================
   SCROLL
========================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
/* =========================
   SAFE AREA GLOBAL ANDROID (MAX 1024)
   Aplica a todos los modulos con topbar
========================= */
@media (max-width: 1024px) {
  :root {
    --safe-top-android: calc(env(safe-area-inset-top) + 6px);
    --safe-bottom-android: calc(env(safe-area-inset-bottom) + 4px);
  }

  html,
  body {
    min-height: 100dvh;
  }

  .topbar {
    padding-top: var(--safe-top-android) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .softsys-page-header {
    padding-top: var(--safe-top-android) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
}
