/* Modern classy theme (global) */

:root {
  --bg: #0b1220;
  --card: rgba(255, 255, 255, .06);
  --card2: rgba(255, 255, 255, .04);
  --border: rgba(255, 255, 255, .14);
  --border2: rgba(255, 255, 255, .10);
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .70);
  --muted2: rgba(255, 255, 255, .62);
  --accent1: rgba(125, 211, 252, .95);
  --accent2: rgba(167, 139, 250, .95);
  --shadow: 0 18px 60px rgba(0, 0, 0, .45);
  --radius: 18px;
  --radius2: 14px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(125, 211, 252, .18), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(167, 139, 250, .16), transparent 60%),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--accent1);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

h1,
h2,
h3 {
  margin: 0 0 8px 0;
  letter-spacing: .2px
}

p {
  margin: 0 0 10px 0
}

/* ===== Layout helpers ===== */
.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(10px);
}

.card.subtle {
  background: var(--card2);
  box-shadow: none;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.card-title {
  font-weight: 800;
  font-size: 16px;
}

.card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--border2);
  margin: 14px 0;
}

/* ===== Topbar (admin) ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #081018;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.brand-title {
  font-weight: 900;
  line-height: 1.05
}

.brand-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px
}

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

/* ===== Header row (admin) ===== */
.header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.lead {
  color: var(--muted);
  margin-top: 6px
}

.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
}

.pill strong {
  color: var(--text)
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .9);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

/* ===== Buttons/links ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.05);
  text-decoration: none
}

.btn.primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #081018;
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .14);
  color: var(--text);
}

/* ===== Alerts ===== */
.alert {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .06);
  margin: 14px 0;
  color: var(--text);
}

.alert.success {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .10);
}

.alert.error {
  border-color: rgba(251, 113, 133, .45);
  background: rgba(251, 113, 133, .12);
}

/* ===== Forms ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(10, 16, 30, .55);
  color: var(--text);
  outline: none;
}

select {
  cursor: pointer
}

input:focus,
select:focus {
  border-color: rgba(125, 211, 252, .65);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, .10);
}

.actions {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* keep legacy submit buttons usable too */
button,
input[type="submit"] {
  appearance: none;
  border: 0;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #081018;
  font-weight: 800;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
  filter: brightness(1.03)
}

/* ===== Grids ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Tables (admin + legacy) ===== */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border2);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, .08);
  font-size: 12.5px;
  color: rgba(255, 255, 255, .86);
  font-weight: 900;
  letter-spacing: .2px;
}

.table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, .03);
}

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

.right {
  text-align: right
}

/* legacy tables still used by older pages */
.table0,
.table1 {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%
}

.table0 td {
  padding: 8px 0
}

.table1 {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
}

.table1 td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  color: rgba(255, 255, 255, .86);
}

.table1 tr:last-child td {
  border-bottom: 0
}

.table1 .entete td,
.table1 tr.entete td {
  font-weight: 900;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .08);
}

.table1 tr.ligne:nth-child(even) td {
  background: rgba(255, 255, 255, .03)
}

/* ===== Text helpers ===== */
.center {
  text-align: center
}

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

.muted2 {
  color: var(--muted2)
}

.small-links {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted)
}

hr {
  border: 0;
  border-top: 1px solid var(--border2);
  margin: 20px 0
}

/* ===== Footer ===== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 28px;
  color: var(--muted2);
}

.footer-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

.link {
  color: var(--accent1);
  text-decoration: none
}

.link:hover {
  text-decoration: underline
}

/* ===== Responsive ===== */
@media (max-width:900px) {
  .grid-2 {
    grid-template-columns: 1fr
  }

  .table {
    min-width: 640px
  }
}

@media (max-width:640px) {
  .topbar-row {
    flex-direction: column;
    align-items: flex-start
  }

  .top-actions {
    justify-content: flex-start
  }

  .container {
    width: calc(100% - 24px)
  }
}

/* ===== Member page small helpers ===== */
.nowrap {
  white-space: nowrap;
}

.accent {
  color: var(--accent1);
}

/* optional: lists/cards used in membre.php (if not already in your css) */
.list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, .86);
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.card.mini {
  padding: 14px;
}

.mini-title {
  font-weight: 900;
  margin-bottom: 6px;
}

.contact {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.contact-name {
  font-weight: 900;
}

.contact-role {
  color: var(--muted);
  font-size: 13px;
}

.contact-line {
  color: rgba(255, 255, 255, .86);
}

/* ===== TRUE responsive table (mobile -> cards) ===== */
@media (max-width:640px) {

  /* remove forced wide table on phones */
  .table {
    min-width: 0;
  }

  /* transform rows into cards */
  .table.responsive thead {
    display: none;
  }

  .table.responsive,
  .table.responsive tbody,
  .table.responsive tr,
  .table.responsive td {
    display: block;
    width: 100%;
  }

  .table.responsive tbody tr {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border2);
    border-radius: 14px;
    margin: 10px 0;
    overflow: hidden;
  }

  .table.responsive td {
    border-bottom: 1px solid var(--border2);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: baseline;
    text-align: left;
  }

  .table.responsive td:last-child {
    border-bottom: 0;
  }

  .table.responsive td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .2px;
  }

  /* keep amounts right-ish without breaking layout */
  .table.responsive td.right {
    text-align: left;
  }
}

.nowrap {
  white-space: nowrap;
}

@media (max-width:640px) {
  .table {
    min-width: 0;
  }

  .table.responsive thead {
    display: none;
  }

  .table.responsive,
  .table.responsive tbody,
  .table.responsive tr,
  .table.responsive td {
    display: block;
    width: 100%;
  }

  .table.responsive tbody tr {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border2);
    border-radius: 14px;
    margin: 10px 0;
    overflow: hidden;
  }

  .table.responsive td {
    border-bottom: 1px solid var(--border2);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: baseline;
    text-align: left;
  }

  .table.responsive td:last-child {
    border-bottom: 0;
  }

  .table.responsive td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .2px;
  }

  .table.responsive td.right {
    text-align: left;
  }
}