/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.menu .app-brand.demo {
  height: 64px;
}

.app-brand-logo.demo svg {
  width: 100px;
  height: auto;
}

.app-brand-text.demo {
  font-size: 1.375rem;
}

[data-bs-theme="dark"] option {
	background: #484a5d;
    color: #cfcde4;
  }

/* ! For .layout-navbar-fixed added fix padding top to .layout-page */
/* Default navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 72px !important;
}
/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 254px;
    position: relative;
  }
  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    right: 0.65rem;
  }
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1rem;
}

/*
* Mobile responsiveness fixes (audit 2026-10-10)
* Fix: navbar-nav-right flex-basis:100% forces horizontal overflow on narrow
* screens, causing the whole page to shrink-to-fit (zoomed out look).
******************************************************************************/
@media (max-width: 575.98px) {
  .layout-navbar .navbar-nav-right {
    flex-basis: auto !important;
    flex-shrink: 1;
    min-width: 0;
  }
  .layout-navbar #navbar-collapse {
    flex-basis: auto !important;
    min-width: 0;
    overflow: visible;
  }
  .layout-navbar .navbar-nav.flex-row {
    flex-wrap: nowrap;
  }
  /* Generic safety net: any nav-tabs/pills row should wrap instead of
     forcing the page wider than the viewport on small screens. */
  .nav-tabs:not(.flex-column),
  .nav-pills:not(.flex-column) {
    flex-wrap: wrap;
  }
  .nav-tabs .nav-link,
  .nav-pills .nav-link {
    white-space: normal;
  }
  /* card-header rows with title + action buttons side-by-side should stack
     on mobile instead of forcing horizontal overflow. */
  .card-header.d-flex.justify-content-between {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  .card-header.d-flex.justify-content-between > * {
    max-width: 100%;
  }
  .card-header .input-group {
    width: 100%;
  }
  .card-header form {
    width: 100%;
  }
  /* Long-text badges/alerts (e.g. subscription expired messages) must wrap
     instead of pushing the page wider than the screen. */
  .badge {
    white-space: normal !important;
    max-width: 100%;
  }
}

/* Global safety net (all screen sizes): never let the page itself scroll
   sideways. Inner elements that legitimately need horizontal scroll
   (.table-responsive, code blocks, etc.) keep working via their own
   overflow-x:auto — only the outer page is locked down. */
html, body {
  overflow-x: hidden;
}

/*
* Mobile table-to-cards (audit 2026-10-10)
* Any .table-responsive table automatically becomes a stacked card list on
* narrow screens (JS in layout-dashboard.blade.php adds data-label + the
* .mobile-card-table class). Removes the need to scroll tables sideways.
******************************************************************************/
@media (max-width: 767.98px) {
  table.mobile-card-table thead {
    display: none;
  }
  table.mobile-card-table,
  table.mobile-card-table tbody,
  table.mobile-card-table tr,
  table.mobile-card-table td {
    display: block;
    width: 100% !important;
  }
  table.mobile-card-table tr {
    border: 1px solid var(--bs-border-color, #e0e0e0);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bs-card-bg, #fff);
  }
  table.mobile-card-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
    border: none !important;
    padding: 0.4rem 0;
    white-space: normal;
  }
  table.mobile-card-table td:not(:last-child) {
    border-bottom: 1px dashed var(--bs-border-color, #eee) !important;
  }
  table.mobile-card-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #6c757d);
    text-align: left;
    margin-right: auto;
    flex-shrink: 0;
  }
  table.mobile-card-table td:empty,
  table.mobile-card-table td:has(> x-no-data) {
    display: none;
  }
  table.mobile-card-table td.mobile-card-table-full {
    display: block;
    text-align: center;
  }
  table.mobile-card-table td.mobile-card-table-full::before {
    content: none;
  }
}

/*
* File Manager mobile fix (audit 2026-10-10)
* The laravel-filemanager package uses a fixed col-4/col-8 split even on
* mobile, squeezing the file listing into ~190px and forcing the NAME/SIZE/
* TYPE table to scroll sideways. Stack the folder tree above the file list
* instead, each full width.
******************************************************************************/
@media (max-width: 767.98px) {
  .fm-body.d-flex {
    flex-wrap: wrap !important;
  }
  .fm-tree.col-4.col-md-3 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid var(--bs-border-color, #e0e0e0);
  }
  .fm-content.col-8.col-md-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .fm-info-block.d-flex {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .fm-info-block .col-4 {
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
  }
  .fm-info-block .col-4 .progress {
    width: 100px;
  }
  .fm-navbar .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .fm-navbar .row > [class*="col-"] {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }
  .fm-content-body, .fm-table {
    overflow-x: hidden !important;
  }
  /* The plugin forces a fixed 100vh-style height with overflow:visible for
     a desktop "app shell" feel. On mobile this makes content (especially
     the bottom status bar) spill out and visually collide with the page
     footer below it. Let it grow naturally instead. */
  .fm.d-flex.flex-column {
    height: auto !important;
    min-height: 0 !important;
  }
  .fm-body.d-flex {
    height: auto !important;
  }
  /* Toolbar mobile: match the requested mockup — square rounded purple
     buttons, 5 per row grid, all groups merged into one tidy grid. */
  .fm-navbar .row.justify-content-between {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .fm-navbar .row.justify-content-between > .col-auto {
    display: contents;
  }
  .fm-navbar .row.justify-content-between {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
  }
  .fm-navbar .btn-group {
    display: contents;
    margin: 0 !important;
  }
  .fm-navbar .btn-group .btn {
    flex: 0 0 auto !important;
    width: 3.2rem !important;
    min-width: 3.2rem !important;
    max-width: 3.2rem !important;
    height: 3.2rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem !important;
    font-size: 1.35rem;
  }
  .fm-navbar .btn-group .btn:disabled {
    opacity: 0.45;
  }
}
