#page-content {
  --week-resources-width: 360px;
  --week-gap: 1rem;
}

#page-content .week-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--week-resources-width);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--week-gap);
  width: 100%;
  height: 100%;
  min-height: 0;
}

#page-content .week-top-card {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: none;
}

.week-header-content { display: flex; flex-direction: column; gap: 1rem; }
.week-subject-icon { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 0.85rem; background: #dbeafe; color: #2563eb; font-size: 1.25rem; }
.week-status-badge { flex-shrink: 0; padding: 0.35rem 0.7rem; border-radius: 999px; background: #002147; color: #fff; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; }
.week-header-divider { height: 1px; background: #e2e8f0; }
.week-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.week-summary-card { display: flex; align-items: center; gap: 0.75rem; min-width: 0; padding: 0.85rem 1rem; border: 1px solid #e2e8f0; border-radius: 0.9rem; }
.week-summary-marks { background: #eff6ff; border-color: #bfdbfe; }
.week-summary-missed { background: #fff1f2; border-color: #fda4af; color: inherit; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.week-summary-missed:hover { background: #ffe4e6; border-color: #fb7185; transform: translateY(-1px); }
.week-summary-icon { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: 0.7rem; font-size: 0.95rem; }
.week-summary-marks .week-summary-icon { background: #dbeafe; color: #2563eb; }
.week-summary-missed .week-summary-icon { background: #fecdd3; color: #be123c; }
.week-summary-label { margin: 0; color: #64748b; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.week-summary-value { margin: 0.15rem 0 0; color: #0f172a; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.week-summary-value span { color: #64748b; font-size: 0.9rem; font-weight: 700; }
.week-focus-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.week-focus-tag { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0.3rem 0.55rem; border: 1px solid #86efac; border-radius: 0.55rem; background: #dcfce7; color: #166534; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.week-focus-tag i { font-size: 0.65rem; }

.missed-marks-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.missed-marks-modal.hidden { display: none; }
.missed-marks-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.missed-marks-dialog { position: relative; display: flex; flex-direction: column; width: min(32rem, 100%); height: 26rem; max-height: calc(100vh - 3rem); padding: 1.5rem; border: 1px solid #fda4af; border-radius: 1.25rem; background: #fffafa; box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24); }
.missed-marks-dialog h2 { margin: 0; color: #881337; font-size: 1.35rem; font-weight: 800; }
.missed-marks-close { position: absolute; top: 0.85rem; right: 0.85rem; display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 1px solid #fecdd3; border-radius: 0.6rem; background: #fff1f2; color: #be123c; transition: background 0.2s; }
.missed-marks-close:hover { background: #fecdd3; }
.missed-marks-description { margin: 0.4rem 0 1rem; color: #64748b; font-size: 0.82rem; }
.missed-marks-list { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 0.65rem; overflow-y: auto; padding-right: 0.35rem; }
.missed-marks-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0.9rem; border: 1px solid #fda4af; border-radius: 0.8rem; background: #fff1f2; }
.missed-marks-item p { margin: 0; color: #4c0519; font-size: 0.85rem; font-weight: 700; }
.missed-marks-item span { color: #9f1239; font-size: 0.72rem; }
.missed-marks-item strong { color: #be123c; font-size: 0.9rem; white-space: nowrap; }
.missed-marks-empty { color: #64748b; font-size: 0.85rem; }

@media (max-width: 640px) {
  .week-summary-grid { grid-template-columns: 1fr; }
  .week-status-badge { font-size: 0.6rem; }
}

#page-content .week-main-column {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  display: flex;
}

#page-content .week-resources-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 100%;
  display: flex;
  min-height: 0;
}

#page-content .week-resources-panel > div {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.content-card {
  transition: all 0.2s;
}

.content-card:hover {
  transform: translateY(-2px);
}

.assignment-item {
  transition: all 0.2s;
}

.assignment-item:hover {
  background: #f1f5f9;
}

.quiz-btn {
  transition: all 0.2s;
}

.quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resource-item {
  position: relative;
  overflow: hidden;
  padding-left: 1.25rem;
  transition: all 0.2s;
}

.resource-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.35rem;
  border-radius: 999px 0 0 999px;
}

.resource-item:hover {
  background: #e2e8f0;
}

.resource-item-ppt { background: #fff1e6; border-color: #fdba74; }
.resource-item-pdf { background: #fee2e2; border-color: #fca5a5; }
.resource-item-word { background: #dbeafe; border-color: #93c5fd; }
.resource-item-video { background: #dff7fd; border-color: #7dd3e8; }
.resource-item-green { background: #dcfce7; border-color: #86efac; }
.resource-item-ppt:hover { background: #fed7aa; }
.resource-item-pdf:hover { background: #fecaca; }
.resource-item-word:hover { background: #bfdbfe; }
.resource-item-video:hover { background: #bcecf7; }
.resource-item-green:hover { background: #bbf7d0; }
.resource-icon-ppt { color: #ea580c; }
.resource-icon-pdf { color: #dc2626; }
.resource-icon-word { color: #2563eb; }
.resource-icon-video { color: #27bbec; }
.resource-icon-green { color: #16a34a; }
.resource-item-ppt::before { background: #ea580c; }
.resource-item-pdf::before { background: #dc2626; }
.resource-item-word::before { background: #2563eb; }
.resource-item-video::before { background: #27bbec; }
.resource-item-green::before { background: #16a34a; }

.app-dark #page-content .week-top-card,
.app-dark #page-content .week-main-column > div,
.app-dark #page-content .week-resources-panel > div {
  border-color: #123b65;
  background: #001a38;
  color: #e2e8f0;
}
.app-dark #page-content .week-top-card h1,
.app-dark #page-content .week-resources-panel h3 {
  color: #f1f5f9;
}
.app-dark #page-content #content-subject-name,
.app-dark #page-content .week-main-column .text-slate-500,
.app-dark #page-content .week-resources-panel p {
  color: #a8b6c8;
}
.app-dark #page-content #content-subject-icon {
  border: 1px solid color-mix(in srgb, var(--week-subject-color, #4777a8) 35%, #123b65);
  background: color-mix(in srgb, var(--week-subject-color, #4777a8) 20%, #002147) !important;
}
.app-dark #page-content .week-header-divider {
  background: #24466b;
}
.app-dark #page-content .week-status-badge {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #002147;
}
.app-dark #page-content .week-summary-card {
  border-color: #24466b;
  background: #002147;
}
.app-dark #page-content .week-summary-marks {
  background: #102f50;
}
.app-dark #page-content .week-summary-missed {
  border-color: #754253;
  background: #382532;
}
.app-dark #page-content .week-summary-missed:hover {
  border-color: #a75b71;
  background: #482b3a;
}
.app-dark #page-content .week-summary-icon {
  background: #123b65;
  color: #bfdbfe;
}
.app-dark #page-content .week-summary-missed .week-summary-icon {
  background: #593345;
  color: #fecdd3;
}
.app-dark #page-content .week-summary-label,
.app-dark #page-content .week-summary-value span {
  color: #a8b6c8;
}
.app-dark #page-content .week-summary-value {
  color: #f1f5f9;
}
.app-dark #page-content .week-main-column > div > div {
  border-color: #123b65;
  background: #002147;
}
.app-dark #page-content .week-main-column .bg-slate-200 {
  background: #123b65;
  color: #dbeafe;
}
.app-dark #page-content .detail-button {
  border-color: #21496f;
  background: #0b3158;
  color: #e2e8f0;
}
.app-dark #page-content .detail-button:hover {
  background: #123b65;
}
.app-dark #page-content .detail-button-accent-red {
  border-color: #824c5a;
  background: #3a2634;
  color: #ffd0d4;
}
.app-dark #page-content .detail-button-accent-red:hover {
  background: #4a2e3e;
}
.app-dark #page-content .detail-button-accent-blue {
  border-color: #2b5680;
  background: #123b65;
  color: #d5e8ff;
}
.app-dark #page-content .detail-button-accent-blue::before {
  background: #3b82f6;
}
.app-dark #page-content .detail-button-accent-blue:hover {
  background: #194b78;
}
.app-dark #page-content .detail-button-large {
  border-color: #fff;
  background: #fff;
  color: #002147;
}
.app-dark #page-content .detail-button-large .text-slate-100 {
  color: #002147;
}
.app-dark #page-content .detail-progress-bar {
  background: rgba(0, 33, 71, 0.2);
}
.app-dark #page-content #resources-search {
  border-color: #24466b;
  background: #002147;
  color: #f1f5f9;
}
.app-dark #page-content #resources-search::placeholder {
  color: #9aabc0;
}
.app-dark #page-content #resources-search:focus {
  border-color: #4777a8;
  box-shadow: 0 0 0 2px rgba(71,119,168,0.24);
}
.app-dark #page-content [aria-label="Filter resources by category"] {
  border-color: #24466b;
  background: #002147;
  color: #dbeafe;
}
.app-dark #page-content #resources-category-previous,
.app-dark #page-content #resources-category-next {
  color: #a8b6c8;
}
.app-dark #page-content #resources-category-previous:hover,
.app-dark #page-content #resources-category-next:hover {
  background: #123b65;
  color: #fff;
}
.app-dark #page-content .resource-item {
  color: #e2e8f0;
}
.app-dark #page-content .resource-item-ppt {
  border-color: #92521e;
  background: #3b2a1c;
}
.app-dark #page-content .resource-item-pdf {
  border-color: #8f3b46;
  background: #3b222b;
}
.app-dark #page-content .resource-item-word {
  border-color: #315f91;
  background: #172f4a;
}
.app-dark #page-content .resource-item-video {
  border-color: #28718a;
  background: #153743;
}
.app-dark #page-content .resource-item-green {
  border-color: #33734b;
  background: #193829;
}
.app-dark #page-content .resource-item-ppt:hover { background: #4a3321; }
.app-dark #page-content .resource-item-pdf:hover { background: #4a2933; }
.app-dark #page-content .resource-item-word:hover { background: #1d3a5a; }
.app-dark #page-content .resource-item-video:hover { background: #194653; }
.app-dark #page-content .resource-item-green:hover { background: #204733; }
.app-dark #page-content .resource-item .text-slate-900 { color: #f1f5f9; }
.app-dark #page-content .resource-item .text-slate-500 { color: #b8c8dc; }
.app-dark #page-content .resource-item .text-slate-400 { color: #a8b6c8; }
.app-dark #page-content .missed-marks-dialog {
  border-color: #754253;
  background: #241a26;
}
.app-dark #page-content .missed-marks-dialog h2 { color: #fecdd3; }
.app-dark #page-content .missed-marks-description,
.app-dark #page-content .missed-marks-empty { color: #a8b6c8; }
.app-dark #page-content .missed-marks-item {
  border-color: #754253;
  background: #382532;
}
.app-dark #page-content .missed-marks-item p { color: #fce7f3; }
.app-dark #page-content .missed-marks-item span { color: #fda4af; }
.app-dark #page-content .missed-marks-item strong { color: #fecdd3; }
.app-dark #page-content .missed-marks-close {
  border-color: #754253;
  background: #382532;
  color: #fecdd3;
}
.app-dark #page-content .missed-marks-close:hover { background: #593345; }