:root{--bg:#f5f7fb;--card:#fff;--line:#e5e7eb;--text:#102a43;--muted:#64748b;--brand:#5b5ce2;--brand-hover:#4f46d8;--success:#16a34a;--danger:#c2413b;--soft:#eef2ff;--radius:18px;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text)}
*{box-sizing:border-box}html,body{margin:0;min-width:320px;background:var(--bg)}body{min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}a{text-decoration:none;color:inherit}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#f8fafc,#eef4f3)}.auth-card{width:min(500px,100%);background:var(--card);border:1px solid #dbe2e8;border-radius:24px;padding:34px;box-shadow:0 20px 55px rgba(15,23,42,.08)}.admin-brand{display:flex;align-items:center;gap:12px}.admin-brand .brand-logo{width:48px;height:48px}.admin-brand strong{display:block;font-size:20px;font-weight:800}.admin-brand small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.eyebrow,.admin-kicker{margin-top:28px;color:#52606d;font-size:11px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}.auth-card h1{margin:12px 0 10px;font-size:clamp(34px,7vw,52px);line-height:.98;letter-spacing:-.055em}.auth-card>p{color:var(--muted);line-height:1.6;margin:0 0 24px}.form-stack{display:grid;gap:2px}.field{display:grid;gap:7px;margin:9px 0}.field label{font-size:12px;font-weight:700;color:#475569}.field input,.field select,.field textarea{width:100%;border:1px solid #d6dde6;border-radius:12px;padding:12px 13px;background:#fff;color:var(--text);outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(91,92,226,.12)}.field textarea{min-height:110px;resize:vertical}.form-hint{font-size:11px;color:var(--muted);line-height:1.5}.btn{min-height:42px;padding:0 15px;border:1px solid transparent;border-radius:11px;font-size:13px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:7px}.btn-primary{background:var(--brand);color:#fff}.btn-primary:hover{background:var(--brand-hover)}.btn-outline{background:#fff;border-color:var(--line);color:#334155}.btn-outline:hover{background:#f8fafc}.btn-ghost{background:transparent;color:var(--muted);border:0}.btn:disabled{opacity:.55;cursor:wait}.full{width:100%}
.admin-shell{min-height:100vh}.admin-topbar{height:70px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 clamp(16px,4vw,48px);background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;backdrop-filter:blur(14px)}.admin-actions{display:flex;gap:8px;align-items:center}.storage-status{padding:8px 11px;border-radius:999px;background:#ecfdf3;color:#166534;font-size:10px;font-weight:800;letter-spacing:.05em}.admin-main{max-width:1280px;margin:auto;padding:0 clamp(16px,4vw,48px) 60px}.admin-panel-title{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;padding:48px 0 28px}.admin-panel-title h1{margin:9px 0 10px;font-size:clamp(38px,6vw,66px);line-height:.95;letter-spacing:-.06em}.hero-copy{max-width:620px;margin:0;color:var(--muted);line-height:1.6}.admin-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);overflow:auto}.admin-tab{border:0;background:transparent;color:var(--muted);padding:13px 14px;font-weight:700;white-space:nowrap;position:relative}.admin-tab.active{color:var(--brand)}.admin-tab.active:after{content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:3px;background:var(--brand);border-radius:3px 3px 0 0}
.signal-rail{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:22px 0}.signal-item{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px}.signal-item strong{display:block;font-size:25px}.signal-item span{display:block;margin-top:4px;color:var(--muted);font-size:11px}.admin-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px}.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}.panel-head h3{margin:0;font-size:17px}.table-wrap{overflow:auto}.admin-note-table{width:100%;border-collapse:collapse;min-width:620px}.admin-note-table th{text-align:left;padding:10px;color:#94a3b8;font-size:10px;text-transform:uppercase;border-bottom:1px solid var(--line)}.admin-note-table td{padding:13px 10px;border-bottom:1px solid #eef2f6;font-size:13px}.admin-note-table tr:last-child td{border-bottom:0}.title-cell{font-weight:700}.title-cell small{display:block;color:var(--muted);font-weight:400;margin-top:3px}.admin-table-actions{display:flex;gap:5px}.icon-btn{border:1px solid var(--line);background:#fff;border-radius:9px;padding:7px 10px;color:#475569}.status{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:800;text-transform:uppercase}.status-published{background:#dcfce7;color:#166534}.status-draft{background:#fff7ed;color:#9a3412}.admin-empty-panel{padding:24px 5px;color:var(--muted);line-height:1.6}.upload-box{border:1.5px dashed #cbd5e1;border-radius:14px;padding:15px;background:#f8fafc}.upload-box:hover{border-color:var(--brand);background:#fafaff}.upload-state{margin-top:9px;padding:10px;border-radius:10px;background:#f1f5f9;color:var(--muted);font-size:11px;line-height:1.5}.upload-state.ok{background:#ecfdf3;color:#166534}.upload-state.bad{background:#fef2f2;color:#b42318}.progress{height:5px;background:#e5e7eb;border-radius:9px;overflow:hidden;margin-top:8px}.progress i{display:block;height:100%;width:55%;background:var(--brand);animation:load 1s infinite alternate}@keyframes load{to{width:90%}}
.modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.5);display:grid;place-items:center;padding:16px;z-index:100}.modal{width:min(620px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:20px;padding:22px;box-shadow:0 25px 80px rgba(0,0,0,.2)}.modal-head{display:flex;justify-content:space-between;align-items:center}.modal-head h2{margin:0;font-size:21px}.close{width:35px;height:35px;border:0;border-radius:9px;background:#f1f5f9;font-size:20px}.toast-region{position:fixed;right:16px;bottom:16px;z-index:200}.toast{background:#0f172a;color:#fff;padding:12px 15px;border-radius:11px;margin-top:7px;box-shadow:0 12px 30px rgba(0,0,0,.15);font-size:12px;max-width:360px}.toast.error{background:#b42318}
@media(max-width:900px){.admin-layout{grid-template-columns:1fr}.signal-rail{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.auth-page{padding:12px}.auth-card{padding:25px 20px;border-radius:20px}.auth-card h1{font-size:38px}.admin-topbar{height:auto;min-height:64px;padding:10px 14px}.admin-topbar .admin-brand small{display:none}.admin-topbar .storage-status{display:none}.admin-topbar .btn-outline:first-of-type{display:none}.admin-main{padding:0 12px 40px}.admin-panel-title{display:block;padding:32px 0 20px}.admin-panel-title .btn{margin-top:15px}.admin-panel-title h1{font-size:42px}.signal-rail{gap:8px}.signal-item{padding:13px}.admin-tabs{margin:0 -12px;padding:0 8px}.panel{padding:14px;border-radius:14px}.admin-actions{gap:5px}.admin-actions .btn{padding:0 10px;font-size:11px}.modal{padding:18px;border-radius:17px}}

/* Mobile modal fix */
.modal-bg{overflow-y:auto;overflow-x:hidden;align-items:flex-start;justify-items:center;padding:20px 12px;overscroll-behavior:contain}
.modal{width:100%;max-width:620px;margin:0 auto;min-width:0}
@media(max-width:600px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  .modal-bg{padding:14px 10px 28px;display:block}
  .modal{width:100%;max-width:none;margin:0;border-radius:16px;padding:18px 15px}
  .modal-head{position:sticky;top:0;background:#fff;padding-bottom:12px;z-index:2}
  .modal-head h2{font-size:20px}
  .field{margin:10px 0}
  .field input,.field select,.field textarea{min-height:48px;font-size:16px}
  .upload-box{padding:13px}
}

/* ===== QuickNote Admin UI polish ===== */
:root{
  --shadow-sm:0 2px 8px rgba(15,23,42,.04);
  --shadow-md:0 12px 32px rgba(15,23,42,.07);
  --shadow-lg:0 24px 70px rgba(15,23,42,.12);
  --focus:0 0 0 4px rgba(91,92,226,.13);
}
::selection{background:#dfe1ff;color:#27276f}
button,a,input,select,textarea{ -webkit-tap-highlight-color:transparent }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:0;box-shadow:var(--focus)}
.admin-shell{background:linear-gradient(180deg,#f8fafc 0,#f5f7fb 360px)}
.admin-topbar{box-shadow:0 1px 12px rgba(15,23,42,.03)}
.admin-brand{transition:transform .18s ease}.admin-brand:hover{transform:translateY(-1px)}
.admin-brand .brand-logo{object-fit:contain;border-radius:12px}
.admin-panel-title{animation:fadeUp .28s ease both}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.signal-item{box-shadow:var(--shadow-sm);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.signal-item:hover{transform:translateY(-2px);box-shadow:var(--shadow-md);border-color:#d5daf2}
.signal-item strong{letter-spacing:-.035em}
.panel{box-shadow:var(--shadow-sm);transition:box-shadow .18s ease,border-color .18s ease}
.panel:hover{box-shadow:var(--shadow-md);border-color:#dce1ea}
.admin-tab{transition:color .18s ease,background .18s ease}
.admin-tab:hover{background:#f8fafc;color:#334155}
.btn{transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease}
.btn:not(:disabled):hover{transform:translateY(-1px)}
.btn-primary:not(:disabled):hover{box-shadow:0 8px 20px rgba(91,92,226,.22)}
.btn-primary:not(:disabled):active{transform:translateY(0)}
.btn-outline:hover{box-shadow:var(--shadow-sm)}
.field input,.field select,.field textarea{transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
.field input::placeholder,.field textarea::placeholder{color:#a0aec0}
.field input:hover,.field select:hover,.field textarea:hover{border-color:#c4ccd7}
.upload-box{transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.upload-box:focus-within{border-color:var(--brand);box-shadow:var(--focus);background:#fafaff}
.upload-box input[type=file]{width:100%;font-size:12px;color:#475569}
.upload-box input[type=file]::file-selector-button{border:0;border-radius:9px;background:#e9eaff;color:#4038a8;padding:9px 12px;margin-right:9px;font-weight:700;cursor:pointer}
.admin-note-table tbody tr{transition:background .14s ease}
.admin-note-table tbody tr:hover{background:#fafbff}
.icon-btn{transition:.15s ease}.icon-btn:hover{background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px)}
.status{letter-spacing:.04em}
.modal-bg{backdrop-filter:blur(5px);animation:modalFade .18s ease}
.modal{box-shadow:var(--shadow-lg);animation:modalIn .2s ease}
@keyframes modalFade{from{opacity:0}to{opacity:1}}
@keyframes modalIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
.close{transition:.15s ease}.close:hover{background:#fee2e2;color:#b42318;transform:rotate(3deg)}
.admin-empty-panel{border-radius:12px;background:#f8fafc;padding:28px 18px}
.toast{animation:toastIn .2s ease}.toast.error{box-shadow:0 10px 30px rgba(180,35,24,.18)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(max-width:600px){
  .admin-topbar{box-shadow:0 2px 15px rgba(15,23,42,.06)}
  .admin-main{padding-bottom:28px}
  .admin-panel-title{padding-top:27px}
  .admin-panel-title h1{font-size:clamp(34px,11vw,46px)}
  .hero-copy{font-size:13px}
  .signal-item{min-height:76px}
  .admin-tabs{scrollbar-width:none}.admin-tabs::-webkit-scrollbar{display:none}
  .admin-tab{padding:12px 13px;font-size:12px}
  .panel{box-shadow:0 3px 16px rgba(15,23,42,.045)}
  .modal-bg{padding:10px 8px 24px}
  .modal{box-shadow:0 18px 55px rgba(15,23,42,.18)}
  .modal .btn{min-height:48px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}
}

/* ===== Mobile overflow + content fit ===== */
html,body,#app{max-width:100%;overflow-x:hidden}
.admin-shell,.admin-main,.admin-layout,.admin-layout>* ,.panel{min-width:0;max-width:100%}
.admin-layout{width:100%}
.panel{overflow:hidden}
.hero-copy,.admin-empty-panel,.panel p,.form-hint{overflow-wrap:anywhere;word-break:normal}
.table-wrap{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
.admin-note-table{max-width:none}
@media(max-width:600px){
  .admin-main{width:100%;overflow:hidden}
  .admin-panel-title{width:100%;max-width:100%}
  .admin-panel-title>div{min-width:0}
  .admin-panel-title h1{max-width:100%;overflow-wrap:normal}
  .admin-layout{display:grid;width:100%;grid-template-columns:minmax(0,1fr);gap:12px}
  .admin-layout>*{width:100%;min-width:0}
  .panel{width:100%;max-width:100%;overflow:hidden}
  .panel-head{min-width:0}
  .panel-head h3{min-width:0}
  .admin-note-table{width:100%;min-width:0;table-layout:fixed}
  .admin-note-table th,.admin-note-table td{padding:12px 7px;overflow:hidden;text-overflow:ellipsis}
  .admin-note-table th:nth-child(3),.admin-note-table td:nth-child(3){max-width:115px}
  .admin-note-table th:last-child,.admin-note-table td:last-child{width:68px}
  .admin-note-table .title-cell{width:42%;white-space:normal}
  .admin-note-table td{white-space:nowrap}
  .admin-note-table .title-cell,.admin-note-table .title-cell small{white-space:normal;overflow-wrap:anywhere}
  .admin-empty-panel{width:100%;max-width:100%;overflow-wrap:anywhere;white-space:normal}
  .admin-empty-panel p{max-width:100%;margin:12px 0}
  .modal-bg{width:100vw;max-width:100vw;left:0;right:0}
  .modal{width:100%;max-width:100%;min-width:0}
}

/* ===== Notes mobile card layout ===== */
@media(max-width:600px){
  .admin-note-table{display:block;width:100%;min-width:0;border-collapse:separate}
  .admin-note-table thead{display:none}
  .admin-note-table tbody{display:grid;gap:10px}
  .admin-note-table tbody tr{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
      "note status"
      "course course"
      "actions actions";
    gap:8px 10px;
    width:100%;
    padding:14px 12px;
    background:#fff;
    border:1px solid #e8ecf2;
    border-radius:13px;
    box-shadow:0 2px 8px rgba(15,23,42,.035);
  }
  .admin-note-table tbody td{
    display:block;
    width:auto!important;
    max-width:none!important;
    min-width:0;
    padding:0;
    border:0;
    overflow:visible;
    text-overflow:clip;
    white-space:normal;
  }
  .admin-note-table tbody td:nth-child(1){grid-area:note}
  .admin-note-table tbody td:nth-child(2){
    grid-area:course;
    color:#64748b;
    font-size:12px;
    padding-top:1px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .admin-note-table tbody td:nth-child(3){grid-area:status;align-self:start}
  .admin-note-table tbody td:nth-child(4){grid-area:actions;border-top:1px solid #eef2f6;padding-top:10px}
  .admin-note-table tbody td:nth-child(4) .admin-table-actions{
    display:flex;
    width:100%;
    gap:7px;
  }
  .admin-note-table tbody td:nth-child(4) .icon-btn{
    flex:1;
    min-height:40px;
    font-size:12px;
    justify-content:center;
  }
  .admin-note-table .title-cell{font-size:14px;line-height:1.35}
  .admin-note-table .title-cell small{font-size:11px;margin-top:2px}
  .admin-note-table .status{font-size:9px;padding:5px 7px}
}

/* ===== Category mobile cards ===== */
@media(max-width:600px){
  .category-table{display:block;width:100%;min-width:0}
  .category-table thead{display:none}
  .category-table tbody{display:grid;gap:12px}
  .category-table tbody tr{
    display:grid;
    grid-template-columns:minmax(90px,30%) minmax(0,1fr);
    grid-template-areas:
      "name description"
      "slug description"
      "action action";
    gap:7px 14px;
    width:100%;
    padding:16px 12px;
    border:1px solid #e7ebf1;
    border-radius:16px;
    background:#fff;
    box-shadow:0 2px 10px rgba(15,23,42,.035);
  }
  .category-table tbody td{
    display:block;
    width:auto!important;
    min-width:0;
    max-width:none!important;
    padding:0;
    border:0;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:normal;
  }
  .category-table tbody td:nth-child(1){
    grid-area:name;
    font-weight:800;
    font-size:14px;
    line-height:1.3;
  }
  .category-table tbody td:nth-child(2){
    grid-area:slug;
    color:#64748b;
    font-size:12px;
    overflow-wrap:anywhere;
  }
  .category-table tbody td:nth-child(3){
    grid-area:description;
    color:#334155;
    font-size:13px;
    line-height:1.5;
  }
  .category-table tbody td:nth-child(4){
    grid-area:action;
    border-top:1px solid #eef2f6;
    padding-top:10px;
  }
  .category-table tbody td:nth-child(4) .icon-btn{
    min-height:40px;
    min-width:82px;
    padding:0 16px;
  }
}

/* ===== Loading + service health ===== */
.loading-overlay{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:rgba(248,250,252,.82);backdrop-filter:blur(7px);opacity:0;visibility:hidden;transition:.18s}
.loading-overlay.show{opacity:1;visibility:visible}
.loading-card{min-width:190px;text-align:center;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:22px;box-shadow:0 20px 55px rgba(15,23,42,.12)}
.loading-card strong{display:block;margin-top:12px;font-size:14px}.loading-card small{display:block;margin-top:5px;color:#64748b;font-size:11px}
.loading-spinner{display:inline-block;width:27px;height:27px;border:3px solid #e5e7eb;border-top-color:var(--brand);border-radius:50%;animation:adminSpin .75s linear infinite;vertical-align:middle}
@keyframes adminSpin{to{transform:rotate(360deg)}}
.health-modal{max-width:540px}.health-content{margin-top:20px;display:grid;gap:10px}
.health-loading{padding:24px;text-align:center;color:#64748b;background:#f8fafc;border-radius:13px}
.health-loading .loading-spinner{margin-right:8px;width:20px;height:20px;border-width:2px}
.health-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:15px;border:1px solid #e5e7eb;border-radius:13px;background:#fff}
.health-row strong{display:block;font-size:14px}.health-row small{display:block;color:#64748b;font-size:11px;margin-top:4px;line-height:1.45}
.health-pill{flex:none;padding:7px 10px;border-radius:999px;font-size:10px;font-weight:800}
.health-pill.ok{background:#dcfce7;color:#166534}.health-pill.error{background:#fee2e2;color:#b42318}.health-time{color:#94a3b8;font-size:10px;text-align:right}.health-error{padding:15px;background:#fef2f2;color:#b42318;border-radius:12px;line-height:1.6}
@media(max-width:600px){
 .health-modal{max-width:none}.health-row{align-items:flex-start}.health-row small{max-width:220px}
}

/* ===== Dashboard service status cards ===== */
.service-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0 14px}
.service-card{display:flex;align-items:center;gap:12px;min-width:0;padding:15px 16px;background:#fff;border:1px solid #e5e7eb;border-radius:15px;box-shadow:var(--shadow-sm)}
.service-icon{width:38px;height:38px;display:grid;place-items:center;flex:none;border-radius:11px;background:#eef2ff;color:#4f46e5;font-size:12px;font-weight:900}
.service-card strong{display:block;font-size:13px}.service-card small{display:block;margin-top:3px;color:#94a3b8;font-size:10px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.service-state{display:inline-flex;margin-left:8px;padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;vertical-align:middle}.service-state.checking{background:#f1f5f9;color:#64748b}.service-state.healthy{background:#dcfce7;color:#166534}.service-state.failed{background:#fee2e2;color:#b42318}
@media(max-width:600px){
 .service-status-grid{grid-template-columns:1fr;gap:8px;margin:15px 0 10px}
 .service-card{padding:13px}.service-icon{width:36px;height:36px}
 .service-card strong{font-size:13px}.service-state{margin-left:5px}
 .service-card small{font-size:10px;max-width:250px}
}

@media(max-width:600px){
 .admin-table-actions{display:flex;gap:7px;flex-wrap:wrap}
 .admin-table-actions .icon-btn{min-height:40px;padding:0 13px}
 .delete-course-btn,.delete-note-btn{color:#b42318}
}


/* ===== Students control ===== */
.student-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  margin:14px 0;
}
.student-toolbar>div:first-child strong{display:block;font-size:22px;letter-spacing:-.03em}
.student-toolbar>div:first-child span{display:block;color:#64748b;font-size:11px;margin-top:2px}
.student-search{display:flex;align-items:center;gap:8px;min-width:280px}
.student-search input{
  width:min(340px,45vw);
  min-height:40px;
  border:1px solid #dbe1e8;
  border-radius:10px;
  padding:0 12px;
  outline:none;
  font:inherit;
  background:#fff;
}
.student-search input:focus{border-color:var(--brand);box-shadow:var(--focus)}
.student-identity{display:flex;align-items:center;gap:10px;min-width:0}
.student-identity>div{min-width:0}
.student-identity strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.student-identity small{display:block;color:#64748b;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.student-avatar{
  width:38px;height:38px;flex:none;border-radius:50%;object-fit:cover;
  border:1px solid #dbe5e7;background:#eef2f4;
}
.student-avatar-fallback{display:grid;place-items:center;font-weight:800;color:#14546a}
.student-id{font-size:10px;color:#64748b;word-break:break-all}
.student-modal{max-width:620px}
.student-profile-card{padding:4px 0 8px}
.student-profile-top{display:flex;align-items:center;gap:14px;padding:12px 0 20px;border-bottom:1px solid #edf0f4}
.student-profile-top h3{margin:0 0 8px;font-size:20px}
.student-avatar-large{width:74px;height:74px;flex:none;border-radius:50%;object-fit:cover;border:1px solid #dbe5e7;background:#eef2f4}
.student-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.student-facts>div{padding:13px;border:1px solid #e7ebf0;border-radius:12px;background:#fafbfc;min-width:0}
.student-facts span{display:block;color:#64748b;font-size:10px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:5px}
.student-facts strong{display:block;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
@media(max-width:600px){
  .student-toolbar{align-items:stretch;flex-direction:column;padding:12px;margin:12px 0}
  .student-search{min-width:0;width:100%}
  .student-search input{width:100%;min-width:0}
  .student-table tbody tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"student role" "id id" "joined joined" "action action"}
  .student-table tbody td:nth-child(1){grid-area:student}
  .student-table tbody td:nth-child(2){grid-area:id;color:#64748b;font-size:10px}
  .student-table tbody td:nth-child(3){grid-area:joined;color:#64748b;font-size:11px}
  .student-table tbody td:nth-child(4){grid-area:role}
  .student-table tbody td:nth-child(5){grid-area:action;border-top:1px solid #eef2f6;padding-top:10px}
  .student-table tbody td:nth-child(5) .icon-btn{width:100%;min-height:40px}
  .student-avatar{width:34px;height:34px}
  .student-facts{grid-template-columns:1fr}
  .student-modal{width:100%}
}

/* ===== Responsive footer ===== */
.admin-footer{width:100%;max-width:1180px;margin:0 auto;padding:20px 24px 26px;display:flex;align-items:center;justify-content:space-between;gap:16px;color:#64748b;font-size:11px;border-top:1px solid #e8edf3}
.admin-footer>div:first-child strong{display:block;color:#334155;font-size:11px}
.admin-footer>div:first-child span{display:block;margin-top:3px;color:#94a3b8}
.admin-footer-status{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.footer-dot{width:7px;height:7px;border-radius:50%;background:#cbd5e1;box-shadow:0 0 0 3px #f1f5f9}
.footer-dot.ok{background:#16a34a;box-shadow:0 0 0 3px #dcfce7}
.footer-dot.bad{background:#dc2626;box-shadow:0 0 0 3px #fee2e2}
.footer-sep{color:#cbd5e1}
@media(max-width:700px){.admin-footer{padding:18px 14px 24px;display:grid;gap:9px;justify-content:stretch}.admin-footer-status{justify-content:flex-start;line-height:1.5}}
@media(max-width:420px){.admin-topbar .admin-actions{width:100%;overflow-x:auto;scrollbar-width:none;padding-bottom:1px}.admin-topbar .admin-actions::-webkit-scrollbar{display:none}.admin-topbar .btn{flex:none}.admin-panel-title{padding-left:2px;padding-right:2px}.admin-tabs{overflow-x:auto;white-space:nowrap}.admin-tab{flex:none}.signal-rail{grid-template-columns:1fr 1fr}.panel-head{gap:8px;flex-wrap:wrap}}

/* Past Papers */
.paper-only-fields{display:none}
.paper-only-fields .field{margin-bottom:14px}
.past-paper-table th,.past-paper-table td{white-space:nowrap}
@media(max-width:760px){
  .admin-tabs{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .admin-tabs::-webkit-scrollbar{display:none}
  .admin-tab{flex:0 0 auto}
  .past-paper-table{min-width:720px}
}

/* ===== Notes + Past Papers form polish ===== */
.paper-only-fields{
  display:none;
  padding:14px;
  margin:0 0 4px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbfa;
}
.paper-only-fields .field:last-child{margin-bottom:0}
#resource-type{font-weight:600}
.upload-box{
  border:1px dashed #b8cbc7;
  border-radius:14px;
  padding:14px;
  background:#fbfdfc;
}
.upload-box input[type=file]{width:100%;max-width:100%}
@media(max-width:680px){
  .modal{width:calc(100vw - 24px);max-height:88vh;overflow:auto;padding:20px 16px}
  .form-stack{gap:13px}
  .paper-only-fields{padding:11px}
  .upload-box{padding:11px}
  .past-paper-table{min-width:720px}
}
