/* Shared EPS04 identity. Existing forms and tables retain their layout rules. */
:root {
  --sports-navy: #061a38;
  --sports-ink: #102a4c;
  --sports-blue: #0757ce;
  --sports-line: #cdddf1;
  --sports-surface: #f0f6ff;
  --sports-shadow: 0 4px 12px #123f7612;
}

.sports-mobile-footer { display: none; }

.sidebar {
  background: linear-gradient(156deg, #0a2c55, var(--sports-navy) 39%, #071d3d 81%, #062e61);
  border-color: #1e497a;
}
.sidebar .brand { position: relative; }
.sidebar .brand::after {
  position: absolute;
  content: "";
  inset: auto 0 -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #1577e5 35%, #52d1ff 66%, transparent);
}
.sidebar .brand-icon { flex: none; }
.sidebar .brand strong { color: #fff; font-style: italic; white-space: nowrap; }
.sidebar .brand strong span { color: #41c8ff; }
.sidebar .brand strong small { font-size: .54em; }
.sidebar .brand em {
  display: block;
  color: #d7ecff;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0;
  font-style: normal;
  text-transform: none;
}
.sidebar .side-caption { color: #a4c4e9; }
.sidebar .side-nav a.active {
  background: linear-gradient(159deg, #086ade, #0649bf 62%, #0878d4);
  border-color: #448dec;
  box-shadow: 0 3px 8px #020b21a6, inset 0 1px #83c9f768;
}
.sidebar .side-nav a.active::before { display: none; }
.sidebar .side-nav a.active .nav-ico { color: #fff; }
.sidebar .side-foot { padding-bottom: 13px; }
.sports-morocco-ribbon {
  position: relative;
  flex: none;
  min-height: 105px;
  margin: 0 -16px -18px;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(142deg, #041834, #062b57);
}
.sports-morocco-cloth {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #c1272d;
  clip-path: polygon(0 21%, 10% 12%, 23% 6%, 29% 6%, 42% 13%, 58% 29%, 76% 47%, 92% 55%, 100% 55%, 100% 100%, 0 100%);
}
.sports-morocco-cloth img {
  position: absolute;
  inset: 0;
  width: 107%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 56%;
  transform: translateX(-10%);
}
.sports-morocco-cloth::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(27deg, #3c081652 13%, transparent 39%, #5c16266b 66%, #f5413830 83%);
}
.sports-morocco-ribbon::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 31px;
  clip-path: polygon(0 21%, 15% 10%, 26% 7%, 36% 12%, 48% 24%, 62% 40%, 74% 50%, 85% 56%, 100% 56%, 100% 100%, 0 100%);
  background: linear-gradient(175deg, #47beff, #0484e2 17%, #095fba 31%, #052b5c 62%, #041834);
}
.sports-morocco-silhouette {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 23px;
  background: #02172f;
  clip-path: polygon(0 85%, 5% 85%, 5% 69%, 11% 69%, 11% 75%, 16% 75%, 16% 63%, 21% 63%, 21% 55%, 24% 40%, 27% 53%, 27% 65%, 31% 65%, 31% 76%, 39% 76%, 39% 52%, 42% 52%, 42% 22%, 44% 22%, 45% 0, 46% 22%, 49% 22%, 49% 74%, 55% 74%, 55% 61%, 58% 48%, 61% 61%, 61% 76%, 65% 76%, 65% 60%, 69% 60%, 69% 69%, 72% 69%, 72% 50%, 74% 28%, 76% 50%, 76% 80%, 82% 80%, 82% 72%, 88% 72%, 88% 85%, 100% 85%, 100% 100%, 0 100%);
}

.workspace .topbar {
  --toolbar-line: #4d80b0;
  --toolbar-surface: #173c67;
  color: #eef7ff;
  background:
    linear-gradient(125deg, transparent 72%, #2a82c95c 72.2%, #2a82c95c 74.5%, transparent 74.7%),
    linear-gradient(100deg, #061a38 4%, #092952 58%, #0e4c87 100%);
  border-bottom: 2px solid #2aa8ed;
  box-shadow: 0 4px 14px #061a383b;
}
.workspace .topbar .breadcrumb { color: #f6faff; }
.workspace .topbar #page-crumb { font-weight: 800; }
.workspace .topbar :is(.menu-toggle,.top-search,.top-alert,#eps-context-help,.profile-badge) {
  border: 1px solid var(--toolbar-line);
  border-radius: 9px;
  color: #f1f7ff;
  background: var(--toolbar-surface);
  box-shadow: inset 0 1px #ffffff12;
}
.workspace .topbar :is(.menu-toggle,.top-search,.top-alert,#eps-context-help,.profile-badge):hover,
.workspace .topbar .menu-toggle[aria-expanded="true"] {
  border-color: #91c8ff;
  background: #25588c;
}
.workspace .topbar .menu-toggle svg { width: 19px; height: 19px; vertical-align: middle; }
.workspace .topbar .top-search kbd { color: #deecff; background: #102e53; border-color: #5680a9; }
.workspace .topbar #eps-context-help { width: 44px; min-height: 44px; padding: 0; }
.workspace .topbar .top-alert { position: relative; }
.workspace .topbar #reminder-count:not([hidden]) {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ffcf60;
  color: #122642;
  min-width: 15px;
  height: 15px;
  font-size: .64rem;
}
.workspace .topbar .profile-badge { display: grid; place-items: center; width: 44px; height: 44px; background: #e2f0ff; color: #143d6b; font-weight: 800; }
.workspace .topbar .profile-badge:hover { background: #fff; color: #143d6b; }
.workspace .topbar .work-mode-switch { border: 1px solid #62a5ed; background: #133e76; color: #f3f8ff; white-space: nowrap; }
.workspace .topbar .work-mode-switch:hover { background: #1b548c; }
html[data-work-mode="terrain"] .workspace .topbar .work-mode-switch { border-color: #ffda80; background: #ffcf60; color: #2b260f; }
html[data-work-mode="terrain"] .workspace .topbar .work-mode-switch:hover { background: #ffe190; }
.workspace .topbar :is(.sync-badge,#school-year) { color: #edfbff; }
.workspace .topbar .sync-badge { border-color: #5d89b4; background: #133d6b; }
.workspace .topbar .sync-badge[data-state="synced"] { border-color: #59ad94; color: #e0fff1; background: #15564e; }
.workspace .topbar .sync-badge:is([data-state="draft"],[data-state="error"],[data-state="conflict"]) { border-color: #d6af63; color: #ffefc4; background: #644717; }
.workspace .topbar :is(a,button):focus-visible { outline: 2px solid #ffda7b; outline-offset: 3px; }
@media screen and (max-width: 800px) {
  .workspace .topbar { padding-inline: 10px; gap: 7px; }
  .workspace .topbar :is(.top-search,.top-alert,.menu-toggle) { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px; }
  .workspace .topbar .top-meta { gap: 5px; }
  .workspace .topbar .breadcrumb { margin-left: 0; }
  .workspace .topbar .header-logo { margin: 0; }
}
@media screen and (min-width: 376px) and (max-width: 430px) {
  .workspace .topbar #page-crumb { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}
@media screen and (max-width: 375px) {
  .workspace .topbar { display: grid; grid-template-columns: 44px minmax(0,1fr); row-gap: 5px; height: auto; padding-block: 7px; }
  .workspace .topbar .top-meta { grid-column: 1 / -1; justify-content: space-between; gap: 5px; }
}
html[data-work-mode="choose"] .workspace > :is(.sports-masthead,.sports-mobile-footer) { display: none; }
.work-entry-stage, html[data-work-mode="choose"] #main {
  background: linear-gradient(110deg, #edf5ff 15%, #eff5ffed 58%, #ecf5ffdc), url("sports-stadium.webp") center / cover no-repeat;
}
.work-mode-card.preparation .work-mode-icon { background: #e4efff; color: #0757ce; }
.work-mode-card.terrain { border-color: #063867; background: linear-gradient(145deg, #103c60, #082d3b); }

.sports-dashboard { min-width: 0; }
.sports-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(229px, .34fr);
  gap: 16px;
  align-items: start;
}
.sports-dashboard-main, .sports-dashboard-rail { min-width: 0; }
.sports-dashboard-rail { display: grid; gap: 14px; }
.sports-dashboard-main > .page-head { margin: 14px 0 12px; }
.sports-reminders.card, .sports-agenda.card, .sports-assiduite.card {
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid var(--sports-line);
  border-radius: 13px;
  box-shadow: var(--sports-shadow);
  background: #fff;
}
.sports-reminders.card { margin-bottom: 14px; }
.sports-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #fcfdff, #eef5ff);
  border-bottom: 1px solid #deebfb;
  border-radius: 12px 12px 0 0;
  padding: 11px 14px;
}
.sports-panel-head h2, .sports-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--sports-ink);
  font-size: 1.02rem;
  line-height: 1.3;
}
.sports-panel-head .ui-icon, .sports-section-title .ui-icon { width: 20px; height: 20px; color: var(--sports-blue); }
.sports-panel-head > span {
  padding: 4px 7px;
  border-radius: 5px;
  color: #0b4da2;
  background: #e0eeff;
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}
.sports-reminder-body { padding: 10px 14px 11px; }
.sports-reminders .sports-reminder-body b { color: var(--sports-ink); }
.sports-reminders .sports-reminder-body p { color: #485d76; overflow-wrap: anywhere; }
.sports-reminder-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sports-reminders .sports-reminder-actions .btn { margin: 7px 0 0; padding: 8px 10px; }
.sports-reminder-actions a, .sports-panel-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 5px;
  color: #0754af;
  font-size: .82rem;
  font-weight: 800;
}
.sports-panel-message { padding: 12px 14px; margin: 0; font-size: .87rem; color: #485d76; }
.sports-agenda ul { list-style: none; padding: 0 14px; margin: 0; }
.sports-agenda li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid #e3edf8; font-size: .81rem; }
.sports-agenda li small { flex-basis: 100%; color: #496481; }
.sports-agenda li span { font-variant-numeric: tabular-nums; color: #0754af; white-space: nowrap; }
.sports-agenda li b { color: var(--sports-ink); overflow-wrap: anywhere; }
.sports-panel-link { margin: 0 14px; }
.sports-panel-link .ui-icon { width: 15px; height: 15px; }
.sports-dashboard-rail .dashboard-vacations { margin: 0; }
.sports-assiduite-summary { display: flex; align-items: center; gap: 12px; padding: 13px; }
.sports-assiduite-ring {
  display: grid;
  place-items: center;
  flex: none;
  width: 65px;
  height: 65px;
  color: var(--sports-ink);
  background: conic-gradient(#07834d 0 var(--present), #b53742 var(--present) var(--absent), #4872a2 var(--absent) 100%);
  border-radius: 50%;
  font-size: .89rem;
}
.sports-assiduite-ring b { display: grid; place-items: center; width: 51px; height: 51px; background: #fff; border-radius: 50%; }
.sports-assiduite-summary ul { list-style: none; padding: 0; margin: 0; flex: 1; font-size: .76rem; color: var(--sports-ink); }
.sports-assiduite-summary li { --status-color: #07834d; display: flex; align-items: baseline; gap: 5px; padding: 2px 0; }
.sports-assiduite-summary li:nth-child(2) { --status-color: #b53742; }
.sports-assiduite-summary li:nth-child(3) { --status-color: #4872a2; }
.sports-assiduite-summary li::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--status-color); flex: none; }
.sports-assiduite-summary li span { margin-inline-end: auto; }

.sports-hero, .sports-dashboard .terrain-session {
  position: relative;
  overflow: hidden;
  padding: clamp(19px, 3vw, 29px);
  border: 1px solid #1e5d9c;
  border-radius: 16px;
  color: white;
  background: linear-gradient(92deg, #061b3bfa 11%, #093263e8 48%, #0b355a37 100%), url("sports-stadium.webp") center / cover no-repeat;
  box-shadow: 0 6px 19px #0a3b742b;
}
.sports-dashboard .terrain-session {
  background: linear-gradient(92deg, #061b3bfa 12%, #093263ed 55%, #0b355a6b 100%), url("sports-stadium.webp") center / cover no-repeat !important;
  border-color: #1e5d9c !important;
  border-radius: 16px !important;
}
.sports-hero::before, .sports-dashboard .terrain-session::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 23px;
  width: 46px;
  height: 4px;
  background: #ffca52;
  border-radius: 0 0 4px 4px;
}
.sports-hero .eyebrow, .sports-dashboard .terrain-session .eyebrow { color: #c3e5ff; }
.sports-hero h1 { color: #fff; margin: 9px 0 8px; font-size: clamp(1.72rem, 3.4vw, 2.52rem); line-height: 1.1; letter-spacing: -.04em; }
.sports-hero p { margin: 0; color: #ecf5ff; overflow-wrap: anywhere; }
.sports-dashboard .terrain-session h2 { overflow-wrap: anywhere; }
.sports-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.sports-hero-actions .sports-hero-secondary { color: #fff; background: #102e55e8; border: 1px solid #8fa9c8; }
.sports-hero-actions .sports-hero-secondary:hover { background: #224d7e; }
.sports-indicators {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.sports-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 80px;
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid #ffffff42;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(155deg, #0575dc, #0744ae 80%);
  box-shadow: 0 4px 8px #164b8824;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.sports-indicator:nth-child(2) { background: linear-gradient(155deg, #07834d, #045c42); }
.sports-indicator:nth-child(3) { background: linear-gradient(155deg, #aa5702, #844100); }
.sports-indicator:nth-child(4) { background: linear-gradient(155deg, #6841c4, #433097); }
.sports-indicator:hover { filter: brightness(1.08); color: #fff; }
.sports-indicator span { min-width: 0; overflow-wrap: anywhere; }
.sports-indicator strong { display: block; font-size: clamp(1.35rem, 2.25vw, 1.88rem); color: #fff; line-height: 1.15; }
.sports-indicator .ui-icon { flex: none; width: 23px; height: 23px; }
.sports-section-title { margin: 0 0 10px; }
.sports-dashboard .work-tool { min-height: 88px; padding: 13px; border-color: var(--sports-line); border-radius: 13px; box-shadow: var(--sports-shadow); }
.sports-dashboard .work-tool small { margin-top: 2px; }
.sports-dashboard .work-tool:hover { background: #f1f7ff; border-color: #68a8eb; }
.sports-dashboard .work-tool:nth-child(3n + 2) .work-tool-icon { color: #087250; background: #dcf5eb; }
.sports-dashboard .work-tool:nth-child(3n + 3) .work-tool-icon { color: #855000; background: #fff0d1; }
.sports-dashboard > .home-weekly { margin-top: 16px; }

.sports-title-icon { display: none; }
@media screen {
  #main .page-head h1 { color: var(--sports-ink); }
  .sports-title-icon:has(svg) {
    display: inline-grid;
    place-items: center;
    vertical-align: .13em;
    width: 1.35em;
    height: 1.35em;
    margin-inline-end: .3em;
    border: 1px solid #c6defb;
    border-radius: .3em;
    background: #e2effe;
    color: var(--sports-blue);
  }
  .sports-title-icon svg { width: .74em; height: .74em; }
  #main .card { border-color: var(--sports-line); }
  #main :is(.table-wrap,.weekly-panel) table thead th {
    background: linear-gradient(180deg, #145ca5, #0c427c);
    color: #fff;
  }
  #main :is(.table-wrap,.weekly-panel) table thead th a { color: inherit; }
  #main .table-wrap tbody tr:nth-child(even) { background-color: #f0f6fd; }
}
@media (min-width: 801px) and (max-width: 1180px) {
  .sidebar .brand > span { display: none; }
  .sports-morocco-ribbon { margin-inline: -9px; min-height: 53px; }
  .sports-morocco-cloth img { transform: none; width: 100%; }
  .sports-morocco-ribbon::after { height: 12px; }
  .sports-morocco-silhouette { height: 10px; }
}
@media (max-width: 1050px) {
  .sports-dashboard-layout { grid-template-columns: 1fr; }
  .sports-dashboard-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .sports-mobile-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    margin: 0 12px calc(82px + env(safe-area-inset-bottom));
    border-radius: 10px;
    color: #edf5ff;
    background: var(--sports-navy);
    font-size: .78rem;
  }
  .sports-mobile-footer img { border-radius: 2px; object-fit: contain; }
  .sports-morocco-ribbon { margin-inline: -9px; }
  #mobile-nav a.active { background: #e1eeff; color: #0754af; }
}
@media (max-width: 560px) {
  .sports-dashboard-rail { grid-template-columns: minmax(0,1fr); }
  .sports-hero, .sports-dashboard .terrain-session {
    background-position: 64% center;
  }
  .sports-indicators { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .sports-hero-actions .btn { width: 100%; justify-content: center; }
}
@media print {
  .sports-masthead, .sports-morocco-ribbon, .sports-mobile-footer { display: none !important; }
}
