/* Workspace presentation from the unified handoff of 2026-10-09.
   Existing forms, states and interaction hooks belong to the application. */
.app-shell {
    --muted: #716a78;
    --danger: #b63152;
    grid-template-columns: 238px minmax(0, 1fr);
    font-size: 13px;
    line-height: 1.5;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

.app-shell :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--purple);
    outline-offset: 3px;
}

.app-shell .sidebar { padding: 23px 14px 16px; height: 100dvh; overflow-y: auto; }
.app-shell .sidebar-brand { gap: 12px; padding: 0 10px 22px; }
.app-shell .sidebar-logo { width: 44px; height: 44px; flex-basis: 44px; }
.app-shell .sidebar-brand-name { font-size: 25px; letter-spacing: -.7px; }
.app-shell .role-box { margin: 0 6px 20px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: white; }
.app-shell .role-box-label { font-weight: 400; letter-spacing: 0; text-transform: none; }
.app-shell .role-select { font-size: 13px; font-weight: 600; }
.app-shell .sidebar-nav { gap: 3px; margin-top: 0; }
.app-shell .nav-link { min-height: 41px; padding: 11px 13px; gap: 12px; border-radius: 10px; color: #665f6e; font-size: 13px; font-weight: 400; }
.app-shell .nav-link:hover { background: #f5f2f8; }
.app-shell .nav-link.is-active { color: var(--purple); background: var(--purple-soft); font-weight: 550; }
.app-shell .sidebar-footer { padding-top: 28px; gap: 4px; }
.app-shell .profile-card { border-top: 1px solid var(--line); border-radius: 0; padding: 14px 6px; }
.app-shell .avatar { width: 32px; height: 32px; flex-basis: 32px; background: var(--purple-soft); color: var(--purple); font-size: 11px; font-weight: 550; }

.app-main { padding: 26px 30px 34px; }
.app-shell .page-header { gap: 20px; margin-bottom: 23px; }
.app-shell .page-header h1, .app-shell .page-title { font-size: 27px; font-weight: 650; letter-spacing: -.6px; line-height: 1.25; }
.app-shell .page-header p, .app-shell .page-subtitle { font-size: 12px; line-height: 1.6; }
.app-shell .panel { border-radius: 16px; box-shadow: none; }
.app-shell .section-title { font-weight: 550; }
.app-shell .section-subtitle { line-height: 1.6; }
.app-shell .page-header-actions, .app-shell .header-actions { gap: 8px; flex-wrap: wrap; }

.app-shell .btn { min-height: 36px; padding: 8px 13px; border-radius: 9px; font-size: 12px; font-weight: 500; line-height: 1.4; }
.app-shell .btn:hover { transform: none; }
.app-shell .btn-outline { border-color: var(--line); background: white; color: var(--text); }
.app-shell .btn-outline:hover { background: #f5eefb; }
.app-shell .btn-secondary { background: #fff8d4; color: #594b14; }
.app-shell .btn-secondary:hover { background: #ffefaf; }
.app-shell .btn:disabled { cursor: default; opacity: .6; }
.app-shell .btn-sm { min-height: 34px; padding: 7px 11px; font-size: 12px; }

.app-main :where(input[type="text"], input[type="search"], input[type="email"],
    input[type="password"], input[type="number"], input[type="date"], input[type="time"],
    input[type="url"], select, textarea) {
    border: 1px solid #ded9e4;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 12px;
    color: var(--text);
    background-color: var(--surface);
}
.app-main :where(input[type="text"], input[type="search"], input[type="email"],
    input[type="password"], input[type="number"], input[type="date"], input[type="time"],
    input[type="url"], select) { min-height: 36px; }
.app-main textarea { line-height: 1.6; }
.app-shell .status-pill, .app-shell .membership-status, .app-shell .teacher-group-status, .app-shell .teacher-group-type {
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

/* Continuous entity lists; preserve all fields and existing action links. */
.app-shell .entity-list { gap: 0; }
.app-shell .entity-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 22px; }
.app-shell .entity-row:last-child { border-bottom: 0; }
.app-shell .entity-row:hover { background: #fcfaff; }
.app-shell .entity-title { font-weight: 600; }
.app-shell .entity-meta { font-size: 12px; line-height: 1.6; }
.app-shell .entity-actions { gap: 8px; }
.app-shell .finance-table th { background: #fbfafc; font-size: 10px; font-weight: 500; }
.app-shell .finance-table td { padding-top: 15px; padding-bottom: 15px; }
.app-shell .finance-table tbody tr:hover { background: #fcfaff; }
.app-shell .finance-search { gap: 12px; }

/* Teacher groups become rows using the same membership and schedule content. */
.app-shell .teacher-groups-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}
.app-shell .teacher-group-card {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.35fr) minmax(130px, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 10px 24px;
    padding: 18px 22px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.app-shell .teacher-group-card:first-child { border-radius: 14px 14px 0 0; }
.app-shell .teacher-group-card:last-child { border-bottom: 0; border-radius: 0 0 14px 14px; }
.app-shell .teacher-group-card:hover { transform: none; box-shadow: none; background: #fcfaff; border-color: var(--line); }
.app-shell .teacher-group-card-top { grid-column: 1; grid-row: 1; flex-wrap: wrap; gap: 8px; }
.app-shell .teacher-group-number { color: #352d3f; font-size: 15px; font-weight: 600; }
.app-shell .teacher-group-title { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.app-shell .teacher-group-meta { grid-column: 1; grid-row: 2; margin: 0; }
.app-shell .teacher-group-card > .teacher-group-section { margin: 0; grid-row: 1 / span 2; min-width: 0; }
.app-shell .teacher-group-card > .teacher-group-section:nth-of-type(3) { grid-column: 2; }
.app-shell .teacher-group-card > .teacher-group-section:nth-of-type(4) { grid-column: 3; }
.app-shell .teacher-group-section-title { font-size: 11px; font-weight: 450; text-transform: none; letter-spacing: 0; }
.app-shell .teacher-group-student { flex-wrap: wrap; gap: 5px 8px; line-height: 1.5; }
.app-shell .teacher-group-student > span { min-width: 0; overflow-wrap: anywhere; }
.app-shell .teacher-group-avatar { width: 24px; height: 24px; flex-basis: 24px; font-size: 11px; }
.app-shell .teacher-group-card-footer { grid-column: 4; grid-row: 1 / span 2; align-self: center; margin: 0; padding: 0; border: 0; font-size: 12px; color: var(--purple); gap: 10px; }

.app-shell .feedback-card { border-radius: 16px; padding: 24px; }
.app-shell .feedback-card-header h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.app-shell .feedback-card-header p, .app-shell .feedback-meta { line-height: 1.6; }
.app-shell .feedback-status { font-size: 11px; font-weight: 500; }
.app-shell .feedback-readonly { background: #f7f6f9; border-radius: 12px; padding: 20px; line-height: 1.7; }
.app-shell .feedback-month { border-radius: 16px; }
.app-shell .feedback-stat { border-radius: 16px; }
.app-shell .feedback-stat span { font-size: 12px; font-weight: 450; text-transform: none; letter-spacing: 0; }
.app-shell .feedback-stat strong { font-weight: 550; }
.app-shell .feedback-manage-footer { gap: 16px; }

/* FullCalendar hooks match the installed v7 event renderer. */
.app-shell .calendar-panel { padding: 18px; border-radius: 16px; }
.app-shell .calendar-panel > .ui-form { margin-bottom: 18px; }
#teacherCalendar {
    padding: 0;
    --fc-border-color: #e5e7eb;
    --fc-today-bg-color: #f7f2fd;
    --fc-pulse-primary: #5d27a1;
    --fc-pulse-primary-over: #713fb0;
    --fc-pulse-primary-down: #4a1d83;
    --fc-pulse-now: #d64d57;
    --fc-pulse-border: #e5e7eb;
    --fc-pulse-unselected: #f4f1f6;
    --fc-pulse-selected: #fff;
    --fc-pulse-selected-foreground: #4a1d83;
    font-size: 12px;
}
#teacherCalendar [role=heading] { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
#teacherCalendar button:not(.millimon-calendar-event) { min-height: 34px; font-size: 12px; font-weight: 500; border-radius: 8px; }
#teacherCalendar button:not(.millimon-calendar-event):not([role=tab]) { padding: 8px 12px; border-color: var(--line); box-shadow: none; background: white; }
#teacherCalendar [role=tablist] { background: #f4f1f6; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
#teacherCalendar button[role=tab][aria-selected=true] { color: var(--purple); background: white; box-shadow: 0 1px 3px #2f203414; }
#teacherCalendar .calendar-day-header { background: #fbfafc; color: var(--muted); }
#teacherCalendar .calendar-day-header-inner { padding: 0 6px; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-size: 12px; font-weight: 400; }
#teacherCalendar .calendar-time-label { font-size: 11px; padding: 0 8px; }
:is(#teacherCalendar, .calendar-more-popover) .millimon-calendar-event {
    --subject-color: #64616b;
    --subject-background: #e9e8ea;
    --subject-text: #35313c;
    --fc-event-color: var(--subject-color);
    --fc-event-contrast-color: var(--subject-text);
    border: 0;
    border-left: 3px solid var(--subject-color);
    border-radius: 7px;
    background: var(--subject-background);
    color: var(--subject-text);
    box-shadow: none;
    opacity: 1;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
:is(#teacherCalendar, .calendar-more-popover) .millimon-calendar-event:hover { transform: none; box-shadow: none; filter: brightness(.98); }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-inner { display: block; height: 100%; width: 100%; min-width: 0; min-height: 0; padding: 0; overflow: hidden; color: inherit; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-content { padding: 8px 9px 7px; gap: 4px; color: var(--subject-text); }
:is(#teacherCalendar, .calendar-more-popover) :is(.calendar-lesson-title, .calendar-lesson-group, .calendar-lesson-time, .calendar-lesson-teacher, .calendar-lesson-status) { color: inherit; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-group { order: -1; flex-shrink: 0; font-size: 13px; font-weight: 650; line-height: 1.25; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-title { font-size: 11px; font-weight: 450; }
:is(#teacherCalendar, .calendar-more-popover) :is(.calendar-lesson-time, .calendar-lesson-teacher) { font-size: 11px; line-height: 1.3; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-time { flex-shrink: 0; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-status { font-size: 10px; font-weight: 500; line-height: 1.3; margin-top: auto; padding-top: 0; min-width: 0; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-status > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-month-compact .calendar-lesson-content { height: auto; padding: 4px 6px; gap: 2px; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-month-compact .calendar-lesson-group { font-size: 11px; line-height: 1.25; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-month-compact :is(.calendar-lesson-time, .calendar-lesson-teacher, .calendar-lesson-status) { font-size: 9px; line-height: 1.3; }
:is(#teacherCalendar, .calendar-more-popover) .calendar-lesson-month-compact .calendar-lesson-status { margin-top: 0; }
#teacherCalendar .calendar-more-link { padding: 4px 6px; color: var(--purple-dark); font-size: 11px; font-weight: 600; cursor: pointer; }
#teacherCalendar .calendar-more-link:hover { background: #f1e8fb; border-radius: 5px; }
.calendar-more-popover { max-width: calc(100vw - 24px); max-height: min(70vh, 600px); overflow-y: auto; border-radius: 12px; border-color: var(--line); box-shadow: 0 8px 24px rgba(42, 32, 50, .1); }
:is(#teacherCalendar, .calendar-more-popover) .lesson-status-cancelled { border-left-style: dashed; }
:is(#teacherCalendar, .calendar-more-popover) .lesson-status-cancelled .calendar-lesson-group { text-decoration: line-through; }
.app-shell .lesson-drawer-header, .app-shell .lesson-drawer-footer { border-color: var(--line); }
.app-shell .lesson-drawer-title { font-weight: 600; letter-spacing: -.3px; }

/* Shared sections, including the methodist workspace. */
.app-shell > div:last-child, .app-main, .app-main .panel,
.app-main :is(.entity-main, .info-item, .section-head > div, .page-header > div) { min-width: 0; }
.app-shell .nav-icon { display: flex; width: 19px; flex: 0 0 19px; align-items: center; justify-content: center; }
.app-shell .nav-icon svg, .app-shell .mobile-menu-button svg { display: block; }
.app-shell .role-box-label { font-size: 10px; }
.app-shell .role-box-value { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.app-shell .role-select { width: 100%; min-width: 0; }
.app-shell .profile-copy strong { font-size: 11px; font-weight: 550; overflow-wrap: anywhere; }
.app-shell .nav-link > span:not(.nav-icon) { min-width: 0; }
.app-shell .nav-badge { margin-left: auto; }
.app-main :is(h1, h2, h3, .entity-title, .note-box, .info-value, .page-subtitle) { overflow-wrap: anywhere; }
.app-main :is(.section-title, .teacher-group-detail-panel h2, .teacher-next-lesson h2, .teacher-lessons-history h2) { font-size: 18px; font-weight: 600; }
.app-main :is(.content-stack, .teacher-group-detail-grid) { gap: 18px; }
.app-main :is(.section-card, .teacher-group-detail-panel, .teacher-next-lesson, .teacher-lessons-history) { padding: 22px; }
.app-main .teacher-group-detail-header h1 { font-size: 27px; font-weight: 650; letter-spacing: -.6px; }
.app-main :is(.page-back, .teacher-group-back) { font-size: 12px; font-weight: 500; }
.app-main :is(.info-label, .finance-label, .form-section-title) { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.app-main .entity-actions { flex-wrap: wrap; }
.app-main :is(.ui-form, .form-actions, .header-actions) { min-width: 0; }
.app-main :is(input, select, textarea) { max-width: 100%; }
.app-main :is(.table-wrap, .table-scroll, .teacher-lessons-table-wrap, .homework-history-scroll) { max-width: 100%; overflow-x: auto; }
.app-main .btn-danger { border-color: #f0cbd5; background: #fae7ec; color: #9f2f50; }
.app-main .btn-danger:hover { background: #f6d7e0; }

/* Existing feedback and income screens retain their fields and states. */
.app-main .feedback-scope { gap: 24px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.app-main .feedback-scope .btn { padding: 10px 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.app-main .feedback-scope [aria-current=page] { color: var(--purple); box-shadow: inset 0 -2px var(--purple); }
.app-main :is(.feedback-month, .income-month) { padding: 16px 18px; border-radius: 16px; }
.app-main :is(.feedback-month strong, .income-month strong) { font-size: 16px; font-weight: 600; }
.app-main :is(.feedback-month-arrow, .income-month-arrow) { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.app-main .feedback-stat span, .app-main .income-label, .app-main .income-month span { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.app-main .income-total { font-size: 32px; font-weight: 600; }
.app-main .income-stat-card strong { font-size: 24px; font-weight: 550; }
.app-main :is(.income-card-heading h2, .income-lessons-header h2) { font-size: 18px; font-weight: 600; }
.app-main .income-rating-value { font-size: 28px; font-weight: 600; }
.app-main :is(.income-table, .finance-table) { font-size: 12px; }
.app-main :is(.income-table th, .finance-table th) { padding: 11px 14px; background: #faf9fc; color: var(--muted); font-size: 10px; font-weight: 500; }
.app-main .income-table td { padding: 15px 14px; }

/* Decorate native dialogs without changing open/hidden states or size modes. */
.app-main :is(.approval-dialog, .client-archive-dialog) { border-radius: 16px; padding: 22px 24px; box-shadow: 0 20px 60px #23143930; }
.app-main :is(.approval-dialog, .client-archive-dialog, .task-dialog)::backdrop { background: #23143970; }
.app-main :is(.approval-dialog h2, .client-archive-dialog h2, .lesson-drawer-title) { font-size: 20px; }
.app-main :is(.lesson-drawer-header, .lesson-drawer-footer) { padding: 18px 22px; }
.app-main .lesson-drawer-body { padding: 20px 22px; }
.app-main .task-dialog:not(.task-dialog-quick) { border-radius: 16px; }
.app-main .task-dialog:not(.task-dialog-quick) .task-dialog-toolbar { padding: 12px 20px; }
.app-main .task-dialog:not(.task-dialog-quick) .task-dialog-body { padding: 22px 24px; }

/* Keep compact task calendars, quick-create and transition hooks. */
.app-main .task-workspace-header h1 { font-size: 27px; font-weight: 650; letter-spacing: -.6px; }
.app-main :is(.task-view-tabs, .approval-tabs) { gap: 24px; }
.app-main :is(.task-section h2, .approval-heading h2) { font-size: 18px; font-weight: 600; }
.app-main .task-section { padding: 22px; }
.app-main .task-dialog .task-section { padding: 18px 0; }
.app-main .task-column { background: #f5f2f8; border-radius: 12px; }
.app-main .task-column h2 { background: #f5f2f8; font-weight: 550; }
.app-main .task-column.task-drop-target { background: #eee4fa; }
.app-main .task-card { border-radius: 10px; padding: 13px; box-shadow: none; }
.app-main .task-card-title strong { font-weight: 550; }
.app-main .task-view-tabs a { font-size: 12px; }
.app-main .approval-card { padding: 22px; border-radius: 16px; }
.app-main .approval-filters { align-items: end; }
.app-main .approval-muted { font-size: 11px; }
@media (min-width: 781px) and (max-width: 1200px) {
    .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
    .app-shell .sidebar { padding: 22px 12px 16px; }
    .app-shell .sidebar-brand { gap: 8px; padding-left: 0; padding-right: 0; }
    .app-shell .sidebar-logo { width: 34px; height: 34px; flex-basis: 34px; }
    .app-shell .sidebar-brand-name { font-size: 22px; }
    .app-main { padding: 24px 20px; }
    .app-shell .teacher-group-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; }
    .app-shell .teacher-group-card-top { grid-column: 1; grid-row: 1; }
    .app-shell .teacher-group-meta { grid-column: 1; grid-row: 2; }
    .app-shell .teacher-group-card > .teacher-group-section:nth-of-type(3) { grid-column: 2; grid-row: 1 / span 2; }
    .app-shell .teacher-group-card > .teacher-group-section:nth-of-type(4) { grid-column: 1; grid-row: 3; }
    .app-shell .teacher-group-card-footer { grid-column: 2; grid-row: 3; justify-self: end; }
}
@media (max-width: 780px) {
    .app-shell { display: block; }
    .app-shell .sidebar { width: min(280px, 86vw); }
    .app-main { padding: 22px 14px 32px; }
    .app-shell .page-header h1, .app-shell .page-title { font-size: 26px; }
    .app-shell .sidebar { padding: 22px 16px 16px; }
    .app-shell .entity-row { padding: 17px 4px; }
    .app-shell .teacher-group-card { display: flex; gap: 12px; padding: 18px; }
    .app-shell .teacher-group-card-top { width: 100%; }
    .app-shell .teacher-group-meta { margin: 0; }
    .app-shell .teacher-group-card-footer { align-self: stretch; justify-content: space-between; padding-top: 10px; }
    .app-shell .feedback-card { padding: 18px; }
    .app-shell .feedback-card-header h2 { font-size: 20px; }
    .app-shell .calendar-panel { padding: 12px; }
    #teacherCalendar .calendar-lesson-content { padding: 8px; }
    .app-main .finance-table td { padding-top: 16px; padding-bottom: 16px; }
    .app-main :is(.btn, .income-month-arrow, .feedback-month-arrow), .app-shell .nav-link { min-height: 44px; }
    .app-main :is(input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="url"], select, textarea) { font-size: 16px; }
    .app-main .task-quick-form .task-form :is(input, select, textarea) { font-size: 16px; }
    .app-main .task-dialog-quick .btn { min-height: 36px; }
    .app-main :is(.section-card, .teacher-group-detail-panel, .teacher-next-lesson, .teacher-lessons-history, .task-section, .approval-card) { padding: 18px; }
    .app-main .task-dialog .task-section { padding: 16px 0; }
    .app-main :is(.page-header-actions, .header-actions, .form-actions) { flex-wrap: wrap; }
    .app-main :is(.task-workspace-header h1, .teacher-group-detail-header h1) { font-size: 24px; }
    .app-main .task-dialog:not(.task-dialog-quick) .task-dialog-body { padding: 16px; }
    .app-main :is(.approval-dialog, .client-archive-dialog) { padding: 20px; }
    .app-main .approval-filters :is(input, select) { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell .btn, .app-shell .nav-link, .app-shell .teacher-group-card { transition: none; }
}

/* Conducted lessons awaiting a recording remain green, with a red outline. */
.app-shell .status-pill.is-completed_no_recording,
.app-shell .teacher-history-status.is-completed_no_recording,
.app-shell .lesson-detail-status.is-completed_no_recording {
    background: #e6f5ec;
    color: #216b43;
    border: 2px solid #c43d4b;
}
:is(#teacherCalendar, .calendar-more-popover) .millimon-calendar-event.lesson-status-completed_no_recording {
    --subject-text: #216b43;
    background: #e6f5ec;
    color: #216b43;
    border: 2px solid #c43d4b;
}
:is(.app-shell, .calendar-more-popover) .calendar-status-dot.status-completed_no_recording,
.app-shell .drawer-status-dot.status-completed_no_recording,
.app-shell .lesson-detail-status.is-completed_no_recording .lesson-detail-status-dot {
    background: #329b62;
    box-shadow: 0 0 0 2px #c43d4b;
}
