:root{
    /* AZUL CORPORATIVO */
  --brand-blue: #002568;

/* ====== PALETA BASE (DASH) ====== */
  --card: #002568;               /* cards oscuras (login, etc) */
  --line:rgba(255,255,255,.12);
  --danger:#ff4d4d;
  --white:#ffffff;

/* Alias (para compatibilidad con lo ya hecho) */
  --login-card-bg: var(--brand-blue);
  --primary: var(--brand-blue);
  --bg: var(--brand-blue);

/* ====== TEXTO ====== */
  --text:#eaf0ff;
  --muted:#aab6d6;
  --text-dark: #0b1220;

  /* ====== LINEAS ====== */
  --line: rgba(255,255,255,.12);

  /* ====== LOGIN (FONDO BLANCO + CARD AZUL) ====== */
  --login-bg:#ffffff;             /* fondo blanco del login */
  --login-text-dark:#0b1220;
  --login-muted-dark:#5c677d;
  --login-divider:#e7eaf0;

  /* ====== TAMAÑOS PARAMETRIZABLES ====== */
  --login-shell-padding:48px;
  --login-logo-width:550px;
  --login-title-size:36px;
  --login-subtitle-size:16px;
  --login-card-width:420px;
  --login-input-size:14px;
  --login-button-size:15px;
  --login-button-bg: #f57c00;      /* naranjo principal */
  --login-button-bg-hover: #ef6c00;
  --login-button-text: #ffffff;
  --login-title-color: var(--login-card-bg);

  /* ====== DASHBOARD (CONTENIDO) ====== */
  --content-bg: #ffffff;         /* fondo blanco de la grilla */
  --content-border: #e1e6ef;

  /* ====== ACCIONES ====== */
  --danger: #ff4d4d;
  --white: #ffffff;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:var(--bg);
}

/* =========================
   AUTH (LOGIN)
   ========================= */
body.auth{
  background:var(--login-bg);
}

.auth-shell{
  min-height:100vh;
  display:flex;
  align-items:stretch;
  background:var(--login-bg);
}

.auth-left{
  flex:1.1;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:var(--login-shell-padding);
  background:var(--login-bg);
  border-right:1px solid var(--login-divider);
}

.auth-logo{
  width:min(100%, var(--login-logo-width));
  max-width:100%;
  height:auto;
  display:block;
  margin-bottom:20px
}

.auth-left h1{
  margin:0 0 8px 0;
  font-size:var(--login-title-size);
  color: var(--login-title-color); /* azul corporativo */
  font-weight:700;
}

.auth-left p{
  margin:0;
  font-size:var(--login-subtitle-size);
  color:var(--login-muted-dark);
  max-width:420px
}

.auth-right{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:var(--login-shell-padding);
  background:var(--login-bg);
}

/* Card (mantener look azul) */
.auth-card{
  width:min(var(--login-card-width), 100%);
  background:var(--login-card-bg);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:22px;
  box-shadow:0 12px 40px rgba(0,0,0,.35);
}

.auth-card h2{margin:0 0 14px 0}

/* Labels e inputs dentro del card */
.auth-card label{
  display:block;
  margin:12px 0 6px 0;
  color:var(--muted);
  font-size:14px
}

.auth-card input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid #cfd6e4;     /* borde gris claro */
  background:#ffffff;          /* fondo blanco */
  color:#0b1220;               /* texto negro */
  outline:none;
  font-size:var(--login-input-size);
}

.auth-card input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(47,124,255,.15);
}


.btn-primary{
  width:100%;
  margin-top:16px;
  padding:12px 14px;
  border:0;
  border-radius:12px;
  background: var(--login-button-bg);
  color: var(--login-button-text);
  cursor:pointer;
  font-weight:600;
  font-size:var(--login-button-size);
  transition: background .2s ease, box-shadow .2s ease;
}

.btn-primary:hover{
  background: var(--login-button-bg-hover);
  box-shadow: 0 6px 18px rgba(245,124,0,.35);
}

.alert{
  background:rgba(255,77,77,.12);
  border:1px solid rgba(255,77,77,.35);
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
  margin:10px 0;
}

.auth-foot{margin-top:12px;color:var(--muted)}

/* =========================
   APP LAYOUT (DASH)
   ========================= */
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 18px;
  border-bottom:1px solid rgba(255,255,255,.15);
  background: var(--brand-blue); /* AZUL CORPORATIVO */
}

.topbar-left{display:flex;align-items:center;gap:12px}
.brand-logo{width:44px;height:auto}
.brand-name{font-weight:700}
.brand-sub{font-size:12px;color:var(--muted)}

.topbar-nav{display:flex;gap:14px;flex-wrap:wrap}

.nav-group{
  position:relative;
}

.nav-link-btn{
  background:transparent;
  cursor:pointer;
  font-family:inherit;
  color:#ffffff;
  border:1px solid transparent;
  padding:8px 10px;
  border-radius:10px;
  font-size:14px;
  line-height:1.2;
  appearance:none;
}
.nav-caret{
  display:inline-block;
  margin-left:6px;
  font-size:11px;
  line-height:1;
  transition:transform .18s ease;
}
.nav-group.is-open .nav-caret{
  transform:rotate(180deg);
}

.nav-dropdown{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  min-width:170px;
  padding:6px;
  border-radius:10px;
  background:#f28c00;
  border:1px solid #f7b04d;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  display:none;
  z-index:20;
}

.nav-group.is-open .nav-dropdown{
  display:block;
}

.nav-link-dropdown{
  display:block;
  color:#ffffff;
  border:1px solid transparent;
}

.nav-link-dropdown:hover{
  background:#f5a623;
  border-color:#f8bf66;
}

.nav-link{
  color:#ffffff;
  text-decoration:none;
  font-size:14px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
}

.nav-link:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
}

.nav-link.danger{
  color:#ffd6d6;
  border-color:rgba(255,77,77,.25)
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
}

.user-chip{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-size:13px;
}

.content{padding:18px}

.content-card{
  border:1px solid var(--content-border);
  background: var(--content-bg);   /* BLANCO */
  border-radius:18px;
  padding:18px;
  min-height: calc(100vh - 92px);
  color: var(--text-dark);         /* texto oscuro dentro */
}

.content-card h2{
  margin:0 0 14px 0;
  color: var(--primary);   /* azul corporativo */
  font-weight:700;
}

.grid-area{margin-top:12px}

.grid-placeholder{
  border:1px dashed rgba(255,255,255,.25);
  border-radius:14px;
  padding:18px;
  color:var(--muted)
}

/* Responsive */
@media (max-width: 900px){
  .auth-shell{flex-direction:column}
  .auth-left{
    border-right:0;
    border-bottom:1px solid var(--login-divider)
  }
}

.pt-grid-wrap{
  width:100%;
}

/* child row */
.dt-child-box{
  padding:12px 14px;
  background:#f6f8fc;
  border:1px solid #e1e6ef;
  border-radius:12px;
  margin:10px 0;
  color:#0b1220;
}
.dt-child-row{
  padding:6px 0;
  border-bottom:1px dashed #dde3ef;
}
.dt-child-row:last-child{border-bottom:0}

/* acciones */
.acciones{
  display:flex;
  gap:6px;
  justify-content:flex-start;
  align-items:center;
}
.icon-btn{
  width:28px;
  height:28px;
  border-radius:8px;
  border:1px solid #d5dceb;
  background:#ffffff;
  cursor:pointer;
  font-size:14px;
  line-height:1;
}
.icon-btn:hover{
  border-color:#002568;
  box-shadow:0 4px 12px rgba(0,37,104,.12);
}

/* ===== Acciones en grilla ===== */
.acciones{
  display:flex;
  gap:6px;
  justify-content:flex-start;
  align-items:center;
  flex-wrap:wrap;
}

.gte-btn{
  height:28px;
  padding:0 10px;
  border-radius:8px;
  border:1px solid #d5dceb;
  background:#ffffff;
  cursor:pointer;
  font-size:12px;
  font-weight:700;
  color:#002568;
}

.gte-btn:hover{
  border-color:#002568;
  box-shadow:0 4px 12px rgba(0,37,104,.12);
}

/* ===== DataTables (global) ===== */
body.app .dataTables_wrapper{
  width:100%;
  max-width:100%;
}
body.app .dataTables_wrapper .dataTables_scroll{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
body.app .dataTables_wrapper .dataTables_scrollHead,
body.app .dataTables_wrapper .dataTables_scrollBody{
  min-width:100%;
}
body.app table.dataTable{
  width:100% !important;
}

@media (max-width: 1100px){
  .topbar{
    flex-wrap:wrap;
    gap:10px;
  }
  .topbar-left{
    min-width:0;
  }
  .topbar-nav{
    order:3;
    width:100%;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .topbar-right{
    margin-left:auto;
    flex-wrap:wrap;
    justify-content:flex-end;
  }
}

@media (max-width: 900px){
  .auth-left{
    padding:28px 18px;
    align-items:center;
  }
  .auth-right{
    padding:18px;
  }
  .auth-logo{
    width:min(58vw, 320px);
    margin:0 auto 16px auto;
  }
  .auth-left h1{
    font-size:28px;
    text-align:center;
  }
  .auth-left p{
    text-align:center;
    margin:0 auto;
  }
}

@media (max-width: 640px){
  .auth-logo{
    width:min(52vw, 190px);
    margin:0 auto 12px auto;
  }
}

@media (max-width: 760px){
  .content{
    padding:10px;
  }
  .content-card{
    padding:12px;
    border-radius:14px;
    min-height: calc(100vh - 140px);
  }
  .brand-name{
    font-size:13px;
    line-height:1.25;
  }
  .nav-link,
  .nav-link-btn{
    font-size:13px;
    padding:7px 9px;
  }
  .topbar-right{
    width:100%;
    justify-content:space-between;
    gap:8px;
  }
  .user-chip{
    max-width:calc(100% - 62px);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.app .dataTables_wrapper .dataTables_length,
  body.app .dataTables_wrapper .dataTables_filter,
  body.app .dataTables_wrapper .dataTables_info,
  body.app .dataTables_wrapper .dataTables_paginate{
    float:none !important;
    text-align:left;
    width:100%;
  }
  body.app .dataTables_wrapper .dataTables_filter{
    margin-top:8px;
  }
  body.app .dataTables_wrapper .dataTables_filter input{
    width:100%;
    max-width:100%;
    margin-left:0;
    margin-top:6px;
  }
}


