/* ── ADMIN LAYOUT ── */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-toolbar-left .sec-lbl {
  margin-bottom: 0;
}

/* ── TABLE ── */
.admin-table-wrap {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead tr {
  background: var(--cream);
  border-bottom: 2px solid var(--rule);
}

.admin-table th {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background: var(--paper);
}

.td-ref {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}

.td-nom {
  font-weight: 500;
}

.td-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.admin-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-style: italic;
}

/* ── TABLE ACTION BUTTONS ── */
.tbl-btn {
  padding: 4px 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity .12s;
}

.tbl-btn:hover { opacity: .75; }

.tbl-btn-outline {
  background: none;
  border-color: var(--blue);
  color: var(--blue);
}

.tbl-btn-danger {
  background: none;
  border-color: var(--alert);
  color: var(--alert);
}

.tbl-btn-edit {
  background: var(--blue);
  color: var(--paper);
}


/* ── LOGIN PAGE ── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
}

.login-form {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 32px 36px 28px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}

.login-error {
  background: var(--alert-bg);
  border: 1px solid rgba(192, 57, 43, .2);
  color: var(--alert);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.login-ok {
  background: var(--ok-bg);
  border: 1px solid rgba(39, 174, 96, .2);
  color: var(--ok);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.setup-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: -4px;
}

.btn-login {
  background: var(--blue);
  color: var(--paper);
  border: none;
  padding: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity .15s;
}

.btn-login:hover { opacity: .85; }

.btn-m365 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #8c8c8c;
  border-radius: 3px;
  color: #1a1a1a;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 14px;
  text-decoration: none;
  transition: background .12s, border-color .12s;
  cursor: pointer;
}

.btn-m365:hover {
  background: #f5f5f5;
  border-color: #555;
}

.login-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.login-sep::before,
.login-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, .55);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--blue);
  border-radius: 6px 6px 0 0;
  color: var(--paper);
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(244,241,235,.6);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--paper); }

.modal-body {
  padding: 20px 20px 8px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.modal-body .sec-lbl { margin-top: 14px; }
.modal-body .card { margin-bottom: 0; }

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

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--cream);
  border-radius: 0 0 6px 6px;
}

.modal-err {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--alert);
  flex: 1;
}

/* ── TABS ── */
.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 24px;
}

.tab-btn {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: var(--muted);
  transition: color .12s, border-color .12s;
}

.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── STEP TITLE (import) ── */
.step-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: .75rem;
  color: var(--ink);
}

/* ── IMPORT RESULT / ERROR ── */
.import-result {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  font-size: 13px;
}

.import-error {
  margin-top: 1rem;
  background: var(--alert-bg);
  border: 1px solid rgba(192,57,43,.2);
  border-radius: 6px;
  padding: .75rem 1rem;
  color: var(--alert);
  font-size: 12px;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.badge-m365  { background: #e8f0fe; color: #1a73e8; }
.badge-local { background: var(--cream); color: var(--muted); border: 1px solid var(--rule); }
.badge-admin { background: #fef3e2; color: #e67e22; }
.badge-user  { background: var(--cream); color: var(--muted); border: 1px solid var(--rule); }
.badge-ok    { background: var(--ok-bg); color: var(--ok); }
.badge-off   { background: var(--alert-bg); color: var(--alert); }

/* ── CORPS D'ÉTAT / TAUX HORAIRES (modal) ── */
.corps-hdr {
  display: grid;
  grid-template-columns: 1fr 1fr 140px 32px;
  gap: 8px;
  padding: 0 0 4px;
}
.corps-hdr span {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.corps-row {
  display: grid;
  grid-template-columns: 1fr 1fr 140px 32px;
  gap: 8px;
  margin-bottom: 6px;
  align-items: start;
}
.taux-hdr {
  display: grid;
  grid-template-columns: 1fr 80px 32px;
  gap: 8px;
  padding: 0 0 4px;
}
.taux-hdr span {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.taux-row {
  display: grid;
  grid-template-columns: 1fr 80px 32px;
  gap: 8px;
  margin-bottom: 6px;
  align-items: start;
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .admin-container { padding: 14px 10px 40px; }
  .modal { max-width: 100%; }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }
}
