/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #1c2330;
  --border:       #30363d;
  --border-muted: #21262d;
  --text:         #e6edf3;
  --text-muted:   #7d8590;
  --text-subtle:  #484f58;
  --primary:      #3b82f6;
  --primary-hover:#2563eb;
  --success:      #22c55e;
  --error:        #f85149;
  --warning:      #d29922;
  --accent:       #58a6ff;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */
.container      { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.main-content   { flex: 1; padding: 2rem 0 3rem; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container,
.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 1rem;
}
.logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.site-header nav a {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.site-header nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.site-header nav a.nav-active { color: var(--text); background: rgba(255,255,255,0.08); }
.btn-link {
  background: none;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}
.btn-link:hover { color: var(--error); background: rgba(248,81,73,0.08); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-muted);
  padding: 1rem 0;
  color: var(--text-subtle);
  font-size: 0.78rem;
  text-align: center;
}

/* ============================================================
   Page Section Headers
   ============================================================ */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }
.muted { color: var(--text-muted); font-size: 0.875rem; }
p.muted { margin-bottom: 1.25rem; }

/* ============================================================
   Buttons — unified
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--border); }

.btn-danger { background: rgba(248,81,73,0.1); color: var(--error); border-color: rgba(248,81,73,0.3); }
.btn-danger:hover { background: rgba(248,81,73,0.2); border-color: rgba(248,81,73,0.45); }

.btn-success { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.2); }

.btn-warning { background: rgba(210,153,34,0.1); color: var(--warning); border-color: rgba(210,153,34,0.3); }
.btn-warning:hover { background: rgba(210,153,34,0.2); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin-bottom: 1rem; }

.quota-card .quota-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.quota-card .quota-value span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* ============================================================
   Alerts (inline banners for redirect-based feedback)
   ============================================================ */
.alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.alert-success { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.alert-error   { background: rgba(248,81,73,0.1);  color: var(--error);   border: 1px solid rgba(248,81,73,0.25); }

/* Toast (auto-fade for redirect notifications) */
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  transition: opacity 0.5s;
}
.toast-success { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.toast-error   { background: rgba(248,81,73,0.1);  color: var(--error);   border: 1px solid rgba(248,81,73,0.25); }
.toast-fade    { opacity: 0; pointer-events: none; }

/* ============================================================
   Status Badges
   ============================================================ */
.status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-pending  { background: rgba(210,153,34,0.15); color: var(--warning); border: 1px solid rgba(210,153,34,0.3); }
.status-approved { background: rgba(34,197,94,0.12);  color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.status-rejected { background: rgba(248,81,73,0.12);  color: var(--error);   border: 1px solid rgba(248,81,73,0.3); }
.status-deleted  { background: rgba(125,133,144,0.12); color: var(--text-muted); border: 1px solid rgba(125,133,144,0.25); }

/* ============================================================
   Tables — unified
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead { background: rgba(0,0,0,0.2); }
.data-table th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table td.actions {
  white-space: nowrap;
}
.data-table td.actions .btn,
.data-table td.actions form { display: inline; margin-right: 0.25rem; }
.data-table .cell-desc {
  max-width: 10em;
  word-break: break-word;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.data-table .cell-filename {
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Forms — unified
   ============================================================ */
.form-field { margin-bottom: 1rem; }
.form-field label,
.form-grid  label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
  appearance: auto;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-hint { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--text-muted); }

.form-inline { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.form-grid   { display: grid; gap: 0.85rem; }
.form-grid label { display: block; }
.form-grid label input,
.form-grid label textarea,
.form-grid label select { margin-top: 0.3rem; }
.form-grid > .btn,
.form-grid > button { justify-self: start; width: auto; }

.inline-form     { display: inline; }
.replace-file-form { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }

/* Inline number input for batch grams */
.form-inline input[type="number"] { width: 80px; }

/* ============================================================
   Modals — unified (works for both old "modal" and new "rv-modal" class patterns)
   ============================================================ */

/* Old class pattern (.modal / .modal-content) */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.modal-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  overflow: hidden;
}
.modal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  padding: 1.1rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.modal-content label {
  display: block;
  padding: 0 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.modal-content label input,
.modal-content label textarea {
  margin-top: 0.3rem;
}
.modal-content label textarea {
  min-height: 80px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem 1.1rem;
  margin-top: 0.85rem;
}

/* New rv-modal class pattern (admin/files.ejs) */
.rv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.rv-modal.rv-modal-open { display: flex; }
.rv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
.rv-modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  overflow: hidden;
}
.rv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.rv-modal-header h3 { font-size: 1rem; font-weight: 600; }
.rv-modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 0.25rem; border-radius: 6px; display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
}
.rv-modal-close:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.rv-modal-meta {
  margin: 1rem 1.25rem 0;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}
.rv-meta-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; }
.rv-meta-row span { color: var(--text-muted); }
.rv-meta-row strong { font-weight: 500; }
.rv-modal-field { padding: 0.85rem 1.25rem 0; }
.rv-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rv-gram-row    { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.rv-gram-input  {
  width: 120px; padding: 0.55rem 0.75rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 0.95rem;
  transition: border-color 0.15s;
}
.rv-gram-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.rv-gram-input:disabled { opacity: 0.35; }
.rv-gram-unit { color: var(--text-muted); font-size: 0.875rem; }
.rv-no-deduct-toggle {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: 0.875rem; user-select: none;
  transition: background 0.15s;
}
.rv-no-deduct-toggle:hover { background: rgba(255,255,255,0.07); }
.rv-no-deduct-toggle input { accent-color: var(--primary); cursor: pointer; }
.rv-toggle-box { display: none; }
.rv-textarea {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-size: 0.875rem; resize: vertical; min-height: 80px;
  font-family: inherit; transition: border-color 0.15s;
}
.rv-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.rv-modal-actions {
  display: flex; justify-content: flex-end;
  gap: 0.5rem; padding: 0.85rem 1.25rem 1.1rem;
}
.rv-modal-btn {
  padding: 0.48rem 1rem; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s;
}
.rv-modal-btn-cancel  { background: rgba(255,255,255,0.06); border-color: var(--border); color: var(--text); }
.rv-modal-btn-cancel:hover { background: rgba(255,255,255,0.1); }
.rv-modal-btn-confirm { background: var(--primary); color: #fff; border-color: var(--primary); }
.rv-modal-btn-confirm:hover { background: var(--primary-hover); }
.rv-modal-btn-danger  { background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.3); color: var(--error); }
.rv-modal-btn-danger:hover { background: rgba(248,81,73,0.2); }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.pagination .page-info { color: var(--text-muted); font-size: 0.82rem; }
.pagination a { text-decoration: none; }

/* ============================================================
   Auth (Login)
   ============================================================ */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.auth-form label { display: block; margin-bottom: 0.85rem; font-size: 0.82rem; color: var(--text-muted); }
.auth-form label input { margin-top: 0.3rem; }
.auth-form .btn { margin-top: 0.5rem; width: 100%; justify-content: center; }
.auth-divider { text-align: center; margin: 1rem 0 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.55rem 1rem; margin-top: 0.25rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  text-decoration: none; font-size: 0.875rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover { background: rgba(255,255,255,0.05); border-color: var(--text-muted); }
.btn-google-icon { flex-shrink: 0; }

/* ============================================================
   Admin — Student management toolbar
   ============================================================ */
.student-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.student-toolbar input[type="text"] { width: 200px; flex-shrink: 0; }
.student-toolbar select            { width: auto; }
.student-total { color: var(--text-muted); font-size: 0.82rem; margin-left: 0.25rem; }
.per-page { color: var(--text-muted); font-size: 0.82rem; }
.student-batch-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-muted);
  flex-wrap: wrap;
}
.student-batch-actions label { color: var(--text-muted); font-size: 0.875rem; display: flex; align-items: center; gap: 0.4rem; }
.student-batch-actions input[type="number"] { width: 70px; }

/* ============================================================
   Library
   ============================================================ */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .current { color: var(--text); }
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.library-toolbar input[type="text"]  { width: 200px; }
.library-toolbar input[type="file"]  { font-size: 0.82rem; color: var(--text-muted); }
.library-bulk-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-muted);
}

/* ============================================================
   Student — file links
   ============================================================ */
.link-download { color: var(--accent); text-decoration: none; font-size: 0.875rem; }
.link-download:hover { text-decoration: underline; }
.replace-file-form input[type="file"] { font-size: 0.78rem; max-width: 140px; }

/* ============================================================
   Admin Files (rv-*) — Audit Review Page
   ============================================================ */

/* Page header */
.rv-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.rv-title    { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.rv-subtitle { font-size: 0.875rem; color: var(--text-muted); }
.rv-count-badge {
  padding: 0.3rem 0.85rem;
  background: rgba(59,130,246,0.1);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Status Tabs */
.rv-tabs {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.rv-tab {
  padding: 0.5rem 1.05rem;
  border-radius: 8px 8px 0 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  bottom: -1px;
  transition: color 0.15s, background 0.15s;
}
.rv-tab:hover { color: var(--text); }
.rv-tab-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}

/* Main card */
.rv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 10px;
  overflow: hidden;
}

/* Table */
.rv-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rv-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rv-table thead { background: rgba(0,0,0,0.22); }
.rv-table th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.rv-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
}
.rv-table tbody tr:last-child td { border-bottom: none; }
.rv-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.rv-th-check, .rv-td-check { width: 2rem; padding-left: 0.9rem; }
.rv-checkbox { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

/* Cells */
.rv-td-project { min-width: 110px; max-width: 150px; }
.rv-project-name { display: block; font-weight: 500; }
.rv-project-desc { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.12rem; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-td-student { min-width: 130px; }
.rv-student-name  { display: block; font-weight: 500; }
.rv-student-email { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.rv-td-file { min-width: 110px; max-width: 170px; }
.rv-filename { display: block; color: var(--accent); text-decoration: none; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-filename:hover { text-decoration: underline; }
.rv-td-status { white-space: nowrap; min-width: 80px; }
.rv-badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.rv-badge-pending  { background: rgba(210,153,34,0.15); color: var(--warning); border: 1px solid rgba(210,153,34,0.3); }
.rv-badge-approved { background: rgba(34,197,94,0.12);  color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.rv-badge-rejected { background: rgba(248,81,73,0.12);  color: var(--error);   border: 1px solid rgba(248,81,73,0.3); }
.rv-badge-deleted  { background: rgba(125,133,144,0.1);  color: var(--text-muted); border: 1px solid rgba(125,133,144,0.2); }
.rv-reject-reason { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-td-grams { white-space: nowrap; }
.rv-grams       { font-weight: 600; color: var(--primary); font-size: 0.88rem; }
.rv-grams small { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; }
.rv-grams-free  { font-size: 0.8rem; color: var(--text-muted); }
.rv-na          { color: var(--text-subtle); }
.rv-td-time { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.rv-td-actions { white-space: nowrap; min-width: 130px; }
.rv-actions    { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.rv-inline-form { display: contents; }

/* Dense mode for review table */
.rv-table.rv-table-dense { font-size: 0.8rem; }
.rv-table.rv-table-dense th,
.rv-table.rv-table-dense td { padding: 0.52rem 0.62rem; }

/* Action buttons */
.rv-act {
  display: inline-flex; align-items: center; gap: 0.22rem;
  padding: 0.27rem 0.55rem; border-radius: 6px;
  font-size: 0.77rem; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; background: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4; white-space: nowrap; font-family: inherit;
}
.rv-act svg { flex-shrink: 0; }
.rv-act-download { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.25); color: var(--accent); }
.rv-act-download:hover { background: rgba(59,130,246,0.18); }
.rv-act-approve  { background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25);  color: var(--success); }
.rv-act-approve:hover  { background: rgba(34,197,94,0.18); }
.rv-act-reject   { background: rgba(248,81,73,0.06);  border-color: rgba(248,81,73,0.2);   color: var(--error); }
.rv-act-reject:hover   { background: rgba(248,81,73,0.15); }
.rv-act-revert   { background: rgba(210,153,34,0.06); border-color: rgba(210,153,34,0.2);  color: var(--warning); }
.rv-act-revert:hover   { background: rgba(210,153,34,0.15); }
.rv-act-delete   { background: transparent; border-color: rgba(248,81,73,0.15); color: rgba(248,81,73,0.5); }
.rv-act-delete:hover   { background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.35); color: var(--error); }

/* Batch bar */
.rv-batch-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
  font-size: 0.82rem;
}
.rv-batch-hint { color: var(--text-muted); }

/* Empty state */
.rv-empty {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.rv-empty svg { opacity: 0.35; margin: 0 auto 0.65rem; display: block; }
.rv-empty p   { margin: 0; font-size: 0.875rem; }

/* ============================================================
   Priority Badges
   ============================================================ */
.priority-badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.52rem; border-radius: 20px;
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap;
}
.priority-high   { background: rgba(248,81,73,0.15);   color: #f85149; border: 1px solid rgba(248,81,73,0.35); }
.priority-medium { background: rgba(210,153,34,0.15);  color: #d29922; border: 1px solid rgba(210,153,34,0.35); }
.priority-low    { background: rgba(34,197,94,0.1);    color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }

/* Printing Status Badges */
.printing-status-badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.52rem; border-radius: 20px;
  font-size: 0.73rem; font-weight: 600;
  white-space: nowrap;
}
.ps-not_started { background: rgba(125,133,144,0.12); color: var(--text-muted); border: 1px solid rgba(125,133,144,0.25); }
.ps-printing    { background: rgba(59,130,246,0.12);  color: var(--accent);     border: 1px solid rgba(59,130,246,0.3); }
.ps-completed   { background: rgba(34,197,94,0.12);   color: var(--success);    border: 1px solid rgba(34,197,94,0.3); }

/* Printer tag */
.rv-printer-tag {
  display: inline-block; padding: 0.15rem 0.45rem; border-radius: 5px;
  background: rgba(88,166,255,0.1); color: var(--accent);
  font-size: 0.75rem; border: 1px solid rgba(88,166,255,0.2);
  white-space: nowrap;
}

/* Type tag */
.rv-type-tag {
  display: inline-block; padding: 0.1rem 0.35rem; border-radius: 4px;
  background: rgba(125,133,144,0.1); color: var(--text-muted);
  font-size: 0.7rem; margin-top: 0.15rem;
}

/* Grams estimate */
.rv-grams-est { font-size: 0.78rem; color: var(--text-muted); }

/* Appointed time */
.rv-apt-time { color: var(--accent); font-size: 0.72rem; }

/* Priority summary row */
.priority-summary-row {
  display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.priority-summary-card {
  flex: 1; min-width: 110px; padding: 1rem 1.25rem;
  border-radius: 10px; text-align: center;
  border: 1px solid var(--border);
}
.priority-summary-high   { background: rgba(248,81,73,0.06);  border-color: rgba(248,81,73,0.2); }
.priority-summary-medium { background: rgba(210,153,34,0.06); border-color: rgba(210,153,34,0.2); }
.priority-summary-low    { background: rgba(34,197,94,0.05);  border-color: rgba(34,197,94,0.2); }
.ps-count { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; }
.ps-label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.priority-summary-high .ps-count   { color: #f85149; }
.priority-summary-medium .ps-count { color: #d29922; }
.priority-summary-low .ps-count    { color: #22c55e; }

/* Priority row highlights */
.priority-row-high   { border-left: 3px solid rgba(248,81,73,0.5); }
.priority-row-medium { border-left: 3px solid rgba(210,153,34,0.5); }
.priority-row-low    { border-left: 3px solid rgba(34,197,94,0.3); }

/* Priority tab colors */
.rv-tab-high.rv-tab-active   { color: #f85149; border-bottom-color: #f85149; }
.rv-tab-medium.rv-tab-active { color: #d29922; border-bottom-color: #d29922; }
.rv-tab-low.rv-tab-active    { color: #22c55e; border-bottom-color: #22c55e; }

/* Print count badge in student list */
.print-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 0.4rem;
  border-radius: 20px; background: rgba(59,130,246,0.12);
  color: var(--accent); font-size: 0.78rem; font-weight: 700;
  border: 1px solid rgba(59,130,246,0.2);
}

/* Required field badge */
.required-badge {
  display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
  background: rgba(248,81,73,0.15); color: var(--error);
  font-size: 0.7rem; font-weight: 600; margin-left: 0.3rem;
  vertical-align: middle;
}

/* Two-column form layout */
.form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.form-row-2 label { display: flex; flex-direction: column; gap: 0.35rem; }

/* Select in form */
.form-grid select, .rv-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23a6adbb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.8rem) 50%;
}
.form-grid select:focus, .rv-select:focus { border-color: var(--primary); }

/* Compact select variant for dense toolbars */
.rv-select-compact {
  font-size: 0.8rem;
  padding: 0.25rem 2rem 0.25rem 0.5rem;
}

/* Field hint */
.rv-field-hint { font-size: 0.78rem; color: var(--accent); font-weight: 400; }

/* Modal two-column layout */
.rv-modal-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .container, .container-wide { padding: 0 1rem; }
  .main-content { padding: 1.25rem 0 2rem; }
  .site-header nav a { padding: 0.3rem 0.45rem; font-size: 0.78rem; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.55rem 0.65rem; }
  .rv-table   { font-size: 0.82rem; }
  .rv-table th, .rv-table td { padding: 0.55rem 0.65rem; }
  .card { padding: 1rem 1.1rem; }
}

@media (max-width: 1400px) {
  .rv-project-desc,
  .rv-student-email,
  .rv-type-tag { display: none !important; }
  .rv-table th, .rv-table td { padding: 0.48rem 0.56rem; }
}
