:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef6f8;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ec;
  --brand: #3157ff;
  --brand-strong: #1738c7;
  --teal: #079b8a;
  --amber: #f58a07;
  --danger: #e5484d;
  --success: #0f8f62;
  --navy: #172033;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #eef4ff 0, #f7fbff 260px, var(--bg) 620px);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 42px rgba(23, 32, 51, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 126px;
  max-width: 36vw;
  height: auto;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: #3157ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
}

.muted {
  color: var(--muted);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head p {
  margin: 6px 0 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.13);
  transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.18);
}

.btn-primary {
  background: linear-gradient(135deg, #3157ff, #6839e9);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2549ea, #5730d1);
}

.btn-secondary {
  background: linear-gradient(135deg, #079b8a, #11b46b);
  color: #fff;
}

.btn-ghost {
  background: linear-gradient(135deg, #172033, #3157ff);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #e5484d, #f58a07);
  color: #fff;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.action-card {
  position: relative;
  display: flex;
  min-height: 174px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--card-start, #3157ff), var(--card-end, #6839e9));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 22px 44px rgba(23, 32, 51, 0.17);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 42%);
  pointer-events: none;
}

.action-card:hover {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 60px rgba(23, 32, 51, 0.23);
  transform: translateY(-4px);
}

.action-kicker {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.action-title {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.18;
}

.action-arrow {
  align-self: flex-end;
  color: #fff;
  font-weight: 800;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(49, 87, 255, 0.12);
}

input[readonly] {
  background: #f1f5f9;
  color: #475467;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.search-actions {
  margin-top: 24px;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  font-weight: 700;
  text-align: center;
}

.message.success,
.success {
  color: var(--success);
}

.message.error,
.error {
  color: var(--danger);
}

.search-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.colis-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.colis-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.info-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 6px;
}

.info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-row span:first-child {
  color: var(--muted);
  font-size: 13px;
}

.info-row span:last-child {
  font-weight: 700;
  text-align: right;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  display: none;
  padding: 22px;
  border: 1px dashed #c8d3df;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.status-select {
  min-width: 135px;
  font-weight: 800;
}

.statut-stocke {
  border-color: #a8e1ca;
  background: #ecfdf3;
  color: #067647;
}

.statut-recupere {
  border-color: #ffd28a;
  background: #fffaeb;
  color: #a15c07;
}

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 920px) {
  .home-grid,
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 14px;
  }

  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .btn {
    flex: 1 1 auto;
  }

  .home-grid,
  .form-grid,
  .results-grid,
  .search-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }
}
