:root {
  --hm-primary: #0b63c7;
  --hm-secondary: #0b2a5b;
  --hm-gray: #6b7280;
  --hm-light: #f4f7fb;
  --hm-success: #16a34a;
  --hm-danger: #dc2626;
  --hm-white: #fff;
}

body {
  background: var(--hm-light);
  color: #1f2937;
  font-family: Arial, Helvetica, sans-serif;
}

.login-page {
  align-items: center;
  background: linear-gradient(135deg, var(--hm-secondary), var(--hm-primary));
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--hm-white);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .25);
  max-width: 430px;
  padding: 32px;
  width: 100%;
}

.login-logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 260px;
}

.btn-hm {
  background: var(--hm-primary);
  border: 0;
  color: var(--hm-white);
}

.btn-hm:hover {
  background: var(--hm-secondary);
  color: var(--hm-white);
}

.sidebar {
  background: linear-gradient(180deg, var(--hm-secondary), #06162f);
  box-shadow: 6px 0 18px rgba(0, 0, 0, .15);
  color: var(--hm-white);
  height: 100vh;
  left: 0;
  overflow-y: auto;
  position: fixed;
  top: 0;
  width: 270px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-menu { overflow-y: auto; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.15); margin-top: auto; padding: 8px 0; }
.sidebar-footer .sidebar-logout { color: #fecaca; }

.sidebar .brand {
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  padding: 20px;
  text-align: center;
}

.sidebar .brand img {
  background: var(--hm-white);
  border-radius: 12px;
  max-width: 170px;
  padding: 8px;
}

.sidebar .brand h6 {
  font-weight: 700;
  margin: 10px 0 0;
}

.sidebar a {
  border-left: 4px solid transparent;
  color: #dbeafe;
  display: block;
  padding: 10px 18px;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 255, 255, .1);
  border-left-color: #60a5fa;
  color: var(--hm-white);
}

.module-card {
  background: var(--hm-white);
  border: 1px solid #e6edf5;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  color: #1f2937;
  display: block;
  height: 100%;
  min-height: 150px;
  padding: 22px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.module-card:hover {
  box-shadow: 0 14px 30px rgba(15, 23, 42, .14);
  color: var(--hm-secondary);
  transform: translateY(-3px);
}

.module-card .icon {
  align-items: center;
  background: linear-gradient(135deg, var(--hm-primary), var(--hm-secondary));
  border-radius: 14px;
  color: var(--hm-white);
  display: flex;
  font-size: 22px;
  height: 48px;
  justify-content: center;
  margin-bottom: 13px;
  width: 48px;
}

.module-card h5 {
  font-weight: 700;
  margin-bottom: 5px;
}

.module-card p {
  color: var(--hm-gray);
  font-size: 14px;
  margin: 0;
}

.main {
  margin-left: 270px;
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: var(--hm-white);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 99;
}

.content {
  padding: 24px;
}

.card-hm {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.print-report-button {
  background: var(--hm-primary);
  border-color: var(--hm-primary);
  font-weight: 600;
}

.print-report-button:hover {
  background: var(--hm-secondary);
  border-color: var(--hm-secondary);
}

.print-report-header {
  display: none;
}

.kpi {
  background: var(--hm-white);
  border-left: 5px solid var(--hm-primary);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  padding: 20px;
}

.kpi .label {
  color: var(--hm-gray);
  font-weight: 700;
}

.kpi .value {
  color: var(--hm-secondary);
  font-size: 28px;
  font-weight: 700;
}

.table thead th {
  background: var(--hm-secondary);
  color: var(--hm-white);
  white-space: nowrap;
}

.page-title {
  color: var(--hm-secondary);
  font-weight: 700;
}

.badge-activo {
  background: var(--hm-success);
}

.badge-inactivo {
  background: var(--hm-gray);
}

.password-note {
  color: var(--hm-gray);
  font-size: .82rem;
}

@media (max-width: 900px) {
  .sidebar {
    height: auto;
    position: relative;
    width: 100%;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    position: relative;
  }
}

@media print {
  @page {
    margin: 12mm;
    size: landscape;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11px;
  }

  .sidebar,
  .topbar,
  .no-print,
  .btn,
  form.d-inline,
  .alert {
    display: none !important;
  }

  .print-report-header {
    align-items: center;
    border-bottom: 2px solid #0b2a5b;
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 8px;
  }

  .print-report-title {
    color: #0b2a5b;
    font-size: 24px;
    font-weight: 700;
  }

  .print-report-header img {
    height: 48px;
    object-fit: contain;
    width: auto;
  }

  .main {
    margin: 0;
    min-height: auto;
  }

  .content {
    padding: 0;
  }

  .card,
  .card-hm,
  .kpi {
    border: 1px solid #bbb;
    box-shadow: none;
  }

  .table-responsive {
    overflow: visible;
  }

  .table {
    font-size: 10px;
    width: 100%;
  }

  .table thead th {
    background: #e9ecef !important;
    color: #000 !important;
    print-color-adjust: exact;
  }

  input,
  select,
  textarea {
    border: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
    padding: 0 !important;
  }
}
