/*
 * Modern Theme — SYFCO Brand
 * Tema oscuro (default) + tema claro (.theme-light)
 * Toggle guardado en localStorage['cc-theme']
 * 2026-04-15
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* =========================================================
   TRANSICIÓN SUAVE AL CAMBIAR TEMA
   ========================================================= */
body,
.navbar-default.navbar-static-side,
.ibox, .ibox-title, .ibox-content,
#page-wrapper,
.row.border-bottom,
.navbar.navbar-static-top {
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* =========================================================
   BASE — aplica a ambos temas
   ========================================================= */
body {
  font-family: 'Poppins', 'Open Sans', sans-serif !important;
}

body::after {
  display: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Open Sans', sans-serif !important;
}

.btn {
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  letter-spacing: 0.3px !important;
  transition: all 0.2s ease !important;
}

.control-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.form-control {
  border-radius: 6px !important;
  font-size: 13px !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.label {
  border-radius: 4px !important;
  font-weight: 500 !important;
}

.table {
  font-size: 13px !important;
}

.table thead th {
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 12px 14px !important;
  border-top: none !important;
}

.table tbody td {
  padding: 11px 14px !important;
  vertical-align: middle !important;
}

.ibox {
  border-radius: 10px !important;
  border: none !important;
  margin-bottom: 20px;
  overflow: hidden;
}

.ibox-title {
  padding: 16px 20px !important;
  border-radius: 10px 10px 0 0 !important;
}

.ibox-title h5 {
  font-size: 14px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.ibox-content {
  padding: 20px !important;
  border: none !important;
}

.ibox-tools .btn {
  border-radius: 5px !important;
  font-size: 11px !important;
  padding: 4px 10px !important;
}

.alert {
  border-radius: 8px !important;
  border: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.pagination > li > a,
.pagination > li > span {
  font-size: 12px !important;
  border-radius: 5px !important;
  margin: 0 2px !important;
  min-width: 32px;
  text-align: center;
}

.wrapper.wrapper-content {
  padding: 25px 30px !important;
}

.minimalize-styl-2 {
  border-radius: 6px !important;
}

/* =========================================================
   TEMA OSCURO (default — sin clase extra en body)
   ========================================================= */
body:not(.theme-light) {
  background-color: #f0f2f5 !important;
  color: #2c3e50;
}

/* Sidebar oscuro */
body:not(.theme-light) .navbar-default.navbar-static-side {
  background-color: #082c66 !important;
  border-right: none !important;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

body:not(.theme-light) .navbar-default {
  background-color: #082c66 !important;
  border-color: transparent !important;
}

/* Área del logo — tema oscuro (ya es oscuro, sin fondo extra) */
body:not(.theme-light) .sidebar-logo-area {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 20px 16px 16px;
}

body:not(.theme-light) .logo-name {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

body:not(.theme-light) #side-menu::after {
  color: rgba(255,255,255,0.3) !important;
  background-color: transparent !important;
}

body:not(.theme-light) #side-menu {
  background: transparent !important;
  padding-top: 50px !important;
}

body:not(.theme-light) .nav > li > a {
  color: #a8b4c4 !important;
  border-left: 3px solid transparent !important;
}

body:not(.theme-light) .nav > li > a:hover,
body:not(.theme-light) .nav > li > a:focus {
  background-color: #0d3b8a !important;
  color: #ffffff !important;
  border-left-color: #00afe5 !important;
}

body:not(.theme-light) .nav > li.active > a {
  background-color: #0d3b8a !important;
  color: #ffffff !important;
  border-left: 3px solid #00afe5 !important;
}

body:not(.theme-light) .nav > li.active {
  border-left: none !important;
  background: transparent !important;
}

body:not(.theme-light) .nav > li > a .fa {
  color: #00afe5;
  opacity: 0.85;
}

body:not(.theme-light) .nav-second-level li a {
  color: #a8b4c4 !important;
  background-color: rgba(0,0,0,0.15) !important;
  border-left: 3px solid transparent !important;
}

body:not(.theme-light) .nav-second-level li a:hover {
  background-color: rgba(0,0,0,0.25) !important;
  color: #fff !important;
  border-left-color: #00afe5 !important;
}

body:not(.theme-light) .nav-second-level {
  background-color: rgba(0,0,0,0.1) !important;
}

/* Topbar — tema oscuro */
body:not(.theme-light) #page-wrapper {
  background-color: #f0f2f5 !important;
}

body:not(.theme-light) .row.border-bottom {
  background-color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  border-bottom: none !important;
}

body:not(.theme-light) .navbar.navbar-static-top {
  background-color: #ffffff !important;
  border-bottom: none !important;
}

body:not(.theme-light) .minimalize-styl-2 {
  background-color: #00afe5 !important;
  border-color: #0090c0 !important;
  color: #fff !important;
}

body:not(.theme-light) .nav.navbar-top-links > li > a {
  color: #8a9bb0 !important;
}

body:not(.theme-light) .nav.navbar-top-links > li > a:hover {
  color: #00afe5 !important;
  background: transparent !important;
}

/* Cards — tema oscuro */
body:not(.theme-light) .ibox {
  background-color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
}

body:not(.theme-light) .ibox-title {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e8ecf0 !important;
}

body:not(.theme-light) .ibox-title h5 {
  color: #2c3e50 !important;
}

body:not(.theme-light) .ibox-content {
  background-color: #ffffff !important;
}

/* Tabla — tema oscuro */
body:not(.theme-light) .table {
  color: #2c3e50 !important;
}

body:not(.theme-light) .table thead th {
  background-color: #f5f7fa !important;
  border-bottom: 2px solid #e8ecf0 !important;
  color: #8a9bb0 !important;
}

body:not(.theme-light) .table tbody tr:hover {
  background-color: #f8faff !important;
}

body:not(.theme-light) .table tbody td {
  border-top: 1px solid #e8ecf0 !important;
}

body:not(.theme-light) .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #fafbfc !important;
}

/* Forms — tema oscuro */
body:not(.theme-light) .form-control {
  border-color: #e8ecf0 !important;
  color: #2c3e50 !important;
}

body:not(.theme-light) .form-control:focus {
  border-color: #00afe5 !important;
  box-shadow: 0 0 0 3px rgba(0,175,229,0.15) !important;
}

body:not(.theme-light) .control-label {
  color: #8a9bb0 !important;
}

/* Botones — tema oscuro */
body:not(.theme-light) .btn-primary {
  background-color: #00afe5 !important;
  border-color: #00afe5 !important;
  color: #fff !important;
}

body:not(.theme-light) .btn-primary:hover {
  background-color: #0090c0 !important;
  border-color: #0090c0 !important;
  box-shadow: 0 4px 12px rgba(0,175,229,0.35) !important;
}

body:not(.theme-light) .btn-default {
  background-color: #fff !important;
  border-color: #e8ecf0 !important;
  color: #2c3e50 !important;
}

body:not(.theme-light) .btn-default:hover {
  background-color: #f5f7fa !important;
}

body:not(.theme-light) .btn-danger {
  background-color: #e74c3c !important;
  border-color: #e74c3c !important;
}

body:not(.theme-light) .btn-success {
  background-color: #27ae60 !important;
  border-color: #27ae60 !important;
}

body:not(.theme-light) .btn-warning {
  background-color: #f39c12 !important;
  border-color: #f39c12 !important;
  color: #fff !important;
}

/* Paginación — tema oscuro */
body:not(.theme-light) .pagination > li > a,
body:not(.theme-light) .pagination > li > span {
  border-color: #e8ecf0 !important;
  color: #00afe5 !important;
}

body:not(.theme-light) .pagination > .active > a {
  background-color: #00afe5 !important;
  border-color: #00afe5 !important;
  color: #fff !important;
}

body:not(.theme-light) .pagination > li > a:hover {
  background-color: #e6f7fc !important;
}

/* Alerts — tema oscuro */
body:not(.theme-light) .alert-success { background-color: #eafaf1 !important; color: #1e8449 !important; }
body:not(.theme-light) .alert-danger,
body:not(.theme-light) .alert-error  { background-color: #fef9f9 !important; color: #c0392b !important; }
body:not(.theme-light) .alert-info   { background-color: #eaf4fd !important; color: #1a5276 !important; }
body:not(.theme-light) .alert-warning{ background-color: #fef9e7 !important; color: #9a6700 !important; }

/* =========================================================
   TEMA CLARO (.theme-light en body)
   ========================================================= */
body.theme-light {
  background-color: #f5f7fa !important;
  color: #082c66;
}

/* Sidebar claro */
body.theme-light .navbar-default.navbar-static-side {
  background-color: #ffffff !important;
  border-right: 1px solid #e8ecf0 !important;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

body.theme-light .navbar-default {
  background-color: #ffffff !important;
  border-color: #e8ecf0 !important;
}

body.theme-light .sidebar-logo-area {
  border-bottom: 1px solid #e8ecf0;
  padding: 20px 16px 16px;
}

body.theme-light .logo-name {
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

body.theme-light #side-menu::after {
  color: #b0bec5 !important;
  background-color: transparent !important;
}

body.theme-light #side-menu {
  background: transparent !important;
  padding-top: 50px !important;
}

body.theme-light .nav > li > a {
  color: #546e7a !important;
  border-left: 3px solid transparent !important;
  font-weight: 500 !important;
}

body.theme-light .nav > li > a:hover,
body.theme-light .nav > li > a:focus {
  background-color: #e6f7fc !important;
  color: #00afe5 !important;
  border-left-color: #00afe5 !important;
}

body.theme-light .nav > li.active > a {
  background-color: #e6f7fc !important;
  color: #00afe5 !important;
  border-left: 3px solid #00afe5 !important;
  font-weight: 600 !important;
}

body.theme-light .nav > li.active {
  border-left: none !important;
  background: transparent !important;
}

body.theme-light .nav > li > a .fa {
  color: #00afe5 !important;
  opacity: 0.9;
}

body.theme-light .nav-second-level li a {
  color: #607d8b !important;
  background-color: #f8f9fa !important;
  border-left: 3px solid transparent !important;
}

body.theme-light .nav-second-level li a:hover {
  background-color: #e6f7fc !important;
  color: #00afe5 !important;
  border-left-color: #00afe5 !important;
}

body.theme-light .nav-second-level {
  background-color: #f8f9fa !important;
}

/* Topbar — tema claro */
body.theme-light #page-wrapper {
  background-color: #f5f7fa !important;
}

body.theme-light .row.border-bottom {
  background-color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  border-bottom: 1px solid #e8ecf0 !important;
}

body.theme-light .navbar.navbar-static-top {
  background-color: #ffffff !important;
  border-bottom: none !important;
}

body.theme-light .minimalize-styl-2 {
  background-color: #00afe5 !important;
  border-color: #0090c0 !important;
  color: #fff !important;
}

body.theme-light .nav.navbar-top-links > li > a {
  color: #546e7a !important;
}

body.theme-light .nav.navbar-top-links > li > a:hover {
  color: #00afe5 !important;
  background: transparent !important;
}

/* Cards — tema claro */
body.theme-light .ibox {
  background-color: #ffffff !important;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06) !important;
}

body.theme-light .ibox-title {
  background-color: #ffffff !important;
  border-bottom: 1px solid #f0f2f5 !important;
}

body.theme-light .ibox-title h5 {
  color: #082c66 !important;
}

body.theme-light .ibox-content {
  background-color: #ffffff !important;
}

/* Tabla — tema claro */
body.theme-light .table {
  color: #082c66 !important;
}

body.theme-light .table thead th {
  background-color: #f8f9fa !important;
  border-bottom: 2px solid #e8ecf0 !important;
  color: #78909c !important;
}

body.theme-light .table tbody tr:hover {
  background-color: #e6f7fc !important;
}

body.theme-light .table tbody td {
  border-top: 1px solid #f0f2f5 !important;
}

body.theme-light .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #fafbfc !important;
}

/* Forms — tema claro */
body.theme-light .form-control {
  border-color: #dde3ea !important;
  color: #082c66 !important;
  background-color: #fff !important;
}

body.theme-light .form-control:focus {
  border-color: #00afe5 !important;
  box-shadow: 0 0 0 3px rgba(0,175,229,0.12) !important;
}

body.theme-light .control-label {
  color: #78909c !important;
}

/* Botones — tema claro (mismos colores) */
body.theme-light .btn-primary {
  background-color: #00afe5 !important;
  border-color: #00afe5 !important;
  color: #fff !important;
}

body.theme-light .btn-primary:hover {
  background-color: #0090c0 !important;
  border-color: #0090c0 !important;
  box-shadow: 0 4px 12px rgba(0,175,229,0.3) !important;
}

body.theme-light .btn-default {
  background-color: #fff !important;
  border-color: #dde3ea !important;
  color: #082c66 !important;
}

body.theme-light .btn-default:hover {
  background-color: #f5f7fa !important;
}

body.theme-light .btn-danger  { background-color: #e74c3c !important; border-color: #e74c3c !important; }
body.theme-light .btn-success { background-color: #27ae60 !important; border-color: #27ae60 !important; }
body.theme-light .btn-warning { background-color: #f39c12 !important; border-color: #f39c12 !important; color: #fff !important; }

/* Paginación — tema claro */
body.theme-light .pagination > li > a,
body.theme-light .pagination > li > span {
  border-color: #dde3ea !important;
  color: #00afe5 !important;
}

body.theme-light .pagination > .active > a {
  background-color: #00afe5 !important;
  border-color: #00afe5 !important;
  color: #fff !important;
}

body.theme-light .pagination > li > a:hover {
  background-color: #e6f7fc !important;
}

/* Alerts — tema claro */
body.theme-light .alert-success { background-color: #eafaf1 !important; color: #1e8449 !important; }
body.theme-light .alert-danger,
body.theme-light .alert-error  { background-color: #fef9f9 !important; color: #c0392b !important; }
body.theme-light .alert-info   { background-color: #eaf4fd !important; color: #1a5276 !important; }
body.theme-light .alert-warning{ background-color: #fef9e7 !important; color: #9a6700 !important; }

/* =========================================================
   BOTÓN TOGGLE DE TEMA (topbar)
   ========================================================= */
#theme-toggle {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 13px;
  margin-right: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}

#theme-toggle:hover {
  border-color: #00afe5;
  color: #00afe5;
}

body:not(.theme-light) #theme-toggle {
  color: #8a9bb0;
  border-color: #dee2e6;
}

body.theme-light #theme-toggle {
  color: #546e7a;
  border-color: #dde3ea;
}

/* Ícono correcto según tema */
body:not(.theme-light) #theme-toggle .icon-dark { display: none; }
body:not(.theme-light) #theme-toggle .icon-light { display: inline; }
body.theme-light      #theme-toggle .icon-light { display: none; }
body.theme-light      #theme-toggle .icon-dark  { display: inline; }

/* =========================================================
   LOGIN — layout base
   ========================================================= */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif !important;
  transition: background 0.3s ease;
}

body.login-page::after {
  display: none !important;
}

/* Card central */
.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 20px 60px rgba(8,44,102,0.18);
  transition: box-shadow 0.3s ease;
}

/* Logo */
.login-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-wrap .logo-tema {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.login-brand-name {
  font-size: 28px;
  font-weight: 700;
  color: #082c66;
  margin: 0;
  letter-spacing: -0.5px;
}

/* Divisor sutil debajo del logo */
.login-logo-wrap::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: #00afe5;
  border-radius: 2px;
  margin: 16px auto 0;
}

/* Formulario */
.login-form {
  margin: 0;
}

/* Cada campo con icono */
.login-field-wrap {
  position: relative;
  margin-bottom: 16px;
}

.login-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #082c66;
  font-size: 14px;
  z-index: 5;
  pointer-events: none;
  transition: color 0.2s ease;
}

.login-field-wrap:focus-within .login-field-icon {
  color: #00afe5;
}

.login-input {
  padding-left: 40px !important;
  border: 1px solid #b0c4d8 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  height: 44px !important;
  font-family: 'Poppins', sans-serif !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: none !important;
}

.login-input:focus {
  border-color: #00afe5 !important;
  box-shadow: 0 0 0 3px rgba(0,175,229,0.15) !important;
  outline: none !important;
}

/* Liquid effect */
.login-field-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #082c66, #00afe5, #082c66, #00afe5);
  background-size: 200% 100%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}

.login-field-wrap:focus-within::after {
  width: 100%;
  animation: liquidFlow 1.8s linear infinite;
}

@keyframes liquidFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Botón submit */
body.login-page .btn-primary {
  background-color: #082c66 !important;
  border-color: #082c66 !important;
  color: #ffffff !important;
  width: 100%;
  height: 44px;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  letter-spacing: 0.3px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.login-page .btn-primary:hover {
  background-color: #00afe5 !important;
  border-color: #00afe5 !important;
  box-shadow: 0 4px 16px rgba(0,175,229,0.35) !important;
}

body.login-page .btn-default {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #8a9bb0 !important;
  font-size: 13px !important;
  background: none !important;
  border: none !important;
  text-decoration: none;
}

body.login-page .btn-default:hover {
  color: #00afe5 !important;
}

/* Footer */
.login-footer {
  margin-top: 24px;
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
}

/* Alertas dentro del card */
body.login-page .alert {
  border-radius: 8px !important;
  font-size: 13px !important;
  margin-bottom: 16px;
}

/* LOGIN — tema oscuro (default) */
body.login-page:not(.theme-light) {
  background: linear-gradient(135deg, #082c66 0%, #0d3b8a 50%, #082c66 100%) !important;
}

body.login-page:not(.theme-light) .login-footer {
  color: rgba(255,255,255,0.6);
}

/* LOGIN — tema claro */
body.login-page.theme-light {
  background: #f0f2f5 !important;
}

body.login-page.theme-light .login-card {
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

body.login-page.theme-light .login-footer {
  color: #8a9bb0;
}

/* Botón toggle en login */
#login-theme-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  z-index: 9999;
}

#login-theme-toggle:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

body.login-page.theme-light #login-theme-toggle {
  background: #ffffff;
  border-color: #dde3ea;
  color: #546e7a;
}

body.login-page.theme-light #login-theme-toggle:hover {
  border-color: #00afe5;
  color: #00afe5;
}

body.login-page:not(.theme-light) #login-theme-toggle .icon-dark  { display: inline; }
body.login-page:not(.theme-light) #login-theme-toggle .icon-light { display: none; }
body.login-page.theme-light       #login-theme-toggle .icon-light { display: inline; }
body.login-page.theme-light       #login-theme-toggle .icon-dark  { display: none; }

/* =========================================================
   LOGOS POR TEMA
   logo-dark  = se muestra en tema oscuro (sidebar oscuro)
   logo-light = se muestra en tema claro  (sidebar blanco)
   ========================================================= */

/* Por defecto: mostrar logo-dark, ocultar logo-light */
.logo-tema.logo-light { display: none !important; }
.logo-tema.logo-dark  { display: block !important; }

/* Tema claro (sidebar): ocultar logo-dark, mostrar logo-light */
body:not(.login-page).theme-light .logo-tema.logo-dark  { display: none !important; }
body:not(.login-page).theme-light .logo-tema.logo-light { display: block !important; }

/* Login: siempre mostrar logo-light, nunca logo-dark */
body.login-page .logo-tema.logo-dark  { display: none !important; }
body.login-page .logo-tema.logo-light { display: block !important; }

/* =========================================================
   SCROLLBAR sidebar
   ========================================================= */
.sidebar-collapse::-webkit-scrollbar { width: 4px; }
.sidebar-collapse::-webkit-scrollbar-track { background: transparent; }
.sidebar-collapse::-webkit-scrollbar-thumb { background-color: rgba(128,128,128,0.2); border-radius: 4px; }
