:root{
  --bg:#f2f4f8;
  --card:#ffffff;
  --modal-background:rgba(47, 52, 65, 0.98);
  --modal-background-header:rgba(201, 211, 240, 0.96);
  --bg-shell:rgba(220, 222, 227, 0.85)
  --bg-shell2:rgba(185, 206, 255, 0.35)
  --ink:#101828;
  --muted:#5d6b82;
  --primary:#0b4dd8;
  --accent:#f59e0b;
  --border:#e2e8f0;
  --shadow:0 20px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft:0 12px 30px rgba(15, 23, 42, 0.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:"Space Grotesk","Manrope","Segoe UI",system-ui,sans-serif;
  background:linear-gradient(160deg,#f4f6fb 0%,#f0f4ff 40%,#f8f3e7 100%);
  color:var(--ink);
  min-height:100vh;
}
.bg-orb{position:fixed;border-radius:50%;filter:blur(0);opacity:0.5;z-index:0;}
.orb-1{width:420px;height:420px;background:radial-gradient(circle,#bcd7ff,transparent 70%);top:-120px;left:-80px;}
.orb-2{width:520px;height:520px;background:radial-gradient(circle,#ffd9a8,transparent 70%);bottom:-180px;right:-120px;}
.topbar{
  position:sticky;top:0;z-index:2;
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 32px;background:rgba(15, 41, 81, 0.29);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex;gap:12px;align-items:center;}
.brand-mark{background:var(--primary);color:#fff;border-radius:12px;padding:8px 12px;font-weight:700;}
.brand-title{font-weight:700;}
.brand-sub{font-size:12px;color:var(--muted);}
.topnav{display:flex;gap:16px;}
.nav-link{color:rgba(15, 23, 42, 0.8);text-decoration:none;font-weight:600;}
.nav-link:hover{color:var(--primary);}
.user-chip{display:flex;align-items:center;gap:12px;background:var(--card);padding:8px 12px;border-radius:999px;box-shadow:var(--shadow-soft);}
.issue-button{position:relative;padding-right:10px;}
.su-pill{display:inline-flex;align-items:center;justify-content:center;padding:4px 10px;border-radius:999px;background:#fff7ed;border:1px solid #fdba74;color:#9a3412;font-size:11px;font-weight:700;}
.notif-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;line-height:1;}
.notif-badge.is-empty{background:#94a3b8;}
.logout{color:#c0392b;text-decoration:none;font-weight:600;}
.page{position:relative;z-index:1;padding:32px;display:flex;flex-direction:column;gap:24px;}
.hero{display:flex;justify-content:space-between;gap:24px;align-items:center;}
.hero.compact{align-items:flex-start;}
.eyebrow{text-transform:uppercase;letter-spacing:0.2em;font-size:11px;color:var(--muted);font-weight:700;}
.hero h1{font-size:32px;margin:6px 0;}
.muted{color:var(--muted);}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;}
.btn-primary,.btn-secondary{border:none;border-radius:12px;padding:10px 18px;font-weight:700;text-decoration:none;display:inline-flex;align-items:center;gap:8px;}
.btn-primary{background:var(--primary);color:#fff;box-shadow:0 12px 24px rgba(11,77,216,0.25);}
.btn-secondary{background:var(--card);color:var(--ink);border:1px solid var(--border);}
.btn-outline{background:transparent;color:inherit;border:1px solid currentColor;box-shadow:none;}
.btn-outline{background:transparent;color:inherit;border:1px solid currentColor;box-shadow:none;}
.panel{background:var(--card);border-radius:20px;padding:24px;box-shadow:var(--shadow);border:1px solid var(--border);}
.panel.no-padding{padding:0;overflow:hidden;}
.panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.panel-actions{display:flex;align-items:center;gap:12px;}
.input{padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:#f8fafc;min-width:220px;}
.student-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;}
.student-card{background:linear-gradient(135deg,#ffffff 0%,#f6f7fb 100%);border:1px solid var(--border);border-radius:16px;padding:16px;display:flex;justify-content:space-between;align-items:center;gap:12px;transition:transform 0.15s ease,box-shadow 0.15s ease;position:relative;}
.student-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-soft);}
.student-card.is-hidden{opacity:0.7;border-style:dashed;}
.activity-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.activity-summary-card{border:1px solid var(--border);border-radius:14px;background:linear-gradient(145deg,#fbfcff 0%,#f3f6fb 100%);padding:12px;min-height:96px;display:flex;flex-direction:column;justify-content:space-between;gap:10px;}
.activity-summary-card header{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.activity-summary-card h3{margin:0;font-size:14px;line-height:1.2;}
.activity-count{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-weight:700;font-size:12px;padding:0 8px;}
.activity-pill-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.activity-pill{border:1px solid #cbd5e1;background:#eef2f7;color:#334155;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:700;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
button.activity-pill{cursor:pointer;}
button.activity-pill:hover{background:#e2e8f0;}
.activity-summary-card.is-active .activity-pill:not(.done):not(.more):not(.empty){background:#ffedd5;border-color:#fdba74;color:#9a3412;}
.activity-summary-card.is-active button.activity-pill:not(.done):not(.more):not(.empty):hover{background:#fed7aa;}
.activity-pill.done{background:#dcfce7;border-color:#86efac;color:#166534;}
.activity-pill.more{background:#e2e8f0;color:#475569;}
.activity-pill.empty{background:#f8fafc;color:#64748b;border-style:dashed;}
.student-link{display:flex;justify-content:space-between;align-items:center;gap:12px;text-decoration:none;color:inherit;flex:1;}
.student-name{font-weight:700;font-size:18px;}
.role-badge{margin-left:8px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);background:#eef2ff;color:#3730a3;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;cursor:pointer;}
.role-badge:hover{background:#dbe3ff;}
.student-meta{font-size:12px;color:var(--muted);}
.home-badge{display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:2px 8px;border-radius:999px;border:1px solid #fcd34d;background:#fffbeb;color:#92400e;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.07em;}
.student-arrow{font-size:18px;color:var(--muted);}
.student-action{margin-left:auto;}
.student-action-group{margin-left:auto;display:flex;align-items:center;gap:8px;}
.btn-su{border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:0 10px;min-width:40px;height:32px;font-weight:800;letter-spacing:.04em;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;}
.btn-su:hover{background:#dbeafe;transform:translateY(-1px);box-shadow:0 8px 16px rgba(15,23,42,.1);}
.btn-su:disabled{opacity:.65;cursor:wait;transform:none;box-shadow:none;}
.btn-x{border:1px solid var(--border);background:#fff;color:#c0392b;border-radius:999px;width:32px;height:32px;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform 0.15s ease,box-shadow 0.15s ease;}
.btn-x:hover{transform:translateY(-1px);box-shadow:0 8px 16px rgba(15,23,42,0.1);}
.btn-ghost{border:1px solid var(--border);padding:8px 14px;border-radius:999px;text-decoration:none;color:var(--muted);font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:0.12em;}
.btn-mini{padding:6px 10px;font-size:10px;letter-spacing:0.08em;}
.btn-small{padding:8px 12px;font-size:12px;border-radius:10px;}
.btn-icon{border:1px solid #cbd5e1;background:#f1f5f9;color:#0f172a;border-radius:10px;width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--shadow-soft);}
.btn-icon.active{background:#0b4dd8;color:#fff;border-color:#0b4dd8;}
.btn-icon:hover{transform:translateY(-1px);box-shadow:0 8px 16px rgba(15,23,42,0.12);}
.btn-icon svg{width:16px;height:16px;fill:currentColor;}
.task-controls{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.filters-header h3{margin:0;font-size:16px;}
.task-filters{display:flex;align-items:center;gap:10px;}
.input-filter-name{min-width:180px;width:220px;height:40px;padding:8px 12px;border-radius:12px;border:1px solid #cbd5e1;background:#f8fafc;}
.filter-btn{border:1px solid #cbd5e1;background:#f1f5f9;color:#0f172a;border-radius:12px;width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--shadow-soft);transition:transform 0.15s ease,box-shadow 0.15s ease,background 0.15s ease,border-color 0.15s ease,color 0.15s ease;}
.filter-btn:hover{transform:translateY(-1px);box-shadow:0 8px 16px rgba(15,23,42,0.12);}
.filter-btn svg{width:18px;height:18px;fill:currentColor;}
.filter-btn.mode-all{background:#eef2f7;color:#334155;}
.filter-btn.mode-hide-corrected{background:#fef3c7;color:#92400e;border-color:#fcd34d;}
.filter-btn.mode-hide-delivered{background:#fed7aa;color:#9a3412;border-color:#fdba74;}
.filter-btn.mode-only-corrected{background:#dcfce7;color:#166534;border-color:#86efac;}
.filter-btn.mode-none{background:#eef2f7;color:#334155;}
.filter-btn.mode-due{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe;}
.filter-btn.mode-desc{background:#e2e8f0;color:#0f172a;border-color:#cbd5e1;}
.filter-btn.mode-asc{background:#e0f2fe;color:#0c4a6e;border-color:#bae6fd;}
.actions-col{width:170px;}
.table-actions{gap:8px;}
.input-slim{min-width:120px;}
.actions-col .input{background:#f1f5f9;border-color:#cbd5e1;}
.actions-col .input:focus{outline:2px solid rgba(15,23,42,0.15);}
.link-button{border:none;background:none;color:var(--primary);font-weight:700;cursor:pointer;padding:0;}
.link-button:hover{text-decoration:underline;}
.task-state{display:inline-flex;width:10px;height:10px;border-radius:50%;margin-right:8px;vertical-align:middle;}
.task-state.on{background:#16a34a;}
.task-state.done{background:#0ea5e9;}
.task-state.expired{background:#f59e0b;}
.task-state.off{background:#b91c1c;}
.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:0.12em;text-transform:uppercase;}
.badge.on{background:#dcfce7;color:#166534;border:1px solid #86efac;}
.badge.off{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;}
.inline-form{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;}
.table-actions{display:flex;flex-direction:column;align-items:flex-start;gap:6px;}
.input-slim{padding:8px 10px;min-width:0;width:16ch;font-size:13px;}
.controls-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.table-actions .due-form{flex-basis:100%;flex-direction:column;align-items:flex-start;gap:4px;}
.table-actions .due-form .input{font-size:12px;}
.table-actions .due-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.table-actions .due-date{width:19ch;}
.table-actions .due-time{width:16ch;font-size:11px;}
.hidden-field{display:none;}

.student-badges{display:flex;flex-wrap:wrap;gap:8px;max-width:100%;padding-bottom:2px;}
.student-badge{position:relative;display:flex;align-items:center;justify-content:center;min-width:52px;height:52px;border-radius:14px;background:#e6ecf6;border:1px solid #d2dbea;font-weight:700;font-size:12px;color:var(--ink);}
.student-badge-button{cursor:pointer;}
.student-badge-button:hover{box-shadow:0 6px 14px rgba(15,23,42,0.12);}
.student-badge.grade-color{background:var(--grade-color);border-color:rgba(15,23,42,0.15);color:#fff;}
.student-initials{pointer-events:none;}
.student-badges .badge-rating{position:absolute;top:4px;left:4px;width:18px;height:18px;border-radius:50%;color:#fff;font-size:10px;display:flex;align-items:center;justify-content:center;}
.badge-rating.level-0{background:#b91c1c;}
.badge-rating.level-1{background:#ea580c;}
.badge-rating.level-2{background:#f59e0b;}
.badge-rating.level-3{background:#eab308;}
.badge-rating.level-4{background:#84cc16;}
.badge-rating.level-5{background:#16a34a;}
.status-dot{position:absolute;top:4px;right:4px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;border:2px solid #fff;box-shadow:0 4px 10px rgba(15,23,42,0.18);color:#fff;font-size:9px;display:flex;align-items:center;justify-content:center;}
.status-score{position:absolute;top:-10px;right:10px;background:#0f172a;color:#fff;font-size:9px;padding:1px 5px;border-radius:999px;border:1px solid rgba(255,255,255,0.6);}
.status-dot.pending{background:#f59e0b;}
.status-dot.delivered{background:#16a34a;}
.status-dot.corrected{background:#0f172a;}

.modal{position:fixed;top:40px;left:0;width:100vw;height:100vh;display:none;align-items:center;justify-content:center;z-index:9999;}
.modal.modal-top{z-index:10001;}
.modal.is-open{display:flex;}
.modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,0.45);backdrop-filter:blur(6px);}
.modal-card{position:relative;z-index:1;background:var(--card);border-radius:22px;box-shadow:var(--shadow);border:1px solid var(--border);width:95vw;max-height:90vh;display:flex;flex-direction:column;}
.modal-header{display:flex;align-items:center;border-top-right-radius:20px;border-top-left-radius:20px;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--border);background:var(--modal-background-header);}
.modal-body{padding:0 20px 16px 20px;overflow:auto;max-height:72vh;background:var(--modal-background);border-bottom-right-radius:20px;border-bottom-left-radius:20px;}
.modal-soft .modal-body{background:#edf1f7;}
.modal-body .md-content{max-width:none;margin:0;}
.student-task-modal-body{background-color: #d7d7d7;}
.review-modal .modal-body{overflow:hidden;}
.review-modal .modal-header{padding:10px 16px;gap:10px;}
.review-nav-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.review-nav-row{display:flex;gap:8px;}
.review-nav-inline{display:inline-flex;align-items:center;gap:6px;margin-left:8px;}
.btn-nav{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;border:1px solid var(--border);background:#fff;color:#1f2937;font-weight:700;cursor:pointer;}
.btn-nav:disabled{opacity:0.4;cursor:default;}
.review-grade-inline{margin-top:8px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.review-grade-inline .review-form-inline{margin:0;}
.review-grade-inline #review-grade-status{margin:0;}
.review-grid{display:grid;grid-template-columns:minmax(0,0.9fr) minmax(0,1.2fr) minmax(0,0.8fr);gap:20px;height:72vh;align-items:stretch;}
.review-section{background:#2f3441;border:1px solid #41485a;border-radius:16px;padding:16px;color:#e2e8f0;}
.review-scroll{overflow:auto;max-height:95%;}
.review-commands{display:flex;flex-direction:column;min-height:0;height:95%;overflow:hidden;}
.review-commands .command-log{flex:1;overflow:auto;max-height:none;}
.review-section h3{margin:0 0 8px 0;}
.review-autocorrect-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;}
.review-title{}
.review-title.small{font-size:14px;}
.review-files{list-style:none;padding:0;margin:8px 0;}
.review-replays{display:grid;gap:6px;margin:8px 0 12px;}
.review-replay-row{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.review-replay-row .muted{font-size:12px;}
.file-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe;text-decoration:none;font-weight:600;font-size:12px;}
.file-pill:hover{background:#e0e7ff;}
.review-form{display:flex;flex-direction:column;gap:10px;}
.review-form-inline{flex-direction:row;align-items:center;gap:10px;flex-wrap:wrap;}
.review-form-inline .input{width:140px;}
.review-form textarea{width:100%;border:1px solid var(--border);border-radius:10px;padding:10px;font-family:inherit;font-size:14px;}
.review-log{margin-top:10px;white-space:pre-wrap;background:#1f232b;border:1px solid #4b5563;border-radius:10px;padding:10px;font-size:13px;color:#e2e8f0;max-height:180px;overflow:auto;}
.review-backups{display:grid;gap:8px;margin:8px 0 12px 0;}
.backup-zip-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.backup-zip-chip{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 10px;border-radius:999px;border:1px solid #475569;background:#1f2937;color:#e2e8f0;text-decoration:none;}
.backup-zip-chip:hover{background:#111827;border-color:#64748b;}
.backup-zip-chip.is-disabled{opacity:.65;cursor:default;}
.backup-zip-icon{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:22px;padding:0 8px;border-radius:999px;background:#0f172a;border:1px solid #334155;font-size:10px;font-weight:800;letter-spacing:.06em;}
.backup-zip-meta{font-size:11px;color:#cbd5e1;white-space:nowrap;}
.backup-zip-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 8px;border-radius:999px;background:#f59e0b;color:#1f2937;font-size:11px;font-weight:800;border:1px solid #fbbf24;}
.backup-zip-reviewer{font-size:11px;color:#94a3b8;}
.review-error{margin-top:8px;color:#b91c1c;font-weight:600;font-size:13px;}
.auto-score{font-weight:700;margin-bottom:6px;}
.review-section #review-autocorrect{font-size:13px;line-height:1.5;}
.review-section #review-autocorrect ul{margin:6px 0 10px 16px;}
.review-section #review-autocorrect li{margin:3px 0;}
.review-section #review-autocorrect .auto-ok{color:#15803d;font-weight:600;}
.review-section #review-autocorrect .auto-ko{color:#b91c1c;font-weight:600;}
.review-section #review-autocorrect .auto-rating{margin-bottom:6px;font-weight:600;}
.review-section #review-autocorrect .auto-level{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#0f172a;color:#fff;font-size:12px;margin:0 6px;}
#review-student-name{font-size:23px;font-weight:700;color: rgba(0,0,0,0.6);}
.review-modal .eyebrow{font-size:11px;margin-bottom:2px;}
.review-modal #review-modal-title{font-size:28px;line-height:1.1;margin:0;}
.review-modal .muted#review-modal-sub{margin:4px 0 0 0;}
.review-modal #review-student-name{font-size:16px;line-height:1.1;}
.review-modal .review-grade-inline{margin-top:6px;gap:6px;}
.review-modal .review-form-inline{gap:8px;}
.review-modal .review-form-inline .input{width:120px;padding:6px 9px;font-size:12px;}
.review-modal .review-form-inline .btn-outline.btn-small,
.review-modal .review-nav-actions .btn-secondary.btn-small{padding:6px 10px;font-size:11px;border-radius:9px;}
.review-modal .btn-nav{width:30px;height:30px;font-size:18px;}
.admin-block{margin-top:14px;}
.admin-block h3{margin:0 0 8px 0;font-size:15px;}
.admin-commands{background:#0f172a;color:#e2e8f0;border-radius:12px;padding:12px;overflow:auto;font-size:12px;line-height:1.4;}
.admin-commands code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}
.modal#replay-modal .modal-card{max-width:960px;}
#replay-terminal{min-height:380px;max-height:65vh;overflow:auto;white-space:pre-wrap;background:#0b1533;border:1px solid #1e293b;}
#replay-terminal .xterm{padding:10px 8px;}
#replay-terminal .xterm-viewport{overflow-y:auto !important;}
.modal#student-replay-modal .modal-card{max-width:960px;}
.modal#student-selfcheck-modal .modal-card{max-width:760px;}
#student-replay-terminal{min-height:380px;max-height:65vh;overflow:auto;white-space:pre-wrap;background:#0b1533;border:1px solid #1e293b;}
.prove-live-panel{min-height:78vh;display:flex;flex-direction:column;}
.prove-live-terminal{flex:1;min-height:60vh;max-height:none;white-space:pre-wrap;background:#0b1533;border:1px solid #1e293b;}
.prove-live-terminal .xterm{padding:10px 8px;}
.admin-actions{display:flex;flex-wrap:wrap;gap:8px;}
.admin-output{margin-top:12px;}
.issue-form{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:10px;margin:14px 0 18px;}
.issue-form label{display:grid;gap:6px;color:#e2e8f0;font-size:13px;}
.issue-form label:last-of-type{grid-column:1/-1;}
.issue-message{min-height:90px;width:100%;resize:vertical;}
.issue-form-actions{grid-column:1/-1;display:flex;align-items:center;gap:10px;}
.issue-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.issue-card{border:1px solid #4b5563;border-radius:12px;padding:10px;background:#1f2937;color:#e2e8f0;min-height:180px;}
.issue-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.issue-card-head h3{margin:0;}
.issue-card h3{margin:0 0 10px 0;font-size:14px;}
.issue-list{display:grid;gap:8px;max-height:340px;overflow:auto;padding-right:4px;}
.issue-item{border:1px solid #4b5563;border-radius:10px;background:#0f172a;padding:10px;display:grid;gap:8px;}
.issue-item.is-unread{border-color:#f59e0b;box-shadow:0 0 0 1px rgba(245,158,11,0.35);}
.issue-selectable{cursor:pointer;transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;}
.issue-selectable:hover{transform:translateY(-1px);border-color:#93c5fd;}
.issue-selectable.is-selected{border-color:#3b82f6;box-shadow:0 0 0 1px rgba(59,130,246,0.35);}
.issue-item header{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.issue-item p{margin:0;white-space:pre-wrap;word-break:break-word;color:#e5e7eb;}
.issue-md{line-height:1.5;word-break:break-word;color:#e5e7eb;}
.issue-md code{background:#1f2937;border-radius:6px;padding:2px 6px;color:#e2e8f0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}
.issue-md pre{background:#020617;color:#e2e8f0;border-radius:8px;padding:10px;overflow:auto;margin:8px 0 0 0;}
.issue-md pre code{background:transparent;color:inherit;padding:0;border-radius:0;}
.issue-priority,.issue-area,.issue-status{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:999px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;}
.issue-priority.baixa{background:#dbeafe;color:#1e3a8a;}
.issue-priority.normal{background:#e2e8f0;color:#334155;}
.issue-priority.alta{background:#fed7aa;color:#9a3412;}
.issue-priority.urgent{background:#fee2e2;color:#991b1b;}
.issue-area{background:#ede9fe;color:#5b21b6;}
.issue-status{background:#dcfce7;color:#166534;}
.issue-meta{font-size:11px;color:#94a3b8;}
.issue-response{font-size:12px;color:#e2e8f0;background:#1e293b;border:1px solid #334155;border-radius:8px;padding:8px;}
.issue-thread{display:grid;gap:8px;margin-top:4px;}
.issue-thread-row{border:1px solid #334155;border-radius:8px;padding:8px;background:#111827;}
.issue-thread-row.is-admin{border-color:#1d4ed8;background:#0b1b3f;}
.issue-thread-row.is-user{border-color:#475569;background:#0f172a;}
.issue-thread-head{font-size:11px;color:#93c5fd;margin-bottom:4px;}
.issue-thread-row p{margin:0;color:#e5e7eb;white-space:pre-wrap;word-break:break-word;}
.modal-soft .issue-form label{color:#334155;}
.modal-soft .issue-card{border-color:#cbd5e1;background:#f8fafc;color:#1f2937;}
.modal-soft .issue-item{border-color:#cbd5e1;background:#ffffff;color:#0f172a;}
.modal-soft .issue-item p,.modal-soft .issue-md{color:#1e293b;}
.modal-soft .issue-md code{background:#eef2ff;color:#1e3a8a;}
.modal-soft .issue-md pre{background:#f1f5f9;color:#0f172a;border:1px solid #cbd5e1;}
.modal-soft .issue-meta{color:#64748b;}
.modal-soft .issue-response{color:#1e293b;background:#eef2ff;border-color:#c7d2fe;}
.modal-soft .issue-thread-row{background:#f8fafc;border-color:#cbd5e1;}
.modal-soft .issue-thread-row.is-admin{background:#e0ecff;border-color:#93c5fd;}
.modal-soft .issue-thread-row.is-user{background:#f8fafc;border-color:#cbd5e1;}
.modal-soft .issue-thread-head{color:#1d4ed8;}
.backup-delete-btn{margin-left:auto;width:24px;height:24px;font-size:14px;min-width:24px;padding:0;}
.issue-thread-row .btn-ghost{justify-self:start;}
.issue-admin-block{margin-top:18px;padding-top:14px;border-top:1px solid #334155;}
.issue-admin-header{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.issue-admin-header h3{margin:0;font-size:15px;}
.issue-admin-actions{display:grid;gap:8px;}
.issue-admin-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.issue-admin-actions .input{min-width:0;width:100%;}
.survey-summary-block{background:#273142;border:1px solid #3b475f;border-radius:12px;padding:12px;}
.survey-question-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:10px;}
.survey-question-card{background:#202a3a;border:1px solid #3c4b67;border-radius:10px;padding:10px;}
.survey-question-card h4{margin:0 0 8px 0;font-size:16px;line-height:1.3;color:#dbe7ff;}
.survey-bar-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(100px,2fr) 32px;gap:8px;align-items:center;margin:6px 0;}
.survey-bar-label{font-size:12px;color:#c5d5f5;line-height:1.2;}
.survey-bar-track{height:9px;background:#111827;border-radius:999px;overflow:hidden;border:1px solid #324056;}
.survey-bar-fill{height:100%;background:linear-gradient(90deg,#fb923c,#f59e0b);}
.survey-bar-value{font-size:12px;font-weight:700;color:#fbbf24;text-align:right;}
.survey-idea-block textarea{width:100%;resize:vertical;}
.survey-keyword-block{background:#273142;border:1px solid #3b475f;border-radius:12px;padding:12px;}
.keyword-cloud{display:flex;flex-wrap:wrap;gap:8px;}
.keyword-pill{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:#1e2a3f;border:1px solid #41557c;color:#cfe0ff;font-size:12px;}
.keyword-pill em{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#f59e0b;color:#1f2937;font-style:normal;font-weight:700;}

@media (max-width:1200px){
  .review-grid{grid-template-columns:1fr;height:auto;}
  .review-modal .modal-body{overflow:auto;}
  .btn-nav{width:36px;height:36px;}
}
.task-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;}
.task-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;display:flex;justify-content:space-between;align-items:center;text-decoration:none;color:inherit;}
.task-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;}
.task-cards.is-hidden{display:none;}
.task-list-wrap{margin-top:14px;}
.task-list-wrap.is-hidden{display:none;}
.student-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:20px;align-items:start;}
.student-main{min-width:0;}
.student-charts{margin-bottom:16px;}
.student-charts-grid{display:grid;grid-template-columns:repeat(2,minmax(360px,1fr));gap:16px;grid-auto-rows:auto;}
.student-charts-grid .chart-card.full{grid-column:auto;}
.student-charts-grid .chart-card{min-height:150px;padding:12px;}
.student-charts-grid .chart-card h3{font-size:10pt;line-height:1.2;margin:0 0 6px 0;}
.student-charts-grid canvas{max-height:120px;}
.student-charts-grid .chart-zoom-card{cursor:zoom-in;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;}
.student-charts-grid .chart-zoom-card:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.14);border-color:#9fb2d9;}
.student-charts-grid .chart-zoom-card:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;}
.chart-zoom-modal-card{max-width:1100px;min-height:72vh;}
.chart-zoom-modal-body{padding:14px 20px 20px 20px;background:#f2f5fa;}
#chart-zoom-canvas{width:100% !important;height:62vh !important;max-height:none;}
.student-hero{display:grid;grid-template-columns:minmax(260px,420px) minmax(0,1fr) auto;gap:24px;align-items:start;}
.student-hero-main{min-width:0;display:flex;flex-direction:column;}
.student-hero .student-charts{width:100%;min-width:0;max-width:none;margin:0;}
.student-hero .hero-actions{align-self:flex-start;justify-content:flex-end;min-width:130px;flex-wrap:wrap;}
.task-rating{display:flex;align-items:center;gap:10px;margin:8px 0 10px 0;flex-wrap:wrap;}
.task-rating .rating-label{font-weight:600;color:var(--muted);font-size:13px;}
.rating-stars{display:flex;align-items:center;gap:4px;}
.rating-star{border:none;background:transparent;font-size:18px;cursor:pointer;color:#a9a9a9;padding:0;line-height:1;}
.rating-star.is-active{color:#f59e0b;}
.task-rating.is-readonly .rating-star{cursor:default;}
.rating-status{font-size:12px;color:var(--muted);}
.student-log{background:linear-gradient(180deg,var(--bg-shell) 0%,var(--bg-shell2) 100%);border:1px solid var(--border);border-radius:16px;padding:16px;box-shadow:var(--shadow-soft);position:sticky;top:120px;max-height:calc(100vh - 180px);overflow:auto;}
.log-header{margin-bottom:10px;}
.log-header h3{margin:0 0 4px 0;font-size:16px;}
.command-filters{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 6px;}
.task-badge-toggle{cursor:pointer;transition:transform 0.15s ease,box-shadow 0.15s ease,opacity 0.15s ease;}
.task-badge-toggle:hover{transform:translateY(-1px);box-shadow:0 6px 12px rgba(15,23,42,0.12);}
.task-badge-toggle.is-off{opacity:0.35;filter:grayscale(0.6);}
.command-filter-toggle{font-weight:800;}
.command-filter-danger{background:#fee2e2;color:#991b1b;border-color:#fecaca;}
.command-filter-unassigned{background:#e2e8f0;color:#334155;border-color:#cbd5e1;}
.command-log{list-style:none;margin:0;padding:0;display:grid;gap:10px;}
.command-log li{display:grid;grid-template-columns:minmax(40px,60px) 1fr;gap:10px;align-items:start;}
.command-row.is-hidden{display:none;}


.command-row.no-time{grid-template-columns:1fr;}
.command-row.no-time .command-text{grid-column:1/-1;}
.command-time{display:flex;flex-direction:column;gap:2px;}
.command-time-line{display:block;font-size:10px;color:var(--muted);}
.command-meta{display:block;font-size:10px;color:var(--muted);}
.command-text code{background:#eef2f7;padding:2px 6px;border-radius:6px;font-family:Consolas,monospace;}
.command-time{font-size:10px;color:var(--muted);letter-spacing:0.06em;text-transform:uppercase;}
.command-text{font-size:12px;color:#1f2937;word-break:break-word;line-height:1.4;}
.command-text.dangerous code{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;}
.task-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;margin-right:6px;font-size:10px;font-weight:700;background:var(--badge-bg,#e2e8f0);color:#0f172a;border:1px solid var(--badge-border,transparent);letter-spacing:0.04em;}
.task-badge.is-empty{background:#334155;color:#e2e8f0;border-color:#1f2937;}
.task-card-extended{background:linear-gradient(160deg,#9ebfd2 0%,#f5f7fb 100%);border:1px solid var(--border);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow-soft);min-height:220px;}
.task-card-extended.is-corrected{background:rgb(178 178 178 / 73%);}
.task-card-extended.is-hidden{display:none;}
.task-card-extended.prove-card{background:linear-gradient(160deg,#bfd4e3 0%,#f7f9fd 100%);}
.task-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.score-group{display:flex;flex-direction:column;align-items:center;gap:4px;}
.score-legend{display:flex;gap:12px;align-items:center;font-size:11px;color:var(--muted);}
.task-meta{display:flex;flex-direction:column;gap:4px;color:#64748b;font-size:12px;}
.task-date{margin:6px 0 4px;color:#64748b;font-size:12px;}
.modal-task-header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:8px 0 6px;}
.task-title-link{background:none;border:none;padding:0;color:inherit;font:inherit;text-align:left;cursor:pointer;}
.task-title-link:hover{text-decoration:underline;}
.auto-list{margin:0;padding-left:18px;display:grid;gap:8px;}
.auto-list li{padding:8px 12px;border-radius:10px;background:#f8fafc;}
.auto-list li.auto-ok{border:1px solid #bbf7d0;background:#ecfdf3;color:#166534;font-weight:600;}
.auto-list li.auto-ko{border:1px solid #fecaca;background:#fff1f2;color:#991b1b;font-weight:600;}
.auto-summary{display:flex;gap:12px;margin:0 0 12px;}
.auto-summary .auto-ok,.auto-summary .auto-ko{padding:4px 10px;border-radius:999px;font-weight:600;}
.auto-summary .auto-ok{background:#ecfdf3;color:#166534;border:1px solid #bbf7d0;}
.auto-summary .auto-ko{background:#fff1f2;color:#991b1b;border:1px solid #fecaca;}
.files-open{background:#ede9fe;border-color:#c4b5fd;color:#5b21b6;}
.files-open:hover{background:#ddd6fe;color:#4c1d95;}
.task-selfcheck{background:#fee2e2;border-color:#fecaca;color:#b91c1c;}
.task-selfcheck:hover{background:#fecaca;color:#991b1b;}
.files-list{list-style:none;padding:0;margin:0;}
.files-list li{display:block;}
.files-list a{color:#1d4ed8;text-decoration:none;font-weight:600;}
.files-list a:hover{text-decoration:underline;}
.reports-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;padding:2px 0;}
.report-card{background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:10px;box-shadow:var(--shadow-soft);}
.report-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.report-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:0.04em;border:1px solid #cbd5e1;background:#e2e8f0;color:#334155;}
.report-chip-pdf{background:#fee2e2;border-color:#fecaca;color:#991b1b;}
.report-chip-md{background:#e0e7ff;border-color:#c7d2fe;color:#3730a3;}
.report-date{font-size:12px;color:var(--muted);}
.report-name{margin:0;font-size:17px;line-height:1.3;word-break:break-word;}
.report-meta{margin:0;font-size:12px;color:var(--muted);}
.report-actions{display:flex;gap:8px;flex-wrap:wrap;}
.file-tree{list-style:none;margin:0;padding:0;display:grid;gap:8px;}
.file-node{border:1px solid var(--border);background:rgba(21, 21, 21, 0.8);border-radius:10px;padding:6px 10px;color:#0f172a;}
.file-node.is-dir{background:#e2e8f0;border-color:#94a3b8;color:#0f172a;}
.file-node.is-dir .file-row{cursor:pointer;}
.file-node.is-dir:not(.is-open) > .file-children{display:none;}
.file-row{display:flex;align-items:center;gap:10px;font-size:14px;}
.file-node.is-file{display:inline-flex;align-items:center;border-radius:999px;background:#2f3641;border-color:#4b5563;color:#e2e8f0;padding:6px 12px;}
.file-node.is-file .file-row{gap:8px;}
.file-node.is-file .file-spacer{display:none;}
.file-node.is-file .file-icon{color:#93c5fd;}
.file-node.is-file .file-size{margin-left:10px;color:#93a4bf;font-size:11px;}
.file-node.is-file .file-link{color:#dbe7ff;max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.file-link{background:transparent;border:0;padding:0;color:#979dac;font-weight:600;cursor:pointer;}
.file-link:hover{text-decoration:underline;}
.file-icon{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:#334155;font-weight:700;}
.file-toggle{display:inline-block;width:16px;}
.file-spacer{display:inline-block;width:16px;}
.file-size{margin-left:auto;font-size:12px;color:#64748b;white-space:nowrap;}
.file-children{list-style:none;margin:8px 0 0 18px;padding:0;display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;}
.file-node.is-dir > .file-children > .file-node.is-dir{flex:1 1 100%;}
.file-preview-body{min-height:120px;}
.file-preview-code{background:#0f172a;color:#e2e8f0;border-radius:10px;padding:12px;overflow:auto;max-height:60vh;}
.file-preview-image{max-width:100%;height:auto;border-radius:10px;display:block;}
.file-preview-download{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.file-preview-body .toastui-editor-contents{color:#e2e8f0;}
.file-preview-body .toastui-editor-contents code{background:#1f2330;color:#e2e8f0;}
.file-preview-body .toastui-editor-contents pre{background:#0f172a;color:#e2e8f0;}
.files-size{font-size:12px;color:#6b7280;}
.task-badges{display:flex;align-items:center;gap:8px;}
.activity-id-pill{padding:4px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.04em;background:#0f172a;color:#e2e8f0;border:1px solid #334155;}
.task-badges .badge-rating{width:26px;height:26px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff;font-size:12px;box-shadow:0 6px 14px rgba(15,23,42,0.18);}
.status-pill{padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;}
.status-pill.pendent{background:#fff7ed;color:#b45309;border:1px solid #fed7aa;}
.status-pill.entregada{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0;}
.status-pill.corregida{background:#eef2ff;color:#3730a3;border:1px solid #c7d2fe;}
.status-pill.inactiva{background:#f1f5f9;color:#64748b;border:1px solid #cbd5e1;}
.score-pill{padding:4px 10px;border-radius:999px;font-size:11px;font-weight:700;background:#fff;border:1px solid var(--border);}
.task-meta{font-size:12px;color:var(--muted);}
.task-card-body{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-right:0;}
.task-card-body > div:first-child{flex:1;min-width:0;}
.task-card-body h3{margin:0;font-size:18px;}
.score-ring{--size:64px;position:absolute;top:0;right:0;width:var(--size);aspect-ratio:1/1;border-radius:50%;background:conic-gradient(var(--ring-color, #4b9b1c) var(--percent), #4f4f4f 0);display:flex;align-items:center;justify-content:center;font-weight:700;color:#dcdcdc;flex-shrink:0;}
.score-ring.header{position:static;--size:42px;}
.score-ring span{font-size:12px;}
.score-rings{display:flex;gap:8px;align-items:center;}
.task-card-footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;border-top:1px dashed var(--border);padding-top:10px;font-size:12px;color:var(--muted);min-height:32px;margin-top:auto;}
.table-scroll{overflow:auto;border-radius:16px;}
.grade-table{width:100%;min-width:680px;border-collapse:separate;border-spacing:0 6px;font-size:12px;}
.grade-table thead th{text-align:left;padding:6px 10px;color:var(--muted);font-weight:600;}
.grade-table tbody td{padding:6px 10px;background:rgba(255,255,255,0.6);border-top:1px solid rgba(0,0,0,0.04);border-bottom:1px solid rgba(0,0,0,0.04);}
.grade-table tbody tr.is-expired td{background:rgba(235,235,235,0.7);}
.grade-table tbody tr td:first-child{border-radius:10px 0 0 10px;}
.grade-table tbody tr td:last-child{border-radius:0 10px 10px 0;}
.activity-list-table .task-title-link{font-size:13px;font-weight:600;}
.activity-list-table .activity-id-pill{font-size:11px;}
.task-list-row.is-hidden{display:none;}
.task-list-row.prove-row td{background:rgba(236,245,255,0.72);}
.grade-student{font-weight:600;color:#1f2a37;}
.task-row-title{font-weight:600;color:#1f2a37;}
.task-row-title.sortable{cursor:pointer;user-select:none;}
.task-row-title.sortable.is-sorted::after{content:attr(data-sort-dir);font-size:10px;color:var(--muted);margin-left:6px;}
.student-col-title{font-weight:600;color:#1f2a37;}
.grade-chip{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:4px 8px;border-radius:999px;border:1px solid var(--grade-color);color:var(--grade-color);font-weight:700;background:rgba(255,255,255,0.6);}
.grade-empty{color:var(--muted);}
.grade-upload{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:4px 8px;border-radius:999px;border:1px solid #fdba74;background:#fff7ed;color:#c2410c;font-weight:800;}
.grade-btn{cursor:pointer;background:transparent;border:0;padding:0;}
.grade-btn.grade-chip{border:1px solid var(--grade-color);background:rgba(255,255,255,0.6);padding:4px 8px;}
.grade-btn.grade-empty{color:var(--muted);}
.grade-btn.grade-upload{color:#c2410c;border-color:#fdba74;background:#fff7ed;}
.task-col-title{font-weight:600;color:#1f2a37;}
.task-col-due{font-size:10px;color:var(--muted);}
.col-avg{font-size:10px;color:var(--muted);}
.row-weight-control{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:var(--muted);margin-top:2px;}
.row-weight-input{width:64px;height:24px;padding:2px 6px;border-radius:8px;border:1px solid #cbd5e1;background:#f8fafc;color:#1f2a37;font-size:11px;}
.table-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.filter-group{display:flex;gap:8px;flex-wrap:wrap;}
.table-hint{font-size:11px;}
.task-col-title.sortable{cursor:pointer;user-select:none;display:inline-flex;align-items:center;gap:6px;}
.task-col-title.sortable.is-sorted::after{content:attr(data-sort-dir);font-size:10px;color:var(--muted);}
.task-col-title.sortable[data-sort-dir="asc"]::after{content:"↑";}
.task-col-title.sortable[data-sort-dir="desc"]::after{content:"↓";}
.tasks-filters{display:grid;grid-template-columns:minmax(220px,1fr) 180px;gap:10px;align-items:center;margin-bottom:12px;}
.tasks-filters .input{width:100%;}
.users-check-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px 12px;}
.checkbox-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--border);border-radius:10px;background:rgba(33, 33, 33, 0.1);}
.feedback-inline{margin:8px 0 0 0;font-size:13px;color:#8e3a11;white-space:pre-wrap;max-height:120px;overflow:auto;padding-right:6px;}
.ra-obj{margin:6px 0 0 0;font-size:11px;color:#475569;text-transform:uppercase;letter-spacing:0.08em;}
.time-pill{margin-left:8px;padding:2px 8px;border-radius:999px;background:#f1f5f9;border:1px solid #cbd5e1;font-size:11px;color:#475569;}
.reflection-box{margin-top:10px;display:flex;flex-direction:column;gap:6px;}
.reflection-text{width:100%;min-height:110px;border:1px solid var(--border);border-radius:10px;padding:9px;font-family:inherit;font-size:11px;background:#f8fafc;resize:vertical;display:block;}
.reflection-box{width:100%;}
.reflection-status{font-size:11px;color:var(--muted);}
.btn-reflection{ border: 1px solid #969696;}
.file-table{width:100%;border-collapse:collapse;table-layout:fixed;}
.file-table th,.file-table td{padding:8px 10px;border-bottom:1px solid var(--border);text-align:left;font-size:14px;vertical-align:top;}
.col-task{width:110px;}
.col-title{width:420px;}
.col-due{width:160px;}
.btn-link{color:var(--primary);font-weight:700;text-decoration:none;}
.report-frame{width:100%;height:72vh;border:0;}
.charts-grid{--grid-cols:4;display:grid;grid-template-columns:repeat(var(--grid-cols),minmax(220px,1fr));gap:16px;grid-auto-rows:120px;grid-auto-flow:dense;}
.chart-card{background:linear-gradient(135deg,#ffffff 0%,#f8fafc 100%);border:1px solid var(--border);border-radius:16px;padding:16px;box-shadow:var(--shadow-soft);position:relative;min-height:180px;}
.chart-card h3{margin-top:0;font-size:16px;}
.chart-card.full{grid-column:1/-1;}
.chart-card.is-dragging{opacity:0.6;border-style:dashed;}
.chart-drag-handle{cursor:move;}
.chart-resize-handle{position:absolute;right:10px;bottom:10px;width:14px;height:14px;border-radius:4px;background:linear-gradient(135deg,#cbd5f5,#64748b);cursor:nwse-resize;opacity:0.7;z-index:3;touch-action:none;}
.chart-card.is-resizing{user-select:none;}
@media (max-width:1200px){
  .charts-grid{--grid-cols:3;}
}
@media (max-width:980px){
  .charts-grid{--grid-cols:2;}
}
@media (max-width:720px){
  .charts-grid{--grid-cols:1;}
}
.chart-resize-handle::after{content:"";position:absolute;right:3px;bottom:3px;width:6px;height:6px;border-right:2px solid rgba(255,255,255,0.9);border-bottom:2px solid rgba(255,255,255,0.9);}
.heatmap{overflow:auto;border:1px solid var(--border);border-radius:14px;background:#fff;}
.heatmap-grid{display:grid;gap:4px;padding:10px;min-width:max-content;}
.heatmap-row{display:contents;}
.heatmap-cell{font-size:11px;line-height:1;display:flex;align-items:center;justify-content:center;border-radius:6px;border:1px solid transparent;min-height:28px;}
.heatmap-student{justify-content:flex-start;padding-left:8px;font-weight:600;color:#0f172a;background:#f8fafc;border-color:#e2e8f0;position:sticky;left:0;z-index:2;}
.heatmap-header .heatmap-student{z-index:3;}
.heatmap-task{background:#f1f5f9;border-color:#e2e8f0;font-weight:600;color:#0f172a;position:sticky;top:0;z-index:2;}
.heatmap-score{cursor:default;}
.heatmap-score.status-done{box-shadow:inset 0 0 0 2px rgba(22,163,74,0.35);}
.heatmap-score.status-pending{box-shadow:inset 0 0 0 2px rgba(245,158,11,0.45);}
.heatmap-score.status-none{background:#e5e7eb;box-shadow:inset 0 0 0 1px rgba(148,163,184,0.4);}
.heatmap-legend{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;font-size:12px;color:#475569;}
.legend-pill{padding:4px 10px;border-radius:999px;border:1px solid var(--border);background:#f8fafc;}
.legend-none{background:#e5e7eb;}
.legend-pending{background:#fef3c7;border-color:#f59e0b;color:#9a3412;}
.legend-done{background:#dcfce7;border-color:#16a34a;color:#166534;}
.legend-scale{display:flex;align-items:center;gap:8px;}
.legend-gradient{display:inline-block;width:90px;height:10px;border-radius:999px;background:linear-gradient(90deg,hsl(0,70%,45%),hsl(120,70%,45%));}
.md-content{padding:16px;line-height:1.6;max-width:1000px;margin:0 auto;}
.md-content h1{font-size:26px;margin:0 0 10px;}
.md-content h2{font-size:20px;margin:14px 0 6px;}
.md-content h3{font-size:17px;margin:12px 0 6px;}
.md-content p{margin:8px 0;}
.md-content ul,.md-content ol{margin:8px 0 8px 20px;}
.md-content li{margin:4px 0;}
.md-content code{background:#ddd;padding:2px 6px;border-radius:6px;font-family:Consolas,monospace;}
.md-content pre{background:#1c1e23;color:#e2e8f0;padding:12px;border-radius:10px;overflow:auto;font-family:Consolas,monospace;font-size:12px;line-height:1.4;margin:10px 10%;}
.md-content pre code{background:transparent;padding:0;color:inherit;display:block;}
.md-content table{width:100%;border-collapse:collapse;margin:10px 0;}
.md-content th,.md-content td{border:1px solid var(--border);padding:8px 10px;text-align:left;vertical-align:top;}
.md-content th{background:#f8fafc;}
.md-content hr{border:0;border-top:1px solid var(--border);margin:12px 0;}
.empty{padding:20px;border:1px dashed var(--border);border-radius:12px;color:var(--muted);}

.chat-panel{padding-top:20px;background-color: #7070706e;}
.chat-panel .panel-header{cursor:pointer;}
.chat-unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;margin-left:8px;border-radius:999px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;vertical-align:middle;}
.chat-panel .chat-layout{max-height:2200px;opacity:1;overflow:hidden;transition:max-height .25s ease,opacity .2s ease,margin-top .2s ease;}
.chat-panel.is-collapsed .panel-header{margin-bottom:0;}
.chat-panel.is-collapsed .chat-layout{max-height:0;opacity:0;margin-top:0;pointer-events:none;}
.chat-layout{display:grid;grid-template-columns:minmax(260px,320px) minmax(0,1fr);gap:16px;align-items:start;}
.chat-topics,.chat-thread{border:1px solid var(--border);border-radius:14px;padding:12px;background:#f8fafc;}
.chat-thread-header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px;}
.chat-thread-header h3{margin:0 0 4px 0;}
.chat-thread-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.chat-compose{display:grid;gap:8px;}
.chat-compose textarea{width:100%;border:1px solid var(--border);border-radius:10px;padding:10px;font-family:inherit;font-size:14px;resize:vertical;}
.chat-reply-actions{display:flex;justify-content:space-between;align-items:center;gap:8px;}
.chat-topic-list{display:grid;gap:8px;max-height:420px;overflow:auto;padding-top:10px;}
.chat-topic-item{border:1px solid var(--border);border-radius:10px;padding:10px;background:#fff;text-align:left;cursor:pointer;display:grid;gap:4px;}
.chat-topic-item.is-active{border-color:#0b4dd8;background:#eaf0ff;}
.chat-topic-item.has-unread{background:rgba(11,77,216,0.08);border-color:rgba(11,77,216,0.28);}
.chat-topic-title{font-weight:700;color:#0f172a;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.chat-topic-unread{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#ef4444;color:#fff;font-size:11px;font-weight:700;}
.chat-topic-meta{font-size:12px;color:#64748b;}
.chat-messages{min-height:200px;max-height:360px;overflow:auto;display:grid;gap:8px;padding-right:4px;margin-bottom:10px;}
.chat-message{border:1px solid var(--border);border-radius:10px;padding:10px;background:#fff;}
.chat-message.has-unread{background:rgba(11,77,216,0.07);border-color:rgba(11,77,216,0.28);}
.chat-message header{display:flex;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:12px;}
.chat-message-actions{display:flex;align-items:center;gap:8px;}
.chat-message-unread{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:1px 7px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;font-weight:700;vertical-align:middle;}
.chat-md{line-height:1.5;word-break:break-word;}
.chat-md code{background:#e2e8f0;border-radius:6px;padding:2px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}
.chat-md pre{background:#0f172a;color:#e2e8f0;border-radius:8px;padding:10px;overflow:auto;margin:8px 0 0 0;}
.chat-md pre code{background:transparent;color:inherit;padding:0;border-radius:0;}
.chat-panel .btn-ghost.danger{color:#b91c1c;border-color:#fca5a5;background:#fff5f5;}
.chat-panel .btn-ghost.danger:hover{background:#fee2e2;}
.btn-ghost.danger{color:#b91c1c;border-color:#fca5a5;background:#fff5f5;}
.btn-ghost.danger:hover{background:#fee2e2;}
.chat-status{font-size:12px;min-height:16px;}

.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;}
.login-card{position:relative;z-index:1;background:var(--card);padding:32px;border-radius:20px;box-shadow:var(--shadow);width:360px;}
.login-title{font-size:22px;font-weight:700;margin-bottom:6px;}
.login-sub{color:var(--muted);margin-top:0;margin-bottom:16px;}
.login-form{display:flex;flex-direction:column;gap:12px;}
.login-form label{display:flex;flex-direction:column;font-size:12px;color:var(--muted);gap:6px;}
.login-form input{padding:10px 12px;border-radius:10px;border:1px solid var(--border);}
.error{color:#c0392b;font-weight:600;font-size:13px;}

@media (max-width:1700px){
  .student-charts-grid{grid-template-columns:repeat(2,minmax(320px,1fr));}
}

@media (max-width:1400px){
  .student-hero{grid-template-columns:minmax(260px,1fr) auto;}
  .student-hero .student-charts{grid-column:1/-1;}
  .student-charts-grid{grid-template-columns:repeat(2,minmax(280px,1fr));}
  .activity-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width:1100px){
  .student-charts-grid{grid-template-columns:1fr;}
}

@media (max-width:900px){
  .topbar{flex-direction:column;align-items:flex-start;gap:12px;}
  .user-chip{flex-wrap:wrap;border-radius:16px;}
  .hero{flex-direction:column;align-items:flex-start;}
  .student-layout{grid-template-columns:1fr;}
  .chat-layout{grid-template-columns:1fr;}
  .tasks-filters{grid-template-columns:1fr;}
  .student-log{position:static;max-height:none;}
  .student-hero{display:flex;flex-direction:column;}
  .student-charts-grid{grid-template-columns:1fr;}
  .student-hero .hero-actions{width:100%;justify-content:flex-start;min-width:0;}
  .student-hero .student-charts{width:100%;min-width:0;max-width:none;}
  .activity-summary-grid{grid-template-columns:1fr;}
  .issue-form{grid-template-columns:1fr;}
  .issue-columns{grid-template-columns:1fr;}
}
.modal-body .md-content,
.modal-body .toastui-editor-contents{color:#e2e8f0;}
.modal-body .md-content code,
.modal-body .toastui-editor-contents code{background:#3a3f4b;color:#f8fafc;}
.modal-body .md-content pre,
.modal-body .toastui-editor-contents pre{background:#1f232b;color:#e2e8f0;}
.modal-body .md-content a,
.modal-body .toastui-editor-contents a{color:#93c5fd;}
.modal-body .md-content th,
.modal-body .md-content td,
.modal-body .toastui-editor-contents th,
.modal-body .toastui-editor-contents td{border-color:#4b5563;}
.modal-body .md-content th,
.modal-body .toastui-editor-contents th{background:#3a3f4b;}
.modal-body .toastui-editor-contents details{margin:10px 0;padding:8px 10px;border:1px solid #4b5563;border-radius:10px;background:#2f3441;}
.modal-body .toastui-editor-contents details>summary{cursor:pointer;font-weight:700;color:#e2e8f0;list-style:disclosure-closed;}
.modal-body .toastui-editor-contents details[open]>summary{list-style:disclosure-open;}
.modal-body .toastui-editor-contents details:not([open])>:not(summary){display:none;}
.modal-body .toastui-editor-contents pre code.language-python,
.modal-body .toastui-editor-contents pre code.language-bash,
.modal-body .toastui-editor-contents pre code.language-sh{display:block;background:#0f172a;border:1px solid #233044;border-radius:8px;padding:12px;color:#dbe7ff;}
.modal-body .toastui-editor-contents .py-kw{color:#c084fc;font-weight:700;}
.modal-body .toastui-editor-contents .py-bi{color:#7dd3fc;font-weight:600;}
.modal-body .toastui-editor-contents .py-str{color:#86efac;}
.modal-body .toastui-editor-contents .py-num{color:#fbbf24;}
.modal-body .toastui-editor-contents .py-comment{color:#94a3b8;font-style:italic;}

/* Loading states for progressive dashboard loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #dc2626;
}

.error-state .btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.error-state .btn-link:hover {
  text-decoration: underline;
}
