/* ============================================================
   BioTime Pro Theme — Sistema Checador ITCC
   ============================================================ */

/* --- Variables ------------------------------------------- */
:root {
  --btp-sidebar-bg:    #1a2035;
  --btp-sidebar-width: 230px;
  --btp-topbar-h:      52px;
  --btp-primary:       #1a237e;
  --btp-accent:        #3949ab;
  --btp-hover:         rgba(255,255,255,.08);
  --btp-page-bg:       #f0f2f5;
}

/* --- Reset / Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, Arial, sans-serif;
  font-size: 13px;
  background: var(--btp-page-bg);
  margin-left: var(--btp-sidebar-width);
  margin-top:  var(--btp-topbar-h);
  min-height:  100vh;
  transition: margin-left .2s ease;
}

/* --- Sidebar --------------------------------------------- */
.btp-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width:  var(--btp-sidebar-width);
  background: var(--btp-sidebar-bg);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .2s ease;
}

body.btp-sidebar-hidden { margin-left: 0; }
body.btp-sidebar-hidden .btp-sidebar { width: 0; }

.btp-sidebar-logo {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btp-sidebar-logo img { width: 36px; height: 36px; border-radius: 4px; }
.btp-brand-name { color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.btp-brand-sub  { color: rgba(255,255,255,.45); font-size: 10px; }

.btp-nav-section { padding: 10px 0 2px; }

.btp-nav-section-title {
  padding: 3px 16px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.32);
  text-transform: uppercase;
  letter-spacing: .9px;
}

.btp-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 12.5px;
  border-left: 3px solid transparent;
  transition: background .14s, color .14s;
  white-space: nowrap;
}

.btp-nav-link .ni { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.btp-nav-link:hover  { background: var(--btp-hover); color: #fff; text-decoration: none; }
.btp-nav-link.active { background: rgba(57,73,171,.3); color: #fff; border-left-color: #64b5f6; }

/* --- Top-bar --------------------------------------------- */
.btp-topbar {
  position: fixed;
  top: 0; left: var(--btp-sidebar-width); right: 0;
  height: var(--btp-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 1100;
  transition: left .2s ease;
}

body.btp-sidebar-hidden .btp-topbar { left: 0; }

.btp-sidebar-toggle {
  border: 0;
  background: transparent;
  color: #1a237e;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-right: 10px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.btp-sidebar-toggle:hover { color: #3949ab; }

.btp-page-title { font-size: 14px; font-weight: 600; color: #1a237e; }

.btp-user-pill  { display: flex; align-items: center; gap: 10px; }

.btp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #3949ab; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.btp-user-name { font-size: 12.5px; font-weight: 600; color: #333; }
.btp-user-role { font-size: 11px; color: #888; }

.btp-logout {
  background: none; border: 1px solid #e0e0e0; border-radius: 4px;
  padding: 4px 12px; font-size: 12px; color: #555;
  text-decoration: none; cursor: pointer;
  transition: background .14s;
}
.btp-logout:hover { background: #f5f5f5; color: #333; text-decoration: none; }

/* --- Content wrapper ------------------------------------- */
.btp-content { padding: 20px; min-height: calc(100vh - var(--btp-topbar-h)); }

/* --- Cards ----------------------------------------------- */
.btp-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.09);
  overflow: hidden;
  margin-bottom: 18px;
}

.btp-card-header {
  background: var(--btp-primary);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex; align-items: center; justify-content: space-between;
}

.btp-card-body { padding: 16px; }

/* --- Stat cards ------------------------------------------ */
.btp-stat {
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.09);
  border-left: 4px solid var(--btp-primary);
  display: flex;
  align-items: center;
  gap: 14px;
}

.btp-stat .si { font-size: 28px; }
.btp-stat .sv { font-size: 24px; font-weight: 700; color: var(--btp-primary); line-height: 1; }
.btp-stat .sl { font-size: 11px; color: #888; margin-top: 3px; }

/* --- Tables ---------------------------------------------- */
.btp-table-panel {
  background: #fff; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.09); overflow: hidden;
  margin-bottom: 18px;
}

.btp-table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid #eee;
  background: #fafafa;
}

.btp-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.btp-table thead th {
  background: #e8eaf6; color: #1a237e;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 9px 12px; border-bottom: 2px solid #c5cae9;
  white-space: nowrap;
}

.btp-table tbody td {
  padding: 7px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle;
}

.btp-table tbody tr:hover { background: #f5f5ff; }

/* --- Badges ---------------------------------------------- */
.btp-badge {
  padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 600; display: inline-block; white-space: nowrap;
}

.btp-badge-success   { background: #e8f5e9; color: #2e7d32; }
.btp-badge-warning   { background: #fff3e0; color: #e65100; }
.btp-badge-danger    { background: #ffebee; color: #c62828; }
.btp-badge-info      { background: #e3f2fd; color: #1565c0; }
.btp-badge-secondary { background: #eceff1; color: #546e7a; }
.btp-badge-dark      { background: #263238; color: #fff; }

/* --- Buttons --------------------------------------------- */
.btp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; border-radius: 4px; padding: 6px 14px;
  font-size: 12px; cursor: pointer; text-decoration: none;
  transition: opacity .15s;
}
.btp-btn:hover { opacity: .88; text-decoration: none; }
.btp-btn-primary   { background: var(--btp-primary); color: #fff; }
.btp-btn-accent    { background: #42a5f5; color: #fff; }
.btp-btn-success   { background: #43a047; color: #fff; }
.btp-btn-warning   { background: #fb8c00; color: #fff; }
.btp-btn-danger    { background: #e53935; color: #fff; }
.btp-btn-outline   { background: #fff; color: #1a237e; border: 1px solid #c5cae9; }
.btp-btn-sm        { padding: 3px 9px; font-size: 11px; }

/* --- Filter bar ------------------------------------------ */
.btp-filter-bar {
  background: #fff; border-radius: 8px; padding: 12px 16px;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}

.btp-filter-bar label { font-size: 11px; font-weight: 600; color: #555; display: block; margin-bottom: 3px; }

.btp-filter-bar input,
.btp-filter-bar select {
  border: 1px solid #ddd; border-radius: 4px; padding: 5px 9px; font-size: 12px;
}

.btp-filter-bar input:focus,
.btp-filter-bar select:focus {
  border-color: #3949ab; outline: none; box-shadow: 0 0 0 2px rgba(57,73,171,.12);
}

/* --- Pagination ------------------------------------------ */
.btp-pager { display: flex; gap: 3px; align-items: center; justify-content: flex-end; padding: 8px 14px 10px; }

.btp-pager a,
.btp-pager span {
  padding: 4px 10px; border-radius: 4px; font-size: 12px;
  text-decoration: none; border: 1px solid #ddd; color: #333;
}

.btp-pager a:hover { background: #e8eaf6; }
.btp-pager .cur    { background: var(--btp-primary); color: #fff; border-color: var(--btp-primary); }

/* --- Module cards (dashboard) ---------------------------- */
.btp-dash-section-title {
  display: block;
  width: 100%;
  margin: 4px 0 8px;
  text-align: center;
  font-size: 12px; font-weight: 700; color: #1a237e; text-transform: uppercase;
  letter-spacing: .4px; padding: 3px 12px;
  border: 1px solid #c5cae9; border-radius: 6px; background: #fff;
}

.btp-module-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.09);
  padding: 14px 10px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .15s, box-shadow .15s;
  border-top: 3px solid var(--btp-primary);
  height: 100%;
}

.btp-module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.13);
  text-decoration: none;
  color: inherit;
}

.btp-module-card .mc-icon  { font-size: 26px; margin-bottom: 6px; display: block; }
.btp-module-card .mc-title { font-weight: 700; font-size: 12px; color: #1a237e; margin-bottom: 3px; }
.btp-module-card .mc-desc  { font-size: 10px; color: #888; }

/* --- Login page ------------------------------------------ */
.login-body {
  margin: 0 !important;
  background: #f0f2f5;
}

.btp-login-wrap {
  display: flex; min-height: 100vh;
}

.btp-login-left {
  width: 360px; flex-shrink: 0;
  background: linear-gradient(160deg, #1a237e 0%, #283593 55%, #3949ab 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 28px; color: #fff; text-align: center;
}

.btp-login-left img { width: 72px; height: 72px; border-radius: 10px; margin-bottom: 18px; }
.btp-login-left h2  { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.btp-login-left p   { font-size: 13px; color: rgba(255,255,255,.65); margin: 0; }

.btp-login-divider  { width: 40px; height: 2px; background: rgba(255,255,255,.25); margin: 18px auto; border-radius: 1px; }

.btp-login-logos    { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 24px; }
.btp-login-logos img { height: 36px; width: auto; filter: brightness(0) invert(1) opacity(.7); }

.btp-login-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #f0f2f5; padding: 40px 20px;
}

.btp-login-box {
  background: #fff; border-radius: 10px; padding: 36px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,.10); width: 100%; max-width: 380px;
}

.btp-login-box h3   { font-size: 18px; font-weight: 700; color: #1a237e; margin-bottom: 4px; }
.btp-login-box .sub { font-size: 12px; color: #888; margin-bottom: 24px; }

/* --- Backward compat ------------------------------------- */
.container-custom { height: 100vh; }
.input-container  { margin-bottom: 1rem; }
.centrado         { text-align: center; }
.centradob        { margin: 0 auto; display: block; text-align: center; }

.table-custom { background-color: #313f86; color: white; }
.table-custom thead tr.col-first { background-color: #39c4ca !important; color: white !important; }

.btn-custom-primary  { background-color: #39c4ca !important; border-color: #39c4ca !important; color: white !important; }
.btn-custom-primary:hover  { background-color: #313f86 !important; border-color: #313f86 !important; }
.btn-custom-secondary { background-color: #313f86 !important; border-color: #313f86 !important; color: white !important; }
.btn-custom-secondary:hover { background-color: #39c4ca !important; border-color: #39c4ca !important; }

.modal-header, .modal-footer { background-color: #39c4ca; color: white; }

.boton_r_abajo { margin-top: 0 !important; }
.btn-back { position: relative !important; top: auto !important; left: auto !important; }

.pagination .page-link { background-color: #39c4ca !important; border-color: #39c4ca !important; color: white !important; }
.pagination .page-link:hover { background-color: #2da2a6 !important; border-color: #2da2a6 !important; }
.pagination .active .page-link { background-color: #2b9ca1 !important; border-color: #2b9ca1 !important; }
