:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #172033;
  background: #eef2f6;
  --primary: #16324f;
  --primary-light: #e8f0f7;
  --accent: #16805c;
  --accent-dark: #106646;
  --border: #d8e0e8;
  --muted: #667085;
  --danger: #b42318;
  --warning: #fff4cc;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(16, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #e7eef5 0, #f5f7fa 230px, #eef2f6 100%);
}

header {
  min-height: 72px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #10263d, #1c4669);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 18px rgba(16, 24, 39, 0.22);
}

header > a {
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 24px 50px;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(28px, 4vw, 38px);
  color: #132c45;
  line-height: 1.15;
}

h2 {
  margin: 34px 0 17px;
  font-size: 23px;
  color: #233d56;
}

hr {
  border: 0;
  border-top: 1px solid #d5dde6;
  margin: 36px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 17px;
}

.card,
.panel,
.stat {
  background: var(--white);
  border: 1px solid rgba(216, 224, 232, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #a9c5dc;
  box-shadow: 0 13px 30px rgba(16, 24, 39, 0.13);
}

.big {
  min-height: 125px;
  padding: 23px;
  color: #183650;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  position: relative;
  overflow: hidden;
}

.big::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #17805c, #36a77e);
}

.big small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.panel {
  max-width: 650px;
  padding: 22px;
  display: grid;
  gap: 15px;
}

.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.inline {
  max-width: none;
  grid-template-columns: 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: #263d52;
  font-weight: 700;
}

input,
select,
textarea,
button,
.button {
  min-height: 48px;
  padding: 13px 15px;
  border: 1px solid #cbd5df;
  border-radius: 11px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  background: #fff;
  color: #172033;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3984b5;
  box-shadow: 0 0 0 4px rgba(57, 132, 181, 0.12);
}

button,
.button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

button:hover,
.button:hover {
  background: #214d72;
  transform: translateY(-1px);
}

.secondary {
  background: #5d6b79;
  border-color: #5d6b79;
}

.secondary:hover {
  background: #485561;
}

.confirm {
  background: var(--accent);
  border-color: var(--accent);
}

.confirm:hover {
  background: var(--accent-dark);
}

.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.small {
  min-height: auto;
  padding: 8px 11px;
  font-size: 14px;
}

.current-user {
  margin-bottom: 24px;
  padding: 15px 18px;
  background: #e7f5ee;
  border: 1px solid #b8dfcb;
  border-radius: 13px;
  color: #174934;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.current-user a {
  color: #14563e;
  font-weight: 800;
}

.user-select {
  max-width: 540px;
}

.users-grid {
  margin-bottom: 32px;
}

.users-grid .card {
  min-height: auto;
}

.draft-banner {
  margin: 16px 0 26px;
  padding: 16px 18px;
  background: var(--warning);
  border: 1px solid #e5c457;
  border-radius: 13px;
  box-shadow: 0 5px 15px rgba(120, 88, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 13px;
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}

.stat strong {
  color: #173752;
  font-size: 25px;
}

.table {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: #edf3f7;
  color: #28445d;
  font-size: 14px;
}

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

.flash {
  margin-bottom: 18px;
  padding: 15px 17px;
  border-radius: 11px;
  font-weight: 700;
}

.success {
  background: #dcf5e6;
  border: 1px solid #acd9bc;
  color: #185a38;
}

.error {
  background: #ffe2e2;
  border: 1px solid #f1b8b8;
  color: #8d1d17;
}

.login {
  max-width: 460px;
  margin: 55px auto;
}

.actions,
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.actions form,
.confirm-actions form {
  margin: 0;
}

.confirm-actions {
  margin-top: 20px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.three-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 15px;
}

.hint {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  header {
    min-height: 64px;
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  header > a {
    font-size: 17px;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1;
    text-align: center;
  }

  main {
    padding: 24px 15px 40px;
  }

  h1 {
    margin-bottom: 20px;
  }

  h2 {
    margin-top: 29px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .big {
    min-height: 96px;
    padding: 19px;
    font-size: 21px;
  }

  .inline,
  .two-cols,
  .three-cols {
    grid-template-columns: 1fr;
  }

  .current-user,
  .draft-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-banner .button {
    width: 100%;
  }

  .actions,
  .confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .button,
  .actions button,
  .confirm-actions .button,
  .confirm-actions button {
    width: 100%;
  }

  th,
  td {
    padding: 11px 10px;
    font-size: 14px;
  }
}

.folder-card {
  font-size: 30px;
  font-weight: 800;
  min-height: 145px;
}

/* DOCUMENTS AVEC DOSSIERS */

.document-path {
  margin: 0 0 24px;
  padding: 12px 15px;
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 11px;
}

.document-path a {
  color: #174d74;
  font-weight: 700;
  text-decoration: none;
}

.folder-box {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.folder-link {
  min-height: 70px;
  color: #173752;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.folder-link strong {
  color: #16805c;
  font-size: 14px;
  text-transform: uppercase;
}

.folder-link span {
  font-size: 21px;
  font-weight: 800;
}

.folder-card {
  min-height: 145px;
  font-size: 30px;
  font-weight: 800;
}

/* Alertes de dépassement des quantités de câbles vendues */

.text-danger {
  color: #b42318 !important;
}

.row-danger td {
  background: #ffe2e2;
  color: #7a1712;
}

.alert-danger {
  margin: 22px 0;
  padding: 18px 20px;
  background: #ffe2e2;
  border: 2px solid #d92d20;
  border-radius: 14px;
  color: #7a1712;
}

.alert-danger h2 {
  margin-top: 0;
  color: #a51d15;
}

.alert-danger p:last-child {
  margin-bottom: 0;
}

.cable-totals {
  margin: 22px 0;
}

/* Postes ayant dépassé la quantité vendue */

.stat-danger {
  background: #ffe2e2;
  border: 2px solid #d92d20;
}

.stat-danger span,
.stat-danger strong,
.stat-danger small {
  color: #a51d15;
}

.stat-danger small {
  display: block;
  margin-top: 8px;
  font-weight: 700;
  line-height: 1.35;
}
