/* GMDR Shell Repair - stable sidebar + report navigation */

:root {
  --gmdr-shell-width: 260px;
  --gmdr-bg: #f6f3ef;
  --gmdr-card: #ffffff;
  --gmdr-ink: #102f4e;
  --gmdr-muted: #8a8f94;
  --gmdr-line: #ebe5de;
  --gmdr-blue: #29b6f6;
}

body.gmdr-shell-restored {
  background: var(--gmdr-bg) !important;
}

/* Fixed sidebar */
.gmdr-fixed-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--gmdr-shell-width);
  background: #fff;
  border-right: 1px solid var(--gmdr-line);
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: 18px 0 40px rgba(16, 47, 78, .035);
}

.gmdr-fixed-profile {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gmdr-fixed-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid var(--gmdr-blue);
  background: #e8f8ff;
  color: #087db8;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.gmdr-fixed-user {
  color: var(--gmdr-ink);
  font-weight: 950;
  line-height: 1.15;
}

.gmdr-fixed-company {
  color: var(--gmdr-muted);
  font-size: 12px;
  margin-top: 3px;
  font-weight: 750;
}

.gmdr-fixed-nav {
  padding: 26px 0;
  display: grid;
  gap: 4px;
}

.gmdr-fixed-nav a {
  position: relative;
  min-height: 54px;
  padding: 0 22px;
  color: #8f928f;
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.gmdr-fixed-nav a:hover {
  background: #f8fcfe;
  color: var(--gmdr-ink);
}

.gmdr-fixed-nav a.active {
  color: var(--gmdr-ink);
  background: #f3fbff;
}

.gmdr-fixed-nav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 13px;
  bottom: 13px;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--gmdr-blue);
}

.gmdr-fixed-icon {
  width: 21px;
  height: 21px;
  border: 1.8px solid currentColor;
  border-radius: 7px;
  opacity: .75;
}

.gmdr-fixed-footer {
  margin-top: auto;
  padding: 20px 22px 28px;
  border-top: 1px solid var(--gmdr-line);
}

.gmdr-fixed-safe {
  color: var(--gmdr-ink);
  font-size: 12px;
  font-weight: 950;
  margin-bottom: 4px;
}

.gmdr-fixed-safe-text {
  color: var(--gmdr-muted);
  font-size: 12px;
  line-height: 1.35;
}

/* Shift main UI back to the right */
body.gmdr-shell-restored .gmdr-pro-topbar,
body.gmdr-shell-restored .gmdr-page-context,
body.gmdr-shell-restored .gmdr-workbench,
body.gmdr-shell-restored .wsc-page,
body.gmdr-shell-restored .gmdr-dashboard-cards,
body.gmdr-shell-restored .gmdr-pro-welcome,
body.gmdr-shell-restored .gmdr-command-center,
body.gmdr-shell-restored .report-page,
body.gmdr-shell-restored main {
  margin-left: var(--gmdr-shell-width) !important;
  width: calc(100% - var(--gmdr-shell-width)) !important;
}

/* Prevent content from becoming too narrow after shift */
body.gmdr-shell-restored .gmdr-page-context,
body.gmdr-shell-restored .gmdr-workbench,
body.gmdr-shell-restored .wsc-page,
body.gmdr-shell-restored .gmdr-dashboard-cards,
body.gmdr-shell-restored .gmdr-pro-welcome,
body.gmdr-shell-restored .gmdr-command-center {
  max-width: calc(100vw - var(--gmdr-shell-width) - 48px) !important;
}

/* Report navigation repair */
.gmdr-report-nav-repair {
  margin: 14px 0 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gmdr-report-nav-repair a {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gmdr-line);
  color: var(--gmdr-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gmdr-report-nav-repair a:hover {
  background: #f8fcfe;
}

.gmdr-report-nav-repair a.active {
  background: var(--gmdr-blue);
  border-color: var(--gmdr-blue);
  color: #fff;
}

/* Stabilize reports action buttons/links */
body.gmdr-report-page a[href^="/reportes"] {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Avoid floating buttons covering report controls */
body.gmdr-report-page .gmdr-pro-floating {
  opacity: .85 !important;
}

@media (max-width: 1080px) {
  .gmdr-fixed-sidebar {
    display: none;
  }

  body.gmdr-shell-restored .gmdr-pro-topbar,
  body.gmdr-shell-restored .gmdr-page-context,
  body.gmdr-shell-restored .gmdr-workbench,
  body.gmdr-shell-restored .wsc-page,
  body.gmdr-shell-restored .gmdr-dashboard-cards,
  body.gmdr-shell-restored .gmdr-pro-welcome,
  body.gmdr-shell-restored .gmdr-command-center,
  body.gmdr-shell-restored .report-page,
  body.gmdr-shell-restored main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
