/* ==========================================================================
   CAMPUS WAY — SYSTÈME DE COMPTE & TABLEAU DE BORD PERSONNEL PREMIUM
   ========================================================================== */

:root {
  --ac-navy: #071426;
  --ac-blue: #2563EB;
  --ac-teal: #0D9488;
  --ac-bg: #F4F7FB;
  --ac-surface: #FFFFFF;
  --ac-border: #E2E8F0;
  --ac-text: #0F172A;
  --ac-muted: #475569;
  --ac-subtle: #64748B;
}

.ac-page {
  background: var(--ac-bg);
  min-height: 78vh;
  padding: 32px 0 84px;
  color: var(--ac-text);
}

.ac-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* AUTHENTICATION CARD (NON-CONNECTÉ) */
.ac-auth-shell {
  max-width: 480px;
  margin: 24px auto 0;
}

.ac-auth-card {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 12px 34px rgba(7, 20, 38, 0.08);
}

.ac-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
}

.ac-auth-tab {
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ac-muted);
  cursor: pointer;
}

.ac-auth-tab.active {
  background: #FFFFFF;
  color: var(--ac-navy);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.ac-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.ac-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-navy);
}

.ac-input,
.ac-select,
.ac-textarea {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--ac-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ac-text);
  background: #FFFFFF;
}

.ac-textarea {
  min-height: 82px;
  resize: vertical;
}

.ac-input:focus,
.ac-select:focus,
.ac-textarea:focus {
  outline: none;
  border-color: var(--ac-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ac-pass-wrap {
  position: relative;
}

.ac-pass-wrap .ac-input {
  padding-right: 92px;
}

.ac-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #F1F5F9;
  color: var(--ac-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.ac-btn-primary {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 11px;
  background: var(--ac-blue);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.ac-btn-primary:hover {
  background: #1D4ED8;
}

.ac-btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ac-btn-secondary {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ac-navy);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.ac-btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.ac-btn-danger {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #FECACA;
  border-radius: 9px;
  background: #FEF2F2;
  color: #DC2626;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.ac-msg {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.ac-msg.err { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.ac-msg.ok { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.ac-msg.warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* COMPACT DASHBOARD HEADER */
.ac-dash-head {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 18px;
  padding: 22px 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.ac-dash-head h1 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--ac-navy);
  margin: 0 0 4px;
}

.ac-dash-head p {
  font-size: 14.5px;
  color: var(--ac-muted);
  margin: 0;
}

/* 4 KPI SUMMARY CARDS */
.ac-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ac-kpi {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ac-kpi:hover {
  border-color: var(--ac-blue);
  transform: translateY(-2px);
}

.ac-kpi small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ac-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ac-kpi strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--ac-navy);
  margin-top: 2px;
}

.ac-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #EFF6FF;
  color: var(--ac-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* LAYOUT SIDEBAR + CONTENT */
.ac-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: start;
}

.ac-sidebar {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 86px;
}

.ac-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ac-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.ac-nav-btn:hover {
  background: #F8FAFC;
  color: var(--ac-navy);
}

.ac-nav-btn.active {
  background: #EFF6FF;
  color: var(--ac-blue);
  font-weight: 700;
}

.ac-panel {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}

.ac-panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #F1F5F9;
}

.ac-panel-head h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ac-navy);
  margin: 0;
}

.ac-item-row {
  border: 1px solid var(--ac-border);
  border-radius: 14px;
  padding: 16px;
  background: #FAFCFF;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ac-empty {
  text-align: center;
  padding: 40px 20px;
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 14px;
}

.ac-empty h3 {
  font-size: 16.5px;
  color: var(--ac-navy);
  margin: 0 0 6px;
}

.ac-empty p {
  font-size: 14px;
  color: var(--ac-subtle);
  margin: 0 0 18px;
}

.ac-status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #EFF6FF;
  color: #1D4ED8;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .ac-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ac-layout {
    grid-template-columns: 1fr;
  }
  .ac-sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }
  .ac-nav-btn {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .ac-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .ac-panel {
    padding: 18px 16px;
  }
}
