/* =====================================================
   SGI INTRANET — LAYOUT GLOBAL
   Paleta: Primario #046bd2 | Sidebar #1a2a4a
   ===================================================== */

/* --- Reset layout de Astra --- */
body.sgi-layout {
  margin: 0;
  padding: 0;
  background: #f0f5fa;
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow-x: hidden;
}
body.sgi-layout #page { display: flex; min-height: 100vh; }
body.sgi-layout .site-header,
body.sgi-layout .ast-site-header-wrap,
body.sgi-layout #masthead { display: none !important; }
body.sgi-layout .site-footer,
body.sgi-layout #colophon { display: none !important; }
body.sgi-layout #content.site-content { padding: 0; margin: 0; }
body.sgi-layout .ast-container { max-width: 100%; padding: 0; }
body.sgi-layout .entry-content { max-width: 100%; }

/* =====================================================
   SIDEBAR
   ===================================================== */
#sgi-sidebar {
  width: 220px;
  min-height: 100vh;
  background: #1a2a4a;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  box-shadow: 2px 0 16px rgba(0,0,0,0.22);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
#sgi-sidebar::-webkit-scrollbar { width: 4px; }
#sgi-sidebar::-webkit-scrollbar-track { background: transparent; }
#sgi-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Logo */
.sgi-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  text-decoration: none !important;
}
.sgi-logo-icon {
  width: 38px; height: 38px;
  background: #046bd2;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  letter-spacing: -1px;
}
.sgi-logo-text { line-height: 1.2; }
.sgi-logo-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: block;
}
.sgi-logo-sub {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  letter-spacing: 0.3px;
  display: block;
}

/* Nav */
#sgi-sidebar nav { flex: 1; padding: 10px 0; }

.sgi-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  padding: 14px 16px 5px;
  display: block;
}

/* Top-level link (no children) */
.sgi-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.sgi-nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  text-decoration: none !important;
}
.sgi-nav-link.active {
  background: rgba(4,107,210,0.2);
  color: #7ab8ff;
  border-left-color: #046bd2;
  font-weight: 600;
}
.sgi-nav-link .sgi-icon { font-size: 15px; width: 18px; text-align: center; }

/* Accordion group */
.sgi-group { }
.sgi-group-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.sgi-group-header:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sgi-group-header .sgi-icon { font-size: 15px; width: 18px; text-align: center; }
.sgi-group-chevron {
  margin-left: auto;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  transition: transform 0.22s;
}
.sgi-group.open > .sgi-group-header .sgi-group-chevron { transform: rotate(90deg); }
.sgi-group.open > .sgi-group-header { color: #fff; }

.sgi-group-children {
  display: none;
  background: rgba(0,0,0,0.16);
}
.sgi-group.open > .sgi-group-children { display: block; }

.sgi-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 36px;
  color: rgba(255,255,255,0.6);
  font-size: 12.5px;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.14s, color 0.14s;
}
.sgi-sub-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none !important; }
.sgi-sub-link.active {
  background: rgba(4,107,210,0.18);
  color: #7ab8ff;
  border-left-color: #046bd2;
  font-weight: 600;
}
.sgi-sub-link .sgi-icon { font-size: 13px; width: 16px; text-align: center; }

/* Sidebar footer */
.sgi-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

/* =====================================================
   MAIN WRAPPER
   ===================================================== */
#sgi-main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
#sgi-topbar {
  height: 54px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.sgi-breadcrumb {
  flex: 1;
  font-size: 12.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.sgi-breadcrumb a { color: #94a3b8; text-decoration: none; }
.sgi-breadcrumb a:hover { color: #046bd2; }
.sgi-breadcrumb .sgi-bc-current { color: #1e293b; font-weight: 600; }
.sgi-breadcrumb .sgi-bc-sep { color: #cbd5e1; }

.sgi-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sgi-user-name { font-size: 12px; color: #64748b; }
.sgi-avatar {
  width: 32px; height: 32px;
  background: #046bd2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  cursor: pointer;
}

/* Content area */
#sgi-content { flex: 1; padding: 28px 32px; }

.sgi-page-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}
.sgi-page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.sgi-page-header p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.sgi-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 24px;
}

/* Fix iframe pages — remove extra padding */
body.sgi-layout .entry-content .wp-block-html { margin: 0; }
body.sgi-layout .entry-content > * { max-width: 100%; }

/* Responsive */
@media (max-width: 768px) {
  #sgi-sidebar { width: 0; overflow: hidden; }
  #sgi-main { margin-left: 0; }
}
