:root { --sidebar-width: 280px; --navy: #082f55; --blue: #0b4479; --blue-light: #eaf2f9; --surface: #f4f6f9; --text: #1f2a35; --muted: #71808e; --border: #e4e9ef; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-width); flex-shrink: 0; display: flex; flex-direction: column; padding: 1.4rem 1rem; background: linear-gradient(180deg, #0b457a 0%, var(--navy) 100%); color: #fff; z-index: 1045; }
.sidebar-brand { display: flex; align-items: center; gap: .8rem; padding: .4rem .55rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-brand img { width: 56px; height: 56px; object-fit: contain; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.08); }
.sidebar-brand div { min-width: 0; display: grid; }
.sidebar-brand strong { font-size: .96rem; }
.sidebar-brand span { color: rgba(255,255,255,.6); font-size: .72rem; }
.sidebar-nav { display: grid; gap: .42rem; padding-top: 1.5rem; }
.sidebar-nav a { display: flex; align-items: center; color: rgba(255,255,255,.76); text-decoration: none; padding: .82rem 1rem; border-radius: 12px; font-size: .94rem; font-weight: 650; transition: .18s ease; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: rgba(255,255,255,.11); transform: translateX(2px); }
.sidebar-footer { margin-top: auto; padding: 1rem .8rem .25rem; color: rgba(255,255,255,.6); font-size: .78rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #69d8a0; margin-right: .45rem; }
.sidebar-backdrop { display: none; }
.app-main { min-width: 0; flex: 1; }
.topbar { position: sticky; top: 0; z-index: 1030; min-height: 78px; display: flex; align-items: center; padding: .9rem 1.7rem; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-title span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.user-chip { align-items: center; gap: .7rem; }
.avatar, .mini-avatar, .profile-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--blue-light); color: var(--blue); font-weight: 850; }
.avatar { width: 39px; height: 39px; font-size: .78rem; }
.user-chip div:last-child { display: grid; }
.user-chip strong { font-size: .86rem; }
.user-chip span { color: var(--muted); font-size: .72rem; }
.menu-toggle { border: 0; background: transparent; font-size: 1.5rem; margin-right: 1rem; color: var(--navy); }
.content-area { padding: 2rem; max-width: 1500px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-end; margin-bottom: 1.7rem; }
.page-heading h1 { margin: .25rem 0 .3rem; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading-actions { align-items: center; }
.section-kicker { color: var(--blue); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 850; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.metric-card, .content-card, .filter-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 28px rgba(27,52,77,.05); }
.metric-card { display: flex; align-items: center; gap: 1rem; padding: 1.35rem; }
.metric-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--blue-light); color: var(--blue); font-weight: 900; }
.metric-card span { display: block; color: var(--muted); font-size: .82rem; }
.metric-card strong { display: block; margin-top: .15rem; font-size: 1.65rem; }
.content-card { padding: 1.35rem; }
.filter-card { padding: 1rem; margin-bottom: 1rem; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-heading h2 { margin: .2rem 0 0; font-size: 1.1rem; font-weight: 800; }
.table > :not(caption) > * > * { padding: 1rem 1.15rem; border-color: #edf0f3; }
.table thead th { background: #f8fafc; color: #657381; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.activity-table td, .account-table td { font-size: .88rem; }
.event-pill { display: inline-flex; padding: .3rem .55rem; border-radius: 999px; background: #f0f5f9; color: #365d7e; font-size: .72rem; font-weight: 700; }
.empty-state { min-height: 150px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong { color: #3a4652; }
.empty-state span { font-size: .85rem; }
.table-user { display: flex; align-items: center; gap: .75rem; }
.mini-avatar { width: 37px; height: 37px; flex: 0 0 auto; font-size: .7rem; }
.table-user div:last-child { display: grid; }
.table-user span { color: var(--muted); font-size: .72rem; }
.role-badge, .status-badge { display: inline-flex; align-items: center; padding: .32rem .58rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.role-director { background: #e8f0fb; color: #234f7c; }.role-administrativo { background: #f4ecff; color: #714a9c; }.role-docente { background: #eaf8f2; color: #287154; }
.status-badge.is-active { background: #eaf8f1; color: #277050; }.status-badge.is-inactive { background: #faeded; color: #a24343; }
.form-card { max-width: 760px; }.narrow-card { max-width: 760px; }.form-label { font-weight: 650; }.form-control, .form-select { border-radius: 11px; border-color: #d7dfe7; }.form-control:focus, .form-select:focus { border-color: #5686ae; box-shadow: 0 0 0 .2rem rgba(11,68,121,.09); }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.btn { border-radius: 10px; font-weight: 700; }.btn-primary { background: var(--blue); border-color: var(--blue); }.btn-primary:hover { background: #083a68; border-color: #083a68; }
.back-link { display: block; width: fit-content; margin-bottom: .75rem; color: var(--blue); text-decoration: none; font-weight: 650; font-size: .88rem; }
.detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }.detail-label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: .35rem; }.detail-value { font-size: 1rem; }
.profile-hero { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }.profile-avatar { width: 66px; height: 66px; font-size: 1.05rem; }.profile-hero h2 { margin: 0; font-size: 1.3rem; }.profile-hero span { color: var(--muted); }.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; padding-top: 1.3rem; }.profile-grid div { display: grid; }.profile-grid span { color: var(--muted); font-size: .78rem; }.profile-grid strong { margin-top: .2rem; font-size: .92rem; }
.one-time-shell { max-width: 760px; margin: 3rem auto; }.one-time-card { padding: 2rem; }.one-time-card h1 { font-size: 1.65rem; font-weight: 800; margin: .4rem 0 .6rem; }.success-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #e6f7ef; color: #23845b; font-size: 1.6rem; font-weight: 900; margin-bottom: 1rem; }.credential-box { display: grid; gap: .35rem; padding: 1rem; border-radius: 14px; background: #f7f9fb; border: 1px solid var(--border); }.credential-box > span { color: var(--muted); font-size: .75rem; }.temporary-password-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }.temporary-password-row code { font-size: 1.1rem; color: var(--navy); overflow-wrap: anywhere; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 991.98px) { .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(4,26,48,.22); }.sidebar.is-open { transform: translateX(0); }.sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(4,24,42,.42); }.sidebar-backdrop.is-visible { display: block; }.content-area { padding: 1.25rem; }.topbar { padding: .8rem 1.1rem; } }
@media (max-width: 767px) { .metrics-grid, .detail-grid, .profile-grid { grid-template-columns: 1fr; }.page-heading, .page-heading-actions { align-items: stretch; flex-direction: column; }.page-heading-actions .btn { width: 100%; }.content-card { border-radius: 15px; }.temporary-password-row { align-items: stretch; flex-direction: column; }.topbar { min-height: 68px; } }

/* Reglamentos y documentos */
.document-heading { align-items: center; }
.document-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: -.45rem 0 1rem; color: var(--muted); font-size: .84rem; }
.document-breadcrumbs a { color: var(--blue); text-decoration: none; font-weight: 650; }
.document-breadcrumbs strong { color: var(--text); font-weight: 750; }
.document-filter-card { padding: 1.15rem; }
.document-search-summary { padding: .85rem 1rem; border: 1px solid #dce7f1; border-radius: 12px; background: #f6faff; color: #49647d; font-size: .86rem; }
.document-section-heading { margin-bottom: .8rem; }
.document-section-heading h2 { font-size: 1.05rem; }
.document-count { min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 .55rem; border-radius: 999px; background: var(--blue-light); color: var(--blue); font-size: .75rem; font-weight: 850; }
.folder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.folder-card { min-width: 0; display: flex; align-items: center; gap: .85rem; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 16px; color: inherit; text-decoration: none; box-shadow: 0 8px 24px rgba(27,52,77,.04); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.folder-card:hover { transform: translateY(-2px); border-color: #b9ccdc; box-shadow: 0 12px 30px rgba(27,52,77,.08); }
.folder-card-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: #fff3d9; color: #b67a08; font-size: 1.1rem; }
.folder-card-body { min-width: 0; display: grid; gap: .15rem; }
.folder-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.folder-card-body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .74rem; }
.folder-card-arrow { margin-left: auto; color: #8193a4; font-weight: 800; }
.document-empty-state { min-height: 125px; }
.document-table td { font-size: .84rem; }
.document-name-cell { display: flex; align-items: center; gap: .75rem; min-width: 260px; }
.document-name-cell > div:last-child { min-width: 0; display: grid; }
.document-name-cell strong { max-width: 430px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-name-cell span { color: var(--muted); font-size: .72rem; }
.document-type-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: #edf4fa; color: var(--blue); font-size: .63rem !important; font-weight: 900; }
.file-extension-pill { display: inline-flex; padding: .28rem .5rem; border-radius: 999px; background: #f1f4f7; color: #526272; font-size: .67rem; font-weight: 850; }
.document-location { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #526272; font-size: .78rem; }
.upload-dropzone { padding: 1.4rem; border: 1px dashed #b8cad9; border-radius: 15px; background: #f8fbfd; }
.upload-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: .8rem; border-radius: 12px; background: var(--blue-light); color: var(--blue); font-size: 1.25rem; font-weight: 900; }

@media (max-width: 1150px) { .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .folder-grid { grid-template-columns: 1fr; }.document-name-cell strong { max-width: 220px; } }

/* Etapa 3: interacción documental, papelera y movimiento */
.sidebar-nav .sidebar-subitem { margin-left: .85rem; padding: .62rem .9rem; font-size: .82rem; justify-content: space-between; border-left: 1px solid rgba(255,255,255,.16); border-radius: 0 10px 10px 0; }
.sidebar-subitem small { color: rgba(255,255,255,.48); font-size: .66rem; font-weight: 700; }

.reveal-up { opacity: 0; transform: translateY(12px); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1); }
.reveal-up.is-visible { opacity: 1; transform: translateY(0); }

.folder-card { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.folder-card:hover { transform: translateY(-3px); box-shadow: 0 1rem 2.4rem rgba(16,43,70,.10); }
.folder-card-main { display: flex; align-items: center; width: 100%; color: inherit; text-decoration: none; gap: 1rem; }
.folder-delete-form { position: absolute; top: .7rem; right: .7rem; z-index: 4; }
.icon-action { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid transparent; background: rgba(255,255,255,.92); font-size: 1.2rem; line-height: 1; transition: .18s ease; }
.icon-action.danger { color: #b42318; border-color: #f4c7c3; }
.icon-action.danger:hover { background: #fff1f0; transform: scale(1.06); }
.drop-hint { position: absolute; inset: auto 0 0 0; padding: .5rem; text-align: center; background: #0b4e86; color: #fff; font-size: .75rem; font-weight: 750; transform: translateY(100%); transition: transform .18s ease; }
.folder-drop-target.is-drag-over { border-color: #2b78bd; box-shadow: 0 0 0 4px rgba(43,120,189,.12), 0 1rem 2.4rem rgba(16,43,70,.12); transform: translateY(-4px) scale(1.01); }
.folder-drop-target.is-drag-over .drop-hint { transform: translateY(0); }
.root-drop-target { transition: .18s ease; border-radius: 8px; padding: .2rem .45rem; margin-left: -.45rem; }
.root-drop-target.is-drag-over { background: #dfeefa; color: #084b81; box-shadow: 0 0 0 3px rgba(43,120,189,.12); }

.document-table-card { transition: box-shadow .2s ease; }
.document-row { transition: background .18s ease, transform .18s ease, opacity .18s ease; }
.document-row:hover { background: #f8fbfe; }
.document-row.is-selected { background: #edf6ff; box-shadow: inset 3px 0 #2b78bd; }
.document-row.is-dragging { opacity: .45; }
.document-row[draggable="true"] { cursor: grab; }
.document-row[draggable="true"]:active { cursor: grabbing; }
.selection-column { width: 42px; text-align: center; }
.selection-toolbar { position: sticky; top: 88px; z-index: 20; margin-bottom: .8rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; border: 1px solid #cfe3f5; border-radius: 14px; background: rgba(238,247,255,.96); backdrop-filter: blur(10px); box-shadow: 0 .8rem 2rem rgba(16,43,70,.08); animation: toolbarIn .2s ease both; }
.selection-toolbar[hidden] { display: none !important; }
@keyframes toolbarIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.pagination-shell { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.2rem; color: var(--muted); font-size: .88rem; }
.page-button { display: inline-flex; align-items: center; padding: .55rem .8rem; background: #fff; color: var(--blue); border: 1px solid #dce5ee; border-radius: 10px; text-decoration: none; font-weight: 750; transition: .18s ease; }
.page-button:hover { transform: translateY(-1px); border-color: #9fc2df; box-shadow: 0 .5rem 1.2rem rgba(16,43,70,.08); }

.move-dialog { width: min(560px, calc(100vw - 2rem)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 2rem 5rem rgba(13,38,63,.24); }
.move-dialog::backdrop { background: rgba(7,28,47,.45); backdrop-filter: blur(4px); }
.move-dialog form { padding: 1.6rem; }
.dialog-heading h2 { margin: .25rem 0 .4rem; }
.dialog-heading p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.4rem; }

.trash-notice { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem 1.15rem; background: linear-gradient(135deg, #f2f8fe, #fff); border: 1px solid #d6e8f7; border-radius: 16px; }
.trash-notice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #e1f0fb; color: #0b4e86; font-size: 1.3rem; font-weight: 800; }
.trash-notice div:last-child { display: grid; gap: .15rem; }
.trash-notice span { color: var(--muted); font-size: .86rem; }
.trash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.trash-card { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 .5rem 1.5rem rgba(16,43,70,.05); transition: transform .18s ease, box-shadow .18s ease; }
.trash-card:hover { transform: translateY(-2px); box-shadow: 0 .9rem 2rem rgba(16,43,70,.09); }
.trash-card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #fff1d6; color: #b97800; }
.trash-card-body { display: grid; gap: .18rem; }
.trash-card-body span, .trash-card-body small { color: var(--muted); }
.trash-card-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding-top: .7rem; border-top: 1px solid #edf0f4; }

@media (max-width: 767.98px) {
  .selection-toolbar { top: 74px; align-items: flex-start; flex-direction: column; }
  .document-actions { min-width: 170px; }
  .pagination-shell { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal-up { opacity: 1; transform: none; }
}

/* Microinteracciones globales para una interfaz más actual */
.btn { transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 .55rem 1.2rem rgba(11,68,121,.18); }
.content-card, .metric-card, .filter-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 1rem 2rem rgba(16,43,70,.09); }
.filter-card:focus-within { border-color: #bdd5e9; box-shadow: 0 .8rem 2rem rgba(16,43,70,.07); }
.form-control, .form-select { transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 .22rem rgba(43,120,189,.12); }

/* Etapa 4: Docentes y Tareas */
.teacher-metrics { margin-bottom: 1rem; }
.teacher-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.teacher-card { padding: 1rem; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg,#fff,#fbfdff); box-shadow: 0 .55rem 1.4rem rgba(16,43,70,.045); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.teacher-card:hover { transform: translateY(-2px); border-color: #c7d9e8; box-shadow: 0 .9rem 2rem rgba(16,43,70,.08); }
.teacher-card-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.teacher-card-head .mini-avatar { width: 44px; height: 44px; flex: 0 0 auto; }
.teacher-card-identity { min-width: 0; display: grid; }
.teacher-card-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-card-identity span { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-task-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; margin-top: 1rem; }
.teacher-task-stats span { display: grid; gap: .1rem; padding: .55rem; border-radius: 11px; background: #f6f9fc; color: var(--muted); font-size: .68rem; text-align: center; }
.teacher-task-stats strong { color: var(--text); font-size: 1.02rem; }
.teacher-overdue-note { margin-top: .7rem; padding: .5rem .7rem; border-radius: 10px; background: #fff1f0; color: #a52b22; font-size: .76rem; font-weight: 700; }
.task-list-compact { display: grid; gap: .65rem; }
.task-compact-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1px solid #edf1f5; border-radius: 13px; color: inherit; text-decoration: none; transition: .18s ease; }
.task-compact-row:hover { background: #f8fbfe; border-color: #cfe0ee; transform: translateX(2px); }
.task-compact-row > div:first-child { min-width: 0; display: grid; }
.task-compact-row > div:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-compact-row span { color: var(--muted); font-size: .75rem; }
.task-compact-due { display: grid; text-align: right; }
.task-compact-due strong { font-size: .82rem; }
.task-form-card { max-width: 1000px; }
.task-description-input { resize: vertical; min-height: 150px; }
.evidence-toggle { width: 100%; display: flex; align-items: flex-start; gap: .75rem; padding: .9rem; border: 1px solid #dbe6ef; border-radius: 13px; background: #f8fbfe; cursor: pointer; }
.evidence-toggle span { display: grid; gap: .12rem; }
.evidence-toggle small, .form-hint { color: var(--muted); font-size: .75rem; }
.teacher-multi-select { min-height: 170px; }
.task-upload-zone { padding: 1rem; border: 1px dashed #b8cad9; border-radius: 14px; background: #f8fbfd; }
.task-upload-zone > span { display: block; margin-top: .55rem; color: var(--muted); font-size: .75rem; }
.assigned-teachers-summary { padding: .95rem; border: 1px solid #e2e8ef; border-radius: 13px; background: #fbfcfd; }
.assigned-teacher-pills { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.assigned-teacher-pills span { padding: .35rem .6rem; border-radius: 999px; background: #eaf2f9; color: #255b86; font-size: .75rem; font-weight: 700; }
.existing-attachments { display: grid; gap: .55rem; padding: .9rem; border: 1px solid #e4e9ef; border-radius: 13px; }
.attachment-remove-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .55rem .65rem; border-radius: 9px; background: #f8fafc; }
.attachment-remove-row > span:first-child { min-width: 0; display: grid; }
.attachment-remove-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.attachment-remove-row small { color: var(--muted); font-size: .7rem; }
.remove-check { white-space: nowrap; color: #a52b22; font-size: .75rem; font-weight: 700; }
.task-form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid #edf0f3; }
.form-error { margin-top: .35rem; color: #b42318; font-size: .75rem; }

.task-detail-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(260px,.7fr); gap: 1rem; align-items: start; }
.task-detail-title-row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.task-detail-title-row h2 { margin: .2rem 0 0; font-size: 1.12rem; }
.evidence-rule { display: inline-flex; padding: .38rem .62rem; border-radius: 999px; background: #f0f3f6; color: #657381; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.evidence-rule.required { background: #fff3dd; color: #946200; }
.task-description-box { line-height: 1.65; padding: 1rem; border-radius: 13px; background: #f8fafc; border: 1px solid #edf1f4; }
.task-attachments-block { display: grid; gap: .65rem; margin-top: 1.25rem; }
.attachment-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.attachment-list.compact { margin-top: .55rem; }
.attachment-chip { min-width: 210px; max-width: 360px; display: flex; align-items: center; gap: .65rem; padding: .62rem .75rem; border: 1px solid #dce6ee; border-radius: 11px; color: inherit; text-decoration: none; background: #fff; transition: .16s ease; }
.attachment-chip:hover { border-color: #9fc2df; background: #f8fbfe; transform: translateY(-1px); }
.attachment-chip > span:last-child { min-width: 0; display: grid; }
.attachment-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.attachment-chip small { color: var(--muted); font-size: .68rem; }
.attachment-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #eaf2f9; color: #0b4479; font-size: .58rem; font-weight: 900; }
.task-stats-panel { position: sticky; top: 96px; display: grid; gap: .2rem; }
.task-stat-line { display: flex; justify-content: space-between; align-items: center; padding: .72rem 0; border-bottom: 1px solid #edf0f3; }
.task-stat-line span { color: var(--muted); font-size: .8rem; }
.task-stat-line strong { font-size: 1rem; }
.task-stat-line.danger strong { color: #b42318; }
.assignment-review-list { display: grid; gap: 1rem; }
.assignment-review-card { padding: 1rem; border: 1px solid #e1e7ed; border-radius: 15px; background: #fcfdff; }
.assignment-review-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.assignment-status-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.task-status { display: inline-flex; align-items: center; padding: .34rem .58rem; border-radius: 999px; font-size: .69rem; font-weight: 850; }
.task-status.large { padding: .48rem .75rem; font-size: .76rem; }
.status-pendiente { background: #eef2f6; color: #536475; }
.status-en_revision { background: #e7f2ff; color: #155b91; }
.status-devuelta { background: #fff3dd; color: #936000; }
.status-completada { background: #e6f7ed; color: #197142; }
.task-status.overdue { background: #fff0ef; color: #b42318; }
.submission-stack { display: grid; gap: .7rem; }
.submission-card { padding: .85rem; border: 1px solid #e8edf2; border-radius: 12px; background: #fff; }
.submission-card p { margin: .55rem 0 0; color: #425363; font-size: .85rem; white-space: pre-wrap; }
.submission-meta { display: flex; justify-content: space-between; gap: 1rem; }
.submission-meta strong, .submission-meta span { font-size: .75rem; }
.assignment-no-delivery { padding: .8rem; border-radius: 11px; background: #f7f9fb; color: var(--muted); font-size: .8rem; }
.review-actions { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #edf0f3; }
.return-task-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.return-task-form textarea { min-height: 72px; }
.task-history-details { margin-top: .9rem; border-top: 1px solid #edf0f3; padding-top: .8rem; }
.task-history-details summary { cursor: pointer; color: #255b86; font-size: .78rem; font-weight: 750; }
.task-timeline { display: grid; margin-top: .8rem; }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: .7rem; padding: 0 0 1rem; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 12px; bottom: 0; width: 1px; background: #dce5ed; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: .25rem; border-radius: 50%; background: #2b78bd; box-shadow: 0 0 0 4px #edf6ff; }
.timeline-item > div { display: grid; }
.timeline-item strong { font-size: .82rem; }
.timeline-item small { color: var(--muted); font-size: .69rem; }
.timeline-item p { margin: .3rem 0 0; color: #536475; font-size: .8rem; white-space: pre-wrap; }

.teacher-task-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.teacher-task-card { display: grid; gap: .8rem; padding: 1.1rem; border-radius: 17px; border: 1px solid var(--border); background: #fff; color: inherit; text-decoration: none; box-shadow: 0 .65rem 1.8rem rgba(16,43,70,.05); transition: .2s ease; }
.teacher-task-card:hover { transform: translateY(-3px); border-color: #bed5e7; box-shadow: 0 1rem 2.2rem rgba(16,43,70,.09); }
.teacher-task-card-top { display: flex; flex-wrap: wrap; gap: .4rem; }
.teacher-task-card-body h2 { margin: .25rem 0 .35rem; font-size: 1.08rem; }
.teacher-task-card-body p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.teacher-task-card-footer { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: .7rem; padding-top: .8rem; border-top: 1px solid #edf0f3; }
.teacher-task-card-footer div { display: grid; }
.teacher-task-card-footer span { color: var(--muted); font-size: .67rem; }
.teacher-task-card-footer strong { font-size: .75rem; }
.deadline-display { display: grid; gap: .25rem; margin-top: .75rem; padding: .9rem; border-radius: 13px; background: #f7fafc; }
.deadline-display span, .deadline-display small { color: var(--muted); font-size: .75rem; }
.deadline-display strong { font-size: .98rem; }
.deadline-display.overdue { background: #fff2f1; }
.deadline-display.overdue strong { color: #a52b22; }
.returned-observation { margin-bottom: 1rem; padding: .9rem; border: 1px solid #f0d6a6; border-radius: 12px; background: #fff9ec; }
.returned-observation p { margin: .35rem 0 0; white-space: pre-wrap; }
.review-waiting-state { display: flex; align-items: center; gap: .85rem; padding: .8rem; }
.review-waiting-state > div:last-child { display: grid; }
.review-waiting-state span { color: var(--muted); font-size: .8rem; }
.review-waiting-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #e7f2ff; color: #155b91; font-weight: 900; }
.review-waiting-state.completed .review-waiting-icon { background: #e6f7ed; color: #197142; }

@media (max-width: 980px) {
  .teacher-grid, .teacher-task-grid { grid-template-columns: 1fr; }
  .task-detail-layout { grid-template-columns: 1fr; }
  .task-stats-panel { position: static; }
  .review-actions { grid-template-columns: 1fr; }
  .return-task-form { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .teacher-task-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-compact-row { grid-template-columns: 1fr auto; }
  .task-compact-due { display: none; }
  .task-detail-title-row, .assignment-review-head { align-items: flex-start; flex-direction: column; }
  .assignment-status-stack { justify-content: flex-start; }
  .attachment-chip { min-width: 100%; max-width: 100%; }
  .submission-meta { flex-direction: column; gap: .15rem; }
}

/* Búsqueda reactiva y feedback de movimiento */
.live-search-hint { display: block; margin-top: .35rem; color: var(--muted); font-size: .7rem; }
#documentResults { transition: opacity .16s ease; }
#documentResults.is-loading { opacity: .48; pointer-events: none; }
.app-toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2000; max-width: min(420px, calc(100vw - 2.5rem)); padding: .8rem 1rem; border-radius: 12px; background: #163d60; color: #fff; box-shadow: 0 1rem 2.4rem rgba(8,47,85,.24); opacity: 0; transform: translateY(10px); transition: .2s ease; font-size: .82rem; font-weight: 700; }
.app-toast.is-visible { opacity: 1; transform: translateY(0); }
.app-toast-danger { background: #9e2f27; }

/* Navegación accesible de papeleras desplegables */
.sidebar-nav{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#6189aa transparent;padding-bottom:.8rem}
.sidebar-nav-group{min-width:0;display:grid;gap:.25rem}.sidebar-nav-row{display:flex;align-items:center;min-width:0}.sidebar-nav-row>a{flex:1;min-width:0}.sidebar-group-toggle{flex:0 0 34px;border:0;background:transparent;color:#b8d6ec;border-radius:10px;height:38px;display:grid;place-items:center;cursor:pointer}.sidebar-group-toggle:hover,.sidebar-group-toggle:focus-visible{background:#ffffff22;color:#fff;outline:2px solid #89c6e7;outline-offset:1px}.sidebar-group-toggle span{font-size:1.25rem;transition:transform .2s ease}.sidebar-group-toggle[aria-expanded=true] span{transform:rotate(180deg)}.sidebar-submenu{border-left:1px solid #5a86a7;margin-left:.45rem;padding-left:.4rem}.sidebar-submenu[hidden]{display:none!important}.sidebar-submenu a.sidebar-subitem{display:flex;justify-content:space-between;align-items:center;gap:.5rem;font-size:.81rem;padding:.7rem .8rem}.sidebar-subitem small{color:#9fbed4;font-size:.69rem;white-space:nowrap}.sidebar-privacy{margin-top:.6rem}.sidebar-privacy a{color:#c4deef;font-size:.75rem;text-underline-offset:3px}
@media(prefers-reduced-motion:reduce){.sidebar-group-toggle span{transition:none}}
.sidebar-nav{flex:1 1 auto;min-height:0;align-content:start}
