/* Office UX refinement 2026-08-26: additive, loaded after the established UI. */
body[data-page="office"] {
  --zoe-cyan: #28d7d0;
  --zoe-yellow: #f4ba19;
  --zoe-green: #35d787;
  --zoe-blue: #4e8cff;
  --zoe-violet: #7a56db;
  --zoe-rose: #ed167f;
}

body[data-page="office"] .brand-mark {
  color: transparent;
  background: url("/shared/assets/loewenkopf-jendritzki.png") center / contain no-repeat;
}

html[data-theme="light"] body[data-page="office"] .brand-mark {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background: url("/shared/assets/loewenkopf-jendritzki.png") center / contain no-repeat !important;
}

body[data-page="office"] .sidebar-label:nth-of-type(2),
body[data-page="office"] .sidebar-label:nth-of-type(2) ~ .nav-link { --section-accent: var(--zoe-cyan); }

body[data-page="office"] .sidebar-label {
  position: relative;
  padding-left: 12px;
}

body[data-page="office"] .sidebar-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--zoe-rose);
  transform: translateY(-50%);
}

body[data-page="office"] .sidebar-label:nth-of-type(2)::before { background: var(--zoe-cyan); }
body[data-page="office"] .sidebar-label:nth-of-type(3)::before { background: var(--zoe-yellow); }
body[data-page="office"] .sidebar-label:nth-of-type(4)::before { background: var(--zoe-green); }
body[data-page="office"] .sidebar-label:nth-of-type(5)::before { background: var(--zoe-violet); }
body[data-page="office"] .sidebar-label:nth-of-type(6)::before { background: var(--zoe-blue); }

@media (min-width: 981px) {
  body[data-page="office"] .main {
    width: calc(100% - 264px);
    max-width: calc(100% - 264px);
    flex: 0 0 auto;
    box-sizing: border-box;
  }
}

/* Enrollment: compact progress cards with a real, reversible navigation state. */
body[data-page="office"] #panel-enrollment {
  max-width: 1180px;
  margin-inline: auto;
}

body[data-page="office"] #panel-enrollment > .office-toolbar {
  background: transparent;
  border: 0;
  padding-inline: 0;
}

body[data-page="office"] .wizard-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="office"] .wizard-progress li {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 10px 42px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.25;
  cursor: default;
}

body[data-page="office"] .wizard-progress li::before {
  content: attr(data-step);
  position: absolute;
  left: 12px;
  top: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  font: 700 0.72rem/1 var(--jk-font-body);
}

body[data-page="office"] .wizard-progress li.available { cursor: pointer; }
body[data-page="office"] .wizard-progress li.available:hover { border-color: var(--zoe-cyan); }
body[data-page="office"] .wizard-progress li.done::before { content: "✓"; }

body[data-page="office"] .wizard-step {
  padding: clamp(18px, 3vw, 34px);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #12161c) 92%, var(--zoe-blue) 8%);
}

body[data-page="office"] .wizard-step > .form-row {
  padding: 14px;
  border: 1px solid var(--jk-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2, #171c24) 96%, transparent);
}

body[data-page="office"] .classes-grid label,
body[data-page="office"] .acquisition-quick-actions button,
body[data-page="office"] .radio-group label {
  min-height: 44px;
}

body[data-page="office"] #wiz-classes {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

body[data-page="office"] #wiz-classes label > span {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body[data-page="office"] .classes-grid label.active:nth-child(6n+1) { border-color: var(--zoe-rose); background: color-mix(in srgb, var(--zoe-rose) 17%, transparent); }
body[data-page="office"] .classes-grid label.active:nth-child(6n+2) { border-color: var(--zoe-cyan); background: color-mix(in srgb, var(--zoe-cyan) 17%, transparent); }
body[data-page="office"] .classes-grid label.active:nth-child(6n+3) { border-color: var(--zoe-yellow); background: color-mix(in srgb, var(--zoe-yellow) 17%, transparent); }
body[data-page="office"] .classes-grid label.active:nth-child(6n+4) { border-color: var(--zoe-green); background: color-mix(in srgb, var(--zoe-green) 17%, transparent); }
body[data-page="office"] .classes-grid label.active:nth-child(6n+5) { border-color: var(--zoe-blue); background: color-mix(in srgb, var(--zoe-blue) 17%, transparent); }
body[data-page="office"] .classes-grid label.active:nth-child(6n) { border-color: var(--zoe-violet); background: color-mix(in srgb, var(--zoe-violet) 17%, transparent); }

body[data-page="office"] #wiz-student-info:not(:empty) {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--zoe-green) 55%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--zoe-green) 10%, transparent);
  color: var(--jk-text);
  font-weight: 700;
}

body[data-page="office"] #wiz-prior-section.is-irrelevant { display: none; }
body[data-page="office"] .wiz-summary { color: #113124; border-radius: 8px; }

/* Student list becomes a narrow rail after selection and can always be reopened. */
body[data-page="office"] .students-layout {
  transition: grid-template-columns 180ms ease;
}

body[data-page="office"] .students-sidebar-toggle,
body[data-page="office"] .students-sidebar-open { flex: 0 0 38px; }

body[data-page="office"] .students-sidebar-open {
  display: none;
  position: sticky;
  z-index: 8;
  top: 12px;
  margin: 0 0 8px;
}

@media (min-width: 1101px) {
  body[data-page="office"] .students-layout.student-list-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
  body[data-page="office"] .students-layout.student-list-collapsed .students-sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
  body[data-page="office"] .students-layout.student-list-collapsed .students-sidebar-open { display: inline-flex; }
}

body[data-page="office"] .student-file-hero {
  position: sticky;
  z-index: 5;
  top: 0;
  border-top: 3px solid var(--zoe-cyan);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

body[data-page="office"] .acc-actionbar {
  padding-block: 10px;
}

body[data-page="office"] .acc-actionbar .ui-btn { min-height: 42px; }
body[data-page="office"] .subtabs { gap: 8px; align-items: stretch; }
body[data-page="office"] .student-tab-group {
  padding: 5px;
  border: 1px solid var(--jk-border);
  border-radius: 8px;
  background: var(--surface, rgba(255,255,255,.03));
}

body[data-page="office"] .student-tab-group:nth-child(1) { border-top: 3px solid var(--zoe-rose); }
body[data-page="office"] .student-tab-group:nth-child(2) { border-top: 3px solid var(--zoe-cyan); }
body[data-page="office"] .student-tab-group:nth-child(3) { border-top: 3px solid var(--zoe-yellow); }
body[data-page="office"] .student-tab-group:nth-child(4) { border-top: 3px solid var(--zoe-green); }
body[data-page="office"] .student-tab-group:nth-child(5) { border-top: 3px solid var(--zoe-violet); }

body[data-page="office"] .contract-extension-notice {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--zoe-yellow) 55%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--zoe-yellow) 10%, transparent);
}

body[data-page="office"] .contract-extension-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding-top: 10px;
}

body[data-page="office"] .contract-extension-row + .contract-extension-row { border-top: 1px solid var(--jk-border); }
body[data-page="office"] .contract-extension-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }

/* Documents: table first, generators below, and clearer upload naming. */
body[data-page="office"] .student-documents-layout { display: grid; gap: 18px; }
body[data-page="office"] .student-documents-existing { order: 1; }
body[data-page="office"] .student-documents-generate { order: 2; }
body[data-page="office"] .student-documents-upload { order: 3; }
body[data-page="office"] .doc-card-action { border-radius: 8px; }
body[data-page="office"] .doc-card-action[data-gen-kind="contract"],
body[data-page="office"] .doc-card-action[data-gen-kind="training_proof"] { border-color: var(--zoe-cyan); }

body[data-page="office"] .application-note {
  max-width: 260px;
  white-space: normal;
  line-height: 1.4;
}

body[data-page="office"] .application-note summary { cursor: pointer; color: var(--zoe-cyan); }
body[data-page="office"] .application-note p { margin: 6px 0 0; }

/* Shift plan: neutral cells, color belongs to the branch marker. */
body[data-page="office"] .shift-plan-surface {
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--jk-border);
  border-radius: 8px;
  background: var(--surface, rgba(10,14,20,.6));
}

body[data-page="office"] .shift-plan-surface table { min-width: 940px; }
body[data-page="office"] .shift-plan-surface [data-shift-edit] {
  min-height: 58px;
  padding: 8px !important;
  border-color: var(--jk-border) !important;
  border-radius: 6px !important;
  background: var(--surface-2, rgba(255,255,255,.04)) !important;
  color: var(--jk-white) !important;
}

body[data-page="office"] .shift-plan-surface [data-shift-edit]:hover {
  border-color: var(--zoe-cyan) !important;
  transform: translateY(-1px);
}

body[data-page="office"] .shift-review-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* The student file used a few legacy dark-only surfaces. Keep the entire new
   layer readable when the office switches to the light appearance. */
html[data-theme="light"] body[data-page="office"] .students-detail,
html[data-theme="light"] body[data-page="office"] .student-file-hero,
html[data-theme="light"] body[data-page="office"] .subtab-panel {
  color: #121826 !important;
  background: #ffffff !important;
}

html[data-theme="light"] body[data-page="office"] .student-file-hero {
  border-color: #dce3ee !important;
  border-top-color: var(--zoe-cyan) !important;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] body[data-page="office"] .acc-nextbar {
  color: #121826 !important;
  background: #fff7fb !important;
  border-color: #f5b8d5 !important;
}

html[data-theme="light"] body[data-page="office"] .acc-actionbar .ui-btn:not(.ui-btn--primary):not(.ui-btn--danger),
html[data-theme="light"] body[data-page="office"] .acc-nextbar .ui-btn,
html[data-theme="light"] body[data-page="office"] .ui-menu {
  color: #121826 !important;
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] body[data-page="office"] .acc-actionbar .ui-btn:not(.ui-btn--primary):not(.ui-btn--danger):hover,
html[data-theme="light"] body[data-page="office"] .acc-nextbar .ui-btn:hover {
  color: #121826 !important;
  background: #eef2ff !important;
  border-color: #5855e8 !important;
}

html[data-theme="light"] body[data-page="office"] .student-overview-grid,
html[data-theme="light"] body[data-page="office"] .student-overview-details,
html[data-theme="light"] body[data-page="office"] .contract-extension-notice,
html[data-theme="light"] body[data-page="office"] .shift-plan-surface,
html[data-theme="light"] body[data-page="office"] #panel-shifts > .office-toolbar,
html[data-theme="light"] body[data-page="office"] .shift-review-card {
  color: #121826 !important;
  background: #ffffff !important;
  border-color: #dce3ee !important;
}

html[data-theme="light"] body[data-page="office"] #panel-shifts > .office-toolbar h3,
html[data-theme="light"] body[data-page="office"] #shift-week-label {
  color: #121826 !important;
}

html[data-theme="light"] body[data-page="office"] .shift-plan-surface [data-shift-edit] {
  color: #121826 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

@media (max-width: 760px) {
  body[data-page="office"] .wizard-progress { grid-template-columns: 1fr; }
  body[data-page="office"] .wizard-progress li { min-height: 46px; justify-content: flex-start; }
  body[data-page="office"] .wizard-step { padding: 14px; }
  body[data-page="office"] .wizard-step > .form-row { padding: 11px; }
  body[data-page="office"] .wizard-nav { flex-direction: column-reverse; }
  body[data-page="office"] .wizard-nav button { width: 100%; }
  body[data-page="office"] .student-file-hero { position: static; }
  body[data-page="office"] .contract-extension-row { grid-template-columns: 1fr; }
  body[data-page="office"] .shift-plan-surface { padding: 10px; }
  body[data-page="office"] .shift-review-grid { grid-template-columns: 1fr !important; }
}
