@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap");

@font-face {
  font-family: "ISConnectDisplay";
  src: url("../../fonts/font.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #e30613;
  --brand-dark: #b50010;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warning: #f59e0b;
  --info: #2563eb;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 8px 20px rgba(15, 23, 42, 0.06);
  --sidebar-width: 284px;
  --sidebar-collapsed: 92px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  min-height: 46px;
  padding: 0 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.14);
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

h1,
h2,
h3,
.page-title,
.login-title,
.hero-title,
.brand-wordmark {
  font-family: "ISConnectDisplay", "Poppins", sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Buttons */
.btn {
  border: 0;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 10px 20px rgba(227, 6, 19, 0.25);
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.btn-soft {
  background: rgba(227, 6, 19, 0.1);
  color: var(--brand-dark);
}

.btn-soft:hover {
  background: rgba(227, 6, 19, 0.18);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-active {
  background: rgba(22, 163, 74, 0.13);
  color: #15803d;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.badge-muted {
  background: #eef2f7;
  color: #556077;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

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

/* App shell */
.app-shell {
  background: var(--bg);
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

body.sidebar-collapsed .app-layout {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafafb 100%);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  transition: width var(--transition), transform var(--transition);
  z-index: 60;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo-chip {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, #ff3c49 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-logo-chip img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-wordmark {
  font-size: 22px;
  line-height: 1;
  color: var(--text-primary);
  font-weight: 700;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sidebar-collapse {
  flex-shrink: 0;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border-radius: 14px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 48px;
  padding: 0 12px;
  color: #324154;
  font-weight: 600;
  transition: all var(--transition);
}

.nav-link i {
  width: 18px;
  text-align: center;
}

.nav-link:hover {
  background: #f7f8fb;
  border-color: var(--border);
}

.nav-link.is-active {
  background: rgba(227, 6, 19, 0.08);
  border-color: rgba(227, 6, 19, 0.22);
  color: var(--brand-dark);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-help {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.sidebar-help h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.sidebar-help p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: #fff;
}

.sidebar-profile img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(227, 6, 19, 0.2);
  object-fit: cover;
}

.sidebar-profile h4 {
  font-size: 13px;
  line-height: 1.1;
}

.sidebar-profile p {
  font-size: 12px;
  color: var(--text-secondary);
}

body.sidebar-collapsed .sidebar .brand-copy,
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .sidebar-help,
body.sidebar-collapsed .sidebar .sidebar-profile-info,
body.sidebar-collapsed .sidebar .sidebar-profile .btn {
  display: none;
}

body.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-collapsed .sidebar-header {
  flex-direction: column;
  gap: 8px;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-profile {
  justify-content: center;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 78px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
}

.global-search {
  width: min(440px, 44vw);
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fafafb;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.global-search i {
  color: #9ca3af;
}

.global-search input {
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0;
}

.global-search input:focus {
  box-shadow: none;
}

.notify-btn {
  position: relative;
}

.notify-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
}

.user-menu {
  position: relative;
}

.user-chip {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
}

.user-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip span {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 10px;
  display: none;
}

.user-dropdown a,
.user-dropdown button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  min-height: 40px;
  text-align: left;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #334155;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: #f8fafc;
}

body.user-menu-open .user-dropdown {
  display: block;
}

.app-content {
  padding: 26px;
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1;
  margin-bottom: 8px;
  color: #111827;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.toolbar-grid .field {
  display: grid;
  gap: 6px;
}

.toolbar-grid .field span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-dashboard {
  min-height: 260px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  background: #111827;
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 520ms ease, transform 5600ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.82) 0%, rgba(227, 6, 19, 0.42) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: clamp(24px, 4vw, 44px);
  max-width: 760px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(4px);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease, transform 180ms ease;
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.88);
}

.hero-dot.is-active {
  width: 22px;
  background: #ffffff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 0.95;
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border-color: transparent;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(227, 6, 19, 0.06);
}

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

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.kpi-value {
  font-family: "Inter", "Poppins", sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  font-size: clamp(30px, 2.4vw, 40px);
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.kpi-meta .positive {
  color: var(--success);
  font-weight: 700;
}

.kpi-meta .warning {
  color: var(--warning);
  font-weight: 700;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.3fr;
  gap: 14px;
}

.panel-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-subtle);
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.panel-head h3 {
  font-size: 18px;
}

.panel-head p {
  color: var(--text-secondary);
  font-size: 13px;
}

.line-chart {
  width: 100%;
  height: 238px;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
}

.donut {
  width: 180px;
  height: 180px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 46%, var(--warning) 46% 72%, var(--info) 72% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  background: #fff;
  border-radius: 50%;
}

.legend-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.legend-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.activity-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fcfdff;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--info);
}

.activity-item h4 {
  font-size: 14px;
}

.activity-item p {
  font-size: 13px;
  color: var(--text-secondary);
}

.activity-item small {
  color: #94a3b8;
}

/* Companies */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.company-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-subtle);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.company-logo-wrap {
  min-height: 130px;
  border-radius: 14px;
  border: 1px dashed #d8dce4;
  background: #fbfcff;
  display: grid;
  place-items: center;
  padding: 12px;
}

.company-logo-wrap img {
  width: auto;
  height: auto;
  max-height: 96px;
  object-fit: contain;
}

.company-card h3 {
  font-size: 24px;
  line-height: 1.05;
}

.company-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

.company-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* Reports */
.report-grid,
.subreport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
}

.report-card,
.subreport-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-subtle);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.report-icon,
.subreport-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #ff4e58 100%);
}

.report-card h3,
.subreport-card h3 {
  font-size: 26px;
  line-height: 1;
}

.report-card p,
.subreport-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

.report-actions,
.subreport-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.breadcrumb strong {
  color: var(--text-primary);
}

.subreport-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  padding: 28px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 26px;
  color: #1f2937;
  margin-bottom: 8px;
}

/* Admin */
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  border-radius: 12px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  background: rgba(227, 6, 19, 0.1);
  border-color: rgba(227, 6, 19, 0.26);
  color: var(--brand-dark);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
  gap: 14px;
}

.table-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.form-title {
  font-size: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.simple-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.simple-list li {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 10px;
  background: #fff;
}

.check-item input {
  width: 16px;
  min-height: auto;
}

/* Viewer */
.viewer-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.viewer-topbar {
  min-height: 78px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
}

.viewer-topbar h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1;
}

.viewer-topbar p {
  color: var(--text-secondary);
  font-size: 13px;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.viewer-content {
  flex: 1;
  padding: 20px 24px 24px;
  display: grid;
  gap: 14px;
}

.viewer-frame-shell {
  min-height: calc(100vh - 180px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  position: relative;
}

.powerbi-embed-frame {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 180px);
  border: 0;
  display: none;
}

.viewer-frame-shell.has-frame .powerbi-embed-frame {
  display: block;
}

.viewer-frame-shell.has-frame .empty-state {
  display: none;
}

.viewer-frame-shell .empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 22px;
}

/* Login */
.login-page {
  background: var(--bg);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.login-visual {
  position: relative;
  background-image: linear-gradient(145deg, rgba(17, 24, 39, 0.82) 0%, rgba(227, 6, 19, 0.58) 100%), url("../../img/Tiendas DL.png");
  background-size: cover;
  background-position: center;
  padding: 36px;
  display: flex;
  align-items: flex-end;
}

.login-visual-content {
  color: #fff;
  max-width: 560px;
}

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

.login-brand-chip {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-brand-chip img {
  width: 34px;
  height: 34px;
}

.login-brand h1 {
  font-size: clamp(36px, 4.1vw, 54px);
  line-height: 1;
}

.login-visual h2 {
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 0.95;
  margin-bottom: 14px;
}

.login-visual p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
  max-width: 520px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 30px;
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 30px 30px 24px;
  display: grid;
  gap: 18px;
}

.login-card-top {
  text-align: left;
  display: grid;
  gap: 8px;
}

.login-card-top img {
  width: 140px;
  margin-bottom: 12px;
}

.login-card-top .login-center-logo {
  width: min(220px, 60%);
  max-height: 68px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.login-title {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.04;
  margin: 0;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

#loginForm {
  display: grid;
  gap: 12px;
}

.login-card .field {
  gap: 6px;
}

.login-card .field label {
  margin-bottom: 0;
}

.login-card .field input {
  min-height: 48px;
  border-radius: 13px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 46px;
}

.password-toggle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  position: absolute;
  top: 6px;
  right: 6px;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f3f4f6;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-top: -2px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-check input {
  width: 16px;
  min-height: auto;
}

.login-row a {
  color: var(--brand-dark);
  font-weight: 600;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  border-radius: 14px;
}

.login-error {
  min-height: 18px;
  color: var(--brand-dark);
  font-size: 12px;
  margin-top: -2px;
}

.login-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.login-company-logos {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 10px;
  flex-wrap: wrap;
}

.login-company-logos img {
  height: 32px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.74;
}

/* Responsive */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 50;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1320px) {
  .analytics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-grid .panel-card:last-child {
    grid-column: 1 / -1;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    transform: translateX(-102%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: grid;
  }

  .topbar {
    padding: 0 16px;
  }

  .global-search {
    width: min(380px, 52vw);
  }

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

  body.sidebar-collapsed .sidebar .brand-copy,
  body.sidebar-collapsed .sidebar .nav-label,
  body.sidebar-collapsed .sidebar .sidebar-help,
  body.sidebar-collapsed .sidebar .sidebar-profile-info,
  body.sidebar-collapsed .sidebar .sidebar-profile .btn {
    display: initial;
  }
}

@media (max-width: 980px) {
  .subreport-layout {
    grid-template-columns: 1fr;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 280px;
    align-items: flex-start;
  }

  .login-panel {
    margin-top: -60px;
    position: relative;
    z-index: 1;
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  .app-content,
  .viewer-content {
    padding: 14px;
  }

  .topbar {
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }

  .global-search {
    width: 100%;
  }

  .topbar-left {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-right {
    margin-left: auto;
  }

  .kpi-grid,
  .analytics-grid,
  .company-grid,
  .report-grid,
  .subreport-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-topbar {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-actions {
    width: 100%;
  }

  .viewer-actions .btn,
  .viewer-actions a {
    flex: 1;
  }

  .login-card {
    padding: 20px;
  }

  .login-company-logos {
    flex-wrap: wrap;
    justify-content: center;
  }
}
