:root {
  --blue: #007bff;
}

body {
  --admin-sidebar-width: 240px;
}

body.sidebar-collapsed {
  --admin-sidebar-width: 56px;
}

.admin-sidebar-toggle {
  line-height: 1;
}
.admin-sidebar-toggle i {
  font-size: 1.15rem;
}
.admin-sidebar-toggle:hover, .admin-sidebar-toggle:focus {
  text-decoration: none;
  opacity: 0.85;
}

/* List table with filters and sorting
   ------------------------------------------------------------------------- */
.list-container {
  /* Bulk action export button */
  /* Selection counter badge */
}
.list-container .table {
  /* Row hover highlighting */
  /* Bulk selection checkbox column */
}
.list-container .table thead tr:first-child th {
  vertical-align: middle;
}
.list-container .table thead tr:first-child th .th-flex-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.list-container .table thead tr:first-child th .sort-btn {
  padding: 0.2rem 0.4rem;
  background: transparent;
  border: none;
  color: #6c757d;
  flex-shrink: 0;
}
.list-container .table thead tr:first-child th .sort-btn:hover {
  color: var(--blue);
}
.list-container .table thead tr:first-child th .sort-btn i {
  font-size: 0.9rem;
}
.list-container .table thead .filters-row th {
  padding: 0.5rem;
}
.list-container .table thead .filters-row th .filter-input {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  height: calc(1.5em + 0.5rem + 2px);
}
.list-container .table thead .filters-row th .clear-filters-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  margin-top: 0.1rem;
}
.list-container .table tbody tr {
  transition: background-color 0.15s ease-in-out;
}
.list-container .table tbody tr:hover {
  background-color: #e8f4fc !important;
}
.list-container .table .column-checkbox {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}
.list-container .table .column-checkbox input[type=checkbox] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--blue);
}
.list-container .bulk-export-btn.has-selection {
  background-color: #28a745;
  border-color: #28a745;
}
.list-container .bulk-export-btn.has-selection:hover {
  background-color: #218838;
  border-color: #1e7e34;
}
.list-container .selection-count {
  display: none;
  margin-left: 0.25rem;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background-color: #fff;
  color: #333;
  border-radius: 10px;
}
.list-container .selection-count.visible {
  display: inline;
}

.card-body:not(:has(*)) {
  padding: 0;
}

/* Page: 'Backend post index'
   ------------------------------------------------------------------------- */
body#admin_post_index .item-actions {
  white-space: nowrap;
}

body#admin_post_index .item-actions a.btn + a.btn {
  margin-left: 4px;
}

/* Page: 'Backend post show'
   ------------------------------------------------------------------------- */
body#admin_post_show .post-tags .label-default {
  background-color: #e9ecec;
  color: #6D8283;
  font-size: 16px;
  margin-right: 10px;
  padding: 0.4em 1em 0.5em;
}

body#admin_post_show .post-tags .label-default i {
  color: #95A6A7;
}

.form-control:focus {
  color: var(--blue);
  box-shadow: none;
}

/* 2-Column Layout and Sidebar Menu
   ------------------------------------------------------------------------- */
#admin-sidebar {
  border-right: 1px solid #dee2e6;
  min-height: calc(100vh - 56px);
  padding-right: 0;
  background-color: #f8f9fa;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  transition: width 0.15s ease-in-out, max-width 0.15s ease-in-out, flex-basis 0.15s ease-in-out;
}
#admin-sidebar .list-group {
  border-radius: 0;
  border: none;
}
#admin-sidebar .list-group .list-group-item {
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background-color: transparent;
}
#admin-sidebar .list-group .list-group-item i {
  width: 20px;
  margin-right: 10px;
  text-align: center;
  color: #6c757d;
}
#admin-sidebar .list-group .list-group-item:hover {
  background-color: #e9ecef;
}
#admin-sidebar .list-group .list-group-item.active {
  background-color: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
#admin-sidebar .list-group .list-group-item.active i {
  color: #fff;
}

@media (min-width: 992px) {
  #admin-sidebar {
    flex: 0 0 var(--admin-sidebar-width);
    max-width: var(--admin-sidebar-width);
  }
  #main {
    flex: 1 1 auto;
    max-width: calc(100% - var(--admin-sidebar-width));
  }
}
body.sidebar-collapsed #admin-sidebar .list-group-item {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  text-align: center;
}

body.sidebar-collapsed #admin-sidebar .list-group-item i {
  margin-right: 0;
}

body.sidebar-collapsed #admin-sidebar .menu-label {
  display: none;
}

.body-container {
  padding-top: 15px; /* Reduced from 76px */
}

.breadcrumb {
  background-color: #f8f9fa;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.25rem;
}
.breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\f105";
  font-family: "FontAwesome";
  padding: 0 0.5rem;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.admin-page-header .admin-breadcrumb {
  flex: 1 1 auto;
}
.admin-page-header .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
}

.admin-page-header__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
}

.admin-page-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.admin-page-listing-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title-wrapper {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 575.98px) {
  .admin-page-title {
    font-size: 1.4rem;
  }
}
/* Responsive (mobile) stacked table layout (PrestaShop-like: no horizontal scroll)
   ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .list-container .table thead {
    display: none;
  }
  .list-container .table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
  }
  .list-container .table tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #f1f3f5;
  }
  .list-container .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    flex: 0 0 42%;
  }
  .list-container .table tbody td:first-child {
    border-top: none;
  }
  .list-container .table tbody td.column-checkbox {
    justify-content: flex-start;
  }
  .list-container .table tbody td.column-checkbox::before {
    content: "";
    flex: 0 0 0;
  }
  .list-container .table tbody .item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
}
@media (max-width: 991.98px) {
  #admin-sidebar {
    display: none;
  }
}

.dropdown-menu .nav {
  flex-direction: column;
}
.dropdown-menu .nav .nav-item .nav-link {
  color: var(--text-color);
  padding: 0.5rem 1rem;
}
.dropdown-menu .nav .nav-item .nav-link:hover {
  background-color: var(--gray-200);
}
.dropdown-menu .nav .nav-item .nav-link.active {
  background-color: var(--blue);
  color: #fff;
}

@media (max-width: 991.98px) {
  #main {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Page: 'Backend show pages'
   ------------------------------------------------------------------------- */
/* Target all admin show pages */
body[id^=admin_][id$=_show] {
  /* Add a subtle background to the entire page for better visual separation */
  background-color: #f9f9f9;
  /* Style the container for better visual appearance */
  /* Mobile-first styles */
  /* Desktop optimizations */
}
body[id^=admin_][id$=_show] .body-container {
  background-color: #fff;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
  margin-bottom: 1rem;
}
body[id^=admin_][id$=_show] #main {
  /* Add some breathing room on mobile */
  padding-bottom: 2rem;
  /* Common styles for all lists in show pages */
  /* Style for annex lines */
  /* Back to list button styling */
}
body[id^=admin_][id$=_show] #main h1 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  word-break: break-word; /* Prevent overflow on small screens */
}
body[id^=admin_][id$=_show] #main p {
  margin-bottom: 0.5rem;
  line-height: 1.4;
  /* Make labels stand out */
}
body[id^=admin_][id$=_show] #main p strong, body[id^=admin_][id$=_show] #main p b, body[id^=admin_][id$=_show] #main p:first-of-type::before {
  font-weight: 600;
  color: #495057;
}
body[id^=admin_][id$=_show] #main ul {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
  /* General styling for any list in show pages */
}
body[id^=admin_][id$=_show] #main ul:not(.annex-lines):not(.annex-line-prices) {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
body[id^=admin_][id$=_show] #main ul:not(.annex-lines):not(.annex-line-prices) li {
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  padding: 0.75rem;
  /* For desktop, make general lists display in a grid if they have many items */
}
@media (min-width: 768px) {
  body[id^=admin_][id$=_show] #main ul:not(.annex-lines):not(.annex-line-prices) li:not(:only-child) {
    display: inline-block;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
  }
}
body[id^=admin_][id$=_show] #main .annex-lines {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
body[id^=admin_][id$=_show] #main .annex-lines .annex-line {
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  /* Nested lists */
}
body[id^=admin_][id$=_show] #main .annex-lines .annex-line h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: #495057;
}
body[id^=admin_][id$=_show] #main .annex-lines .annex-line .annex-line-prices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 3px solid #e9ecef;
}
body[id^=admin_][id$=_show] #main .annex-lines .annex-line .annex-line-prices .annex-line-price {
  background-color: #fff;
  padding: 0.75rem;
  border-radius: 0.25rem;
}
body[id^=admin_][id$=_show] #main .annex-lines .annex-line .annex-line-prices .annex-line-price h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #495057;
}
body[id^=admin_][id$=_show] #main .btn-link {
  margin-top: 1.5rem;
  display: inline-block;
}
@media (min-width: 768px) {
  body[id^=admin_][id$=_show] #main {
    /* Better spacing on desktop */
    padding-bottom: 3rem;
    /* Create a grid layout for basic info on desktop */
    /* Improved annex lines layout on desktop */
  }
  body[id^=admin_][id$=_show] #main h1 {
    font-size: 2rem;
  }
  body[id^=admin_][id$=_show] #main > p {
    display: inline-block;
    margin-right: 2rem;
    margin-bottom: 0.75rem;
    min-width: 200px;
  }
  body[id^=admin_][id$=_show] #main .annex-lines .annex-line {
    padding: 1.5rem;
    /* Create a grid layout for basic info within annex lines */
  }
  body[id^=admin_][id$=_show] #main .annex-lines .annex-line > p {
    display: inline-block;
    margin-right: 1.5rem;
    margin-bottom: 0.75rem;
    min-width: 180px;
  }
  body[id^=admin_][id$=_show] #main .annex-lines .annex-line .annex-line-prices {
    flex-direction: row;
    flex-wrap: wrap;
  }
  body[id^=admin_][id$=_show] #main .annex-lines .annex-line .annex-line-prices .annex-line-price {
    flex: 1 1 calc(50% - 1rem);
    min-width: 200px;
  }
}
