/* ============================================================
   CEC Education Software Tracker - app.css
   Apple HIG-inspired design system
   ============================================================ */

[hidden] { display: none !important; }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--label);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --- Custom Properties --- */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --label: #000000;
  --label-2: #3C3C43;
  --label-3: #636366;
  --separator: #C6C6C8;
  --accent: #007AFF;
  --success: #34C759;
  --success-bg: #E8F8ED;
  --success-text: #1A5E2A;
  --danger: #FF3B30;
  --danger-bg: #FEF0EF;
  --danger-text: #8A1509;
  --warning: #FF9500;
  --warning-bg: #FFF4E5;
  --warning-text: #7A3E00;
  --purple-bg: #F3EEFF;
  --purple-text: #452880;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --cec-blue: #2472B3;
  --cec-dark: #1a3a5c;
}

/* --- Typography Scale --- */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.4; }
h4 { font-size: 15px; font-weight: 600; line-height: 1.4; }
p, .body { font-size: 17px; line-height: 1.6; }
.caption { font-size: 13px; color: var(--label-3); line-height: 1.4; }
small { font-size: 13px; }

/* --- Layout --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}
.page-padding { padding: 32px 0 64px; }
main { flex: 1; }

/* --- Site Header --- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--cec-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
  line-height: 1.2;
}
.logo-text span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--label-3);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  color: var(--label-2);
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--bg); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 500; }
.nav-admin-link {
  color: var(--label-3) !important;
  font-size: 13px !important;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--label-2);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--separator);
  padding: 8px 0 16px;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 12px 24px;
  color: var(--label-2);
  font-size: 17px;
  border-radius: 0;
}
.mobile-nav a:hover { background: var(--bg); text-decoration: none; }
.mobile-nav a.active { color: var(--accent); font-weight: 500; }

/* --- Site Footer --- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--separator);
  padding: 24px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner p {
  font-size: 13px;
  color: var(--label-3);
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  font-size: 13px;
  color: var(--label-3);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-approved { background: var(--success-bg); color: var(--success-text); }
.badge-review   { background: var(--warning-bg); color: var(--warning-text); }
.badge-rejected { background: var(--danger-bg); color: var(--danger-text); }
.badge-hold     { background: var(--purple-bg); color: var(--purple-text); }
.badge-cycle    { background: var(--warning-bg); color: var(--warning-text); font-size: 12px; padding: 2px 8px; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-lg { padding: 24px; }
.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-body { font-size: 15px; color: var(--label-2); }

/* --- Action Cards (home page grid) --- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.action-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--label);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
}
.action-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--label);
}
.action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.action-icon-blue   { background: #E5F0FF; }
.action-icon-green  { background: var(--success-bg); }
.action-icon-yellow { background: var(--warning-bg); }
.action-card-title { font-size: 17px; font-weight: 600; }
.action-card-desc  { font-size: 15px; color: var(--label-3); line-height: 1.5; flex: 1; }
.action-card-cta   { font-size: 15px; color: var(--accent); font-weight: 500; margin-top: 4px; }

/* --- Stats Bar --- */
.stats-bar {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat-item { display: flex; align-items: baseline; gap: 6px; }
.stat-number { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label  { font-size: 15px; color: var(--label-3); }
.stats-divider {
  width: 1px;
  height: 24px;
  background: var(--separator);
}

/* --- Hero / Page header --- */
.page-hero {
  padding: 40px 0 32px;
}
.page-hero h1 { margin-bottom: 8px; }
.page-hero .lead {
  font-size: 17px;
  color: var(--label-2);
  max-width: 600px;
  line-height: 1.6;
}

/* --- Form Elements --- */
.form-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.form-section-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--separator);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.field:last-child { margin-bottom: 0; }
.field label {
  font-size: 15px;
  font-weight: 500;
  color: var(--label-2);
}
.field label .required {
  color: var(--danger);
  margin-left: 2px;
}
.field-hint {
  font-size: 13px;
  color: var(--label-3);
  margin-top: -2px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field textarea,
.field select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--separator);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--label);
  font-size: 17px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}
.field input.error,
.field textarea.error,
.field select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636366' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.char-counter {
  font-size: 13px;
  color: var(--label-3);
  text-align: right;
  margin-top: -4px;
}
.char-counter.warn { color: var(--warning); }
.char-counter.over { color: var(--danger); }

/* Checkboxes & Radios */
.check-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.check-row,
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check-row:hover, .radio-row:hover { background: var(--bg); }
.check-row input[type="checkbox"],
.radio-row input[type="radio"] {
  width: 22px;
  height: 22px;
  min-height: unset;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.check-row span, .radio-row span {
  font-size: 17px;
  color: var(--label);
  line-height: 1.4;
}

/* Password toggle */
.input-with-toggle {
  position: relative;
}
.input-with-toggle input {
  padding-right: 52px;
}
.toggle-vis {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Inline Messages --- */
.field-error {
  font-size: 13px;
  color: var(--danger-text);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-error::before { content: '!'; font-weight: 700; }
.field-warn {
  font-size: 13px;
  color: var(--warning-text);
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.field-info {
  font-size: 13px;
  color: var(--accent);
  background: #E5F0FF;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.inline-notice {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.inline-notice.info {
  background: #E5F0FF;
  border-color: #B3D4FF;
  color: #004EA3;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 500;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Tool Directory --- */
.dir-controls {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px 10px 40px;
  border: 1.5px solid var(--separator);
  border-radius: var(--radius-md);
  font-size: 17px;
  background: var(--surface);
  color: var(--label);
  -webkit-appearance: none;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--label-3);
  pointer-events: none;
  font-size: 16px;
}
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-row select {
  min-height: 44px;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid var(--separator);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--surface);
  color: var(--label);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636366' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.filter-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}
.result-count {
  font-size: 15px;
  color: var(--label-3);
  margin-bottom: 12px;
}
.tool-list { display: flex; flex-direction: column; gap: 2px; }
.tool-row {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
}
.tool-row + .tool-row { margin-top: 4px; }
.tool-row:hover { background: #F7F7FA; border-color: var(--separator); }
.tool-row-main { flex: 1; min-width: 0; }
.tool-row-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-row-meta {
  font-size: 13px;
  color: var(--label-3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.tool-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chevron {
  color: var(--label-3);
  font-size: 18px;
  line-height: 1;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--label-3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--label-2); margin-bottom: 8px; }

/* --- Status Lookup --- */
.status-form-card { max-width: 560px; }
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--label-3);
  font-size: 15px;
}
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--separator);
}
.status-result {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 640px;
  margin-top: 24px;
}
.status-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.status-result-title { font-size: 20px; font-weight: 600; }
.status-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: var(--label-2);
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  margin-top: 16px;
}
.status-meta-row { display: flex; gap: 8px; }
.status-meta-label { color: var(--label-3); min-width: 130px; }
.status-message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.6;
}
.status-message.approved { background: var(--success-bg); color: var(--success-text); }
.status-message.review   { background: var(--warning-bg); color: var(--warning-text); }
.status-message.rejected { background: var(--danger-bg);  color: var(--danger-text); }
.status-message.hold     { background: var(--purple-bg);  color: var(--purple-text); }

/* --- Confirm Page --- */
.ref-block {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.ref-number {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: step;
}
.step-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--separator);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-body h4 { margin-bottom: 4px; }
.step-body p  { font-size: 15px; color: var(--label-2); }

/* --- Modal / Sheet --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
  padding-bottom: 16px;
}
.modal-title { font-size: 20px; font-weight: 700; }
.modal-close {
  background: var(--bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--label-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.modal-detail-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 15px;
  align-items: flex-start;
}
.modal-detail-row:last-child { border-bottom: none; }
.modal-detail-label { color: var(--label-3); min-width: 130px; flex-shrink: 0; }
.modal-detail-value { color: var(--label); }

/* --- Admin Layout --- */
.admin-header {
  background: var(--cec-dark);
  color: #fff;
}
.admin-header .header-inner { height: 56px; }
.admin-logo-text { font-size: 15px; font-weight: 600; color: #fff; }
.admin-logo-text span { display: block; font-size: 12px; color: rgba(255,255,255,0.6); font-weight: 400; }
.admin-logo-mark { background: rgba(255,255,255,0.2) !important; }
.admin-nav { display: flex; align-items: center; gap: 4px; }
.admin-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.admin-nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; color: #fff; }
.admin-nav a.active { color: #fff; background: rgba(255,255,255,0.15); }
.reviewer-chip {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  white-space: nowrap;
}

/* --- Triage Queue --- */
.queue-section { margin-bottom: 32px; }
.queue-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 10px;
  border-bottom: 2px solid var(--separator);
  margin-bottom: 8px;
}
.queue-section-title {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-badge {
  background: var(--bg);
  border: 1px solid var(--separator);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  padding: 1px 9px;
  color: var(--label-3);
}
.collapse-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.queue-row {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--label);
  transition: background 0.12s;
}
.queue-row:hover { background: #F7F7FA; text-decoration: none; color: var(--label); }
.queue-row.overdue-amber { border-left-color: var(--warning); }
.queue-row.overdue-red { border-left-color: var(--danger); }
.queue-row-name { font-size: 15px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row-stage { font-size: 13px; color: var(--label-3); }
.queue-row-reviewer { font-size: 13px; color: var(--label-3); white-space: nowrap; }
.queue-row-reviewer.unassigned { color: var(--danger); }
.queue-row-time { font-size: 13px; color: var(--label-3); white-space: nowrap; }
.queue-row-time.amber { color: var(--warning); }
.queue-row-time.red { color: var(--danger); }

/* --- Pipeline Status Panel (tool.html) --- */
.pipeline-panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.pipeline-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--separator);
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pipeline-panel-body { padding: 20px; }
.pipeline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.pipeline-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  flex-wrap: wrap;
}
.meta-item { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.meta-label { color: var(--label-3); }

/* --- Notes List --- */
.notes-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.note-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.note-meta { font-size: 13px; color: var(--label-3); margin-bottom: 6px; }
.note-text { font-size: 15px; color: var(--label); line-height: 1.6; }
.notes-empty { font-size: 15px; color: var(--label-3); font-style: italic; padding: 8px 0; }

/* --- Audit Trail --- */
.audit-list { display: flex; flex-direction: column; gap: 0; }
.audit-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}
.audit-item:last-child { border-bottom: none; }
.audit-date { color: var(--label-3); min-width: 110px; flex-shrink: 0; }
.audit-actor { color: var(--accent); min-width: 120px; flex-shrink: 0; }
.audit-action { color: var(--label-2); }

/* --- Tool Record Header --- */
.tool-record-header {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.tool-record-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.tool-record-meta { font-size: 14px; color: var(--label-3); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.tool-record-meta a { color: var(--accent); }

/* --- Collapsible Section --- */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--separator);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.collapsible-header h3 { font-size: 17px; font-weight: 600; }
.collapsible-chevron {
  color: var(--label-3);
  font-size: 16px;
  transition: transform 0.2s;
}
.collapsible-header.open .collapsible-chevron { transform: rotate(180deg); }
.collapsible-body { padding: 20px; }

/* --- Alert / Banner --- */
.alert {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger-text); }
.alert-warning  { background: var(--warning-bg); color: var(--warning-text); }
.alert-info     { background: #E5F0FF;            color: #004EA3; }

/* --- Login Page --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--cec-dark);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-mark {
  width: 56px;
  height: 56px;
  background: var(--cec-blue);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 12px;
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 15px; color: var(--label-3); }

/* --- Submission Details (collapsed panel) --- */
.sub-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.sub-detail-item { font-size: 14px; }
.sub-detail-label { color: var(--label-3); margin-bottom: 2px; font-size: 13px; }
.sub-detail-value { color: var(--label); }

/* --- Responsive: iPad 768px+ --- */
@media (min-width: 768px) {
  .hamburger { display: none; }
  .site-nav { display: flex; }
}

/* --- Responsive: Mobile < 768px --- */
@media (max-width: 767px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .action-card { flex-direction: row; padding: 16px; align-items: flex-start; }
  .action-icon { width: 40px; height: 40px; font-size: 20px; flex-shrink: 0; }
  .action-card-cta { display: none; }
  .stats-bar { gap: 16px; padding: 14px 16px; }
  .stats-divider { display: none; }
  .dir-controls { flex-direction: column; }
  .search-wrap { min-width: 0; }
  .pipeline-fields { grid-template-columns: 1fr; }
  .sub-detail-grid { grid-template-columns: 1fr; }
  .queue-row { grid-template-columns: 1fr auto; }
  .queue-row-stage, .queue-row-reviewer { display: none; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; }
  h1 { font-size: 24px; }
  .login-card { padding: 28px 20px; }
  .filter-row { gap: 8px; }
  .filter-row select { font-size: 14px; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }
}

/* Tag picker */
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.tag-option {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--separator);
  background: var(--fill-quaternary);
  color: var(--label-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.tag-option:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--fill-tertiary);
}
.tag-option.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tag-option.selected:hover {
  background: var(--accent-hover, #0051c3);
  border-color: var(--accent-hover, #0051c3);
  color: #fff;
}

.process-summary[open] .process-summary-chevron { transform: rotate(180deg); }
.process-summary-chevron { display: inline-block; transition: transform 0.2s; }

/* Compliance timeline */
.compliance-timeline { padding-left: 0; }
.ct-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}
.ct-step:last-child { padding-bottom: 0; }
.ct-step::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--separator);
}
.ct-step:last-child::after { display: none; }
.ct-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--separator);
  background: var(--background);
  position: relative;
  z-index: 1;
  margin-top: 1px;
}
.ct-done .ct-dot {
  background: var(--accent, #007aff);
  border-color: var(--accent, #007aff);
}
.ct-done .ct-dot::after {
  content: '';
  position: absolute;
  left: 4px; top: 2px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(40deg);
}
.ct-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 22px;
}
.ct-label { font-size: 14px; font-weight: 500; }
.ct-done .ct-label { color: var(--label); }
.ct-pending .ct-label { color: var(--label-2); }
.ct-date { font-size: 13px; color: var(--label-2); white-space: nowrap; }
.ct-done .ct-date { font-weight: 500; color: var(--label); }
.ct-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,122,255,0.1);
  color: var(--accent, #007aff);
}
