@import url('https://fonts.googleapis.com/css?family=Inter:400,600,800&display=swap');

:root {
  --photo-size: 260px;

  --bg-page: #eaf0fa;
  --bg-card: #ffffff;
  --bg-card-soft: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.74);

  --text-main: #1b1b1b;
  --text-strong: #1e376d;
  --text-soft: #356d91;
  --text-muted: #7c8aa5;

  --accent: #4c82e6;
  --accent-soft: #e7f2ff;
  --accent-border: #d3e8ff;

  --border-soft: rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.10);
  --shadow-glass:
    0 8px 36px rgba(30, 40, 90, 0.13),
    0 1.5px 9px rgba(70, 140, 220, 0.09);

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 2.2em;
}

/* ========= BASE ========= */

html,
body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-page);
  overflow-x: hidden;
  color: var(--text-main);
}

h1 {
  font-size: 2.15rem;
  margin: 0 0 1.5em;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  color: var(--text-strong);
  text-shadow: 0 1px #fff, 0 3px 11px #a7b9e6a4;
}

h2,
.card-title {
  color: var(--text-strong);
}

.ti {
  font-size: 1.45em;
  vertical-align: middle;
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

button {
  cursor: pointer;
  background: #eaf2fb;
  color: #2d68b6;
  border: 1px solid #d7e8fa;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 1em;
  transition: background 0.14s, border 0.14s, transform 0.14s;
}

button:hover {
  background: #d2e5fb;
  border-color: #8dc1fa;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  border-radius: 6px;
  border: 1.3px solid #a8c6f2;
  padding: 6px 8px;
  background: #fafdff;
  font-size: 1em;
  transition: border 0.15s;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.linklike {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
}

/* ========= BACKGROUND / PAGE ========= */

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("image.jpg") center center / cover no-repeat fixed;
  filter: blur(3px) brightness(0.88) saturate(1.01);
}

.container.glass {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  min-height: 92vh;
  margin: 32px auto;
  padding: 2.2em;
  text-align: center;
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1.5px solid rgba(180, 186, 255, 0.13);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: box-shadow 0.18s;
  box-sizing: border-box;
  padding-bottom:100px;
}

.main-content {
  overflow: auto;
  padding-top: 0;
  padding-bottom: 16px;
}

/* ========= GLOBAL COMPONENTS ========= */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
  overflow-x: auto;
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-img {
  margin: 1.3em auto 1em;
  max-width: 220px;
  max-height: 220px;
  height: auto;
  border-radius: 1.1em;
  box-shadow: 0 6px 26px #c2e3fa53, 0 1px 8px #7daeea2a;
  border: 0.5px solid #d7e8fa;
  background: #fbfcfd;
}

/* ========= STATUS BANNERS ========= */

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.banner.ok {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.banner.alert {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

.banner.risk-moderate {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.banner.risk-low {
  background: #fffde7;
  color: #ffc400;
  border: 1px solid #fff59d;
}

/* ========= FLAGS ========= */

.flag-cell {
  width: 48px;
  text-align: right;
}

.mini-flag {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9e9e9e;
}

.mini-flag.flagged {
  color: #c62828;
  filter: saturate(1.4);
  transform: translateY(-1px);
}

/* ========= TOP ACTION BUTTONS ========= */

.gear-btn,
.logout-btn {
  position: fixed;
  top: 14px;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.gear-btn {
  right: 14px;
  padding: 8px 10px;
  border-radius: 10px;
}

.logout-btn {
  right: 66px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-decoration: none;
  color: var(--text-strong);
  font-size: 18px;
}

.logout-btn:hover {
  transform: translateY(-1px);
}

/* ========= MODAL ========= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
}

.modal-content {
  background: #fff;
  width: 360px;
  max-width: calc(100% - 40px);
  margin: 80px auto;
  padding: 16px;
  border-radius: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* ========= DROPZONE / UPLOAD ========= */

.drop-area {
  border: 2.5px dashed #95b8f8;
  border-radius: 1.5em;
  background: rgba(248, 250, 253, 0.92);
  padding: 2.3em 1.2em;
  margin-bottom: 1.5em;
  transition: background 0.2s, border 0.2s;
  box-shadow: 0 2px 17px #d1e4fc2a;
}

.drop-area:hover,
.drop-area:focus-within {
  background: #e3ecfa;
  border-color: var(--accent);
}

.file-label {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0.68em 1.15em;
  border-radius: 1.2em;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-border);
  font-weight: 600;
  font-size: 1.14em;
  box-shadow: 0 1px 7px #c6e1fc17;
  transition: background 0.16s, border 0.14s;
  display: inline-block;
}

.file-label:hover {
  background: #f0f6ff;
  border-color: #89b8fb;
}

.file-label input[type="file"] {
  display: none;
}

/* ========= LOADING / SUCCESS ========= */

#loading {
  margin-top: 2em;
}

.loader {
  border: 7px solid #e3ecfa;
  border-top: 7px solid var(--accent);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
  margin: 0 auto 0.7em;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#success-check {
  display: none !important;
  align-items: center;
  justify-content: center;
  margin: 2em 0 1em;
  flex-direction: column;
  gap: 0.5em;
}

.checkmark {
  width: 54px;
  height: 54px;
  display: block;
}

.checkmark-circle {
  stroke: #5fd379;
  stroke-width: 4;
  fill: #eafff3;
  animation: fill 0.4s ease-in-out 0.2s forwards;
}

.checkmark-check {
  stroke: #49b76d;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.5s cubic-bezier(.65, .05, .36, 1) 0.6s forwards;
}

@keyframes fill {
  100% { fill: #eafff3; }
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

#success-check span {
  font-size: 1.17em;
  color: #49b76d;
  font-weight: bold;
  letter-spacing: 0.01em;
}

/* ========= ALERT / WARNING ========= */

.warning {
  background: #fff6e6;
  color: #d49538;
  border-left: 5px solid #e2aa4e;
  border-radius: 0.85em;
  padding: 1.1em 1.35em;
  margin: 1.7em 0 0.7em;
  font-size: 1.08em;
  text-align: left;
  box-shadow: 0 1px 4px #ffeac860;
}

/* ========= ANALYSIS LAYOUT ========= */

.analysis-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  margin-top: 10px;
}

.preview-col {
  flex: 0 0 var(--photo-size);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.preview-col .preview-img {
  margin: 0;
  max-width: var(--photo-size);
  max-height: var(--photo-size);
}

.result-col {
  flex: 1;
  min-width: 260px;
  margin-top: 0;
  padding-top: 0;
}

.result-col #result {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-col #result > * {
  width: 100%;
  max-width: 980px;
}

.result-col #result table {
  margin-left: auto;
  margin-right: auto;
}

.analysis-layout:not(.details-open) .result-col {
  height: var(--photo-size);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-layout:not(.details-open) .result-col .banner {
  flex: 1;
  overflow: auto;
  margin: 0;
}

.analysis-layout:not(.details-open) .result-col .quick-summary {
  flex: 0 0 auto;
  margin-top: 0;
}

.analysis-layout.details-open .result-col {
  height: auto;
  display: block;
}

.analysis-layout.details-open .result-col .banner {
  height: auto;
  overflow: visible;
}

.result-col .banner {
  height: var(--photo-size);
  overflow: auto;
  margin: 0;
}

.result-col .quick-summary {
  flex: 0 0 auto;
  margin-top: 0;
}

/* ========= QUICK SUMMARY ========= */

.quick-summary {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e6eefc;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  margin-top: 12px;
  text-align: left;
}

.quick-summary-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 14px;
  align-items: baseline;
}

.quick-summary-label {
  font-weight: 700;
  color: var(--text-strong);
  opacity: 0.9;
}

.quick-summary-value {
  color: var(--text-main);
}

/* ========= SCAN CARD ========= */

.scan-card {
  display: grid;
  grid-template-columns: var(--photo-size) 1fr 44px;
  gap: 14px;
  align-items: start;
  max-width: 980px;
  margin: -1px auto 0;
  animation: cardAppear 0.25s ease;
}

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

.scan-photo {
  width: var(--photo-size);
  height: var(--photo-size);
  object-fit: contain;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
}

.scan-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
}

.scan-right .banner {
  flex: 1 1 auto;
  overflow: auto;
  margin: 0;
  border-radius: 12px;
  box-shadow: none !important;
}

.scan-right .quick-summary {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: none !important;
  background: rgba(0, 0, 0, 0.03);
}

.scan-trash {
  width: 40px;
  height: 40px;
  margin-top: 14px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}

.scan-trash:hover {
  background: rgba(224, 49, 49, 0.15);
}

/* ========= PAGE LINKS ========= */

.page-links{
  position: sticky;
  bottom: 0;
  z-index: 50;

  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:18px;
  margin:24px 0 0;
  padding:14px 16px;

  background:rgba(255,255,255,0.82);
  backdrop-filter:blur(10px);
  border-top:1px solid rgba(0,0,0,0.06);
  border-radius:18px 18px 0 0;
  box-shadow:0 -6px 18px rgba(0,0,0,0.08);
}
/* ========= LAVAGE ========= */

.lavage-card {
  margin-top: 1.55em;
  background: rgba(242, 247, 253, 0.95);
  border-left: 6px solid #63a5e9;
  border-radius: 1.1em;
  padding: 1.17em 1.25em;
  font-size: 1.16em;
  color: var(--text-soft);
  text-align: left;
  box-shadow: 0 2px 13px #e8effc7a;
}

.lavage-title {
  font-weight: bold;
  color: var(--text-soft);
  margin-bottom: 0.8em;
  font-size: 1.07em;
  display: flex;
  gap: 0.5em;
  align-items: center;
  letter-spacing: 0.01em;
}

.lavage-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lavage-list > li {
  margin: 0.2em 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}

.lavage-list .ti {
  color: var(--accent);
}

.precautions {
  list-style: disc inside;
  margin: 0.1em 0 0.1em 2em;
  padding-left: 0;
  font-size: 0.98em;
  color: #e26a6a;
}

.lavage-hist {
  margin-top: 1.1em;
  font-size: 0.98em;
  background: #f6fafd;
  border-radius: 10px;
  padding: 0.5em 0.7em;
  border-left: 4px solid #54a1f2;
  color: #267;
}

/* ========= TEXT BLOCKS ========= */

.summary {
  margin: 1em 0 0.7em;
  font-size: 1.09em;
}

.summary b {
  color: #274fa4;
}

.infos-list,
.etat-list {
  text-align: left;
  margin: 0.7em 0 0;
  font-size: 1.04em;
  line-height: 1.7em;
  padding-left: 0.2em;
}

.tag-pending {
  font-size: 0.9em;
  opacity: 0.75;
  margin-left: 6px;
}

/* ========= HISTORY ========= */

.hist-link {
  display: inline-block;
  margin-top: 2em;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.03em;
  letter-spacing: 0.01em;
}

.hist-table {
  margin-top: 1em;
}

.hist-row {
  display: flex;
  align-items: flex-start;
  gap: 1.3em;
  margin-bottom: 1.2em;
  padding: 10px;
  background: #f7fafd;
  border: 2px solid transparent;
  border-radius: 1.2em;
  box-shadow: 0 0 7px #d5e8ff40;
  transition: box-shadow 0.15s;
}

.hist-row.alerte {
  background: #fdf3f7;
  box-shadow: 0 0 9px #ffe4f270;
}

.hist-row.risque-critique {
  border-color: #e74c3c;
}

.hist-row.risque-noncritique {
  border-color: #f1c40f;
}

.hist-img img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 1em;
  box-shadow: 0 1px 8px #e9d2e24f;
  border: 1.5px solid #e8f1ff;
  background: #fff;
}

.hist-info {
  flex: 1;
  margin-left: 0.5em;
}

.hist-date {
  color: #aaa;
  font-size: 0.95em;
  margin-left: 0.5em;
}

.hist-details {
  margin-top: 0.7em;
  border-top: 1px solid #eef2fa;
  padding-top: 0.4em;
  background: #fcfdff;
  border-radius: 0 0 0.9em 0.9em;
  box-shadow: 0 1px 5px #e8effc3e;
}

.hist-summary {
  font-size: 1.07em;
}

.hist-alert {
  color: #e74c3c;
  font-size: 1.3em;
}

.hist-ok {
  color: #27ae60;
  font-size: 1.3em;
}

.hist-details-btn {
  background: #e6e9f3;
  border: none;
  border-radius: 5px;
  padding: 0.18em 0.85em;
  margin-left: 1.1em;
  cursor: pointer;
  font-size: 1.01em;
  color: #2561a6;
  transition: background 0.14s;
}

.hist-details-btn:hover {
  background: #dae8f9;
}

/* ========= TABLES ========= */

.details-table,
.recap-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.details-table {
  margin-top: 0.3em;
  font-size: 0.98em;
}

.details-table td,
.details-table th,
.recap-table td,
.recap-table th,
.compare-table td,
.compare-table th {
  padding: 6px 10px;
}

.details-table th {
  text-align: left;
  background: #f2f2f2;
  color: #3f5d92;
  font-size: 1em;
}

.details-table tr:nth-child(even) {
  background: #f8fbff;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ========= CORRECTIONS ========= */

.corr-table {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.corr-row {
  display: flex;
  align-items: flex-start;
  gap: 1em;
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid #eee;
}

.corr-img img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.corr-info {
  flex: 1;
}

.corr-field {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.7em;
}

.corr-field label {
  min-width: 120px;
  font-weight: 500;
}

.corr-field input,
.corr-field select {
  font-size: 1em;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.corr-field button {
  background: #e0e0e0;
  border: none;
  border-radius: 4px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 1em;
  margin-left: 4px;
}

/* ========= RESPONSIVE ========= */

@media (max-width: 1024px) {
  .container.glass {
    width: 95%;
    padding: 16px;
  }

  .preview-img {
    max-width: 100%;
    height: auto;
  }

  .recap-table,
  .compare-table {
    font-size: 0.95em;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .banner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
  }

  .scan-card {
    grid-template-columns: 1fr;
  }

  .scan-photo {
    width: 100%;
    max-width: var(--photo-size);
    height: auto;
    margin: 0 auto;
  }

  .scan-trash {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .container.glass {
    max-width: 99vw;
    margin: 0;
    border-radius: 0;
    padding: 0.8em 0.4em 1.6em;
  }

  h1 {
    font-size: 1.4em;
    line-height: 1.3em;
  }

  h2,
  .card-title {
    font-size: 1.1em;
  }

  .preview-img {
    max-width: 95vw;
  }

  .hist-img img {
    width: 55px;
    height: 55px;
  }

  .lavage-card,
  .lavage-hist {
    font-size: 1em;
  }

  .btn,
  .btn-secondary,
  .btn-danger {
    width: 100%;
    text-align: center;
  }

  .btn-success {
    background: #1a7f37;
    color: white;
  }

  .hist-link {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    width: 100%;
  }

  table.recap-table th,
  table.recap-table td,
  table.compare-table th,
  table.compare-table td {
    padding: 6px 8px;
    font-size: 0.9em;
  }

  .compare-table thead {
    display: none;
  }

  .compare-table tr {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
  }

  .compare-table td:first-child {
    font-weight: bold;
  }

  .compare-table td:last-child {
    opacity: 0.8;
  }

  .analysis-layout {
    flex-direction: column;
    align-items: center;
  }

  .preview-col,
  .result-col {
    width: 100%;
    flex: none;
  }

  .preview-col .preview-img {
    max-width: min(100%, var(--photo-size));
    max-height: none;
  }

  .result-col .banner,
  .analysis-layout:not(.details-open) .result-col {
    height: auto;
  }

  .quick-summary-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .corr-row {
    flex-direction: column;
  }

  .corr-field {
    flex-direction: column;
    align-items: stretch;
  }

  .corr-field label {
    min-width: 0;
  }
}
/* ===== Commande en cours ===== */

.current-order-wrap{
  max-width:1180px;
  margin:8px auto 0;
  text-align:left;
  padding-bottom: 24px;
}

.current-order-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:0 0 14px;
  padding:0 4px;
}

.current-order-title{
  margin:0;
  font-size:1.35rem;
  font-weight:800;
  color:#1e376d;
}

.current-order-meta{
  color:#5d6f95;
  font-size:0.98rem;
  font-weight:600;
}

/* ✅ une carte par ligne */
.order-cards-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
  align-items:start;
}

.garment-card{
  background:rgba(255,255,255,0.92);
  border:1px solid rgba(0,0,0,0.06);
  border-radius:18px;
  box-shadow:0 10px 26px rgba(0,0,0,0.10);
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:0;
  height:auto;
  align-self:start;
}

.garment-card-top{
  display:grid;
  grid-template-columns:125px minmax(0, 1fr);
  gap:14px;
  align-items:start;
}

.garment-thumb{
  width: 125px;
  height:125px;
  object-fit:contain;
  background:rgba(255,255,255,0.95);
  border:1px solid rgba(0,0,0,0.06);
  border-radius:14px;
  padding:6px;
  box-shadow:0 4px 14px rgba(0,0,0,0.06);
}

.garment-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.garment-status{
  border-radius:12px;
  padding:8px 10px;
  font-size:0.92em;
  line-height:1.25;
}

.garment-status.ok{
  background:#e8f5e9;
  color:#1b5e20;
  border:1px solid #c8e6c9;
}

.garment-status.low{
  background:#fffde7;
  color:#8a6d00;
  border:1px solid #fff59d;
}

.garment-status.critical{
  background:#ffebee;
  color:#b71c1c;
  border:1px solid #ffcdd2;
}

.garment-status-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  margin-bottom:2px;
}

.garment-status-sub{
  font-size:0.92em;
  opacity:0.92;
}

.garment-summary{
  display:grid;
  grid-template-columns:120px minmax(0, 1fr);
  gap:4px 12px;
  align-items:start;
}

.garment-summary-label{
  font-weight:800;
  color:#375287;
  white-space:nowrap;
}

.garment-summary-value{
  color:#202020;
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.garment-actions{
  margin-top:4px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.garment-link-btn{
  background:none;
  border:none;
  padding:0;
  color:#2561a6;
  text-decoration:underline;
  font-weight:600;
  cursor:pointer;
}

.garment-link-btn.risk{
  color:#c62828;
}

.garment-trash{
  width:38px;
  height:38px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,0.9);
  box-shadow:0 4px 12px rgba(0,0,0,0.10);
  display:grid;
  place-items:center;
}

.garment-trash:hover{
  background:rgba(224,49,49,0.15);
}

.garment-details{
  display:none;
  margin-top:4px;
}

.garment-details.open{
  display:block;
}

@media (max-width:700px){
  .garment-card-top{
    grid-template-columns:1fr;
  }

  .garment-thumb{
    width:100%;
    max-width:none;
    height:180px;
  }

  .garment-summary{
    grid-template-columns:110px minmax(0, 1fr);
    gap:4px 10px;
  }

  .current-order-header{
    flex-direction:column;
    align-items:flex-start;
  }
}
.garment-risk-list{
  margin:6px 0 0 18px;
  padding:0;
}

.garment-risk-list li{
  margin:2px 0;
}

.garment-status.critical .garment-risk-list{
  color:#b71c1c;
}

/* ===== Historique : retour intégré en haut + liste scrollable ===== */

.container.glass.history-container{
  display:flex !important;
  flex-direction:column;
  height:calc(100vh - 64px);
  min-height:calc(100vh - 64px);
  overflow:hidden;
  padding-bottom:24px !important;
  padding-top: 32px !important;
}

.history-topbar{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: -6px 0 14px 0;
  padding: 0 0 4px 0;
}

.history-back-btn{
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.94);
  color: #2c3e70;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.history-back-btn:hover{
  background: #f4f8ff;
  border-color: #c8daf8;
}

.history-back-btn .ti{
  font-size:1.1em;
}

.history-scroll-area{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
}
.history-topbar a{
  max-width:max-content;
}

@media (max-width: 600px){
  .container.glass.history-container{
    height:100vh;
    min-height:100vh;
  }
}

.live-risk-box {
  margin: 12px 0 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  border: 1px solid transparent;
}

.live-risk-box.low {
  background: #fff8e1;
  border-color: #ffe082;
  color: #8a6d00;
}

.live-risk-box.moderate {
  background: #fff3e0;
  border-color: #ffb74d;
  color: #b85c00;
}

.live-risk-box.critical {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #b71c1c;
}

.live-risk-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 6px;
}

.live-risk-list {
  margin: 0;
  padding-left: 18px;
}

.live-risk-list li {
  margin: 4px 0;
}

.garment-status.low {
  background: #fffde7;
  border: 1px solid #fff59d;
}

.garment-status.moderate {
  background: #fff3e0;
  border: 1px solid #ffcc80;
}

.garment-status.critical {
  background: #ffebee;
  border: 1px solid #ffcdd2;
}

.risk-subline {
  margin-top: 4px;
  line-height: 1.35;
}

.risk-dot {
  margin-right: 4px;
}

.page-topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
}

.page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  color: #2561a6;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(76,130,230,0.18);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: background .15s, transform .12s, box-shadow .15s;
}

.page-back-btn:hover {
  background: #f3f8ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.page-back-btn .ti {
  font-size: 1.1em;
}

/* =============================================
   RECHERCHE — styles à ajouter dans styles.css
   ============================================= */

.search-mode-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1.5em;
  flex-wrap: wrap;
}

.search-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1em;
  background: #eaf2fb;
  color: var(--accent);
  border: 1.5px solid var(--accent-border);
  transition: background 0.15s, border 0.15s, color 0.15s;
}

.search-tab.active,
.search-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.search-panel {
  max-width: 860px;
  margin: 0 auto;
}

.search-input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5em;
  flex-wrap: wrap;
}

.search-input-row input {
  width: 220px;
  padding: 10px 14px;
  font-size: 1.1em;
  border-radius: 10px;
}

.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1.2em;
  font-weight: 600;
  color: var(--text-strong);
  flex-wrap: wrap;
}

.admin-filter-bar select {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.97em;
  min-width: 180px;
}

.photo-drop-zone {
  border: 2px dashed var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 2em 1em;
  text-align: center;
  background: var(--accent-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.5em;
}

.photo-drop-zone.drag-over {
  border-color: var(--accent);
  background: #d8eaff;
}

.photo-drop-zone p {
  margin: 0.5em 0 0;
  color: var(--text-soft);
  font-size: 0.97em;
}

.photo-label-btn {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.search-commande-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95em;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.loader-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 1.5em;
  color: var(--text-soft);
  font-size: 1em;
}

.search-photo-ref {
  text-align: left;
}
/* ========== LIGHTBOX ========== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lb-fade-in 0.18s ease;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
  animation: lb-zoom-in 0.18s ease;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  color: #fff;
  font-size: 2.2em;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
  background: none;
  border: none;
}
.lightbox-close:hover { opacity: 1; }
@keyframes lb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-zoom-in { from { transform: scale(0.92); } to { transform: scale(1); } }

/* Curseur sur les images cliquables */
.hist-img img,
.garment-thumb img,
img.garment-thumb {
  cursor: zoom-in;
}


/* ========== PAVÉ NUMÉRIQUE RECHERCHE ========== */
.numeric-pad-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  width: 100%;
}
.numeric-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 10px;
  width: 284px;
}
.num-btn {
  background: rgba(80, 70, 160, 0.75);
  border: 2px solid rgba(120, 110, 220, 0.9);
  border-radius: 12px;
  color: #fff;
  font-size: 1.6em;
  font-weight: bold;
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  width: 100%;
}
.num-btn:active, .num-btn:hover {
  background: rgba(110, 95, 210, 0.95);
  transform: scale(0.96);
}
.num-btn-wide {
  grid-column: span 2;
}