/* ============================================================
   AIGP V4.6 - Global Compact Enterprise UI
   Purpose: make more portal cards/boxes visible on one screen.
   This file intentionally overrides previous page CSS globally.
   ============================================================ */

:root {
  --aigp-compact-page-pad: 20px;
  --aigp-compact-card-pad: 18px;
  --aigp-compact-radius: 16px;
  --aigp-compact-gap: 14px;
}

/* Global page density */
body {
  font-size: 14px;
}

main,
.page,
.content,
.main,
.main-content,
.admin-content,
.dashboard,
.portal-content,
.app-main,
.app-content {
  gap: var(--aigp-compact-gap) !important;
}

/* Main content area next to sidebar */
body:not(.auth-body) .content,
body:not(.auth-body) .main-content,
body:not(.auth-body) .admin-content,
body:not(.auth-body) .portal-content,
body:not(.auth-body) .app-content,
body:not(.auth-body) main:not(.auth-shell) {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

/* Reduce large page headers */
.page-header,
.header-card,
.hero-card,
.top-card,
.command-header,
.dashboard-header,
.system-header,
.admin-header,
.management-header,
.card-header-large {
  padding: 20px 24px !important;
  margin-bottom: 14px !important;
  border-radius: 16px !important;
}

.page-header h1,
.header-card h1,
.hero-card h1,
.command-header h1,
.dashboard-header h1,
.admin-header h1,
.management-header h1,
h1 {
  font-size: 28px !important;
  line-height: 1.15 !important;
  margin-bottom: 6px !important;
}

.page-header p,
.header-card p,
.hero-card p,
.command-header p,
.dashboard-header p,
.admin-header p,
.management-header p {
  font-size: 14px !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}

/* General cards */
.card,
.panel,
.box,
.widget,
.metric-card,
.stat-card,
.summary-card,
.dashboard-card,
.kpi-card,
.content-card,
.section-card,
.table-card,
.health-card,
.record-card {
  border-radius: var(--aigp-compact-radius) !important;
  padding: var(--aigp-compact-card-pad) !important;
  margin-bottom: 14px !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055) !important;
}

/* Dashboard metric cards */
.metrics-grid,
.stats-grid,
.kpi-grid,
.summary-grid,
.cards-grid,
.dashboard-grid,
.command-grid {
  gap: 14px !important;
}

.metric-card,
.stat-card,
.kpi-card,
.summary-card {
  min-height: 116px !important;
  padding: 16px 18px !important;
}

.metric-card .icon,
.stat-card .icon,
.kpi-card .icon,
.metric-icon,
.stat-icon,
.kpi-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
}

.metric-card h3,
.metric-card .label,
.stat-card h3,
.stat-card .label,
.kpi-card h3,
.kpi-card .label {
  font-size: 13px !important;
  line-height: 1.25 !important;
  margin: 8px 0 8px !important;
}

.metric-card .value,
.stat-card .value,
.kpi-card .value,
.metric-value,
.stat-value,
.kpi-value,
.big-number {
  font-size: 25px !important;
  line-height: 1.05 !important;
  margin: 4px 0 4px !important;
}

.metric-card .sub,
.metric-card .hint,
.stat-card .sub,
.stat-card .hint,
.kpi-card .sub,
.kpi-card .hint,
.metric-subtitle,
.stat-subtitle {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

/* Common dashboard exact-looking classes */
[class*="metric"],
[class*="stat"],
[class*="kpi"] {
  line-height: 1.25;
}

/* Two-column panels */
.grid,
.row-grid,
.two-col,
.two-column,
.dashboard-two-col,
.section-grid {
  gap: 14px !important;
}

/* Section titles */
.card h2,
.panel h2,
.section-card h2,
.dashboard-card h2,
.content-card h2,
h2 {
  font-size: 21px !important;
  line-height: 1.2 !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

.card h3,
.panel h3,
.section-card h3,
.dashboard-card h3,
.content-card h3,
h3 {
  font-size: 16px !important;
  line-height: 1.25 !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

/* Tables */
table {
  font-size: 13px !important;
}

th,
td {
  padding: 10px 12px !important;
  line-height: 1.3 !important;
}

thead th {
  font-size: 11px !important;
  letter-spacing: .045em !important;
}

/* Buttons */
button,
.btn,
.button,
.action-btn,
.primary-btn,
.secondary-btn,
a.btn {
  min-height: 36px !important;
  padding: 9px 13px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

/* Inputs */
input,
select,
textarea,
.input,
.form-control {
  min-height: 38px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

label {
  font-size: 13px !important;
}

/* Sidebar density */
.sidebar,
.side-nav,
.app-sidebar,
.admin-sidebar,
nav.sidebar {
  width: 250px !important;
  min-width: 250px !important;
}

.sidebar .brand,
.side-nav .brand,
.app-sidebar .brand,
.admin-sidebar .brand {
  padding-top: 18px !important;
  padding-bottom: 16px !important;
}

.sidebar a,
.side-nav a,
.app-sidebar a,
.admin-sidebar a,
.sidebar .nav-link,
.side-nav .nav-link,
.app-sidebar .nav-link,
.admin-sidebar .nav-link {
  min-height: 38px !important;
  padding: 9px 14px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

.sidebar .section-title,
.side-nav .section-title,
.app-sidebar .section-title,
.admin-sidebar .section-title,
.sidebar small,
.side-nav small {
  font-size: 10.5px !important;
  margin-top: 12px !important;
  margin-bottom: 6px !important;
}

/* Empty states */
.empty,
.empty-state,
.no-data,
.placeholder,
.dashed,
.info-box {
  padding: 14px 16px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* Progress/utilization sections */
.progress-row,
.utilization-row,
.license-row,
.subscription-row {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  margin-bottom: 10px !important;
}

.progress,
.progress-bar-bg,
.progress-track {
  height: 9px !important;
  border-radius: 999px !important;
}

/* Command center specific improvements */
.subscription-utilization,
.license-utilization,
.department-usage,
.pending-requests,
.expiring-subscriptions,
.expiring-licenses,
.recent-activity,
.monthly-requests {
  min-height: auto !important;
}

/* Avoid oversized top spacing on admin dashboard */
body:not(.auth-body) .admin-page,
body:not(.auth-body) .dashboard-page,
body:not(.auth-body) .system-page {
  padding: 18px 22px !important;
}

/* Browser zoom-like visual compacting for very wide screens */
@media (min-width: 1500px) {
  .metric-card,
  .stat-card,
  .kpi-card,
  .summary-card {
    min-height: 110px !important;
  }

  .metric-card .value,
  .stat-card .value,
  .kpi-card .value,
  .metric-value,
  .stat-value,
  .kpi-value,
  .big-number {
    font-size: 24px !important;
  }
}

/* Laptop screens: prioritize visibility */
@media (max-height: 820px) {
  :root {
    --aigp-compact-page-pad: 16px;
    --aigp-compact-card-pad: 15px;
    --aigp-compact-gap: 12px;
  }

  body {
    font-size: 13px;
  }

  .page-header,
  .header-card,
  .hero-card,
  .top-card,
  .command-header,
  .dashboard-header,
  .system-header,
  .admin-header,
  .management-header {
    padding: 16px 20px !important;
    margin-bottom: 12px !important;
  }

  .page-header h1,
  .header-card h1,
  .hero-card h1,
  .command-header h1,
  .dashboard-header h1,
  .admin-header h1,
  .management-header h1,
  h1 {
    font-size: 25px !important;
  }

  .metric-card,
  .stat-card,
  .kpi-card,
  .summary-card {
    min-height: 98px !important;
    padding: 13px 15px !important;
  }

  .metric-card .value,
  .stat-card .value,
  .kpi-card .value,
  .metric-value,
  .stat-value,
  .kpi-value,
  .big-number {
    font-size: 22px !important;
  }

  .card,
  .panel,
  .box,
  .widget,
  .dashboard-card,
  .content-card,
  .section-card {
    padding: 15px !important;
    margin-bottom: 12px !important;
  }

  .card h2,
  .panel h2,
  .section-card h2,
  .dashboard-card h2,
  h2 {
    font-size: 19px !important;
    margin-bottom: 10px !important;
  }

  th,
  td {
    padding: 8px 10px !important;
  }

  .progress-row,
  .utilization-row,
  .license-row,
  .subscription-row {
    padding: 10px 12px !important;
  }
}

/* Keep auth page separate from this admin compacting except normal link injection */
body.auth-body .auth-shell,
body.auth-body .brand-panel,
body.auth-body .form-panel,
body.auth-body .auth-card {
  /* Auth page keeps its dedicated V4.4.7 scaling. */
}
