/* ═══════════════════════════════════════════════════════════════════════
   PlanifCal — Modern Professional Theme
   Inspiré de ghenry.net/cours : vert signature, blanc, typographie nette
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette ghenry.net */
  --green:         #2d8a4e;
  --green-light:   #3aaf64;
  --green-dim:     rgba(45,138,78,.12);
  --green-glow:    rgba(45,138,78,.25);

  /* Surfaces */
  --bg-base:       #f3f4f6;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f8fafc;
  --bg-sidebar:    #1c2333;
  --bg-sidebar-hover: #252d42;
  --bg-sidebar-active: rgba(45,138,78,.15);

  /* Texte */
  --text-primary:  #111827;
  --text-secondary:#374151;
  --text-muted:    #9ca3af;
  --text-sidebar:  #9eabb8;
  --text-sidebar-active: #ffffff;

  /* Bordures */
  --border:        #e5e7eb;
  --border-dark:   #d1d5db;

  /* États */
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0891b2;

  /* Dimensions */
  --sidebar-w:     230px;
  --topbar-h:      54px;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-xs:     4px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.08);

  --font:          'Inter', -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --transition:    .18s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--text-sidebar-active); }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Topbar ─────────────────────────────────────────────────────────── */
.main-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 1000;
  display: flex; align-items: stretch;
  background: var(--bg-sidebar);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.main-header .logo {
  width: var(--sidebar-w);
  display: flex; align-items: center;
  padding: 0 18px; gap: 10px;
  border-right: 1px solid rgba(255,255,255,.06);
  color: #fff; font-size: 15px; font-weight: 600;
  flex-shrink: 0;
  transition: background var(--transition);
}
.main-header .logo:hover { background: var(--bg-sidebar-hover); }

.logo-accent {
  width: 28px; height: 28px;
  background: var(--green);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--green-glow);
}

.logo-mini { display: none; }

.main-header .navbar {
  flex: 1; display: flex; align-items: center;
  padding: 0 16px; gap: 8px;
}

.sidebar-toggle {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  border: none; background: none; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-sidebar-hover); color: #fff; }

.topbar-breadcrumb {
  font-size: 12px; color: rgba(255,255,255,.45);
  display: flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.breadcrumb-sep { color: rgba(255,255,255,.2); }

.navbar-custom-menu { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.btn-topbar {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-topbar:hover { background: rgba(255,255,255,.1); color: #fff; }

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.topbar-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.topbar-username { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.8); }

.role-badge {
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em;
}
.role-admin { background: var(--green-dim); color: var(--green-light); border: 1px solid rgba(45,138,78,.3); }
.role-guest  { background: rgba(99,102,241,.12); color: #818cf8; border: 1px solid rgba(99,102,241,.25); }

.btn-logout { color: rgba(255,255,255,.4) !important; }
.btn-logout:hover { color: #f87171 !important; border-color: rgba(248,113,113,.3) !important; background: rgba(248,113,113,.08) !important; }

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.main-sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto; overflow-x: hidden;
  z-index: 900;
}

.main-sidebar::-webkit-scrollbar { width: 3px; }
.main-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sidebar { padding-bottom: 20px; }

.user-panel {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.1);
}

.user-panel .info p { color: #fff; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.user-panel .info a { color: var(--text-sidebar); font-size: 11px; display: flex; align-items: center; gap: 5px; }

.online-indicator {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-light);
  box-shadow: 0 0 5px var(--green-light);
  display: inline-block;
}

.sidebar-menu { list-style: none; padding: 8px 0; }

.sidebar-menu > li.header {
  padding: 10px 16px 3px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.2);
  text-transform: uppercase; letter-spacing: .08em;
}

.sidebar-menu > li > a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px;
  color: var(--text-sidebar);
  font-size: 12px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.sidebar-menu > li > a:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}
.sidebar-menu > li.active > a {
  background: var(--bg-sidebar-active);
  color: var(--green-light);
  border-left-color: var(--green);
}

.sidebar-menu > li > a svg { flex-shrink: 0; opacity: .7; }
.sidebar-menu > li.active > a svg { opacity: 1; }

.school-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: inline-block; }

.label {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 20px; line-height: 1.6;
}
.label-primary { background: var(--green-dim); color: var(--green-light); }
.label-default { background: rgba(255,255,255,.08); color: rgba(255,255,255,.4); }

.pull-right-container { margin-left: auto; }

/* ─── Content ─────────────────────────────────────────────────────────── */
.content-wrapper {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--bg-base);
}

.content-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface);
}

.content-header h1 {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -.02em;
}
.content-header h1 small {
  font-size: 12px; font-weight: 400;
  color: var(--text-muted); margin-left: 7px;
}

.breadcrumb {
  display: flex; gap: 6px; align-items: center;
  list-style: none; font-size: 11px; color: var(--text-muted);
}
.breadcrumb li + li::before { content: '/'; color: var(--border-dark); }

.content { padding: 14px 20px; }

/* ─── Box ────────────────────────────────────────────────────────────── */
.box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.box-primary { border-top: 2px solid var(--green); }
.box-default { border-top: 2px solid var(--border-dark); }

.box-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.box-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.box-body { padding: 14px 16px; }
.box-body.no-padding { padding: 0; }
.box-footer {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

/* ─── Alertes ────────────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 10px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.25); color: var(--success); }
.alert-danger  { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); color: var(--danger); }
.alert .close {
  margin-left: auto; background: none; border: none;
  font-size: 16px; cursor: pointer; color: inherit; opacity: .5; line-height: 1;
}
.alert .close:hover { opacity: 1; }

/* ─── Boutons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent;
  font-family: var(--font);
  transition: all var(--transition);
  line-height: 1.4; white-space: nowrap; text-decoration: none;
}
.btn-default {
  background: var(--bg-surface); border-color: var(--border-dark);
  color: var(--text-secondary);
}
.btn-default:hover { background: var(--bg-elevated); border-color: var(--text-muted); color: var(--text-primary); }
.btn-default.active {
  background: var(--green); border-color: var(--green);
  color: #fff; font-weight: 600;
  box-shadow: 0 0 0 3px var(--green-dim);
}
.btn-primary {
  background: var(--green); border-color: var(--green);
  color: #fff; font-weight: 600;
}
.btn-primary:hover { background: var(--green-light); border-color: var(--green-light); box-shadow: var(--shadow); }
.btn-warning {
  background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.3);
  color: var(--warning); font-weight: 600;
}
.btn-warning:hover { background: rgba(217,119,6,.14); }
.btn-info {
  background: rgba(8,145,178,.08); border-color: rgba(8,145,178,.3);
  color: var(--info); font-weight: 600;
}
.btn-info:hover { background: rgba(8,145,178,.14); }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right-width: 1px; }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(17,24,39,.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal.show { display: flex; }

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 540px; max-width: 96vw;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated);
}
.modal-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.modal-header .close {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-header .close:hover { background: var(--bg-base); color: var(--danger); }

.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--bg-elevated);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 8px 11px;
  background: var(--bg-base); border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); font-size: 12px;
  color: var(--text-primary); font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
.help-block { font-size: 11px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
code {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--bg-elevated); color: var(--green);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.main-footer {
  background: var(--bg-sidebar);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 10px 20px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: space-between;
  margin-left: var(--sidebar-w);
}
.footer-left { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.5); }
.footer-left strong { color: rgba(255,255,255,.8); }
.footer-logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 6px var(--green-glow);
}
.footer-sep { color: rgba(255,255,255,.15); }
.footer-right { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.35); font-size: 11px; }

/* ─── Utils ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 54px; }
  .main-header .logo .logo-lg { display: none; }
  .main-header .logo .logo-mini { display: flex; }
  .sidebar-menu > li > a span:not(.label) { display: none; }
  .sidebar-menu > li.header { display: none; }
  .user-panel .info { display: none; }
  .topbar-breadcrumb { display: none; }
}
