:root {
  --bg: #F4F5FA;
  --card: #FFFFFF;
  --card-subtle: #F9FAFC;
  --border: #E8E9F1;
  --text: #1B1F2B;
  --text-soft: #767B8C;
  --text-faint: #A2A6B4;
  --brand: #2F6FED;
  --brand-dark: #1B4FC0;
  --brand-light: #E7EEFF;
  --purple: #7B61FF;
  --purple-soft: #EFECFF;
  --orange: #F5A623;
  --orange-soft: #FDF0DB;
  --red: #E5484D;
  --red-soft: #FCE7E8;
  --teal: #12B886;
  --teal-soft: #E1F7EF;
  --shadow-sm: 0 1px 3px rgba(20,20,43,.05);
  --shadow: 0 4px 16px rgba(20,20,43,.06);
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 72px;
  --topbar-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #0F1116;
  --card: #181B23;
  --card-subtle: #1E222C;
  --border: #272B36;
  --text: #EDEFF5;
  --text-soft: #9CA1B0;
  --text-faint: #6B7080;
  --brand-light: #182744;
  --purple-soft: #241F3D;
  --orange-soft: #3A2C13;
  --red-soft: #3A1E20;
  --teal-soft: #12302A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 6px 20px rgba(0,0,0,.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1116;
    --card: #181B23;
    --card-subtle: #1E222C;
    --border: #272B36;
    --text: #EDEFF5;
    --text-soft: #9CA1B0;
    --text-faint: #6B7080;
    --brand-light: #182744;
    --purple-soft: #241F3D;
    --orange-soft: #3A2C13;
    --red-soft: #3A1E20;
    --teal-soft: #12302A;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow: 0 6px 20px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout Structure ---------- */
.portal-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 100;
  user-select: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

.sidebar-header {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3E7BFF, #7B61FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 10px rgba(47, 111, 237, 0.25);
}

.logo-img {
  width: 38px;
  height: 38px;
  min-width: 38px;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-module {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 12px 6px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-light);
  color: var(--brand);
}

.nav-item.active .nav-icon {
  color: var(--brand);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  display: none;
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand);
}

.nav-badge.soon {
  background: var(--bg);
  color: var(--text-faint);
  border: 1px solid var(--border);
}

.sidebar.collapsed .nav-badge {
  display: none;
}

.nav-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav-item.disabled:hover {
  background: transparent;
  color: var(--text-soft);
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1B1F2B;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 200;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
}

.status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-soft);
}

.sidebar.collapsed .portal-status-chip span {
  display: none;
}

/* ---------- Main Layout Content ---------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Topbar */
.portal-topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  transition: background 0.15s ease;
}

.hamburger-btn:hover {
  background: var(--border);
}

.current-view-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.view-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-light);
  color: var(--brand);
  padding: 3px 8px;
  border-radius: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Topbar Action Buttons */
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.refresh-btn:hover {
  background: var(--bg);
}

.refresh-btn.spinning #portalRefreshIcon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.upload-excel-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--brand);
  background: var(--brand-light);
  color: var(--brand);
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-excel-btn:hover {
  background: var(--brand);
  color: #fff;
}

.last-update-tag {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  margin-right: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--bg);
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 14px 4px 5px;
  border-radius: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2F6FED, #12B886);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.user-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
}

/* ---------- Content Views ---------- */
.view-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.view-panel.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Home / Hub View */
.home-scroll-area {
  height: 100%;
  overflow-y: auto;
  padding: 28px 32px 60px;
}

.home-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Hero Section */
.welcome-hero {
  background: linear-gradient(135deg, #2F6FED 0%, #7B61FF 100%);
  border-radius: 20px;
  padding: 32px 36px;
  color: #FFFFFF;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.22);
}

.hero-bg-shapes {
  position: absolute;
  right: -20px;
  bottom: -40px;
  font-size: 180px;
  opacity: 0.12;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero-date {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 14.5px;
  opacity: 0.9;
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.hero-sync-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-btn-sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  background: #FFFFFF;
  color: var(--brand);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: all 0.15s ease;
}

.hero-btn-sync:hover {
  background: #F4F5FA;
  transform: translateY(-1px);
}

.hero-btn-sync.spinning #homeSyncIcon {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.hero-sync-tag {
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.9;
  background: rgba(255,255,255,0.18);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.25);
}

/* KPI Highlights Grid */
.home-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.home-kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-pill {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-foot {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modules Showcase Grid */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--text-soft);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.module-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.module-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.module-info h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.module-info p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.45;
}

.module-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
}

.mod-stat-item {
  display: flex;
  flex-direction: column;
}

.mod-stat-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
}

.mod-stat-val {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}

.module-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-enter-module {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn-enter-module:hover {
  background: var(--brand-dark);
}

.btn-upload-subtle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-upload-subtle:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-quick-view {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-quick-view:hover {
  background: var(--bg);
  border-color: var(--brand);
  color: var(--brand);
}

/* Upcoming Roadmap Cards */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.roadmap-card {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.roadmap-card:hover {
  opacity: 1;
}

.roadmap-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.roadmap-meta h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.roadmap-meta span {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* Module Embed Iframes */
.module-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
}

/* Toast Notifications */
.portal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1B1F2B;
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.portal-toast.active {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Login y sesión ---------- */
[hidden] { display: none !important; }

body.auth-pending .portal-container { visibility: hidden; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #2F6FED 0%, #7B61FF 100%);
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--card);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 2px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.login-field input {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.login-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.login-error {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  background: var(--red-soft);
  padding: 9px 12px;
  border-radius: 10px;
}

.login-card .btn-enter-module {
  flex: none;
  padding: 12px 16px;
}

.login-card .btn-enter-module:disabled {
  opacity: 0.65;
  cursor: wait;
}

.login-help {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

.logout-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-soft);
}

@media (max-width: 768px) {
  /* Barra superior: el título en una sola línea y los botones siempre visibles */
  .portal-topbar { padding: 0 12px; gap: 10px; }
  .topbar-left { gap: 10px; min-width: 0; flex: 1; }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  .hamburger-btn { flex-shrink: 0; }
  .current-view-title { min-width: 0; font-size: 15px; gap: 8px; }
  #currentViewText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .view-badge { display: none; }
  .theme-toggle-btn { width: 34px; height: 34px; }
  .user-meta { display: none; }
  .user-chip { padding: 3px; }
  .logout-btn { height: 34px; padding: 0 12px; }

  .welcome-hero { padding: 24px 22px; border-radius: 18px; margin-bottom: 22px; }
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 13.5px; }
  .section-title { font-size: 16px; }
  .module-card { padding: 18px; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .home-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .modules-grid { grid-template-columns: 1fr; }
  .roadmap-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 1000;
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 999;
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .home-scroll-area { padding: 20px 16px; }
  .home-kpi-row { grid-template-columns: 1fr; }
  .last-update-tag { display: none; }
  .refresh-btn .btn-text, .upload-excel-btn .btn-text { display: none; }
}
