* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f3f4f6;
    color: #111827;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #111827;
    color: #e5e7eb;
    padding: 1rem;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
}

.sidebar-menu a:hover {
    background: #374151;
}

.menu-section {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 0.75rem;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #ffffff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.topbar h1 {
    font-size: 1.25rem;
}

.content {
    padding: 1.5rem;
}

.footer {
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

label {
    font-size: 0.85rem;
    color: #4b5563;
    display: block;
    margin-bottom: 0.2rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
}

textarea {
    min-height: 70px;
    resize: vertical;
}

.btn {
    display: inline-block;
    border-radius: 0.5rem;
    border: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

th, td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    font-weight: 600;
    white-space: nowrap;
}

tr:nth-child(even) td {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}
/* ===== Responsive sidebar (móvil/tablet) ===== */
.sidebar-toggle{
  display:none;
  background:#111827;
  color:#fff;
  border:0;
  padding:.45rem .75rem;
  border-radius:.5rem;
  cursor:pointer;
}

.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:999;
}

/* Tablet y móvil */
@media (max-width: 1024px) {

  .sidebar-toggle{ display:inline-flex; align-items:center; gap:.4rem; }

  /* Sidebar tipo drawer */
  .sidebar{
    display:block;              /* <-- IMPORTANTE: ya NO se oculta */
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    width:260px;
    z-index:1000;
    transform:translateX(-110%);
    transition:transform .2s ease;
    overflow-y:auto;
  }

  /* Contenido a pantalla completa */
  .app-container{ flex-direction:column; }
  .main-content{ width:100%; }

  /* Cuando está abierto */
  body.sidebar-open .sidebar{ transform:translateX(0); }
  body.sidebar-open .sidebar-overlay{ display:block; }
}

/* ===============================
   GAIO – Layout para .panel + grid .row/.col-*
   (Usado por cotizaciones.php)
================================= */

/* Centrar el contenido y evitar "formulario mega ancho" */
.page-wrap{
  max-width: 1200px;
  margin: 0 auto;
}

/* Tu módulo usa .panel pero tu CSS usa .card. Los igualamos */
.panel{
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

/* Grid horizontal */
.row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.row > [class^="col-"]{
  flex: 1 1 220px;   /* mínimo 220px, luego se acomodan en filas */
  min-width: 220px;
}

.col-12{ flex-basis: 100%; }
.col-6 { flex-basis: calc(50% - 6px); }
.col-4 { flex-basis: calc(33.333% - 8px); }
.col-3 { flex-basis: calc(25% - 9px); }
.col-2 { flex-basis: calc(16.666% - 10px); }

/* Inputs faltantes (select/date/number) para que se vean uniformes */
select,
input[type="date"],
input[type="number"]{
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  background: #fff;
}

/* Utilidades que usas en HTML */
.text-right{ text-align: right; }
.text-center{ text-align: center; }

/* Botón success que sí usas (Exportar PDF) */
.btn-success{
  background: #16a34a;
  color: #fff;
}
.btn-success:hover{
  background: #15803d;
}

/* Responsive: en tablet 2 columnas, en móvil 1 */
@media (max-width: 1024px){
  .col-2,.col-3,.col-4,.col-6{ flex-basis: calc(50% - 6px); }
  .col-12{ flex-basis: 100%; }
}
@media (max-width: 640px){
  .row{ gap: 10px; }
  .col-2,.col-3,.col-4,.col-6,.col-12{ flex-basis: 100%; min-width: 0; }
}

/* Tablas: si se desbordan en móvil */
.table-responsive{ overflow-x: auto; }

.btn-success{
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
}
.btn-success:hover{
  background: #15803d;
}

/* =========================================================
   GAIO - Layout responsive + sidebar desplegable + grid cols
   (PEGAR AL FINAL DE style.css)
========================================================= */

/* Botón success (esto corrige tu "Guardar cotización" gris) */
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

/* Panel/card compat: por si en algunos módulos usas .panel */
.panel { background:#fff; border-radius:0.75rem; padding:1.25rem 1.5rem; box-shadow:0 1px 3px rgba(0,0,0,0.06); margin-bottom:1.5rem; }

/* Grid para tus .row/.col-X (para que acomode horizontal y sea responsive) */
.row{
  display:flex;
  flex-wrap:wrap;
  gap: 12px 14px;
  margin-bottom: 10px;
}
[class^="col-"]{ flex: 1; min-width: 220px; }
.col-12{ flex: 0 0 100%; min-width: 100%; }
.col-6{ flex: 0 0 calc(50% - 14px); }
.col-4{ flex: 0 0 calc(33.333% - 14px); }
.col-3{ flex: 0 0 calc(25% - 14px); }
.col-2{ flex: 0 0 calc(16.666% - 14px); }

.text-right{ text-align:right; }
.text-center{ text-align:center; }

/* Inputs/selects */
select, input[type="date"], input[type="number"]{
  width:100%;
  border-radius:0.5rem;
  border:1px solid #d1d5db;
  padding:0.45rem 0.6rem;
  font-size:0.9rem;
  background:#fff;
}

/* ===== Sidebar: modo escritorio ===== */
.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

/* ===== Menú agrupado (acordeón) ===== */
.nav-group { margin-top: 0.75rem; }
.nav-group-btn{
  width:100%;
  background: transparent;
  border: none;
  color:#9ca3af;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  padding: .5rem .4rem;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.nav-group-btn .chev{ transition: transform .15s ease; opacity:.9; }
.nav-group.open .nav-group-btn .chev{ transform: rotate(90deg); }

.nav-submenu{
  list-style:none;
  margin: .25rem 0 .5rem 0;
  padding-left: .25rem;
  display:none;
}
.nav-group.open .nav-submenu{ display:block; }
.nav-submenu a{
  display:block;
  padding: .38rem .6rem;
  border-radius: .375rem;
  color:#e5e7eb;
  text-decoration:none;
  font-size:.92rem;
}
.nav-submenu a:hover{ background:#374151; }

/* ===== Responsive: sidebar tipo drawer + hamburger ===== */
.sidebar-toggle{
  display:none;
  border:none;
  background:#111827;
  color:#fff;
  border-radius:.5rem;
  padding:.45rem .6rem;
  cursor:pointer;
  font-size:1rem;
}

.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.35);
  z-index: 998;
}

@media (max-width: 1024px){
  .sidebar-toggle{ display:inline-flex; align-items:center; gap:.4rem; }

  .sidebar{
    position:fixed;
    left:-260px;
    top:0;
    width:240px;
    height:100vh;
    z-index: 999;
    transition:left .2s ease;
  }

  body.sidebar-open .sidebar{ left:0; }
  body.sidebar-open .sidebar-overlay{ display:block; }

  .app-container{ flex-direction: column; }
  .main-content{ width:100%; }
  .content{ padding: 1rem; }

  /* Cols a 100% en móvil para que no se aplasten */
  .col-6,.col-4,.col-3,.col-2{ flex:0 0 100%; min-width:100%; }
}

/* ===== Sidebar acordeón (módulos plegables) ===== */
.sidebar-header h2{
  margin: 0 0 .75rem 0;
}

.nav-group{ margin: .25rem 0; }

.nav-details{
  border-radius: .5rem;
}

.nav-summary{
  list-style: none;
  cursor: pointer;
  padding: .55rem .6rem;
  border-radius: .5rem;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9ca3af;
  user-select: none;
}

.nav-summary::-webkit-details-marker{ display:none; }

.nav-details[open] > .nav-summary{
  background: #1f2937;
  color: #e5e7eb;
}

.nav-submenu{
  list-style: none;
  margin: .25rem 0 .5rem 0;
  padding-left: .5rem;
}

.nav-submenu a{
  display:block;
  padding: .45rem .6rem;
  border-radius: .375rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: .92rem;
}

.nav-submenu a:hover{
  background:#374151;
}

/* ====== INPUTS/SELECT consistentes ====== */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  background: #fff;
}

select { cursor: pointer; }

/* ====== CONTENEDORES tipo "card/panel" ====== */
.page-wrap { display: grid; gap: 1.25rem; }
.panel {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ====== ITEM CARD ====== */
.item-card{
  border:1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin: 0.75rem 0;
  background:#fff;
}
.item-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

/* ====== TABLAS RESPONSIVAS (scroll horizontal) ====== */
.table-responsive{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  border:1px solid #e5e7eb;
  border-radius: 0.75rem;
  background:#fff;
}
.table-responsive table{
  margin:0;
  min-width: 900px; /* fuerza scroll en móvil */
}

/* en móviles, más compacto */
@media (max-width: 640px){
  .panel{ padding: 1rem; }
  th, td{ padding: .45rem .5rem; }
  .btn{ padding: .55rem .85rem; }
}

.item-card{
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  background: #fafafa;
}

.item-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}

@media (max-width: 640px){
  .item-header button{
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}

@media (max-width: 640px){
  .item-header button{
    font-size: 0.75rem;
    padding: 6px 10px;
  }
}

@media (max-width: 640px){
  table th,
  table td{
    font-size: 0.75rem;
    padding: 6px;
  }
}

@media (max-width: 640px){
  table th,
  table td{
    font-size: 0.75rem;
    padding: 6px;
  }
}

/* ===== Sidebar acordeón ===== */
.menu-group { margin-top: .35rem; }

.menu-group-btn{
  width: 100%;
  background: transparent;
  border: 0;
  color: #e5e7eb;
  text-align: left;
  font-size: 0.85rem;
  padding: .55rem .6rem;
  border-radius: .5rem;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.menu-group-btn:hover{ background:#374151; }

.menu-group-btn .chev{
  opacity:.9;
  transition: transform .15s ease;
}

.menu-sub{
  list-style:none;
  margin: .15rem 0 .35rem 0;
  padding-left: .4rem;
  display:none;
}

.menu-group.open .menu-sub{ display:block; }
.menu-group.open .menu-group-btn .chev{ transform: rotate(90deg); }

.menu-sub a{
  display:block;
  padding: .4rem .6rem;
  border-radius: .45rem;
  font-size: .88rem;
  color:#e5e7eb;
  text-decoration:none;
}

.menu-sub a:hover{ background:#374151; }

/* ===== Sidebar agrupado + responsive off-canvas ===== */
.sidebar-header { margin-bottom: .75rem; }
.sidebar-subtitle { font-size: .75rem; letter-spacing: .08em; color: #9ca3af; margin-top: .25rem; }

.sidebar-menu { list-style: none; padding: 0; margin: 0; }

.sidebar-link{
  color:#e5e7eb;
  text-decoration:none;
  display:block;
  padding:.45rem .6rem;
  border-radius:.45rem;
  font-size:.95rem;
}
.sidebar-link:hover{ background:#374151; }

.sidebar-group { margin-top: .5rem; }
.sidebar-group-btn{
  width:100%;
  background: transparent;
  border:0;
  color:#e5e7eb;
  text-align:left;
  padding:.45rem .6rem;
  border-radius:.45rem;
  font-size:.85rem;
  letter-spacing:.04em;
  text-transform: uppercase;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.sidebar-group-btn:hover{ background:#1f2937; }

.sidebar-submenu{
  margin:.25rem 0 .5rem 0;
  padding-left:.35rem;
  display:none;
}
.sidebar-group.open .sidebar-submenu{ display:block; }

.sidebar-group .chev{ transition: transform .15s ease; }
.sidebar-group.open .chev{ transform: rotate(90deg); }

.sidebar-empty{
  display:block;
  padding:.35rem .6rem;
  color:#9ca3af;
  font-size:.85rem;
}

/* botón hamburguesa (ya lo tienes en header.php) */
.sidebar-toggle{
  display:none;
  background:#111827;
  color:#fff;
  border:0;
  padding:.45rem .6rem;
  border-radius:.5rem;
  cursor:pointer;
}

/* Overlay */
.sidebar-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index: 998;
}

/* Tablet y móvil: sidebar off-canvas */
@media (max-width: 1024px){
  .sidebar-toggle{ display:inline-flex; gap:.4rem; align-items:center; }

  .sidebar{
    position:fixed;
    top:0; left:0;
    height:100vh;
    z-index: 999;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: 280px;
  }

  body.sidebar-open .sidebar{ transform: translateX(0); }
  body.sidebar-open .sidebar-overlay{ display:block; }

  .app-container{ flex-direction: column; } /* opcional, ayuda en móvil */
  .main-content{ margin-left: 0; }
}

.panel { max-width: 1100px; margin: 0 auto; }  /* ajusta 1100 a tu gusto */
.table-responsive table td,
.table-responsive table th { padding: 6px 8px; font-size: 12px; }

.btnDanger{
  display:inline-block;
  padding:6px 10px;
  background:#dc3545;
  color:#fff;
  border-radius:6px;
  text-decoration:none;
  border:0;
  cursor:pointer;
  font-size:12px;
}
.btnDanger:hover{ filter:brightness(0.95); }

/* Botón naranja GAIO (Reporte Fotográfico) */
.btn-gaio-orange{
  background:#F58C00 !important;
  border:1px solid #F58C00 !important;
  color:#fff !important;
  font-weight:700;
}
.btn-gaio-orange:hover{
  background:#d97706 !important;
  border-color:#d97706 !important;
  color:#fff !important;
}

/* ====== COTIZACIONES: HACER EL CONTENIDO MÁS AMPLIO Y RESPONSIVO ====== */
.page-wrap{
  width: 100%;
  max-width: 1600px;   /* <-- ajusta 1400/1600/1800 a tu gusto */
  margin: 0 auto;
  padding: 18px;
  box-sizing: border-box;
}

.panel{
  width: 100%;
  max-width: 100%;
}

/* Mejor acomodo de columnas */
.row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Tus .col-* deben poder encogerse sin romperse */
[class^="col-"]{
  min-width: 220px;
  flex: 1 1 auto;
}

/* Evitar que tablas “rompan” el layout */
.table-responsive{
  width: 100%;
  overflow-x: auto;
}

/* En pantallas grandes, aprovecha más ancho */
@media (min-width: 1200px){
  .page-wrap{ padding: 22px; }
}

/* En móvil: que no se sienta apretado */
@media (max-width: 768px){
  .page-wrap{ padding: 12px; }
  [class^="col-"]{ min-width: 100%; }
}

/* Overlay scrolleable por si el modal es más alto que la pantalla */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:9999;

  overflow-y:auto;
  padding:16px;
}

/* Caja del modal: limitada a alto de pantalla y con scroll interno */
.modal-box{
  background:#fff;
  max-width:600px;
  width:100%;
  margin:0 auto;
  padding:14px;
  border-radius:10px;

  max-height:calc(100vh - 32px);
  overflow-y:auto;
}

/* Opcional: header del modal pegado arriba al hacer scroll */
.modal-box > div:first-child{
  position:sticky;
  top:0;
  background:#fff;
  z-index:1;
  padding-bottom:8px;
}

/* Opcional: botones pegados abajo al hacer scroll */
.modal-box form > div[style*="justify-content:flex-end"]{
  position:sticky;
  bottom:0;
  background:#fff;
  padding-top:10px;
  z-index:1;
}





