/* ============================================================
   MOD-174-07 · Admin education grid and selected edit panel
============================================================ */

.mod17407-page {
  background: linear-gradient(180deg, #f7fbff 0, #eef5ff 100%);
  min-height: calc(100vh - 72px);
}

.mod17407-container {
  max-width: 1840px;
  padding-inline: clamp(16px, 2vw, 34px);
}

.mod17407-form-container { max-width: 1320px; }

.mod17407-admin-menu a.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .12);
}

.mod17407-admin-menu a:focus-visible,
.mod17407-page button:focus-visible,
.mod17407-page a:focus-visible,
.mod17407-page input:focus-visible,
.mod17407-page select:focus-visible,
.mod17407-page textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .38);
  outline-offset: 2px;
}

.mod17407-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.mod17407-metrics button {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #d6e3f5;
  border-radius: 14px;
  background: #fff;
  color: #12233f;
  text-align: left;
  padding: 12px 16px;
}

.mod17407-metrics button:hover { border-color: #7aa7ee; background: #f8fbff; }
.mod17407-metrics strong { color: #0f3e8a; font-size: 1.45rem; line-height: 1.1; }
.mod17407-metrics span { color: #63738c; font-size: .78rem; margin-top: 5px; }

.mod17407-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(6, minmax(128px, 1fr));
  gap: 10px;
  padding: 16px;
  border: 1px solid #d5e2f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(30, 64, 120, .06);
}

.mod17407-toolbar > label { display: grid; align-content: end; gap: 5px; }
.mod17407-toolbar > label > span { color: #52627a; font-size: .72rem; font-weight: 800; }
.mod17407-toolbar .form-control,
.mod17407-toolbar .form-select { min-height: 40px; border-color: #cbd9eb; font-size: .82rem; }
.mod17407-search { align-self: end; position: relative; }
.mod17407-search i { color: #6d7c92; left: 13px; position: absolute; top: 12px; }
.mod17407-search input { padding-left: 36px; }
.mod17407-date-filters { grid-column: 1 / -1; border-top: 1px solid #e8eef7; padding-top: 8px; }
.mod17407-date-filters summary { color: #40526d; cursor: pointer; font-size: .78rem; font-weight: 800; }
.mod17407-date-filters > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.mod17407-date-filters label { color: #64748b; display: grid; gap: 4px; font-size: .72rem; }
.mod17407-toolbar-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }

.mod17407-bulk {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #d6e3f5;
  border-radius: 14px;
  background: #fff;
}

.mod17407-bulk > strong { color: #17488f; margin-right: 6px; }
.mod17407-bulk .form-select { font-size: .8rem; max-width: 210px; min-height: 36px; }
.mod17407-bulk [data-export-filtered] { margin-left: auto; }
.mod17407-resequence { display: flex; gap: 8px; }
.mod17407-resequence label { align-items: center; color: #5b6b82; display: flex; font-size: .75rem; gap: 5px; }
.mod17407-resequence input { height: 36px; width: 76px; }

.mod17407-workspace {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.9fr) minmax(360px, 1fr);
  margin: 12px 0 36px;
}

.mod17407-list-pane,
.mod17407-detail {
  border: 1px solid #d5e2f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(30, 64, 120, .07);
}

.mod17407-result-head { align-items: center; display: flex; justify-content: space-between; padding: 13px 16px; }
.mod17407-result-head p { color: #63738c; font-size: .76rem; margin: 0; }
.mod17407-result-head strong { color: #123d7b; }
.mod17407-table-wrap { max-width: 100%; overflow: auto; }
.mod17407-table { border-collapse: separate; border-spacing: 0; min-width: 1420px; width: 100%; }
.mod17407-table th {
  background: #f2f6fc;
  border-block: 1px solid #dce6f3;
  color: #43536b;
  font-size: .7rem;
  font-weight: 800;
  padding: 10px 8px;
  position: sticky;
  text-align: left;
  top: 0;
  white-space: nowrap;
  z-index: 2;
}

.mod17407-table td { border-bottom: 1px solid #e9eff7; color: #314158; font-size: .73rem; padding: 9px 8px; vertical-align: middle; }
.mod17407-table tbody tr { cursor: pointer; }
.mod17407-table tbody tr:hover { background: #f6faff; }
.mod17407-table tbody tr.is-selected,
.mod17407-table tbody tr[aria-selected="true"] { background: #eaf3ff; box-shadow: inset 3px 0 #2563eb; }
.mod17407-table tbody tr.is-save-highlight {
  animation: mod17415-saved-highlight 2.6s ease-out;
  background: #dbeafe;
  box-shadow: inset 4px 0 #1d4ed8, inset 0 0 0 1px #93c5fd;
}
.mod17407-table .is-check { text-align: center; width: 38px; }
.mod17407-table td:nth-child(6) strong,
.mod17407-table td:nth-child(6) span { display: block; white-space: nowrap; }
.mod17407-table td:nth-child(6) span { color: #718096; margin-top: 3px; }
.mod17407-table time { white-space: nowrap; }

.mod17407-badge,
.mod17407-type {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
  gap: 4px;
  padding: 4px 8px;
  white-space: nowrap;
}

.mod17407-badge.is-public { background: #dcfce7; color: #166534; }
.mod17407-badge.is-private { background: #f1f5f9; color: #475569; }
.mod17407-type { background: #eaf2ff; color: #1d4ed8; }
.mod17407-thumb { align-items: center; background: #edf2f8; border-radius: 8px; display: flex; height: 45px; justify-content: center; overflow: hidden; width: 80px; }
.mod17407-thumb img { height: 100%; object-fit: cover; width: 100%; }
.mod17407-thumb i { color: #8291a6; font-size: 1.2rem; }
.mod17407-title { -webkit-box-orient: vertical; -webkit-line-clamp: 2; background: none; border: 0; color: #102d57; display: -webkit-box; font-weight: 800; line-height: 1.35; max-width: 250px; overflow: hidden; padding: 0; text-align: left; }
.mod17407-title:hover { color: #1d5fd1; text-decoration: underline; }
.mod17410-title-cell { min-width: 0; overflow: hidden; }
.mod17410-table.is-compact .mod17407-title { width: 100%; }
.mod17407-keywords { display: flex; gap: 3px; max-width: 150px; }
.mod17407-keywords b,
.mod17407-keywords em { background: #f0f4f9; border-radius: 999px; color: #52637b; font-size: .64rem; font-style: normal; font-weight: 700; max-width: 76px; overflow: hidden; padding: 3px 6px; text-overflow: ellipsis; white-space: nowrap; }

.mod17407-pagination { align-items: center; display: flex; gap: 16px; justify-content: center; padding: 14px; }
.mod17407-pagination span { color: #687891; font-size: .8rem; }
.mod17407-empty { color: #77879c; padding: 60px 20px; text-align: center; }
.mod17407-empty i { font-size: 2rem; }

.mod17407-group-view { padding: 12px; }
.mod17407-group-category { border: 1px solid #dce6f3; border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.mod17407-group-category > summary,
.mod17407-group-course > summary { align-items: center; cursor: pointer; display: flex; font-weight: 800; justify-content: space-between; list-style: none; padding: 12px 14px; }
.mod17407-group-category > summary { background: #f4f8fd; color: #173c70; }
.mod17407-group-course { border-top: 1px solid #e5edf7; }
.mod17407-group-course > summary { color: #455a77; font-size: .8rem; padding-left: 26px; }
.mod17407-group-items { display: grid; gap: 6px; padding: 0 12px 12px 34px; }
.mod17407-group-item { align-items: center; background: #fff; border: 1px solid #e2eaf4; border-radius: 9px; color: #203a60; display: grid; font-size: .78rem; gap: 8px; grid-template-columns: 38px 1fr auto auto; padding: 9px 10px; text-align: left; }
.mod17407-group-item:hover { background: #f7faff; border-color: #91b3e7; }
.mod17407-group-item.is-selected { background: #eaf3ff; border-color: #60a5fa; box-shadow: inset 3px 0 #2563eb; }
.mod17407-group-item.is-save-highlight {
  animation: mod17415-saved-highlight 2.6s ease-out;
  background: #dbeafe;
  border-color: #60a5fa;
  box-shadow: inset 4px 0 #1d4ed8, inset 0 0 0 1px #93c5fd;
}

.mod17407-detail { max-height: calc(100vh - 90px); min-height: 450px; overflow: hidden; position: sticky; top: 16px; }
.mod17407-detail-empty { align-items: center; color: #7b899b; display: flex; flex-direction: column; gap: 8px; justify-content: center; min-height: 450px; padding: 30px; text-align: center; }
.mod17407-detail-empty i { color: #8fb2e8; font-size: 2.4rem; }
.mod17407-detail-empty strong { color: #344965; }
.mod17407-detail-empty span { font-size: .78rem; }
.mod17407-detail-content { max-height: calc(100vh - 90px); overflow-y: auto; }
.mod17407-detail-head { align-items: center; background: #f4f8fd; border-bottom: 1px solid #dce6f3; display: grid; gap: 12px; grid-template-columns: 92px 1fr auto; padding: 14px; position: sticky; top: 0; z-index: 4; }
.mod17407-detail-thumb { align-items: center; background: #e6edf7; border-radius: 10px; display: flex; height: 52px; justify-content: center; overflow: hidden; width: 92px; }
.mod17407-detail-thumb img { height: 100%; object-fit: cover; width: 100%; }
.mod17407-detail-head h2 { color: #112f5c; display: -webkit-box; font-size: 1rem; font-weight: 850; line-height: 1.35; margin: 3px 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mod17407-detail-head p,
.mod17407-detail-head span { color: #687890; font-size: .7rem; margin: 0; }
.mod17407-detail-nav { align-items: center; display: flex; gap: 10px; padding: 9px 14px; }
.mod17407-detail-nav button,
.mod17407-detail-nav a { background: none; border: 0; color: #36619b; font-size: .72rem; padding: 0; }
.mod17407-detail-nav a { margin-left: auto; }
.mod17407-detail form > details { border-top: 1px solid #e5edf7; }
.mod17407-detail form > details > summary { color: #28496f; cursor: pointer; font-size: .78rem; font-weight: 850; padding: 12px 14px; }
.mod17407-detail-section { display: grid; gap: 10px; padding: 0 14px 14px; }
.mod17407-detail-grid { grid-template-columns: 1fr 1fr; }
.mod17407-detail-section label { color: #52627a; display: grid; font-size: .7rem; font-weight: 800; gap: 4px; }
.mod17407-detail-section .form-control,
.mod17407-detail-section .form-select { border-color: #cdd9e9; font-size: .78rem; min-height: 36px; }
.mod17407-detail-section textarea { resize: vertical; }
.mod17407-detail-section .form-switch { align-items: center; display: flex; gap: 8px; }
.mod17407-detail-section .form-switch input { min-height: auto; }
.mod17407-admin-info { display: grid; gap: 7px; margin: 0; padding: 0 14px 14px; }
.mod17407-admin-info div { display: grid; font-size: .72rem; grid-template-columns: 120px 1fr; }
.mod17407-admin-info dt { color: #697991; }
.mod17407-admin-info dd { color: #273b58; margin: 0; overflow-wrap: anywhere; }
.mod17407-detail-actions { background: rgba(255,255,255,.97); border-top: 1px solid #dce6f3; bottom: 0; display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; padding: 12px 14px; position: sticky; z-index: 4; }
.mod17407-detail-actions .btn { font-size: .72rem; }

.mod17407-toast { background: #173761; border-radius: 10px; bottom: 24px; box-shadow: 0 12px 32px rgba(15, 35, 65, .28); color: #fff; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; position: fixed; right: 24px; z-index: 1080; }
.mod17407-toast.is-error { background: #9f1d2d; }
.mod17415-list-reload {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 9px;
  color: #9a3412;
  display: flex;
  font-size: .78rem;
  font-weight: 750;
  gap: 12px;
  justify-content: space-between;
  margin: 10px 14px;
  padding: 10px 12px;
}
.mod17415-list-reload[hidden] { display: none; }
.mod17415-drawer-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: .75rem;
  font-weight: 750;
  margin: 10px 12px 0;
  padding: 9px 11px;
}
.mod17415-drawer-error[hidden] { display: none; }
.mod17407-drawer-backdrop { background: rgba(9, 23, 46, .46); inset: 0; position: fixed; z-index: 1040; }
.mod17407-create-panel,
.mod17407-taxonomy-page { margin-bottom: 36px; }
.mod17407-taxonomy-page .admin-education-taxonomy-body { display: block; }

@media (max-width: 1450px) {
  .mod17407-toolbar { grid-template-columns: minmax(250px, 2fr) repeat(3, 1fr); }
  .mod17407-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1199px) {
  .mod17407-workspace { display: block; }
  .mod17407-detail { border-radius: 18px 18px 0 0; bottom: 0; left: 0; margin: 0; max-height: 92vh; position: fixed; right: 0; top: auto; transform: translateY(105%); transition: transform .22s ease; z-index: 1050; }
  .mod17407-detail.is-open { transform: translateY(0); }
  .mod17407-detail-content { max-height: 92vh; }
  .mod17407-detail-empty { display: none; }
}

@media (max-width: 767px) {
  .mod17407-container { padding-inline: 10px; }
  .mod17407-metrics { grid-template-columns: repeat(2, 1fr); }
  .mod17407-metrics button { min-height: 64px; }
  .mod17407-toolbar { grid-template-columns: 1fr 1fr; padding: 12px; }
  .mod17407-search { grid-column: 1 / -1; }
  .mod17407-date-filters > div { grid-template-columns: 1fr 1fr; }
  .mod17407-toolbar-actions { justify-content: stretch; }
  .mod17407-toolbar-actions > * { flex: 1 1 auto; }
  .mod17407-bulk { align-items: stretch; }
  .mod17407-bulk > * { flex: 1 1 calc(50% - 8px); max-width: none !important; }
  .mod17407-bulk > strong { flex-basis: 100%; }
  .mod17407-bulk [data-export-filtered] { margin-left: 0; }
  .mod17407-result-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .mod17407-table-wrap { overflow: visible; }
  .mod17407-table,
  .mod17407-table tbody { display: block; min-width: 0; }
  .mod17407-table thead { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
  .mod17407-table tr { border-bottom: 1px solid #dce6f3; display: grid; gap: 8px; grid-template-columns: 30px 80px 1fr auto; padding: 12px; }
  .mod17407-table td { border: 0; padding: 0; }
  .mod17407-table td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .mod17407-table td:nth-child(2),
  .mod17407-table td:nth-child(10),
  .mod17407-table td:nth-child(12),
  .mod17407-table td:nth-child(13) { display: none; }
  .mod17407-table td:nth-child(3) { grid-column: 4; grid-row: 1; }
  .mod17407-table td:nth-child(4) { grid-column: 4; grid-row: 2; }
  .mod17407-table td:nth-child(5) { grid-column: 2; grid-row: 1 / span 3; }
  .mod17407-table td:nth-child(6) { grid-column: 3; grid-row: 2; }
  .mod17407-table td:nth-child(7) { grid-column: 4; grid-row: 3; }
  .mod17407-table td:nth-child(8) { grid-column: 3; grid-row: 1; }
  .mod17407-table td:nth-child(9) { grid-column: 3; grid-row: 3; }
  .mod17407-table td:nth-child(11) { grid-column: 3 / span 2; grid-row: 4; color: #7a8798; }
  .mod17407-title { max-width: none; }
  .mod17407-detail { border-radius: 0; max-height: 100vh; top: 0; }
  .mod17407-detail-content { max-height: 100vh; }
  .mod17407-detail-grid { grid-template-columns: 1fr; }
  .mod17407-detail-actions { justify-content: stretch; }
  .mod17407-detail-actions .btn { flex: 1 1 calc(50% - 8px); }
  .mod17407-group-items { padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mod17407-detail { transition: none; }
  .mod17407-table tbody tr.is-save-highlight,
  .mod17407-group-item.is-save-highlight { animation: none; }
}

@keyframes mod17415-saved-highlight {
  0%, 45% { background: #bfdbfe; box-shadow: inset 5px 0 #1d4ed8, inset 0 0 0 2px #60a5fa; }
  100% { background: #eaf3ff; box-shadow: inset 3px 0 #2563eb; }
}
