/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0d1b2a;
  --gold:   #c9a84c;
  --gold-d: #a8872e;
  --white:  #ffffff;
  --bg:     #f4f5f7;
  --surface:#ffffff;
  --border: #dde0e6;
  --text:   #1a1a2e;
  --muted:  #6b7280;
  --danger: #dc2626;
  --success:#16a34a;
  --sidebar-w: 220px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size:14px; color:var(--text); background:var(--bg); }

/* ── Auth page ─────────────────────────────────────────────────────────────── */
body.auth-page { display:flex; align-items:center; justify-content:center; min-height:100vh; background:var(--navy); }

.auth-card { background:var(--white); border-radius:12px; padding:48px 40px; width:100%; max-width:420px; box-shadow:0 8px 32px rgba(0,0,0,.25); }

.auth-brand { text-align:center; margin-bottom:28px; }
.auth-brand .brand-mark { width:56px; height:56px; background:var(--navy); color:var(--gold); border-radius:50%; font-size:28px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; margin-bottom:12px; font-family:Georgia,serif; }
.auth-brand h1 { font-size:22px; color:var(--navy); margin-bottom:4px; }
.auth-brand p  { color:var(--muted); font-size:13px; }

.auth-intro  { color:var(--muted); margin-bottom:20px; line-height:1.55; }
.auth-note   { color:var(--muted); font-size:12px; margin-bottom:20px; }

.auth-form .form-group { margin-bottom:16px; }
.auth-form label { display:block; font-weight:600; margin-bottom:6px; font-size:13px; }
.auth-form input[type="email"] { width:100%; padding:10px 14px; border:1px solid var(--border); border-radius:6px; font-size:14px; transition:border-color .2s; }
.auth-form input[type="email"]:focus { outline:none; border-color:var(--gold); }

/* ── Admin layout ──────────────────────────────────────────────────────────── */
body.admin-layout { display:flex; min-height:100vh; }

/* Sidebar */
.sidebar { width:var(--sidebar-w); background:var(--navy); color:var(--white); display:flex; flex-direction:column; flex-shrink:0; position:fixed; top:0; left:0; height:100vh; overflow-y:auto; z-index:100; }

.sidebar-brand { display:flex; align-items:center; gap:10px; padding:20px 16px; color:var(--gold); font-weight:700; font-size:15px; text-decoration:none; border-bottom:1px solid rgba(255,255,255,.1); }
.sidebar-brand .brand-mark { width:32px; height:32px; background:var(--gold); color:var(--navy); border-radius:6px; display:inline-flex; align-items:center; justify-content:center; font-weight:800; font-family:Georgia,serif; font-size:16px; }

.sidebar-nav { padding:12px 0; flex:1; }
.sidebar-nav a { display:block; padding:8px 16px; color:rgba(255,255,255,.8); text-decoration:none; font-size:13px; border-left:3px solid transparent; transition:all .15s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-nav a:hover, .sidebar-nav a.active { color:var(--white); background:rgba(255,255,255,.08); border-left-color:var(--gold); }

.nav-divider { padding:12px 16px 4px; font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:rgba(255,255,255,.35); font-weight:600; }

.scope-form { padding:4px 16px 10px; }
.scope-form select {
  width:100%;
  border:1px solid rgba(255,255,255,.25);
  border-radius:5px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:12px;
  padding:6px 8px;
}

.logout-form { padding:8px 16px; }
.logout-btn { background:none; border:1px solid rgba(255,255,255,.25); color:rgba(255,255,255,.7); padding:7px 14px; border-radius:5px; cursor:pointer; font-size:13px; width:100%; text-align:left; transition:all .15s; }
.logout-btn:hover { border-color:var(--gold); color:var(--gold); }

/* Main content */
.main-content { margin-left:var(--sidebar-w); flex:1; padding:0 32px 48px; min-height:100vh; }

.page-header { display:flex; align-items:center; justify-content:space-between; padding:28px 0 20px; border-bottom:1px solid var(--border); margin-bottom:24px; }
.page-header h2 { font-size:22px; color:var(--navy); }
.header-sub { color:var(--muted); font-size:14px; margin-top:2px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary, button.btn-primary { background:var(--gold); color:var(--navy); border:none; padding:9px 20px; border-radius:6px; font-weight:600; font-size:14px; cursor:pointer; text-decoration:none; display:inline-block; transition:background .15s; }
.btn-primary:hover { background:var(--gold-d); }

.btn-secondary { background:transparent; color:var(--navy); border:1px solid var(--border); padding:8px 18px; border-radius:6px; font-size:14px; cursor:pointer; text-decoration:none; display:inline-block; transition:all .15s; }
.btn-secondary:hover { border-color:var(--navy); }

.btn-export { background:#1a4070; color:#fff; border:none; padding:8px 16px; border-radius:6px; font-size:13px; cursor:pointer; text-decoration:none; display:inline-block; transition:background .15s; }
.btn-export:hover { background:#0f2540; }

.btn-sm { padding:4px 10px; border-radius:4px; font-size:12px; font-weight:600; text-decoration:none; display:inline-block; border:1px solid var(--border); color:var(--navy); background:var(--white); cursor:pointer; transition:all .15s; }
.btn-sm:hover { background:var(--bg); }
.btn-sm.btn-danger { border-color:#fca5a5; color:var(--danger); background:#fff5f5; }
.btn-sm.btn-danger:hover { background:#fee2e2; }
.btn-sm.btn-export { border-color:#bfdbfe; color:#1d4ed8; background:#eff6ff; }

/* ── Flash messages ──────────────────────────────────────────────────────────── */
.flash { padding:12px 16px; border-radius:6px; margin-bottom:20px; font-size:14px; }
.flash-success { background:#dcfce7; color:#166534; border-left:4px solid var(--success); }
.flash-error   { background:#fee2e2; color:#991b1b; border-left:4px solid var(--danger); }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.admin-form { max-width:860px; }
.form-section-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:24px 0 12px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.form-group { display:flex; flex-direction:column; gap:5px; margin-bottom:16px; }
.form-group label { font-weight:600; font-size:13px; color:var(--navy); }
.form-group .hint { font-weight:400; color:var(--muted); font-size:12px; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea { padding:9px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; font-family:inherit; transition:border-color .2s; background:var(--white); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,168,76,.15); }
.form-group textarea { resize:vertical; }
.form-check label { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; padding-top:26px; }

.form-row { display:flex; gap:16px; flex-wrap:wrap; }
.form-row .form-group { flex:1; min-width:160px; }
.form-row .form-group.flex-2 { flex:2; }

.form-actions { margin-top:28px; display:flex; gap:12px; padding-top:20px; border-top:1px solid var(--border); }

/* Checkbox grid */
.checkbox-grid { display:flex; flex-wrap:wrap; gap:12px 24px; }
.checkbox-label { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; font-size:14px; }
.checkbox-label input { width:16px; height:16px; cursor:pointer; accent-color:var(--gold); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x:auto; border-radius:8px; border:1px solid var(--border); }
.admin-table { width:100%; border-collapse:collapse; background:var(--white); }
.admin-table th { background:var(--navy); color:var(--white); padding:10px 14px; text-align:left; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; white-space:nowrap; }
.admin-table td { padding:10px 14px; border-bottom:1px solid var(--border); font-size:13px; vertical-align:middle; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table tbody tr:hover { background:#fafbfc; }
.actions { display:flex; gap:6px; align-items:center; white-space:nowrap; }

.cert-groups-toolbar {
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:20px;
}
.cert-group-add-form {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.cert-group-add-form input[type="text"] {
  min-width:240px;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
  background:var(--white);
}
.cert-groups-hint {
  color:var(--muted);
  font-size:13px;
}
.cert-group-stack {
  display:flex;
  flex-direction:column;
  gap:18px;
}
.cert-group-card {
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--white);
  overflow:hidden;
  box-shadow:0 1px 3px rgba(13,27,42,.05);
}
.cert-group-card-ungrouped {
  border-style:dashed;
}
.cert-group-card.drag-active {
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(201,168,76,.15);
}
.cert-group-header {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:16px 18px;
  background:linear-gradient(135deg, var(--navy), #14345a);
  color:var(--white);
}
.cert-group-card-ungrouped .cert-group-header {
  background:linear-gradient(135deg, #425466, #5b7083);
}
.cert-group-title-wrap {
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.cert-group-title-wrap h3 {
  font-size:16px;
  margin-bottom:4px;
}
.cert-group-title-wrap p {
  color:rgba(255,255,255,.78);
  font-size:12px;
}
.cert-group-drag-handle,
.cert-item-drag-handle {
  font-size:18px;
  line-height:1;
  color:inherit;
  opacity:.75;
  user-select:none;
}
.cert-group-count {
  min-width:34px;
  height:34px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.16);
  color:var(--white);
  font-weight:700;
}
.cert-group-dropzone {
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:16px;
  min-height:94px;
  background:#fbfcfe;
}
.cert-group-dropzone.drop-target {
  background:#fff8e6;
}
.cert-group-empty {
  border:1px dashed #cbd5e1;
  border-radius:10px;
  padding:18px 16px;
  text-align:center;
  color:var(--muted);
  background:rgba(255,255,255,.85);
}
.cert-item-card {
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--white);
  padding:14px 16px;
}
.cert-item-card.drag-active {
  opacity:.55;
}
.cert-item-card.drop-before {
  border-top:3px solid var(--gold);
}
.cert-item-top {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}
.cert-item-title-wrap {
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.cert-item-title-wrap h4 {
  font-size:16px;
  color:var(--navy);
  margin-bottom:4px;
}
.cert-item-title-wrap p {
  color:var(--muted);
  font-size:13px;
}
.cert-item-actions {
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}
.cert-item-meta {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
  gap:12px;
}
.cert-item-meta > div {
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
}
.cert-item-label {
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.05em;
}

/* Badges */
.badge { display:inline-block; padding:2px 8px; border-radius:9999px; font-size:11px; font-weight:600; text-transform:capitalize; }
.badge-private  { background:#f3f4f6; color:#374151; }
.badge-export   { background:#dbeafe; color:#1e40af; }
.badge-public   { background:#dcfce7; color:#166534; }
.badge-archived { background:#fef9c3; color:#713f12; }

/* Education history cards */
.edu-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.edu-card {
  background:var(--white);
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px 18px 14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  background-image:linear-gradient(160deg, rgba(212,175,55,.08), transparent 42%);
}
.edu-card-brand { display:flex; align-items:flex-start; gap:12px; }
.edu-card-logo {
  width:52px; height:52px; object-fit:contain; border-radius:10px;
  background:#fff; border:1px solid var(--border); padding:4px; flex-shrink:0;
}
.edu-card-monogram {
  width:52px; height:52px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--navy); color:#fff; font-weight:700; font-size:20px;
}
.edu-card-brand-text { flex:1; min-width:0; }
.edu-card-institution { margin:0; font-size:16px; color:var(--navy); line-height:1.3; }
.edu-card-institution a { color:inherit; text-decoration:none; }
.edu-card-institution a:hover { color:var(--gold); text-decoration:underline; }
.edu-card-degree { margin:4px 0 0; font-size:13px; color:var(--muted); }
.edu-card-gpa {
  text-align:right; flex-shrink:0; min-width:64px;
  padding:6px 8px; border-radius:8px; background:rgba(13,27,42,.04);
}
.edu-card-gpa-value { display:block; font-size:18px; font-weight:700; color:var(--navy); line-height:1; }
.edu-card-gpa-scale { font-size:11px; color:var(--muted); }
.edu-card-gpa-label { display:block; font-size:10px; font-weight:700; letter-spacing:.06em; color:var(--muted); margin-top:2px; }
.edu-card-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:12px; color:var(--muted); }
.edu-meta-chip { background:var(--bg); border:1px solid var(--border); border-radius:6px; padding:2px 8px; color:var(--navy); font-weight:600; }
.edu-badge-row { display:flex; flex-wrap:wrap; gap:6px; }
.edu-honor-badge {
  display:inline-block; padding:3px 9px; border-radius:9999px; font-size:11px; font-weight:600;
  background:rgba(212,175,55,.18); color:#6b4f00; border:1px solid rgba(212,175,55,.35);
}
.edu-doc-row { display:flex; flex-wrap:wrap; gap:6px; }
.edu-doc-pill {
  display:inline-block; font-size:11px; font-weight:600; padding:3px 8px; border-radius:6px;
  background:#eef2ff; color:#3730a3;
}
.edu-doc-pill-transcript { background:#ecfdf5; color:#166534; }
.edu-doc-pill-diploma { background:#fff7ed; color:#9a3412; }
.edu-doc-pill-link { text-decoration:none; background:#f3f4f6; color:#1f2937; }
.edu-card-actions { display:flex; gap:8px; margin-top:auto; padding-top:4px; }

/* ── Dashboard stats ─────────────────────────────────────────────────────────── */
.stat-grid { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:32px; }
.stat-card { flex:1; min-width:120px; background:var(--white); border:1px solid var(--border); border-radius:10px; padding:20px; text-decoration:none; color:inherit; transition:box-shadow .15s, border-color .15s; }
.stat-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.08); border-color:var(--gold); }
.stat-num   { font-size:32px; font-weight:700; color:var(--navy); line-height:1.1; }
.stat-label { font-size:13px; color:var(--muted); margin-top:4px; }

.quick-actions { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:20px 24px; }
.quick-actions h3 { margin-bottom:14px; font-size:15px; color:var(--navy); }
.action-row { display:flex; gap:10px; flex-wrap:wrap; }
.btn-action { background:var(--bg); border:1px solid var(--border); color:var(--navy); padding:9px 18px; border-radius:6px; font-size:13px; text-decoration:none; font-weight:500; transition:all .15s; }
.btn-action:hover { border-color:var(--gold); background:var(--white); }

.expiration-dashboard { margin-bottom:20px; background:var(--white); border:1px solid var(--border); border-radius:10px; padding:20px 24px; }
.expiration-dashboard-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:16px; }
.expiration-dashboard-head h3 { font-size:15px; color:var(--navy); margin-bottom:6px; }
.expiration-next { min-width:220px; padding:10px 12px; border-radius:8px; background:var(--bg); color:var(--navy); font-size:13px; line-height:1.45; }
.expiration-group-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; }
.expiration-group { border:1px solid var(--border); border-radius:10px; padding:16px; background:#fff; min-height:220px; }
.expiration-group-head { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:12px; }
.expiration-group-head h4 { font-size:14px; color:var(--navy); }
.expiration-group-count { display:inline-flex; align-items:center; justify-content:center; min-width:28px; height:28px; border-radius:999px; font-size:12px; font-weight:700; }
.expiration-group-red { border-color:#fecaca; background:#fef2f2; }
.expiration-group-red .expiration-group-count { background:#dc2626; color:#fff; }
.expiration-group-yellow { border-color:#fde68a; background:#fffbeb; }
.expiration-group-yellow .expiration-group-count { background:#d97706; color:#fff; }
.expiration-group-green { border-color:#bbf7d0; background:#f0fdf4; }
.expiration-group-green .expiration-group-count { background:#16a34a; color:#fff; }
.expiration-list { list-style:none; display:flex; flex-direction:column; gap:10px; }
.expiration-item { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:12px; border:1px solid rgba(13,27,42,.08); border-radius:8px; background:rgba(255,255,255,.82); }
.expiration-item h5 { font-size:13px; color:var(--navy); margin-bottom:4px; }
.expiration-meta, .expiration-days { color:var(--muted); font-size:12px; line-height:1.45; }
.expiration-days { font-weight:600; }

.security-card { margin-top:20px; background:var(--white); border:1px solid var(--border); border-radius:10px; padding:20px 24px; }
.security-card h3 { margin-bottom:10px; font-size:15px; color:var(--navy); }
.security-card p { color:var(--muted); line-height:1.5; }
.security-row { margin-top:14px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.security-meta { color:var(--navy); font-weight:600; }
.security-status { margin-top:10px; min-height:20px; font-size:13px; }

.credential-history-section { margin:24px 0; }
.credential-history-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.credential-history-head h3, .history-form-card h4 { color:var(--navy); }
.history-form-card { margin-top:16px; border:1px solid var(--border); border-radius:10px; background:var(--white); padding:18px 20px; }
.history-inline-form { max-width:none; }

/* ── Preview ─────────────────────────────────────────────────────────────────── */
.preview-meta { display:flex; gap:24px; background:var(--white); border:1px solid var(--border); border-radius:8px; padding:14px 20px; margin-bottom:24px; font-size:14px; }
.preview-section { background:var(--white); border:1px solid var(--border); border-radius:8px; padding:20px; margin-bottom:16px; }
.preview-section h3 { font-size:15px; color:var(--navy); margin-bottom:12px; border-bottom:1px solid var(--border); padding-bottom:8px; }
.preview-list { list-style:none; display:flex; flex-direction:column; gap:6px; }
.preview-list.inline-list { flex-direction:row; flex-wrap:wrap; gap:6px; }
.preview-list li { font-size:13px; }
.preview-list.inline-list li { background:var(--bg); border:1px solid var(--border); border-radius:999px; padding:3px 12px; font-size:12px; }

/* Empty states */
.empty-state { color:var(--muted); padding:32px 0; font-size:14px; }

/* ── Certificate extraction review UI ───────────────────────────────────────── */

.cert-file-banner {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-bottom:20px; padding:10px 14px;
  background:#f0f7ff; border:1px solid #c8e1ff; border-radius:6px;
  font-size:0.9em;
}
.cert-file-hint { margin-left:auto; color:var(--muted); font-size:0.85em; }
.muted-text { color:var(--muted); }

/* Two-column review layout */
.cert-review-layout {
  display:grid;
  grid-template-columns: 1fr 360px;
  gap:24px;
  align-items:start;
  margin-top:4px;
}
.cert-review-left  { min-width:0; }
.cert-review-right { position:sticky; top:24px; }

/* Review field container */
.review-field {
  margin-bottom:16px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--white);
  transition:border-color .2s, box-shadow .2s;
}
.review-field.active {
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(201,168,76,.15);
}
.review-field.field-needs-review {
  border-left:4px solid #f59e0b;
  background:#fffbeb;
}
.review-field.field-needs-review.active {
  border-color:var(--gold);
  border-left-color:var(--gold);
}

/* Field header: label + confidence badge + choose button */
.review-field-header {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-bottom:8px;
}
.review-label {
  font-weight:600; font-size:13px; color:var(--navy);
  flex-shrink:0;
}
.review-label .required { color:var(--danger); }

/* Confidence badge */
.conf-badge {
  font-size:11px; font-weight:700; padding:2px 7px;
  border-radius:9999px; flex-shrink:0;
}
.conf-high { background:#dcfce7; color:#166534; }
.conf-med  { background:#fef3c7; color:#92400e; }
.conf-low  { background:#fee2e2; color:#991b1b; }

/* "Choose" pick button */
.btn-pick {
  margin-left:auto;
  padding:3px 10px;
  border:1px solid var(--gold);
  border-radius:5px;
  background:transparent;
  color:var(--gold-d);
  font-size:12px; font-weight:600;
  cursor:pointer;
  transition:all .15s;
  white-space:nowrap;
}
.btn-pick:hover { background:var(--gold); color:var(--navy); }

/* Full-width input inside review field */
.review-input {
  width:100%;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
  font-family:inherit;
  transition:border-color .2s;
  background:var(--white);
}
.review-input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,168,76,.15); }
.review-input.field-just-filled { border-color:var(--success); box-shadow:0 0 0 3px rgba(22,163,74,.15); }

.cert-extraction-review {
  margin:20px 0;
  padding:18px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--bg);
}
.cert-extraction-review-header {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.cert-extraction-review-header h3,
.cert-extraction-summary-card h4 {
  margin:0 0 6px;
}
.cert-extraction-summary {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
}
.cert-extraction-summary-card,
.cert-extraction-field {
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--white);
  padding:14px;
}
.cert-extraction-summary-card ul {
  margin:0;
  padding-left:18px;
}
.cert-extraction-field {
  margin-top:14px;
}
.cert-extraction-field-header,
.cert-extraction-field-actions {
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.cert-extraction-candidates {
  margin-top:12px;
}
.btn-keep-existing {
  padding:4px 12px;
}

/* Right panel card */
.cert-review-panel {
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
  background:var(--white);
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  max-height:calc(100vh - 60px);
  display:flex;
  flex-direction:column;
}
.panel-header {
  display:flex; align-items:center; gap:8px;
  background:var(--navy);
  color:var(--white);
  padding:12px 16px;
  font-size:13px; font-weight:600;
  flex-shrink:0;
}
#panel-title { flex:1; }
.panel-close {
  background:none; border:none; color:rgba(255,255,255,.6);
  font-size:15px; cursor:pointer; padding:0 2px;
  transition:color .15s;
}
.panel-close:hover { color:var(--white); }

.panel-body {
  padding:16px;
  overflow-y:auto;
  flex:1;
}
.panel-hint { color:var(--muted); font-size:13px; line-height:1.5; margin-bottom:12px; }

/* Candidate cards */
.candidate-card {
  border:1px solid var(--border);
  border-radius:6px;
  padding:12px;
  margin-bottom:10px;
  background:var(--bg);
  transition:border-color .15s;
}
.candidate-card:last-child { margin-bottom:0; }
.candidate-selected {
  border-color:var(--success);
  background:#f0fdf4;
}
.candidate-value {
  font-size:14px; font-weight:600; color:var(--navy);
  margin-bottom:4px;
  overflow-wrap:break-word;
}
.candidate-conf {
  font-size:11px; font-weight:700;
  padding:1px 6px; border-radius:9999px;
  display:inline-block; margin-bottom:6px;
}
.candidate-context {
  font-size:12px; color:var(--muted);
  font-style:italic;
  margin-bottom:8px;
  line-height:1.4;
}
.btn-candidate-select {
  font-size:12px; font-weight:600;
  padding:4px 12px;
  border-radius:5px;
  border:1px solid var(--gold);
  background:transparent;
  color:var(--gold-d);
  cursor:pointer;
  transition:all .15s;
}
.btn-candidate-select:hover { background:var(--gold); color:var(--navy); }
.btn-candidate-selected {
  border-color:var(--success);
  background:#dcfce7;
  color:#166534;
  cursor:default;
}

/* Raw text preview in the right panel */
.raw-text-section { margin-top:4px; }
.raw-text-label {
  font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:.06em; color:var(--muted);
  margin-bottom:6px;
}
.raw-text-preview {
  font-size:11px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  white-space:pre-wrap; overflow-wrap:break-word;
  color:var(--text);
  line-height:1.5;
  max-height:360px;
  overflow-y:auto;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:4px;
  padding:10px;
}

/* Image preview in right panel */
.doc-image-wrap { text-align:center; padding-top:4px; }
.doc-preview-img {
  max-width:100%; border-radius:4px;
  border:1px solid var(--border);
  display:block; margin:0 auto;
}

/* Responsive: stack columns on narrow screens */
@media (max-width: 900px) {
  .cert-review-layout { grid-template-columns: 1fr; }
  .cert-review-right  { position:static; }
  .cert-review-panel  { max-height:400px; }
  .cert-groups-toolbar,
  .cert-item-top { flex-direction:column; align-items:stretch; }
  .expiration-dashboard-head,
  .expiration-item { flex-direction:column; }
  .expiration-next { min-width:0; width:100%; }
  .expiration-group-grid { grid-template-columns:1fr; }
}

/* ── Corporation tiles (work history list) ──────────────────────────────────── */
.corp-tiles { display:flex; flex-direction:column; gap:20px; }

/* Umbrella group (parent company wrapping multiple companies) */
.umbrella-group { display:flex; flex-direction:column; gap:0; border:2px solid var(--gold); border-radius:12px; overflow:hidden; }
.umbrella-header {
  background:var(--gold); color:var(--navy);
  font-size:13px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  padding:6px 20px;
}
.umbrella-companies { display:flex; flex-direction:column; gap:0; }
.umbrella-companies .corp-tile { border:none; border-radius:0; border-top:1px solid var(--border); }
.umbrella-companies .corp-tile:first-child { border-top:none; }

.corp-tile { background:var(--white); border:1px solid var(--border); border-radius:10px; overflow:hidden; }

.corp-tile-header {
  background:var(--navy); color:var(--white);
  padding:16px 20px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.corp-tile-header-main { flex:1; min-width:0; }
.corp-tile-name { font-size:18px; font-weight:700; line-height:1.2; }
.corp-tile-parent { font-size:12px; color:rgba(255,255,255,.6); margin-top:3px; font-style:italic; }
.corp-tile-meta { display:flex; gap:12px; align-items:center; margin-top:6px; flex-wrap:wrap; }
.corp-date-range { font-size:12px; color:rgba(255,255,255,.75); }
.corp-position-count { font-size:11px; font-weight:600; background:rgba(255,255,255,.15); padding:2px 8px; border-radius:9999px; color:rgba(255,255,255,.9); }
.corp-tile-header-actions { align-self:center; flex-shrink:0; }

/* Position tabs */
.corp-tabs {
  display:flex; align-items:stretch;
  background:var(--bg); border-bottom:1px solid var(--border);
  padding:0 16px; gap:2px; overflow-x:auto;
}
.corp-tab {
  background:transparent; border:none; border-bottom:3px solid transparent;
  padding:10px 16px; font-size:13px; font-weight:500; color:var(--muted);
  cursor:pointer; white-space:nowrap; transition:color .15s, border-color .15s;
  flex-shrink:0;
}
.corp-tab:hover { color:var(--navy); }
.corp-tab.active { color:var(--navy); border-bottom-color:var(--gold); font-weight:600; }

/* Tab panels */
.corp-tab-panel { display:none; }
.corp-tab-panel.active { display:block; }

.corp-job-row {
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:14px 20px; gap:16px; flex-wrap:wrap;
}
.corp-job-info { flex:1; min-width:0; }
.corp-job-title { font-size:14px; font-weight:600; color:var(--navy); }
.corp-job-meta { display:flex; flex-wrap:wrap; gap:6px; font-size:12px; color:var(--muted); margin-top:3px; }
.corp-job-desc { font-size:13px; color:var(--muted); margin-top:6px; line-height:1.5; }
.corp-job-actions { display:flex; gap:6px; align-items:center; flex-shrink:0; flex-wrap:wrap; }

/* ── Assign-existing panel (work history list) ───────────────────────────────── */
.corp-assign-panel {
  background:var(--bg); border-top:1px solid var(--border);
  padding:12px 20px;
}
.corp-assign-empty { font-size:13px; color:var(--muted); margin:0; }
.corp-assign-label { display:block; font-size:13px; font-weight:600; color:var(--navy); margin-bottom:8px; }
.corp-assign-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.corp-assign-select { flex:1; min-width:180px; font-size:13px; padding:6px 10px; border:1px solid var(--border); border-radius:6px; }

/* ── Corporation info tile (work edit form) ──────────────────────────────────── */
.corp-info-tile {
  background:var(--navy); border-radius:10px; padding:20px 24px; margin-bottom:24px;
}
.corp-info-tile-header {
  display:flex; gap:12px; align-items:center; margin-bottom:16px;
}
.corp-info-tile-icon { font-size:24px; line-height:1; }
.corp-info-tile-label { font-size:14px; font-weight:700; color:var(--gold); }
.corp-info-tile-hint { font-size:12px; color:rgba(255,255,255,.6); margin-top:2px; }

.corp-info-tile .form-group label { color:rgba(255,255,255,.85); }
.corp-info-tile .form-group .hint { color:rgba(255,255,255,.45); }
.corp-info-tile .form-group input[type="text"] {
  background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.25);
  color:var(--white);
}
.corp-info-tile .form-group input[type="text"]::placeholder { color:rgba(255,255,255,.35); }
.corp-info-tile .form-group input[type="text"]:focus {
  border-color:var(--gold);
  background:rgba(255,255,255,.15);
  box-shadow:0 0 0 3px rgba(201,168,76,.2);
}

/* ── Portfolio Administration Console (BP-015) ───────────────────────────── */
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.console-page .page-header { align-items:flex-start; gap:16px; flex-wrap:wrap; }
.console-alerts { margin-bottom:20px; }
.console-alert-list { list-style:none; display:flex; flex-direction:column; gap:8px; }
.console-alert {
  display:flex; justify-content:space-between; gap:12px; align-items:center;
  padding:10px 14px; border-radius:8px; border:1px solid var(--border); background:var(--surface);
}
.console-alert-warning { border-color:#f59e0b; background:#fffbeb; }
.console-alert-info { border-color:#93c5fd; background:#eff6ff; }
.console-section-head {
  display:flex; justify-content:space-between; align-items:baseline; gap:12px;
  margin:28px 0 12px; flex-wrap:wrap;
}
.console-section-head h3, .console-summaries > h3, .console-deeplinks > h3,
.console-saved-views > h3, .console-eai > h3, .console-audit-preview > h3 { color:var(--navy); }
.console-stat-grid { margin-top:12px; }
.console-queue-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:16px; margin-top:12px;
}
.console-queue-card {
  background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:16px;
}
.console-queue-card header {
  display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px;
}
.console-queue-card h3, .console-queue-card h4 { font-size:15px; color:var(--navy); margin:0; }
.console-queue-card .badge {
  background:var(--navy); color:var(--white); border-radius:999px; padding:2px 8px; font-size:12px;
}
.console-item-list { list-style:none; display:flex; flex-direction:column; gap:10px; margin:10px 0; }
.console-item-list li {
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
  padding-bottom:8px; border-bottom:1px solid var(--border);
}
.console-queue-link { font-size:13px; color:var(--gold-d); text-decoration:none; font-weight:600; }
.console-queue-link:hover { text-decoration:underline; }
.console-link-row { flex-wrap:wrap; margin-top:12px; }
.console-search-form, .console-saved-form {
  display:flex; gap:12px; align-items:end; flex-wrap:wrap; margin-top:8px;
}
.checkbox-inline { display:inline-flex; align-items:center; gap:6px; font-size:13px; margin-bottom:8px; }
.console-footnote { margin-top:32px; font-size:12px; max-width:70ch; }
.muted-text { color:var(--muted); }

@media (max-width: 800px) {
  .sidebar { position:static; width:100%; height:auto; }
  body.admin-layout { flex-direction:column; }
  .main-content { margin-left:0; padding:0 16px 40px; }
  .console-queue-grid { grid-template-columns:1fr; }
}
