/* dashboard.css */

:root {
  --portal-bg-a: #edf4ea;
  --portal-bg-b: #f4f8ff;
  --portal-bg-c: #e8f0df;
  --portal-panel: #ffffff;
  --portal-border: #cfdccb;
  --portal-ink: #162418;
  --portal-muted: #5b6a5d;
  --portal-brand-1: #0f5a34;
  --portal-brand-2: #0b4d7d;
  --portal-shadow: 0 14px 28px rgba(21, 47, 26, 0.12);
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(1200px 700px at -10% -12%, rgba(24, 114, 66, 0.16), rgba(24, 114, 66, 0)),
    radial-gradient(950px 620px at 110% 0%, rgba(20, 88, 140, 0.14), rgba(20, 88, 140, 0)),
    linear-gradient(140deg, var(--portal-bg-a) 0%, var(--portal-bg-b) 54%, var(--portal-bg-c) 100%);
  color: var(--portal-ink);
}

html {
  overflow-x: hidden;
}

#openMenuBtn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 3001;
  width: 44px;
  height: 44px;
  background: linear-gradient(140deg, var(--portal-brand-1) 0%, var(--portal-brand-2) 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--portal-shadow);
  font-size: 2rem;
  cursor: pointer;
  transition: left 0.5s cubic-bezier(.4,0,.2,1);
}

#openMenuBtn:focus {
  outline: 2px solid #1976d2;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0a2a1a 0%, #0b3a24 45%, #0d4e31 100%);
  color: #fff;
  transition: width 0.5s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  border: none;
  box-shadow: none;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  z-index: 2000;
}
.sidebar.collapsed * {
  display: none !important;
}
.sidebar.collapsed #closeMenuBtn {
  display: flex !important;
  position: fixed !important;
  left: 18px;
  top: 18px;
  z-index: 3000;
  background: #001c33;
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 2rem;
  border: none;
  cursor: pointer;
}

.sidebar #closeMenuBtn {
  display: flex;
  position: absolute;
  top: 18px;
  right: -22px;
  z-index: 2001;
  background: none !important;
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  font-size: 2rem;
  border: none;
  cursor: pointer;
  transition: right 0.5s cubic-bezier(.4,0,.2,1);
}

.sidebar #closeMenuBtn:hover {
  background: #1565c0 !important;
}

.sidebar #closeMenuBtn i.material-icons {
  background: none !important;
  box-shadow: none !important;
}



.sidebar-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.9rem;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex-wrap: nowrap;
  flex: 1;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.sidebar-header .brand-logo-gpin {
  height: 50px;
  width: auto;
}

.sidebar-header .brand-logo-claro {
  display: block;
  height: 120px;
  width: auto;
  max-width: 132px;
}

.sidebar h3 {
  display: none;
  font-size: 1.2rem;
  margin: 0;
  white-space: nowrap;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav ul li {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar nav ul li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s;
}

.sidebar nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.14);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: linear-gradient(92deg, #113b25 0%, #1a603b 40%, #1d5f91 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 28, 20, 0.24);
}

.breadcrumbs {
  font-size: 0.875rem;
  margin-left: 56px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  position: absolute;
  right: 2rem;
  top: 1rem;
  z-index: 10;
}
/* User icon button in header */
.user-menu-btn {
  background: none;
  border: none;
  color: #fff !important;
  font-size: 1.8rem;
  cursor: pointer;
  vertical-align: middle;
  display: flex;
  align-items: center;
}

/* Username text in header */
.user-info .user-name {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  margin-left: 0.5rem;
  letter-spacing: 0.5px;
}

.cards {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fdf7 100%);
  padding: 1rem;
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  box-shadow: var(--portal-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(21, 47, 26, 0.18);
}

.card i {
  font-size: 2rem;
  color: var(--portal-brand-2);
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.card p {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0;
}

.data-table {
  background-color: var(--portal-panel);
  margin: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  box-shadow: var(--portal-shadow);
}

.data-table h3 {
  margin-top: 0;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #e3ece0;
}

.footer {
  text-align: center;
  font-size: 0.875rem;
  padding: 1rem;
  background-color: #eaf2e6;
  color: var(--portal-muted);
  margin-top: auto;
  border-top: 1px solid #d1ddca;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    z-index: 2500;
    box-shadow: 4px 0 20px rgba(0,0,0,0.24);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    width: 240px !important;
  }

  .main-content {
    width: 100%;
  }

  .topbar {
    min-height: 64px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .breadcrumbs {
    margin-left: 56px;
    margin-right: 0;
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-info {
    position: static;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  #openMenuBtn {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  .breadcrumbs {
    max-width: 100%;
    margin-left: 48px;
    font-size: 0.78rem;
  }

  .user-info {
    width: 100%;
    justify-content: flex-end;
  }

  .cards,
  .paneles,
  .data-table {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    margin-left: 0;
    margin-right: 0;
  }
}

.loader {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  border: 4px solid #ccc;
  border-top: 4px solid #004c99;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ESTILO TARJETAS COMO EN ENTRUST */
.card {
  position: relative;
  border-top: 4px solid #d32f2f;
  flex-direction: column;
  align-items: flex-start;
}

.card small {
  color: #d32f2f;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.card .warning {
  color: #e65100;
  font-size: 0.75rem;
}

.card .error {
  color: #d32f2f;
  font-size: 0.75rem;
}

/* SECCIÓN DE PANELES */
.paneles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1.5rem;
}

.panel {
  flex: 1;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 0;
  overflow: hidden;
  min-width: 300px;
}

.panel-header {
  background-color: #e0e0e0;
  padding: 0.75rem 1rem;
  font-weight: bold;
  border-bottom: 3px solid #d32f2f;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

/* LISTA DE AUTHENTICATORS */
.auth-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid #eee;
  font-size: 0.95rem;
  align-items: center;
}

.auth-list li i {
  margin-right: 0.5rem;
  color: #004c99;
}

/* PANEL DE AUTHENTICATIONS */
.date-range {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background-color: #fafafa;
  border-top: 1px solid #eee;
}

.auth-metrics {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.auth-apps, .auth-types {
  flex: 1;
  min-width: 220px;
}

.auth-apps p, .auth-types p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

.auth-apps strong, .auth-types strong {
  float: right;
  font-weight: bold;
}

.auth-types i {
  font-size: 1rem;
  margin-right: 0.5rem;
  color: #004c99;
}

/* SELECT DE RANGO DE FECHA */
.date-range select {
  margin-left: 0.5rem;
  padding: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* RESPONSIVE AJUSTES */
@media (max-width: 768px) {
  .cards {
    flex-direction: column;
  }
  .paneles {
    flex-direction: column;
  }
}

.submenu > a {
  justify-content: space-between;
  display: flex;
  align-items: center;
}

.sub-items {
  display: none;
  background-color: #002b4d;
  list-style: none;
  padding-left: 1.5rem;
}

.submenu.open .sub-items {
  display: block;
}

.sub-items li a {
  padding: 0.5rem 1rem;
  display: block;
  color: #ddd;
}

.expand-icon {
  transition: transform 0.3s;
}

.submenu.open > a .expand-icon {
  transform: rotate(180deg);
}

  .paneles {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    font-family: Arial, sans-serif;
  }

  .panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #d32f2f;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1.1rem;
  }

  .panel-header i {
    margin-right: 8px;
    color: #d32f2f;
  }

  .auth-list, .auth-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .auth-list li, .auth-section li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .auth-list i, .auth-section i {
    color: #555;
    margin-right: 8px;
  }

  .label {
    flex: 1;
  }

  .count {
    font-weight: bold;
    color: #1e88e5;
    min-width: 50px;
    text-align: right;
  }

  .date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
  }

  .date-range select {
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid #ccc;
  }

  .auth-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .auth-section h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
  }

      .gpin-modal {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
        background:
          radial-gradient(1200px 800px at 10% 20%, rgba(21, 101, 192, 0.22), rgba(21, 101, 192, 0)),
          rgba(7, 18, 36, 0.52);
      z-index: 9999;
      padding: 18px;
        backdrop-filter: blur(2px);
    }
    .gpin-modal__dialog {
        background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        border-radius: 8px;
      max-width: 610px;
      width: min(610px, 100%);
        box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
      position: relative;
      overflow: hidden;
        border: 1px solid #d7e4f4;
        transform: translateY(8px);
        opacity: 0;
        animation: modal-pop 0.28s ease forwards;
    }
      @keyframes modal-pop {
        to {
          transform: translateY(0);
          opacity: 1;
        }
      }
    .gpin-modal__close {
      position: absolute;
      top: 12px;
      right: 14px;
      border: none;
      background: transparent;
      font-size: 22px;
      color: #757575;
      cursor: pointer;
    }
    .gpin-modal__dialog h3 {
      margin: 0;
      padding: 24px 24px 8px;
      font-size: 1.12rem;
      font-weight: 700;
      color: #12243f;
      letter-spacing: 0.01em;
    }
    .gpin-modal__body {
      padding: 0 24px 18px;
    }
    .contract-overview-meta {
      display: inline-flex;
      align-items: center;
      padding: 0.32rem 0.62rem;
      border-radius: 999px;
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 700;
      color: #0d47a1;
      background: #e8f2ff;
      border: 1px solid #cfe0fb;
      margin: 0 0 0.5rem 0;
    }
    .contract-mode-row {
      display: flex;
      align-items: center;
      gap: 28px;
      padding: 12px 6px 16px;
      color: #202124;
      font-size: 0.95rem;
    }
    .contract-mode-label {
      min-width: 110px;
      font-weight: 700;
    }
    .contract-mode-value {
      font-weight: 500;
    }
    .contract-kpis {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.7rem;
      margin-bottom: 0.85rem;
    }
    .contract-kpi {
      border-radius: 12px;
      border: 1px solid #d6e4f5;
      background: #f8fbff;
      padding: 0.62rem 0.78rem;
      display: grid;
      gap: 0.16rem;
    }
    .contract-kpi__label {
      color: #4e6482;
      font-size: 0.74rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }
    .contract-kpi__value {
      color: #102843;
      font-size: 1rem;
      font-weight: 800;
    }
    .contract-kpi__value.is-active {
      color: #137333;
    }
    .contract-kpi__value.is-expired {
      color: #c62828;
    }
    .entitlements-card {
      border: 1px solid #d8d8d8;
      border-radius: 4px;
      background: #fff;
      overflow: hidden;
    }
    .entitlements-card__head {
      background: #e4e4e4;
      color: #202124;
      font-size: 0.95rem;
      font-weight: 500;
      padding: 16px 18px;
    }
    .entitlements-card__body {
      padding: 22px 18px 18px;
    }
    .entitlement-row {
      display: grid;
      grid-template-columns: 180px 1fr;
      justify-content: center;
      column-gap: 18px;
      padding: 8px 0;
      max-width: 370px;
      margin: 0 auto;
      color: #202124;
      font-size: 0.95rem;
    }
    .entitlement-row span {
      text-align: right;
      font-weight: 700;
    }
    .entitlement-row strong {
      text-align: left;
      font-weight: 500;
    }
    .entitlement-alerts {
      max-width: 340px;
      margin: 12px auto 0;
      display: grid;
      gap: 10px;
    }
    .entitlement-alert {
      display: grid;
      grid-template-columns: 28px 1fr;
      align-items: center;
      gap: 10px;
      color: #5f6368;
      font-size: 0.95rem;
    }
    .entitlement-alert__icon {
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: 800;
      color: #fff;
      line-height: 1;
    }
    .entitlement-alert--danger .entitlement-alert__icon {
      background: #f44336;
      border-radius: 50%;
    }
    .entitlement-alert--warning .entitlement-alert__icon {
      background: transparent;
      color: #f4b400;
      font-size: 1.35rem;
    }
    .gpin-modal__footer {
      display: flex;
      justify-content: flex-end;
      padding: 0 24px 16px;
    }
    .gpin-modal__ok {
      border: none;
      background: transparent;
      color: #ea4335;
      font-size: 0.98rem;
      font-weight: 500;
      cursor: pointer;
      padding: 6px 8px;
    }
    @media (max-width:600px){
      .gpin-modal__dialog h3 {
        padding: 20px 16px 10px;
      }
      .gpin-modal__body {
        padding: 0 16px 16px;
      }
      .contract-mode-row {
        gap: 16px;
        padding: 14px 0 18px;
      }
      .contract-kpis {
        grid-template-columns: 1fr;
      }
      .entitlement-row {
        grid-template-columns: 1fr;
        gap: 4px;
      }
      .entitlement-row span,
      .entitlement-row strong {
        text-align: left;
      }
      .gpin-modal__footer {
        padding: 0 16px 14px;
      }
    }

.sidebar #closeMenuBtn span, .sidebar #closeMenuBtn svg {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        outline: none !important;
        filter: none !important;
        color: #fff !important;
        padding: 0;
      }
      .sidebar #closeMenuBtn svg {
        display: block;
        width: 28px;
        height: 28px;
      }
      .sidebar #closeMenuBtn:hover span {
        background: #1565c0 !important;
      }