html {
  font-size: 14px;
  height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* ===== GOOGLE 2026 MINIMAL DESIGN ===== */
:root {
  --google-bg: #ffffff;
  --google-surface: #f8f9fa;
  --google-border: #e8eaed;
  --google-text: #202124;
  --google-text-secondary: #5f6368;
  --google-primary: #1a73e8;
  --google-primary-hover: #1557b0;
  --google-success: #1ab394;
  --google-success-hover: #17a085;
  --google-radius: 8px;
  --google-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --google-shadow-hover: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
}

body {
  font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--google-text);
  background: var(--google-bg);
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container principal - prend tout l'espace disponible */
.main-container {
  flex: 1 0 auto;
}

/* Container padding */
main.pb-3 {
  padding: 24px;
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
}

.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.stat-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-card.stat-success {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
}

.stat-card.stat-info {
  background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
  color: white;
}

.stat-card.stat-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.stat-icon {
  font-size: 2.5rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-small {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s;
}

.stat-card-small:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-card-small .card-body {
  display: flex;
  align-items: center;
  padding: 1rem;
}

.stat-value-small {
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 0.5rem;
}

.stat-label-small {
  color: #6c757d;
  font-size: 0.9rem;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 12px 12px 0 0 !important;
  padding: 1rem 1.25rem;
}

.card-header h5 {
  color: #495057;
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.list-group-item-action:hover {
  background-color: #f8f9fa;
}

/* Footer en bas - après le contenu, pas fixe */
.footer {
    position: static !important; /* Annule le positionnement absolu de Bootstrap */
    flex-shrink: 0;
}

/* Cards */
.card {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  box-shadow: none;
  margin-bottom: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--google-shadow);
}

.card-header {
  background: var(--google-bg);
  border-bottom: 1px solid var(--google-border);
  padding: 20px 24px;
  font-weight: 500;
  font-size: 18px;
  color: var(--google-text);
}

.card-body {
  padding: 24px;
}

/* Card body compact pour les filtres */
.card-body-compact {
  padding: 16px 20px;
}

/* Layout inline pour les filtres */
.filter-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--google-text);
  margin-bottom: 0;
  min-width: 100px;
  flex-shrink: 0;
  text-align: right;
}

.filter-item .form-select,
.filter-item .choices {
  flex: 1;
}

/* Ajuster les Choices.js dans les filtres inline */
.filter-item .choices {
  width: 100%;
}

.filter-item .choices__inner {
  min-height: 32px;
}

/* Forms */
.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--google-text);
  margin-bottom: 8px;
}

/* Form label compact */
.form-label-compact {
  font-size: 13px;
  font-weight: 500;
  color: var(--google-text);
  margin-bottom: 4px;
}

.form-select, .form-control {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--google-bg);
}

/* Form select compact */
.form-select-compact, .form-control-compact {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  padding: 6px 10px;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--google-bg);
}

.form-select:focus, .form-control:focus,
.form-select-compact:focus, .form-control-compact:focus {
  border-color: var(--google-primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
  outline: none;
}

/* Buttons */
.btn {
  border-radius: var(--google-radius);
  padding: 10px 24px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--google-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--google-primary-hover);
  box-shadow: var(--google-shadow);
}

.btn-secondary {
  background: var(--google-surface);
  color: var(--google-text);
  border: 1px solid var(--google-border);
}

.btn-secondary:hover {
  background: #e8eaed;
}

/* Bouton style link (fond blanc, texte gris) */
.btn-link-style {
  background: white;
  color: var(--google-text-secondary);
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  padding: 10px 24px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  text-align: center;
}

.btn-link-style:hover {
  background: var(--google-surface);
  color: var(--google-text);
  border-color: var(--google-border);
  text-decoration: none;
}

/* Bouton success avec nouvelle couleur verte */
.btn-success {
  background: var(--google-success) !important;
  color: white;
  border: none;
}

.btn-success:hover {
  background: var(--google-success-hover) !important;
  box-shadow: var(--google-shadow);
}

/* Badge success avec nouvelle couleur verte */
.bg-success {
  background: var(--google-success) !important;
}

/* Table */
#itemsTable {
  font-size: 14px;
}

#itemsTable thead th {
  background: var(--google-surface);
  color: var(--google-text);
  font-weight: 500;
  border: none;
  padding: 16px 12px 8px 12px;
  position: relative;
  vertical-align: top;
}

#itemsTable thead th input {
  margin-top: 4px;
  width: 100%;
}

/* Espace pour les icônes de tri DataTables */
#itemsTable thead th.sorting,
#itemsTable thead th.sorting_asc,
#itemsTable thead th.sorting_desc {
  padding-right: 30px;
}

/* Positionner les icônes de tri en haut à droite, au-dessus des filtres */
#itemsTable thead th.sorting:before,
#itemsTable thead th.sorting:after,
#itemsTable thead th.sorting_asc:before,
#itemsTable thead th.sorting_asc:after,
#itemsTable thead th.sorting_desc:before,
#itemsTable thead th.sorting_desc:after {
  right: 8px;
  top: 18px;
}

#itemsTable tbody td {
  padding: 16px 12px;
  border-top: 1px solid var(--google-border);
  vertical-align: middle;
}

#itemsTable tbody tr:hover {
  background: var(--google-surface);
}

/* Lignes alternées avec couleur plus subtile */
#itemsTable tbody tr:nth-child(even) {
  background-color: rgb(238, 242, 247);
}

#itemsTable tbody tr:nth-child(even):hover {
  background: var(--google-surface);
}

.item-link {
  color: var(--google-primary);
  text-decoration: none;
  font-weight: 500;
}

.item-link:hover {
  text-decoration: underline;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 4px 12px;
  font-size: 12px;
}

.bg-success {
  background: var(--google-success) !important;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 14px;
  color: var(--google-text-secondary);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  padding: 6px 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--google-radius);
  padding: 6px 12px;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--google-primary) !important;
  color: white !important;
  border: none;
}

.dataTables_wrapper .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 0;
}

/* Images */
img {
  border-radius: 4px;
}

/* Details page */
.details-container {
  margin: 0 auto;
  max-width: 100%;
}

/* Largeurs adaptatives pour details-container */
@media (min-width: 1400px) and (max-width: 2549px) {
  .details-container {
    max-width: 1320px;
  }
}

@media (min-width: 2550px) and (max-width: 3429px) {
  .details-container {
    max-width: 2400px;
  }
}

@media (min-width: 3430px) {
  .details-container {
    max-width: 3200px;
  }
}

.details-image {
  border-radius: var(--google-radius);
  box-shadow: var(--google-shadow);
}

.info-section {
  margin-bottom: 32px;
}

.info-label {
  font-size: 12px;
  color: var(--google-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 16px;
  color: var(--google-text);
  font-weight: 400;
}

.owned-item-card {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.owned-item-card:hover {
  box-shadow: var(--google-shadow);
}

/* Colonne 3 vide */
.owned-item-card:hover {
  box-shadow: var(--google-shadow);
}

/* Tableaux de résumé avec entête coloré */
.table-summary {
  border: 1px solid #dee2e6;
  margin-bottom: 0;
}

.table-summary thead th {
  background-color: rgb(238, 242, 247);
  color: var(--google-text);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.table-summary tbody td {
  padding: 10px 16px;
  border: 1px solid #dee2e6;
  vertical-align: middle;
}

.table-summary tbody td.info-label {
  font-size: 12px;
  color: var(--google-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  width: 40%;
}

.table-summary tbody td.info-value {
  font-size: 14px;
  color: var(--google-text);
  font-weight: 400;
  width: 60%;
}

/* Choices.js customization */
.choices-custom {
  margin-bottom: 0;
}

.choices__inner {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  min-height: 38px;
  padding: 4px 8px;
  background-color: var(--google-bg);
  font-size: 14px;
}

/* Choices.js compact pour les filtres */
.form-select-compact + .choices__inner {
  min-height: 32px;
  padding: 3px 6px;
  font-size: 13px;
}

/* Tags sélectionnés : gris foncé avec texte blanc */
.choices__list--multiple .choices__item {
  background-color: #5f6368;
  border: none;
  border-radius: 4px;
  color: white;
  padding: 2px 8px;
  margin: 2px;
  font-size: 13px;
}

/* Tags plus petits en mode compact */
.form-select-compact + .choices .choices__list--multiple .choices__item {
  padding: 1px 6px;
  margin: 1px;
  font-size: 12px;
}

.choices__list--multiple .choices__item.is-highlighted {
  background-color: #202124;
}

.choices[data-type*="select-multiple"] .choices__button,
.choices__button {
  background-color: transparent;
  border: none;
  color: white;
  opacity: 0.8;
  padding: 0;
  margin-left: 4px;
}

.choices__button:hover {
  opacity: 1;
}

.choices.is-focused .choices__inner {
  border-color: var(--google-primary);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.choices__list--dropdown {
  border: 1px solid var(--google-border);
  border-radius: var(--google-radius);
  box-shadow: var(--google-shadow);
  background-color: var(--google-bg);
}

/* Items du dropdown : hover avec gris moyen et texte noir */
.choices__list--dropdown .choices__item--selectable {
  color: var(--google-text);
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: #dadce0;
  color: var(--google-text);
}

.choices__input {
  background-color: transparent;
  font-size: 14px;
  color: var(--google-text);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }
}

/* Surcharge pour écrans ultra-larges - Paliers de 500px */

/* Palier 1 : 1400px à 1899px */
@media (min-width: 1400px) and (max-width: 1899px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 1320px !important;
    }
}

/* Palier 2 : 1900px à 2399px */
@media (min-width: 1900px) and (max-width: 2399px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 1800px !important;
    }
}

/* Palier 3 : 2400px à 2899px */
@media (min-width: 2400px) and (max-width: 2899px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 2300px !important;
    }
}

/* Palier 4 : 2900px à 3399px */
@media (min-width: 2900px) and (max-width: 3399px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 2800px !important;
    }
}

/* Palier 5 : 3400px et plus */
@media (min-width: 3400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 3300px !important;
    }
}
