/* ui-refresh.css — load AFTER styles.css:  <link rel="stylesheet" href="/ui-refresh.css"> */

:root {
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.22);
  --fs-label: 0.76rem;   /* smallest text anywhere: was 0.52–0.66rem */
}

/* 1. Case: keep lowercase for interface chrome, restore sentence case for real content */
body { text-transform: none; }
.nav-item, .sidebar-hd, .topbar, .pg-hd h2, .pg-eyebrow, .sec-hd, .badge, .btn-sm, .btn-primary,
.btn-danger, .mobile-nav-item, .stat-lbl, .tbl th, .login-wrap h1, .form-row label, .settings-lbl,
.cc-tag, .assign-tag, .nc-eyebrow, .modal h3, .help-card h3 { text-transform: lowercase; }
.btn-sm, .btn-primary, .btn-danger { white-space: nowrap; }

/* 2. Readable small text */
.sidebar-hd, .pg-eyebrow, .sec-hd, .stat-lbl, .tbl th, .cc-tag, .assign-tag, .nc-eyebrow,
.badge, .settings-lbl, .mat-type, .login-err, .topbar-user, .logout-btn { font-size: var(--fs-label); letter-spacing: .08em; }
.nav-item { font-size: .9rem; padding: 10px 20px; }
.tbl td, .sess-desc, .ann-body, .assign-desc { font-size: .9rem; }
.sess-title, .mat-name { font-size: .95rem; }
.view[id^="view-admin"] .form-row label { font-size: var(--fs-label); letter-spacing: .06em; color: var(--muted); }

/* 3. Status messages become real banners (and disappear when empty) */
.form-msg:empty { display: none; }
.form-msg.ok, .form-msg.err { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: .88rem; }
.form-msg.ok  { background: var(--green-dim); border-color: rgba(121,201,146,.35); color: var(--green); }
.form-msg.err { background: var(--red-dim);   border-color: rgba(237,114,93,.4);  color: var(--red); }
#admin-status:not(:empty), #dashboard-status:not(:empty) { position: sticky; top: 64px; z-index: 50; backdrop-filter: blur(12px); margin-bottom: 16px; }

/* 4. Navigation */
.nav-item { margin: 2px 10px; border-left: 0; border-radius: 8px; }
.nav-item.active { background: var(--raised); box-shadow: inset 3px 0 0 var(--red); }
.sidebar { padding: 20px 0; }
.mobile-nav-item { font-size: .68rem; gap: 4px; }
.mobile-nav-item .mni { font-size: 1.25rem; }
.mobile-nav-item.active::before { top: 6px; left: 50%; right: auto; width: 28px; margin-left: -14px; height: 3px; border-radius: 3px; }
.mobile-more-menu button { font-size: .86rem; }

/* 5. Dashboard: stat strip, class cards, and the one memorable element — the next-class card */
.stat-strip { gap: 12px; border: 0; background: none; }
.stat-cell { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.stat-cell:last-child { border-right: 1px solid var(--rule); }
.stat-val { font-size: 2rem; }
.next-card { border: 1px solid rgba(121,201,146,.4); background: linear-gradient(160deg, rgba(121,201,146,.14), rgba(23,27,24,.9) 60%); box-shadow: var(--shadow); padding: 24px; }
.nc-eyebrow { color: var(--green); }
.nc-title { font-size: 1.4rem !important; }
.nc-meta { font-family: var(--body); font-size: .92rem; line-height: 1.6; color: var(--ink); opacity: .85; }
.course-card, .assign-card, .admin-cell, .help-card { box-shadow: var(--shadow); }
.class-change-panel, .classmates-panel { margin-left: 20px; }
.upcoming-list { margin-bottom: 18px; }
.upcoming-list .sess-row { grid-template-columns: 96px 1fr; border-radius: 8px; border: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 6px; background: var(--surface); }
.upcoming-list .sess-date { color: var(--green); font-size: .8rem; }

/* 6. Admin overview stat cards (JS uses admin-stat-lbl / admin-stat-val; old CSS styled as-label / as-val) */
.admin-stats { gap: 12px; background: none; border: 0; }
.admin-stat { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.admin-stat-lbl { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; text-transform: lowercase; }
.admin-stat-val { font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.admin-grid { gap: 12px; border: 0; background: none; }
.admin-cell { border: 1px solid var(--rule); }

/* 7. Admin forms: boxed, roomy inputs instead of tiny transparent underlines */
.view[id^="view-admin"] .form-row input, .view[id^="view-admin"] .form-row select, .view[id^="view-admin"] .form-row textarea,
.field-like { min-height: 44px; background: var(--surface); border: 1px solid var(--rule2); border-radius: 8px; padding: 10px 12px; font-family: var(--body); font-size: .95rem; font-weight: 400; }
.view[id^="view-admin"] .form-row textarea { height: auto; min-height: 96px; resize: vertical; }
.view[id^="view-admin"] .form-row select { appearance: auto; -webkit-appearance: auto; }
.view[id^="view-admin"] .form-row input:focus, .view[id^="view-admin"] .form-row select:focus, .view[id^="view-admin"] .form-row textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.view[id^="view-admin"] .btn-primary { min-height: 44px; font-family: var(--body); font-size: .92rem; letter-spacing: 0; border-radius: 8px; }
.view[id^="view-admin"] .btn-sm { min-height: 36px; font-family: var(--body); font-size: .84rem; border-radius: 8px; padding: 6px 12px; display: inline-flex; align-items: center; }
.btn-primary, .btn-sm, .btn-danger, .login-btn { border-radius: 8px; }
.btn-danger { font-family: var(--body); font-size: .82rem; padding: 6px 12px; min-height: 36px; }
.btn-primary:hover { background: var(--green); color: #0c110e; }
.login-btn:hover:not(:disabled) { background: var(--green); color: #0c110e; }
.submit-form textarea, .submit-form input, .grade-form input, .grade-form textarea { font-family: var(--body); font-size: .95rem; }
.submit-form textarea { height: 110px; padding: 10px 12px; border: 1px solid var(--rule2); border-radius: 8px; background: var(--surface); }
.submit-form input[type="url"] { padding: 10px 12px; border: 1px solid var(--rule2); border-radius: 8px; background: var(--surface); }
.grade-form input { width: 110px; }

/* 8. Tables */
.tbl { border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.tbl th { padding: 12px 14px; background: var(--raised); }
.tbl td { padding: 14px; color: var(--ink); font-weight: 400; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.025); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:last-child, .tbl th:last-child { text-align: right; }

/* 9. Loading + empty states */
.loading { font-size: .9rem; animation: none; color: transparent; height: 120px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--raised) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { text-align: center; }

/* 10. Login */
.login-wrap { border-radius: 14px; }
.field input { font-size: 1rem; }
.login-err { font-size: .84rem; letter-spacing: 0; }

/* 11. Phones: tables scroll instead of silently hiding the Actions column */
@media (max-width: 480px) {
  .tbl td:nth-child(n+4), .tbl th:nth-child(n+4) { display: table-cell; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }