/* Al-Hikma governance UI — responsive, sidebar-first (no top ribbon) */

/* Legacy top ribbon — never show; all links live in sidebar */
.gov-nav-card,
.gov-nav-scroll,
.gov-toolbar,
.gov-ribbon {
  display: none !important;
}

.gov-shell {
  max-width: 100%;
  overflow-x: hidden;
}

.gov-page-head {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.gov-page-title {
  font-size: 1.25rem;
  line-height: 1.4;
  word-break: break-word;
}

.gov-page-body {
  max-width: 100%;
}

.gov-page-body .card {
  max-width: 100%;
}

.gov-page-body .row {
  margin-left: -8px;
  margin-right: -8px;
}

.gov-page-body .row > [class*="col-"] {
  padding-left: 8px;
  padding-right: 8px;
  min-width: 0;
}

.gov-table-wrap,
.gov-page-body .table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gov-page-body table {
  margin-bottom: 0;
}

.gov-page-body img,
.gov-page-body canvas,
.gov-page-body video {
  max-width: 100%;
  height: auto;
}

.gov-page-body .btn {
  white-space: normal;
}

.gov-member-quick {
  gap: 0.25rem;
}

/* Select2 */
.select2-container {
  width: 100% !important;
  max-width: 100% !important;
}
.select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.25rem 0.5rem;
  border: 1px solid #ced4da;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.7;
  padding-right: 0;
  padding-left: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  left: 6px;
  right: auto;
}
.select2-container--open .select2-dropdown {
  z-index: 2050;
}

/* Sidebar dropdowns (touch-friendly) */
.sidebar .nav-dropdown-items .nav-link {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.sidebar .nav-dropdown.open > .nav-dropdown-items,
.sidebar .nav-item.nav-dropdown.open > ul.nav-dropdown-items {
  max-height: 2000px !important;
  display: block !important;
}

/* Modals / dialogs on small screens */
@media (max-width: 991.98px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .gov-page-title {
    font-size: 1.1rem;
  }
  .gov-page-head {
    padding: 0.65rem 0.75rem;
  }
  .gov-page-body .card-body {
    padding: 0.85rem;
  }
  .gov-page-body .btn-lg {
    width: 100%;
  }
  .gov-page-body .form-row > [class*="col-"] {
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .gov-page-body .table {
    font-size: 0.85rem;
  }
  .gov-page-body .btn-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .gov-page-body .btn-group > .btn {
    flex: 1 1 auto;
  }
  .gov-member-quick {
    width: 100%;
  }
  .gov-member-quick .btn {
    flex: 1 1 auto;
  }
  /* Keep backpack sidebar usable on phones */
  .sidebar {
    z-index: 1040;
  }
  .app-body .main {
    min-width: 0;
  }
}

@media (max-width: 575.98px) {
  .gov-page-body .card-header {
    font-size: 0.95rem;
  }
  .alert {
    font-size: 0.9rem;
  }
}

/* iPad / tablet landscape */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .gov-page-body .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Print */
@media print {
  .sidebar,
  .app-header,
  .gov-page-head {
    display: none !important;
  }
  .gov-page-body {
    padding: 0 !important;
  }
}
