/* css/teacher-dashboard.css */

/* Core Layout */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.dashboard-container {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.dashboard-content-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    min-width: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-info h2 {
    margin: 0;
    font-size: 1.1rem;
}

.user-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Base Card Style */
.dash-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    min-width: 0;
}

.dash-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

/* Daily Operations Center */
.daily-ops-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(260px, 0.95fr) minmax(360px, 1.35fr);
    gap: 20px;
}

@media (max-width: 1120px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-content-column {
        gap: 18px;
    }

    .daily-ops-grid--top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-ops-card--checks {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .dashboard-shell {
        gap: 16px;
    }

    .dashboard-content-column {
        gap: 16px;
    }

    .daily-ops-grid {
        grid-template-columns: 1fr;
    }

    .daily-ops-card--checks {
        grid-column: auto;
    }
}

.daily-ops-card,
.daily-ops-card > * {
    min-width: 0;
}

.daily-ops-card--todos {
    position: relative;
    overflow: visible;
}

.daily-ops-header {
    gap: 10px;
    flex-wrap: wrap;
}

.daily-ops-header--schedule {
    align-items: flex-start;
}

.daily-ops-header-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.daily-ops-header-main--schedule {
    flex-wrap: wrap;
    flex: 1 1 260px;
}

.daily-ops-link {
    flex-shrink: 0;
    white-space: nowrap !important;
}

.daily-ops-link--subtle {
    margin-left: auto;
}

.date-nav-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    flex-wrap: wrap;
}

.date-display-wrap {
    position: relative;
    min-width: 0;
}

.date-display {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    border-bottom: 1px dashed var(--text-sub);
    white-space: nowrap;
}

/* Timeline (Schedule) */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.timeline-item:hover {
    background: var(--accent-soft);
    border-left-color: var(--accent);
}

.timeline-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    min-width: 50px;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-subject {
    font-weight: 600;
    font-size: 1rem;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* Routine & To-Do */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#quickTodoList {
    max-height: clamp(280px, 42vh, 520px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    min-width: 0;
}

.todo-item.done {
    text-decoration: line-through;
    opacity: 0.6;
}

.todo-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-check.checked {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.todo-input-stack {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.todo-input-row {
    display: flex;
    gap: 8px;
    margin-top: 0;
    align-items: stretch;
}

.todo-input-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.todo-input-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.todo-input-controls--single {
    display: grid;
    grid-template-columns: 154px minmax(220px, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 8px;
    width: 100%;
}

.todo-input-field,
#newTodoInput {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
    box-sizing: border-box;
}

.todo-input-add-btn {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}

.todo-input-select,
.todo-input-date,
.todo-input-check,
.todo-priority-picker {
    min-height: 44px;
    height: 44px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
    box-sizing: border-box;
}

.todo-input-select {
    min-width: 130px;
}

.todo-input-title-row #newTodoInput {
    width: 100%;
    min-width: 0;
}

.todo-input-title-row .todo-input-add-btn {
    width: 100%;
    min-width: 0;
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.22);
}

.todo-input-controls--single .todo-input-select {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
}

.todo-input-controls--single .todo-date-picker {
    width: 100%;
    min-width: 0;
}

.todo-input-controls--single .todo-priority-picker {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 8px;
}

.todo-input-controls--single .todo-priority-picker__label {
    display: none;
}

.todo-input-controls--single .todo-priority-star {
    width: 20px;
}

.todo-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.todo-filter-menu {
    position: relative;
    flex: 0 0 auto;
}

.todo-filter-menu__summary {
    user-select: none;
}

.todo-filter-menu__summary[aria-expanded="true"] {
    border-color: rgba(var(--accent-rgb), 0.6);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-main);
}

.todo-dashboard-filters {
    position: absolute;
    top: 54px;
    right: 20px;
    z-index: 30;
    width: max-content;
    max-width: min(300px, calc(100vw - 48px));
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
}

.todo-dashboard-filters[hidden] {
    display: none;
}

.todo-filter-field {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg) 88%, var(--accent, #22c55e) 12%);
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.todo-filter-select,
.todo-filter-number {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-weight: 800;
    outline: none;
}

.todo-filter-select {
    width: 86px;
}

.todo-filter-number {
    width: 42px;
    text-align: center;
}

.todo-filter-select:focus-visible,
.todo-filter-number:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent, #22c55e) 48%, transparent);
    outline-offset: 2px;
}

.todo-date-picker {
    flex: 1 1 230px;
    min-width: 230px;
    height: 44px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent, #22c55e) 34%, var(--border));
    border-radius: 13px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--input-bg, var(--bg)) 92%, var(--accent, #22c55e) 8%), var(--input-bg, var(--bg)));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px color-mix(in srgb, var(--accent, #22c55e) 12%, transparent);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.todo-date-picker:hover,
.todo-date-picker:focus-within {
    border-color: color-mix(in srgb, var(--accent, #22c55e) 62%, var(--border));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 3px color-mix(in srgb, var(--accent, #22c55e) 18%, transparent);
}

.todo-input-date {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color-scheme: dark light;
    box-shadow: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.todo-input-date:focus {
    outline: none;
}

.todo-input-date::-webkit-date-and-time-value,
.todo-input-date::-webkit-datetime-edit {
    color: var(--text-main);
}

.todo-input-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.todo-input-check input {
    margin: 0;
    width: auto;
}

.todo-priority-picker {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px;
    white-space: nowrap;
}

.todo-priority-picker__label {
    margin-right: 4px;
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 700;
}

.todo-priority-star {
    width: 21px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: color-mix(in srgb, var(--text-sub) 45%, transparent);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.todo-priority-star.is-active {
    color: #fbbf24;
}

.todo-priority-star:hover,
.todo-priority-star:focus-visible {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    outline: none;
}

.todo-input-date::-webkit-calendar-picker-indicator {
    display: none;
    opacity: 0;
    -webkit-appearance: none;
}

.todo-date-picker__button {
    flex: 0 0 44px;
    width: 44px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--accent, #22c55e) 24%, var(--border));
    background: color-mix(in srgb, var(--accent, #22c55e) 18%, transparent);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.todo-date-picker__button:hover,
.todo-date-picker__button:focus-visible {
    background: color-mix(in srgb, var(--accent, #22c55e) 28%, transparent);
    outline: none;
}

.todo-date-picker__button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.todo-input-hint {
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.4;
}

.todo-item__body {
    flex: 1;
    min-width: 0;
}

.todo-item__row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.todo-item__badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.todo-item__title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.todo-item__meta {
    min-width: 0;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-item__meta--editable {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
}

.todo-item__meta-dot {
    color: color-mix(in srgb, var(--text-sub) 72%, transparent);
}

.todo-priority-stars {
    color: #fbbf24;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.todo-priority-stars--interactive {
    cursor: default;
}

.todo-priority-stars__button {
    width: 18px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: color-mix(in srgb, var(--text-sub) 46%, transparent);
    cursor: pointer;
    font-size: 0.86rem;
    line-height: 1;
    padding: 0;
}

.todo-priority-stars__button.is-active {
    color: #fbbf24;
}

.todo-priority-stars__button:hover,
.todo-priority-stars__button:focus-visible {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    outline: none;
}

.todo-priority-stars__button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.todo-due-edit-button {
    min-width: 0;
    max-width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 2px 7px;
    background: color-mix(in srgb, var(--accent, #22c55e) 10%, transparent);
    color: var(--text-sub);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
}

.todo-due-edit-button:hover,
.todo-due-edit-button:focus-visible {
    color: var(--text-main);
    background: color-mix(in srgb, var(--accent, #22c55e) 20%, transparent);
    outline: none;
}

.todo-due-edit-button--empty {
    color: color-mix(in srgb, var(--accent, #22c55e) 78%, var(--text-main));
}

.todo-due-edit-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: min(100%, 260px);
    max-width: 100%;
}

.todo-date-picker--inline {
    flex: 1 1 190px;
    min-width: 190px;
    max-width: 260px;
    height: 36px;
    border-radius: 10px;
}

.todo-date-picker--inline .todo-input-date {
    font-size: 0.78rem;
    padding-inline: 8px;
}

.todo-date-picker--inline .todo-date-picker__button {
    flex-basis: 36px;
    width: 36px;
}

.todo-due-edit-action {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 10px;
    background: var(--bg);
    color: var(--text-main);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.todo-due-edit-action--save {
    border-color: color-mix(in srgb, var(--accent, #22c55e) 42%, var(--border));
    background: color-mix(in srgb, var(--accent, #22c55e) 18%, transparent);
}

.todo-due-edit-action:hover,
.todo-due-edit-action:focus-visible {
    border-color: color-mix(in srgb, var(--accent, #22c55e) 58%, var(--border));
    outline: none;
}

.todo-due-edit-action:disabled,
.todo-due-edit-input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.todo-detail-modal-backdrop[hidden],
.todo-view-modal-backdrop[hidden] {
    display: none !important;
}

.todo-detail-modal-backdrop,
.todo-view-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
}

body.todo-detail-modal-open,
body.todo-view-modal-open {
    overflow: hidden;
}

.todo-detail-modal,
.todo-detail-modal *,
.todo-view-modal,
.todo-view-modal * {
    box-sizing: border-box;
}

.todo-detail-modal {
    width: min(680px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft, #111827);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    color: var(--text-main);
}

.todo-view-modal {
    width: min(1220px, calc(100vw - 48px));
    min-height: min(760px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft, #111827);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    color: var(--text-main);
}

.todo-detail-modal__form {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 18px;
}

.todo-detail-modal__header,
.todo-detail-modal__actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.todo-detail-modal__header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.todo-detail-modal__kicker {
    display: block;
    color: var(--accent, #22c55e);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.todo-detail-modal__header h3 {
    margin: 3px 0 0;
    color: var(--text-main);
    font-size: 1.12rem;
    line-height: 1.25;
}

.todo-detail-modal__title {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.todo-detail-modal__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.todo-detail-modal__field > span {
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 700;
}

.todo-detail-modal__textarea {
    min-width: 0;
    min-height: 190px;
    height: clamp(190px, 34vh, 320px);
    max-height: 50vh;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-main);
    font: inherit;
    line-height: 1.55;
    resize: vertical;
}

.todo-detail-modal__textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--accent, #22c55e) 42%, transparent);
    outline-offset: 1px;
}

.todo-detail-modal__status {
    min-height: 18px;
    color: var(--text-sub);
    font-size: 0.78rem;
    line-height: 1.4;
}

.todo-detail-modal__status.is-error {
    color: #fca5a5;
}

.todo-detail-modal__actions {
    align-items: center;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.todo-detail-modal__save-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.todo-view-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--border);
}

.todo-view-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.todo-view-modal__title-wrap {
    min-width: 0;
}

.todo-view-modal__header h3 {
    margin: 3px 0 0;
    color: var(--text-main);
    font-size: 1.18rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.todo-view-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 0.8rem;
    line-height: 1.4;
}

.todo-view-modal__meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg) 70%, transparent);
}

.todo-view-modal__body {
    min-width: 0;
    max-height: 100%;
    overflow: auto;
    padding: 18px;
}

.todo-view-modal__body.is-click-editable {
    cursor: text;
}

.todo-view-modal__edit[hidden] {
    display: none !important;
}

.todo-view-modal__edit {
    min-width: 0;
    max-height: 100%;
    overflow: auto;
    display: grid;
    gap: 12px;
    padding: 18px;
}

.todo-view-modal__input {
    min-width: 0;
    width: 100%;
    height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-main);
    font: inherit;
}

.todo-view-modal__input:focus {
    outline: 2px solid color-mix(in srgb, var(--accent, #22c55e) 42%, transparent);
    outline-offset: 1px;
}

.todo-view-modal__textarea {
    min-height: 360px;
    height: clamp(360px, 52vh, 620px);
}

.todo-view-modal__status {
    min-height: 18px;
    color: var(--text-sub);
    font-size: 0.78rem;
    line-height: 1.4;
}

.todo-view-modal__status.is-error {
    color: #fca5a5;
}

.todo-view-modal__edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.todo-item__arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent, #22c55e) 12%, transparent);
    color: var(--text-sub);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
}

.todo-item__arrow:hover,
.todo-item__arrow:focus-visible {
    border-color: color-mix(in srgb, var(--accent, #22c55e) 58%, var(--border));
    color: var(--text-main);
    background: color-mix(in srgb, var(--accent, #22c55e) 20%, transparent);
    outline: none;
}

.daily-check-item {
    align-items: flex-start;
}

.daily-check-item .todo-check {
    flex-shrink: 0;
    margin-top: 2px;
}

.daily-check-item .todo-item__body {
    padding-right: 4px;
}

@media (max-width: 1280px) {
    .todo-input-controls--single {
        grid-template-columns: 132px minmax(190px, 1fr) minmax(112px, auto);
    }

    .todo-input-controls--single .todo-date-picker__button {
        flex-basis: 38px;
        width: 38px;
    }
}

@media (max-width: 680px) {
    .todo-input-controls--single {
        grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
    }

    .todo-input-controls--single .todo-date-picker,
    .todo-input-controls--single .todo-priority-picker {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .todo-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .todo-filter-menu {
        position: static;
    }

    .todo-dashboard-filters {
        left: 20px;
        right: auto;
        width: calc(100vw - 56px);
    }

    .todo-input-controls--single {
        grid-template-columns: 1fr;
    }

    .todo-input-controls--single .todo-input-select,
    .todo-input-controls--single .todo-date-picker,
    .todo-input-controls--single .todo-priority-picker {
        grid-column: 1 / -1;
    }

    .todo-detail-modal-backdrop,
    .todo-view-modal-backdrop {
        align-items: stretch;
        padding: 10px;
    }

    .todo-detail-modal,
    .todo-view-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .todo-detail-modal__header,
    .todo-detail-modal__actions,
    .todo-view-modal__header {
        align-items: stretch;
        flex-direction: column;
    }

    .todo-view-modal__header-actions,
    .todo-view-modal__edit-actions {
        width: 100%;
    }

    .todo-view-modal__header-actions .td-btn,
    .todo-view-modal__edit-actions .td-btn {
        flex: 1 1 120px;
    }

    .todo-detail-modal__save-actions {
        width: 100%;
    }

    .todo-detail-modal__save-actions .td-btn,
    #quickTodoDetailSkipBtn {
        flex: 1 1 120px;
    }
}

@media (max-width: 1120px) {
    .daily-ops-header--schedule {
        align-items: stretch;
    }

    .daily-ops-link {
        white-space: normal !important;
    }

    .daily-ops-link--subtle {
        margin-left: 0;
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--danger, #ef4444);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 99px;
    border: 2px solid var(--card-bg);
    min-width: 18px;
    text-align: center;
    transform: translate(25%, -25%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.notification-badge.hidden {
    display: none;
}

/* Status Dashboard (Command Center Widgets) */
.status-dashboard {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .status-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .status-dashboard {
        grid-template-columns: 1fr;
    }
}

.status-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.status-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.status-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid var(--border);
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.status-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.status-meta {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-sub);
    line-height: 1.35;
}

/* Command Center Navigation */
.nav-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.nav-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-header::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    height: 100px;
}

.nav-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-name {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.nudge-badge {
    background: var(--error);
    color: #fff;
    padding: 2px 6px;
    border-radius: 99px;
    font-size: 0.7rem;
    margin-left: auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Feed Section (Compact Table Style) */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 4px;
}

.feed-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-batch-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin: -2px 4px 10px;
}

.feed-batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 4px 12px;
    padding: 10px 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 12px;
    background: rgba(var(--accent-rgb), 0.08);
}

.feed-batch-toolbar.hidden {
    display: none;
}

.feed-batch-summary {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
}

.feed-batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-container {
    margin-top: 10px;
}

.teacher-feed-surface {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.feed-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);

    /* Rounded corners + Hidden overflow ensures border-radius clips children */
    border-radius: 12px;
    overflow: hidden;

    background: var(--card-bg);
}

.feed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    white-space: nowrap;
    /* Keep rows compact */
}

.feed-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.02);
}

.feed-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.feed-table tr:hover td {
    background: var(--bg-hover);
    cursor: pointer;
}

.feed-table tr:last-child td {
    border-bottom: none;
}

.feed-row-selected td {
    background: rgba(var(--accent-rgb), 0.12);
}

.feed-row-selected:hover td {
    background: rgba(var(--accent-rgb), 0.18);
}

/* Column Widths */
.col-select {
    width: 54px;
    text-align: center;
}

.col-source {
    width: 120px;
}

.col-author {
    width: 100px;
    text-align: center;
}

.col-time {
    width: 100px;
    text-align: right;
    color: var(--text-sub);
    font-size: 0.8rem;
}

.col-content {
    white-space: normal;
    /* Allow text wrapping for content */
    min-width: 250px;
}

.col-actions {
    width: 96px;
    text-align: right;
}

.feed-select-cell {
    text-align: center;
}

.feed-row-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.feed-row-detail-btn {
    min-width: 58px;
}

.eval-alert-surface {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

#evalAlertContainer.feed-grid {
    display: block;
}

.eval-alert-summary-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.10), rgba(15, 23, 42, 0.02)),
        var(--card-bg);
}

.eval-alert-summary-main,
.eval-alert-summary-metrics,
.eval-alert-flags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.eval-alert-summary-main {
    color: var(--text-sub);
    font-size: 0.84rem;
}

.eval-alert-summary-main strong {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 800;
}

.eval-alert-summary-metrics {
    justify-content: flex-end;
}

.eval-alert-summary-metrics span,
.eval-alert-flags span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    color: var(--text-sub);
    font-size: 0.76rem;
    line-height: 1;
}

.eval-alert-summary-metrics strong {
    color: var(--text-main);
    font-size: 0.84rem;
}

.eval-alert-flags {
    grid-column: 1 / -1;
}

.eval-alert-flags span {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.10);
    color: #f59e0b;
}

.eval-alert-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 10px;
}

.eval-alert-card {
    appearance: none;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 14px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.eval-alert-card:hover,
.eval-alert-card:focus-visible {
    border-color: rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.08);
    transform: translateY(-1px);
    outline: none;
}

.eval-alert-card.is-done {
    opacity: 0.72;
}

.eval-alert-card-main,
.eval-alert-card-side,
.eval-alert-card-topline,
.eval-alert-meta-line {
    display: flex;
}

.eval-alert-card-main {
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.eval-alert-card-topline {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.eval-alert-subject-chip,
.eval-alert-badge,
.eval-alert-done-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1;
}

.eval-alert-subject-chip {
    max-width: 52%;
    min-width: 0;
    padding: 5px 9px;
    border-color: rgba(var(--accent-rgb), 0.22);
    background: rgba(var(--accent-rgb), 0.10);
    color: var(--text-main);
    font-size: 0.77rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eval-alert-title-text {
    display: -webkit-box;
    min-height: 2.7em;
    color: var(--text-main);
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.35;
    word-break: keep-all;
    overflow-wrap: anywhere;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.eval-alert-meta-line {
    min-width: 0;
    gap: 8px;
    color: var(--text-sub);
    font-size: 0.78rem;
    line-height: 1.35;
}

.eval-alert-meta-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eval-alert-meta-line span:not(:last-child)::after {
    content: "·";
    margin-left: 8px;
    color: rgba(148, 163, 184, 0.7);
}

.eval-alert-card-side {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 7px;
    min-width: 0;
}

.eval-alert-badge {
    min-width: 58px;
    padding: 6px 9px;
    font-size: 0.74rem;
    font-weight: 800;
}

.eval-alert-badge--default,
.eval-alert-badge--past {
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.24);
    color: #94a3b8;
}

.eval-alert-badge--plan {
    background: rgba(20, 184, 166, 0.16);
    border-color: rgba(20, 184, 166, 0.30);
    color: #2dd4bf;
}

.eval-alert-badge--today {
    background: rgba(249, 115, 22, 0.16);
    border-color: rgba(249, 115, 22, 0.28);
    color: #fb923c;
}

.eval-alert-badge--upcoming {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.28);
    color: #60a5fa;
}

.eval-alert-progress-count {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: right;
}

.eval-alert-progress-track {
    position: relative;
    display: block;
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.eval-alert-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #60a5fa);
}

.eval-alert-done-label {
    align-self: flex-end;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.22);
    color: #22c55e;
    font-size: 0.72rem;
    font-weight: 800;
}

.eval-alert-done-label--pending {
    background: rgba(148, 163, 184, 0.10);
    border-color: rgba(148, 163, 184, 0.18);
    color: var(--text-sub);
}

/* Content Layout inside Cell */
.feed-content-main {
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-main);
}

.feed-content-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Unread State */
.feed-unread td {
    background: rgba(var(--accent-rgb), 0.05);
    /* Highlight whole row slightly */
}

.feed-unread .feed-content-main {
    color: var(--accent);
}

.feed-unread .col-source::before {
    content: '●';
    color: var(--error);
    margin-right: 6px;
    font-size: 0.6rem;
    vertical-align: middle;
}

/* Command Center Toolbar */
.command-center-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 -10px 4px;
    flex-wrap: wrap;
}

.command-center-title {
    margin: 0;
    font-size: 1.1rem;
}

.command-center-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.command-center-save-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.command-center-save-status.is-saving {
    border-color: rgba(var(--accent-rgb), 0.4);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-main);
}

.command-center-save-status.is-saved {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.command-center-save-status.is-error {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.command-center-save-status.is-local-only {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* Unified Dashboard Buttons */
.td-btn {
    --td-btn-bg: transparent;
    --td-btn-color: var(--text-main);
    --td-btn-border: var(--border);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--td-btn-border);
    background: var(--td-btn-bg);
    color: var(--td-btn-color);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease, opacity 0.18s ease;
}

.td-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.td-btn:active {
    transform: translateY(1px);
}

.td-btn:focus-visible {
    outline: 2px solid rgba(var(--accent-rgb), 0.55);
    outline-offset: 2px;
}

.td-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.td-btn--secondary {
    --td-btn-bg: rgba(var(--accent-rgb), 0.1);
    --td-btn-border: rgba(var(--accent-rgb), 0.44);
    --td-btn-color: var(--text-main);
}

.td-btn--secondary:hover {
    background: rgba(var(--accent-rgb), 0.16);
    border-color: rgba(var(--accent-rgb), 0.62);
}

.td-btn--ghost {
    --td-btn-bg: transparent;
    --td-btn-border: rgba(148, 163, 184, 0.4);
    --td-btn-color: var(--text-sub);
}

.td-btn--ghost:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.55);
    color: var(--text-main);
}

.td-btn--sm {
    height: 30px;
    padding: 0 10px;
    font-size: 0.78rem;
}

.td-btn--xs {
    height: 22px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
}

.td-btn--icon {
    width: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 0.82rem;
}

.td-btn--muted {
    opacity: 0.72;
}

.td-btn--muted:hover {
    opacity: 0.96;
}

.td-btn--subtle {
    color: var(--text-sub);
}

.td-btn--push-right {
    margin-left: auto;
}

/* Legacy Utility Buttons */
.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--text-main);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.auth-card-primary {
    max-width: 420px;
    width: 100%;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.44);
    text-align: left;
}

.auth-card-primary__icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.14);
    font-size: 1.7rem;
}

.auth-card-primary h2 {
    margin: 0 0 10px;
    font-size: 1.28rem;
}

.auth-card-primary .auth-message {
    margin: 0 0 22px;
    color: var(--text-sub);
    font-size: 0.92rem;
    line-height: 1.55;
}

.auth-login-stack {
    display: grid;
    gap: 14px;
}

.auth-login-stack .btn-primary {
    width: 100%;
    min-height: 44px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.25);
}

.auth-email-form {
    display: grid;
    gap: 9px;
}

.auth-email-form label {
    color: var(--text-sub);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-email-form input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--text-main);
    font: inherit;
}

.auth-email-form input:focus {
    outline: 2px solid rgba(129, 140, 248, 0.42);
    outline-offset: 1px;
    border-color: rgba(129, 140, 248, 0.72);
}

.auth-link-btn {
    border: none;
    background: transparent;
    color: #bfdbfe;
    cursor: pointer;
    font-weight: 700;
    padding: 4px 2px;
    text-align: center;
}

.auth-link-btn:hover {
    color: #dbeafe;
}

.auth-email-status {
    min-height: 1.1rem;
    margin: 0;
    color: var(--text-sub);
    font-size: 0.82rem;
    line-height: 1.35;
}

.auth-email-status.error {
    color: #fca5a5;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .command-center-toolbar {
        margin: 8px 0 -8px 2px;
        gap: 8px;
    }

    .command-center-actions {
        width: 100%;
    }

    .eval-alert-summary-bar {
        grid-template-columns: 1fr;
        padding: 11px;
    }

    .eval-alert-summary-metrics {
        justify-content: flex-start;
    }

    .eval-alert-list {
        grid-template-columns: 1fr;
    }

    .eval-alert-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .eval-alert-card-side {
        align-items: flex-start;
    }

    .eval-alert-progress-count {
        text-align: left;
    }

    .eval-alert-progress-track {
        width: 160px;
        max-width: 100%;
    }

    .eval-alert-done-label {
        align-self: flex-start;
    }

    .eval-alert-title-text {
        min-height: auto;
        font-size: 0.92rem;
    }
}

/* Small Modal Styles (Theme/Subscriptions) */
.theme-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.theme-modal-overlay.active {
    display: flex;
}

.theme-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: var(--text-main);
}

.feed-dock-modal {
    width: min(1200px, 96vw);
    max-width: min(1200px, 96vw);
    padding: 20px;
}

.feed-dock-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.feed-dock-modal__hint {
    margin: 6px 0 0;
    color: var(--text-sub);
    font-size: 0.88rem;
    line-height: 1.45;
}

.feed-dock-modal__body {
    max-height: min(76vh, 860px);
    overflow-y: auto;
    min-width: 0;
}

.feed-dock-modal__body .teacher-feed-surface {
    padding-bottom: 4px;
}

body.feed-dock-modal-open {
    overflow: hidden;
}

.mood-stats-modal {
    width: min(1120px, 96vw);
    max-width: min(1120px, 96vw);
    padding: 20px;
}

.mood-stats-modal__header,
.mood-stats-modal__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mood-stats-modal__header {
    margin-bottom: 14px;
}

.mood-stats-modal__header h3 {
    margin: 0;
}

.mood-stats-modal__hint {
    margin: 6px 0 0;
    color: var(--text-sub);
    font-size: 0.88rem;
    line-height: 1.45;
}

.mood-stats-modal__body {
    max-height: min(74vh, 820px);
    overflow-y: auto;
    min-width: 0;
    padding-right: 2px;
}

.mood-stats-modal__footer {
    align-items: center;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.mood-stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mood-stats-summary-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.mood-stats-summary-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1.1;
}

.mood-stats-summary-card span {
    color: var(--text-sub);
    font-size: 0.82rem;
}

.mood-stats-summary-card.is-danger {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(239, 68, 68, 0.08);
}

.mood-stats-summary-card.is-warning {
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(245, 158, 11, 0.08);
}

.mood-stats-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.mood-stats-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.035);
    min-width: 0;
}

.mood-stats-panel h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.mood-stats-daily-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.mood-stats-day {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 8px;
    background: rgba(15, 23, 42, 0.26);
}

.mood-stats-day__label {
    color: var(--text-sub);
    font-size: 0.75rem;
    white-space: nowrap;
}

.mood-stats-day__count {
    margin: 4px 0 7px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 800;
}

.mood-stats-day__bar {
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.mood-stats-day__risk {
    height: 100%;
    width: var(--risk-pct, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.mood-stats-distribution {
    display: grid;
    gap: 8px;
}

.mood-stats-dist-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
    color: var(--text-sub);
    font-size: 0.82rem;
}

.mood-stats-dist-track {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.mood-stats-dist-fill {
    height: 100%;
    width: var(--fill-pct, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.95), rgba(45, 212, 191, 0.95));
}

.mood-stats-risk-list {
    display: grid;
    gap: 8px;
}

.mood-stats-risk-item {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.28);
}

.mood-stats-risk-item.is-danger {
    border-color: rgba(239, 68, 68, 0.38);
    background: rgba(239, 68, 68, 0.075);
}

.mood-stats-risk-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.mood-stats-risk-item__name {
    min-width: 0;
    color: var(--text-main);
    font-weight: 800;
}

.mood-stats-risk-item__meta,
.mood-stats-empty {
    color: var(--text-sub);
    font-size: 0.82rem;
    line-height: 1.45;
}

.mood-stats-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mood-stats-chip {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.055);
    font-size: 0.76rem;
}

@media (max-width: 768px) {
    .feed-dock-modal {
        width: min(96vw, 96vw);
        max-width: min(96vw, 96vw);
        padding: 16px;
    }

    .feed-dock-modal__header {
        flex-direction: column;
        align-items: stretch;
    }

    .mood-stats-modal {
        width: min(96vw, 96vw);
        max-width: min(96vw, 96vw);
        padding: 16px;
    }

    .mood-stats-modal__header,
    .mood-stats-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .mood-stats-summary-grid,
    .mood-stats-layout,
    .mood-stats-daily-grid {
        grid-template-columns: 1fr;
    }

    .mood-stats-dist-row {
        grid-template-columns: 76px minmax(0, 1fr) 34px;
    }
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.theme-option {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.theme-option:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.theme-option.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

/* Large Period Detail Modal - Exactly from lesson-planner.css */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3500;
    animation: fade-in 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    width: 1100px;
    max-width: 95vw;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 95vh;
    overflow-y: auto;
    animation: modal-slide-up 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: scale(1.05);
}

/* Modal Content Layout */
.lesson-markdown-body {
    color: inherit;
    overflow-wrap: anywhere;
}

.lesson-markdown-body > *:first-child {
    margin-top: 0;
}

.lesson-markdown-body > *:last-child {
    margin-bottom: 0;
}

.lesson-markdown-body a {
    color: var(--accent, #6366f1);
    text-decoration: underline;
    font-weight: 600;
}

.lesson-markdown-body p {
    margin: 0 0 10px;
}

.lesson-markdown-body h2,
.lesson-markdown-body h3,
.lesson-markdown-body h4,
.lesson-markdown-body h5,
.lesson-markdown-body h6 {
    margin: 14px 0 8px;
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.25;
}

.lesson-markdown-body h2 {
    font-size: 1.05rem;
}

.lesson-markdown-body h3 {
    font-size: 1rem;
}

.lesson-markdown-body h4,
.lesson-markdown-body h5,
.lesson-markdown-body h6 {
    font-size: 0.94rem;
}

.lesson-markdown-body ul,
.lesson-markdown-body ol {
    padding-left: 20px;
    margin: 0 0 10px;
}

.lesson-markdown-body li {
    margin: 4px 0;
}

.lesson-markdown-body blockquote {
    margin: 10px 0;
    padding: 8px 10px;
    border-left: 3px solid var(--primary, #6366f1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: var(--text-main);
}

.lesson-markdown-body code {
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.88em;
}

.lesson-markdown-body pre {
    margin: 10px 0;
    padding: 10px;
    overflow-x: auto;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lesson-markdown-body pre code {
    padding: 0;
    border: 0;
    background: transparent;
}

.lesson-markdown-body hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 12px 0;
}

.lesson-markdown-empty {
    color: var(--text-sub);
    opacity: 0.85;
}

.lesson-markdown-body--compact p,
.lesson-markdown-body--compact ul,
.lesson-markdown-body--compact ol {
    margin-bottom: 6px;
}

#periodContentView {
    padding: 32px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    min-height: 650px;
    line-height: 2.2;
    font-size: 1.2rem;
    word-break: break-all;
    color: var(--text-main);
}

#periodContentView h1,
#periodContentView h2,
#periodContentView h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--primary);
}

#periodContentView img {
    max-width: 30%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Feed Filter Bar */
.feed-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    background: var(--bg-hover);
}

.filter-chip:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.filter-chip input {
    margin-right: 4px;
    accent-color: var(--accent);
}

#feedDetailCard.theme-modal--map-builder-review {
    width: min(1120px, 96vw) !important;
    max-width: min(1120px, 96vw) !important;
}

#feedDetailCard.theme-modal--shop-sales-report {
    width: min(760px, 94vw) !important;
    max-width: min(760px, 94vw) !important;
}

.feed-shop-sales-report {
    display: flex;
    flex-direction: column;
    gap: 14px;
    white-space: normal;
}

.feed-shop-sales-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-sub);
    font-size: 0.86rem;
}

.feed-shop-sales-meta span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
    background: color-mix(in srgb, var(--bg-soft, #0f172a) 82%, transparent);
}

.feed-shop-sales-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.feed-shop-sales-kpi {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    min-width: 0;
}

.feed-shop-sales-kpi.is-accent {
    border-color: rgba(16, 185, 129, 0.42);
    background: rgba(16, 185, 129, 0.1);
}

.feed-shop-sales-kpi span {
    display: block;
    color: var(--text-sub);
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.feed-shop-sales-kpi strong {
    display: block;
    color: var(--text-main);
    font-size: 1.18rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.feed-shop-sales-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.feed-shop-sales-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    background: color-mix(in srgb, var(--bg-soft, #0f172a) 78%, transparent);
    min-width: 0;
}

.feed-shop-sales-section h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--text-main);
}

.feed-shop-sales-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.feed-shop-sales-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: baseline;
    color: var(--text-sub);
    font-size: 0.88rem;
}

.feed-shop-sales-item-name {
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-shop-sales-list strong {
    color: var(--text-main);
}

.feed-shop-sales-empty {
    color: var(--text-sub);
    font-size: 0.88rem;
}

.feed-shop-sales-refund {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 8px 10px;
    align-items: center;
    justify-content: start;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-sub);
    font-size: 0.88rem;
}

.feed-shop-sales-refund strong {
    color: var(--text-main);
}

@media (max-width: 560px) {
    .feed-shop-sales-list li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .feed-shop-sales-list li span:last-child {
        grid-column: 1 / -1;
    }

    .feed-shop-sales-refund {
        grid-template-columns: 1fr auto;
    }
}

.feed-map-review {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feed-map-review-status {
    padding: 12px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-soft, #0f172a) 78%, transparent);
    border: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 0.9rem;
    line-height: 1.5;
}

.feed-map-review-status.is-error {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.22);
}

.feed-map-review-status.is-success {
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    background: rgba(21, 128, 61, 0.2);
}

.feed-map-review-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.feed-map-review-stat {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card-bg) 90%, transparent);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-map-review-stat-label {
    font-size: 0.78rem;
    color: var(--text-sub);
}

.feed-map-review-stat-value {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
}

.feed-map-review-shell {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--panel-bg, var(--card-bg)) 92%, transparent);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feed-map-review-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.feed-map-review-map-tabs,
.feed-map-review-mode-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feed-map-review-map-tab,
.feed-map-review-mode-tab {
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.feed-map-review-map-tab:hover,
.feed-map-review-mode-tab:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

.feed-map-review-map-tab.is-active,
.feed-map-review-mode-tab.is-active {
    background: color-mix(in srgb, var(--accent) 18%, var(--card-bg));
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
}

.feed-map-review-mode-tab[aria-selected="true"] {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.feed-map-review-panel {
    min-height: 420px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-soft, #0f172a) 76%, transparent);
    padding: 14px;
    overflow: hidden;
}

.feed-map-review-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    background: #f8fafc;
}

.feed-map-review-walk-mount {
    width: 100%;
    min-height: 392px;
    border-radius: 12px;
    overflow: hidden;
}

.feed-map-review-message {
    min-height: 360px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-sub);
    padding: 20px;
}

.feed-map-review-message strong {
    color: var(--text-main);
    font-size: 1rem;
}

.feed-map-review-message.is-error {
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.18);
}

@media (max-width: 900px) {
    .feed-map-review-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feed-map-review-panel {
        min-height: 320px;
    }

    .feed-map-review-walk-mount,
    .feed-map-review-message {
        min-height: 280px;
    }
}
