/* =============================================================================
   hydro.css — Bootstrap-free design system for HYDRO
   Replaces: bootstrap.min.css + docs.css
   Covers: layout, utilities, navbar, dropdown, modal (dialog), buttons,
           forms, alerts, badges, spinner, toast, carousel, list-group, nav
============================================================================= */

/* ── Custom properties ─────────────────────────────────────────────────── */
:root {
  --h-primary:      #0d6efd;
  --h-secondary:    #6c757d;
  --h-success:      #198754;
  --h-info:         #0dcaf0;
  --h-warning:      #ffc107;
  --h-danger:       #dc3545;
  --h-light:        #f8f9fa;
  --h-dark:         #212529;
  --h-dark-bg:      #1a1a2e;

  --h-body-bg:      #000;
  --h-body-color:   #dee2e6;
  --h-border-color: rgba(255,255,255,.15);

  --h-font-family:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --h-font-size:    1rem;
  --h-line-height:  1.5;

  --h-radius:       0.375rem;
  --h-radius-lg:    0.5rem;

  --h-transition:   0.15s ease-in-out;
  --h-z-dropdown:   1000;
  --h-z-modal:      1055;
  --h-z-alert:      1060;
  --h-z-toast:      1090;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--h-font-family);
  font-size: var(--h-font-size);
  line-height: var(--h-line-height);
  color: var(--h-body-color);
  background-color: var(--h-body-bg);
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1,h2,h3,h4,h5,h6,p { margin: 0; }

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

hr {
  margin: 0.5rem 0;
  border: 0;
  border-top: 1px solid var(--h-border-color);
  opacity: 1;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container-fluid {
  width: 100%;
  padding-right: 12px;
  padding-left:  12px;
}

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
.px-2 { padding-left: 0.5rem !important;  padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important;    padding-right: 1rem !important; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left:  -12px;
}

[class^="col-"], [class*=" col-"] {
  padding-right: 12px;
  padding-left:  12px;
  flex-shrink: 0;
  width: 100%;
}
.col-1  { width:  8.333%; }
.col-2  { width: 16.667%; }
.col-3  { width: 25%; }
.col-4  { width: 33.333%; }
.col-5  { width: 41.667%; }
.col-6  { width: 50%; }
.col-7  { width: 58.333%; }
.col-8  { width: 66.667%; }
.col-9  { width: 75%; }
.col-10 { width: 83.333%; }
.col-11 { width: 91.667%; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
  .col-md-1  { width:  8.333%; }
  .col-md-2  { width: 16.667%; }
  .col-md-3  { width: 25%; }
  .col-md-4  { width: 33.333%; }
  .col-md-5  { width: 41.667%; }
  .col-md-6  { width: 50%; }
  .col-md-7  { width: 58.333%; }
  .col-md-8  { width: 66.667%; }
  .col-md-9  { width: 75%; }
  .col-md-10 { width: 83.333%; }
  .col-md-11 { width: 91.667%; }
  .col-md-12 { width: 100%; }
  .offset-md-1 { margin-left: 8.333%; }
}

/* ── Display utilities ──────────────────────────────────────────────────── */
.d-none         { display: none !important; }
.d-block        { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex         { display: flex !important; }
.d-grid         { display: grid !important; }
.d-inline-flex  { display: inline-flex !important; }

.vh-100  { height: 100vh; }
.h-100   { height: 100%; }
.w-100   { width: 100%; }
.mw-100  { max-width: 100%; }

@media (min-width: 768px) {
  .d-none.d-md-inline { display: inline !important; }
  .d-md-none          { display: none !important; }
  .d-md-inline        { display: inline !important; }
  .w-md-auto          { width: auto !important; }
}

/* ── Flexbox utilities ──────────────────────────────────────────────────── */
.flex-column    { flex-direction: column !important; }
.flex-row       { flex-direction: row !important; }
.flex-nowrap    { flex-wrap: nowrap !important; }
.flex-shrink-0  { flex-shrink: 0 !important; }

.align-items-center  { align-items: center !important; }
.align-items-start   { align-items: flex-start !important; }
.align-items-end     { align-items: flex-end !important; }

.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

.me-auto { margin-right: auto !important; }
.ms-auto { margin-left:  auto !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* ── Spacing utilities ──────────────────────────────────────────────────── */
.m-0  { margin: 0 !important; }
.m-1  { margin: 0.25rem !important; }
.m-2  { margin: 0.5rem !important; }
.m-auto { margin: auto !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

.p-0  { padding: 0 !important; }
.p-1  { padding: 0.25rem !important; }
.p-2  { padding: 0.5rem !important; }
.p-3  { padding: 1rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

.px-3 { padding-right: 1rem !important; padding-left: 1rem !important; }

/* ── Typography utilities ───────────────────────────────────────────────── */
.text-start  { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }

.fw-light  { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-bold   { font-weight: 700 !important; }

.fs-1 { font-size: 2.5rem !important; }
.fs-2 { font-size: 2rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-nowrap    { white-space: nowrap !important; }
.word-wrap      { word-wrap: break-word !important; }

/* ── Color utilities ────────────────────────────────────────────────────── */
.text-primary   { color: var(--h-primary) !important; }
.text-secondary { color: var(--h-secondary) !important; }
.text-success   { color: var(--h-success) !important; }
.text-info      { color: var(--h-info) !important; }
.text-warning   { color: var(--h-warning) !important; }
.text-danger    { color: var(--h-danger) !important; }
.text-light     { color: var(--h-light) !important; }
.text-dark      { color: var(--h-dark) !important; }
.text-white     { color: #fff !important; }
.text-muted     { color: #6c757d !important; }
.text-light-emphasis { color: #e9ecef !important; }

.bg-primary   { background-color: var(--h-primary) !important; }
.bg-secondary { background-color: var(--h-secondary) !important; }
.bg-success   { background-color: var(--h-success) !important; }
.bg-info      { background-color: var(--h-info) !important; }
.bg-warning   { background-color: var(--h-warning) !important; }
.bg-danger    { background-color: var(--h-danger) !important; }
.bg-light     { background-color: var(--h-light) !important; }
.bg-dark      { background-color: #212529 !important; }
.bg-black     { background-color: #000 !important; }

/* ── Border utilities ───────────────────────────────────────────────────── */
.border-0         { border: 0 !important; }
.border-secondary { border-color: var(--h-secondary) !important; }
.rounded          { border-radius: var(--h-radius) !important; }

/* ── Position utilities ─────────────────────────────────────────────────── */
.position-fixed    { position: fixed !important; }
.position-absolute { position: absolute !important; }
.position-relative { position: relative !important; }

.top-0    { top: 0 !important; }
.top-50   { top: 50% !important; }
.end-0    { right: 0 !important; }
.start-50 { left: 50% !important; }

.translate-middle {
  transform: translate(-50%, -50%) !important;
}

/* ── Visibility ─────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0;
  background-color: #212529;
  color: #fff;
  position: relative;
  z-index: 100;
}

.navbar .container-fluid {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0 8px;
}

.navbar-dark { background-color: #212529; }
.bg-dark.navbar { background-color: #212529 !important; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color var(--h-transition);
  white-space: nowrap;
}

.nav-link:hover { color: #fff; text-decoration: none; }
.text-light.nav-link { color: rgba(255,255,255,.85) !important; }
.fw-bold.nav-link { font-weight: 700; }

/* ── Dropdown ───────────────────────────────────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--h-z-dropdown);
  min-width: 180px;
  padding: 0.25rem 0;
  background-color: #2c2f33;
  border: 1px solid var(--h-border-color);
  border-radius: var(--h-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  list-style: none;
}

.dropdown.open > .dropdown-menu,
.dropdown-menu.open,
.dropdown-menu.show {
  display: block;
}

.dropdown-menu-dark { background-color: #2c2f33; color: #dee2e6; }

.dropdown-menu-end { left: auto; right: 0; }

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 1rem;
  color: #dee2e6;
  background: none;
  border: 0;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--h-transition), color var(--h-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}

.dropdown-divider {
  margin: 0.25rem 0;
  border-top: 1px solid var(--h-border-color);
  opacity: 1;
}

/* Nested submenu */
.submenu {
  position: absolute;
  left: 100%;
  top: 0;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--h-radius);
  transition: color var(--h-transition), background-color var(--h-transition),
              border-color var(--h-transition), box-shadow var(--h-transition);
  white-space: nowrap;
}

.btn:disabled { opacity: 0.65; pointer-events: none; }

.btn-lg  { padding: 0.5rem 1rem; font-size: 1.25rem; border-radius: var(--h-radius-lg); }
.btn-sm  { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

.btn-primary   { background-color: var(--h-primary);   border-color: var(--h-primary);   color: #fff; }
.btn-secondary { background-color: var(--h-secondary); border-color: var(--h-secondary); color: #fff; }
.btn-success   { background-color: var(--h-success);   border-color: var(--h-success);   color: #fff; }
.btn-info      { background-color: var(--h-info);      border-color: var(--h-info);      color: #000; }
.btn-warning   { background-color: var(--h-warning);   border-color: var(--h-warning);   color: #000; }
.btn-danger    { background-color: var(--h-danger);    border-color: var(--h-danger);    color: #fff; }
.btn-light     { background-color: var(--h-light);     border-color: var(--h-light);     color: #000; }
.btn-dark      { background-color: var(--h-dark);      border-color: var(--h-dark);      color: #fff; }

.btn-primary:hover   { background-color: #0b5ed7; border-color: #0a58ca; }
.btn-secondary:hover { background-color: #5c636a; border-color: #565e64; }
.btn-danger:hover    { background-color: #bb2d3b; border-color: #b02a37; }
.btn-warning:hover   { background-color: #ffca2c; border-color: #ffc720; color: #000; }

.btn-outline-primary   { border-color: var(--h-primary);   color: var(--h-primary); }
.btn-outline-secondary { border-color: var(--h-secondary); color: var(--h-secondary); }
.btn-outline-danger    { border-color: var(--h-danger);    color: var(--h-danger); }

.btn-outline-primary:hover   { background-color: var(--h-primary);   color: #fff; }
.btn-outline-secondary:hover { background-color: var(--h-secondary); color: #fff; }
.btn-outline-danger:hover    { background-color: var(--h-danger);    color: #fff; }

.btn-group {
  display: inline-flex;
  border-radius: var(--h-radius);
  overflow: hidden;
}
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--h-radius) 0 0 var(--h-radius); }
.btn-group .btn:last-child  { border-radius: 0 var(--h-radius) var(--h-radius) 0; }

/* Close button */
.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
}
.btn-close::before { content: '✕'; font-size: 1rem; }
.btn-close:hover   { opacity: 1; background-color: rgba(255,255,255,.1); }
.btn-close-white   { color: #fff; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #dee2e6;
  background-color: #2c2f33;
  border: 1px solid #495057;
  border-radius: var(--h-radius);
  outline: none;
  transition: border-color var(--h-transition), box-shadow var(--h-transition);
}

.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

.form-control-lg { padding: 0.5rem 1rem; font-size: 1.25rem; border-radius: var(--h-radius-lg); }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.form-check-input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--h-primary);
}

.form-check-label { cursor: pointer; }

.form-check.form-switch .form-check-input {
  width: 2rem;
  height: 1rem;
}

.form-check-lg .form-check-input { width: 1.25rem; height: 1.25rem; }

.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.input-group .form-control { flex: 1 1 auto; border-radius: 0; }
.input-group .form-control:first-child { border-radius: var(--h-radius) 0 0 var(--h-radius); }
.input-group .form-control:last-child  { border-radius: 0 var(--h-radius) var(--h-radius) 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background-color: #343a40;
  border: 1px solid #495057;
  color: #dee2e6;
}

/* ── Modal (native <dialog>) ────────────────────────────────────────────── */
dialog.h-modal {
  padding: 0;
  border: none;
  border-radius: var(--h-radius-lg);
  background: transparent;
  max-height: 90vh;
  max-width: min(90vw, 500px);
  width: 100%;
  z-index: var(--h-z-modal);
  overflow: visible;
  /* Certains navigateurs réinitialisent la police sur <dialog> */
  font-family: var(--h-font-family);
  font-size: var(--h-font-size);
  color: var(--h-body-color);
}

dialog.h-modal::backdrop {
  background-color: rgba(0,0,0,.65);
  backdrop-filter: blur(2px);
}

dialog.h-modal-fullscreen {
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
}

@media (max-width: 575px) {
  dialog.h-modal-fullscreen {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}

.modal-content {
  background-color: #2c2f33;
  color: #dee2e6;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--h-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--h-border-color);
  gap: 0.5rem;
}

/* Suppression de l'ancienne règle flex-column qui causait le mauvais agencement */
.modal-header.d-flex.flex-column {
  flex-direction: row;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.modal-body {
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--h-border-color);
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--h-radius);
  animation: alertFadeIn 0.2s ease;
  font-family: var(--h-font-family);
  font-size: var(--h-font-size);
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert > .text-start { flex: 1; }

.alert-primary   { background-color: #031633; border-color: #084298; color: #cfe2ff; }
.alert-secondary { background-color: #161719; border-color: #41464b; color: #d3d3d4; }
.alert-success   { background-color: #051b11; border-color: #0f5132; color: #d1e7dd; }
.alert-info      { background-color: #032830; border-color: #087990; color: #cff4fc; }
.alert-warning   { background-color: #332701; border-color: #997404; color: #fff3cd; }
.alert-danger    { background-color: #2c0b0e; border-color: #842029; color: #f8d7da; }

.alert-dismissible { padding-right: 2.5rem; }

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2em 0.5em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 50rem;
}

.badge.bg-primary   { background-color: var(--h-primary) !important;   color: #fff; }
.badge.bg-secondary { background-color: var(--h-secondary) !important; color: #fff; }
.badge.bg-success   { background-color: var(--h-success) !important;   color: #fff; }
.badge.bg-warning   { background-color: var(--h-warning) !important;   color: #000; }
.badge.bg-danger    { background-color: var(--h-danger) !important;    color: #fff; }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner-border {
  display: inline-block;
  width: 2rem; height: 2rem;
  border: 0.25rem solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinnerBorder 0.75s linear infinite;
}
@keyframes spinnerBorder { to { transform: rotate(360deg); } }

.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.2rem; }

.spinner-border.text-primary   { color: var(--h-primary); }
.spinner-border.text-secondary { color: var(--h-secondary); }
.spinner-border.text-warning   { color: var(--h-warning); }
.spinner-border.text-danger    { color: var(--h-danger); }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: absolute;
  z-index: var(--h-z-toast);
  padding: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  min-width: 280px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--h-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-bottom: 0.5rem;
  color: #fff;
}
.toast.show { opacity: 1; }
.toast.hide { opacity: 0; }

.toast-body { flex: 1; font-size: 0.9rem; }

.toast.bg-primary   { background-color: var(--h-primary); }
.toast.bg-secondary { background-color: var(--h-secondary); }
.toast.bg-success   { background-color: var(--h-success); }
.toast.bg-warning   { background-color: var(--h-warning); color: #000; }
.toast.bg-danger    { background-color: var(--h-danger); }

/* ── Carousel ───────────────────────────────────────────────────────────── */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--h-radius);
}
.carousel.slide { overflow: hidden; }

.carousel-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  transition: transform 0.35s ease;
}

.carousel-item {
  flex: 0 0 100%;
  min-width: 100%;
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
}
.carousel-item.active { display: flex; }

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background-color: rgba(0,0,0,.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background-color var(--h-transition);
}
.carousel-control-prev:hover,
.carousel-control-next:hover { background-color: rgba(0,0,0,.8); }

.carousel-control-prev { left: 0.5rem; }
.carousel-control-next { right: 0.5rem; }

.carousel-control-prev-icon::before { content: '‹'; font-size: 1.5rem; }
.carousel-control-next-icon::before { content: '›'; font-size: 1.5rem; }

.carousel-indicators {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.375rem;
  z-index: 2;
  list-style: none;
  padding: 0;
  margin: 0;
}

.carousel-indicators [data-h-slide-to],
.carousel-indicators button {
  width: 0.5rem; height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(255,255,255,.5);
  cursor: pointer;
  transition: background-color var(--h-transition);
}
.carousel-indicators .active { background-color: #fff; }

/* ── List group ─────────────────────────────────────────────────────────── */
.list-group {
  display: flex;
  flex-direction: column;
  border-radius: var(--h-radius);
  overflow: hidden;
}
.list-group-flush { border-radius: 0; }

.list-group-item {
  display: block;
  padding: 0.625rem 1rem;
  color: #dee2e6;
  background-color: #2c2f33;
  border: 1px solid var(--h-border-color);
  border-top: 0;
  text-decoration: none;
}
.list-group-item:first-child { border-top: 1px solid var(--h-border-color); border-radius: var(--h-radius) var(--h-radius) 0 0; }
.list-group-item:last-child  { border-radius: 0 0 var(--h-radius) var(--h-radius); }
.list-group-flush .list-group-item { border-right: 0; border-left: 0; border-radius: 0; }

.list-group-item-action {
  cursor: pointer;
  transition: background-color var(--h-transition);
}
.list-group-item-action:hover { background-color: rgba(255,255,255,.1); color: #fff; }

/* ── Scaffold and display ───────────────────────────────────────────────── */
#scaffold {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#display {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
}

/* ── Notifications (navbar) ─────────────────────────────────────────────── */
#ntf { position: relative; }

#ntf_btn {
  position: relative;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
#ntf_btn:hover { background-color: rgba(255,255,255,.1); }
#ntf_btn i { font-size: 1.25rem; }

#ntf_lt_nb, #ntf_td_nb {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  line-height: 20px;
  text-align: center;
  border-radius: 10px;
  font-weight: bold;
}
#ntf_lt_nb { background-color: #dc3545; color: #fff; }
#ntf_td_nb { background-color: #ffc107; color: #000; }

#ntf_lst {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 320px;
  max-width: 400px;
  padding: 0;
}

#ntf_lst .dropdown-item { white-space: normal; word-wrap: break-word; padding: 0.75rem 1rem; }
#ntf_lst .fw-bold { display: block; margin-bottom: 0.25rem; }
#ntf_lst small { font-size: 0.85rem; opacity: 0.9; }

/* ── Mobile overrides ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
  #ntf_lst { max-height: 300px; min-width: 280px; max-width: calc(100vw - 2rem); right: -10px; }
  
  .col-md-6 { width: 100%; }
  
  dialog.h-modal { max-width: 95vw; }
}

/* ── Login modal iOS zoom fix ───────────────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
  dialog.h-modal input[type="text"],
  dialog.h-modal input[type="password"] { font-size: 16px !important; }
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--h-body-color);
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--h-border-color);
  text-align: left;
}

.table thead th {
  font-weight: 600;
  border-bottom: 2px solid var(--h-border-color);
  white-space: nowrap;
}

/* Dark variant */
.table-dark { color: #dee2e6; background-color: #212529; }
.table-dark th, .table-dark td { border-color: rgba(255,255,255,.1); }
.table-dark thead th { background-color: #1a1d21; border-bottom-color: rgba(255,255,255,.2); }

/* Bootstrap compat alias */
.table-primary { background-color: #1a1d21 !important; }
.table-group-divider { border-top: 2px solid rgba(255,255,255,.2); }

/* Hover */
.table-hover tbody tr { cursor: pointer; transition: background-color 0.15s; }
.table-hover tbody tr:hover { background-color: rgba(255,255,255,.1); }

/* Striped */
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255,255,255,.04); }

/* Scrollable table wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── FullCalendar dark overrides ────────────────────────────────────────────── */
/* Minimal overrides so FC "standard" theme looks acceptable on dark background */
.fc {
  color: #dee2e6;
  --fc-border-color: rgba(255,255,255,.15);
  --fc-button-bg-color: #343a40;
  --fc-button-border-color: #495057;
  --fc-button-hover-bg-color: #495057;
  --fc-button-hover-border-color: #6c757d;
  --fc-button-active-bg-color: #0d6efd;
  --fc-button-active-border-color: #0d6efd;
  --fc-button-text-color: #dee2e6;
  --fc-event-bg-color: #0d6efd;
  --fc-event-border-color: #0b5ed7;
  --fc-page-bg-color: #1a1a2e;
  --fc-neutral-bg-color: #212529;
  --fc-list-event-hover-bg-color: rgba(255,255,255,.1);
  --fc-today-bg-color: rgba(13,110,253,.15);
  --fc-now-indicator-color: #dc3545;
}

.fc .fc-toolbar-title { font-size: 1.1rem; color: #fff; }
.fc .fc-button { font-size: 0.85rem; padding: 0.25rem 0.6rem; cursor: pointer; border-radius: var(--h-radius); }
.fc .fc-button:focus { outline: none; box-shadow: 0 0 0 0.2rem rgba(13,110,253,.4); }
.fc-theme-standard td, .fc-theme-standard th { border-color: rgba(255,255,255,.1); }
.fc-theme-standard .fc-scrollgrid { border-color: rgba(255,255,255,.1); }
.fc .fc-list-empty { background-color: #212529; color: #6c757d; }
.fc .fc-list-event:hover td { background-color: rgba(255,255,255,.1); }
.fc .fc-daygrid-day-number { color: #adb5bd; }
.fc .fc-col-header-cell-cushion { color: #fff; font-weight: 600; }

/* ── Display container (GMAO pages content area) ────────────────────────────── */
/* When gPages creates a container inside #display, override any white bg */
#display .container,
#display .container-fluid {
  background-color: transparent !important;
  color: #dee2e6;
  max-width: 100%;
  padding: 0.5rem;
}

/* Tables inside #display get horizontal scroll on small screens */
#display .container { overflow-x: auto; }

/* bg-dark helper used in gPages containers */
.bg-dark { background-color: #212529 !important; }