/* ===================== GLOBAL LAYOUT ===================== */

html,
body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Layout variables – tune if header/sidebar size changes */
:root {
  --header-offset: 60px;
  --sidebar-offset: 250px;
}

/* MAIN CONTENT WRAPPER*/
.content-wrapper {
  width: 97%;
  max-width: 100%;
  box-sizing: border-box;

  /* push content away from fixed header + sidebar */
  padding-top: var(--header-offset);
  padding-left: var(--sidebar-offset);

  /* let content grow normally */
  overflow-x: hidden;
  overflow-y: visible;
}

/* Inner main content area */
.main-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;

  /* optional: ensure it at least fills viewport below header */
  min-height: calc(100vh - var(--header-offset));
  overflow-x: hidden;
  /* don't set overflow-y; body handles scrolling */
}

/* SIDEBAR – fixed on the left, scrollable if tall */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-offset);
  height: 100vh;              /* viewport height */
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1001;
}

/* TABLES – still horizontally scrollable if wide */
.table-responsive {
  overflow-x: auto;
}

/* Forms */
.form-horizontal {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure all containers respect parent width */
.container,
.container-fluid {
  width: 100%;
  max-width: 100%;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* Prevent nested rows from expanding width with negative margins */
.row {
  margin-left: 0;
  margin-right: 0;
}

/* Modals */
.modal-dialog {
  max-width: 96%;
  margin: 20px auto;
}
