:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #17212b;
  --muted: #667085;
  --line: #d8dee6;
  --primary: #14532d;
  --primary-2: #1f7a43;
  --danger: #b42318;
  --warning: #b54708;
  --info: #175cd3;
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; background: #0f1f17; color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 10px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #ffffff; color: var(--primary); font-weight: 800; flex: 0 0 46px; overflow: hidden; }
.brand-mark.has-image { padding: 5px; }
.brand-mark img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brand small, .topbar small { display: block; color: #9da6b2; font-size: 12px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { color: #d9e3dd; font-size: 14px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 14px; min-height: 44px; transition: background .15s ease, color .15s ease; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-link.active { border: 1px solid rgba(255,255,255,.10); }
.nav-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 30px; background: rgba(255,255,255,.10); color: #d9e3dd; }
.nav-link:hover .nav-icon, .nav-link.active .nav-icon { background: #fff; color: var(--primary); }
.nav-icon svg, .bottom-icon svg, .btn-icon svg { width: 18px; height: 18px; display: block; fill: currentColor; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; min-width: 0; }
.topbar { height: 68px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 4; }
.menu-btn { display: none; border: 0; background: var(--surface-2); border-radius: 12px; padding: 10px 13px; font-size: 20px; }
.content { padding: 24px; padding-bottom: 92px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
h1 { font-size: 25px; margin: 0 0 5px; }
p.sub { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.metric { font-size: 32px; font-weight: 800; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: 14px; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-2); }
.btn-light { background: var(--surface-2); color: var(--text); }
.btn-light:hover { background: #dde5ec; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 7px 10px; border-radius: 10px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; color: #344054; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; color: var(--text); font: inherit; outline: none; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.filter-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: #475467; background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; background: #eef2f6; color: #344054; }
.badge-pending, .badge-submitted, .badge-under-review, .badge-sent { background: #fff7ed; color: #b54708; }
.badge-approved, .badge-active, .badge-responded, .badge-closed { background: #ecfdf3; color: #027a48; }
.badge-rejected, .badge-cancelled, .badge-expired, .badge-ended { background: #fef3f2; color: #b42318; }
.badge-for-nte { background: #eff8ff; color: #175cd3; }
.alert { padding: 13px 15px; border-radius: 14px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #027a48; }
.alert-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert-info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding: 14px 0; }
.pagination a { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-weight: 700; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.profile-head { display: flex; gap: 18px; align-items: center; }
.avatar { width: 84px; height: 84px; border-radius: 24px; background: var(--surface-2); display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--primary); object-fit: cover; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; }
.kv span:nth-child(odd) { color: var(--muted); font-weight: 700; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #f4f6f8 0%, #e8efea 100%); }
.login-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 26px; }
.login-logo { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 900; font-size: 22px; margin-bottom: 16px; overflow: hidden; }
.login-logo.has-image { background: #fff; border: 1px solid var(--line); padding: 7px; }
.login-logo img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.bottom-nav { display: none; }
.btn-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .filter-bar, .pagination { display:none !important; }
  .content { padding:0; }
  .card, .table-wrap { border:0; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: -290px; z-index: 10; transition: .2s ease; }
  .sidebar-open .sidebar { left: 0; }
  .menu-btn { display: inline-block; }
  .content { padding: 16px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; }
  .topbar { padding: 0 14px; }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 4px max(8px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x;
    z-index: 8;
  }
  .bottom-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
  .bottom-nav-link {
    flex: 0 0 84px;
    min-width: 84px;
    height: 62px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 5px 7px;
    border-radius: 14px;
    font-size: 10.5px;
    line-height: 1.1;
    color: #344054;
    font-weight: 800;
    text-align: center;
    scroll-snap-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-link.active { color: var(--primary); background: #f1f7f3; }
  .bottom-nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .bottom-label { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-icon { width: 24px; height: 24px; display: grid; place-items: center; color: currentColor; }
  .bottom-icon svg { width: 21px; height: 21px; }
  table { min-width: 780px; }
}
@media (max-width: 520px) {
  .filter-bar { grid-template-columns: 1fr; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .profile-head { align-items: flex-start; }
  .kv { grid-template-columns: 1fr; }
}
.section-title { margin: 18px 0 12px; padding-top: 4px; font-size: 18px; color: #173624; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.check-grid label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; }
.check-grid input[type="checkbox"] { width: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
@media (max-width: 960px) { .check-grid { grid-template-columns: 1fr; } }

/* Lightweight employee advanced search */
.employee-search-field { min-width: 0; }
.employee-search { position: relative; }
.employee-search-input-wrap { display: flex; gap: 8px; align-items: center; }
.employee-search-input-wrap .employee-search-input { flex: 1; min-width: 0; }
.employee-search-clear { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 12px; padding: 11px 12px; font-weight: 800; cursor: pointer; }
.employee-search-clear:hover { background: #dde5ec; }
.employee-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 28px rgba(16,24,40,.12); overflow: hidden; max-height: 300px; overflow-y: auto; }
.employee-search-result, .employee-search-empty { width: 100%; display: block; text-align: left; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.employee-search-result:last-child, .employee-search-empty:last-child { border-bottom: 0; }
.employee-search-result:hover { background: #f8fafc; }
.employee-search-result strong { display: block; font-size: 14px; }
.employee-search-result small, .employee-search-selected small, .field-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.employee-search-selected { display: none; margin-top: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.employee-search-selected.is-visible { display: block; }
.employee-search-selected strong { display: block; font-size: 13px; }
.req { color: var(--danger); }
.filter-bar-employee-search { grid-template-columns: minmax(260px, 1fr) auto; align-items: end; }
.filter-bar .employee-search-field label { margin-bottom: 6px; }
@media (max-width: 520px) {
  .employee-search-input-wrap { display: grid; grid-template-columns: 1fr; }
  .employee-search-clear { width: 100%; }
  .filter-bar-employee-search { grid-template-columns: 1fr; }
}

/* Dashboard mobile/android-style cards - clean, no glow */
.dashboard-head { align-items: center; }
.scope-banner { background: #f1f7f3; border: 1px solid #cfe7d6; color: #173624; border-radius: var(--radius); padding: 13px 15px; margin: -4px 0 16px; }
.dashboard-cards .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; display: grid; gap: 6px; min-height: 124px; }
.dashboard-cards .stat-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.dashboard-cards .stat-card strong { font-size: 34px; line-height: 1; color: var(--text); }
.dashboard-cards .stat-card small { color: var(--muted); font-size: 12px; }
.stat-card-wide { min-height: 112px; }
.announcement-item { border-top: 1px solid var(--line); padding: 12px 0; }
.announcement-item:first-of-type { border-top: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-tile { border: 1px solid var(--line); border-radius: 15px; padding: 13px; background: #fbfcfd; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.quick-tile b { background: var(--primary); color: #fff; border-radius: 999px; min-width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0 8px; font-size: 12px; }
.credit-list { display: grid; gap: 9px; }
.credit-pill { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fbfcfd; }
.credit-pill b { background: var(--surface-2); color: var(--primary); border-radius: 999px; padding: 5px 8px; font-size: 12px; }
.credit-pill span { font-weight: 800; font-size: 13px; }
.credit-pill strong { font-size: 20px; }
.credit-pill small { grid-column: 3; color: var(--muted); margin-top: -6px; font-size: 11px; }
@media (max-width: 960px) {
  .dashboard-head { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
  .dashboard-head h1 { font-size: 23px; }
  .dashboard-head .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-head .actions .btn { width: 100%; }
  .dashboard-cards.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-cards.grid-2 { grid-template-columns: 1fr; }
  .dashboard-cards .stat-card { border-radius: 20px; min-height: 112px; padding: 15px; }
  .dashboard-cards .stat-card strong { font-size: 30px; }
  .mobile-card { border-radius: 22px; padding: 16px; }
  .quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .dashboard-cards.grid-4 { grid-template-columns: 1fr; }
  .credit-pill { grid-template-columns: auto 1fr auto; }
}

/* Professional quick-view and table polish */
.table-wrap tbody tr { transition: background .12s ease; }
.table-wrap tbody tr:hover { background: #fbfcfd; }
.quick-view-open { overflow: hidden; }
.quick-view-modal[hidden] { display: none !important; }
.quick-view-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.quick-view-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); }
.quick-view-panel { position: relative; width: min(720px, 100%); max-height: min(82vh, 760px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 18px 48px rgba(15, 23, 42, .20); }
.quick-view-panel h2 { margin: 0 42px 14px 0; font-size: 22px; color: #101828; }
.quick-view-close { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.quick-view-close:hover { background: #dde5ec; }
.quick-view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-view-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fbfcfd; min-height: 66px; }
.quick-view-item small { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; margin-bottom: 5px; }
.quick-view-item div { font-size: 14px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.quick-view-item.full { grid-column: 1 / -1; }
@media (max-width: 620px) {
  .quick-view-modal { align-items: end; padding: 0; }
  .quick-view-panel { width: 100%; max-height: 88vh; border-radius: 24px 24px 0 0; padding: 18px; }
  .quick-view-grid { grid-template-columns: 1fr; }
}
@media print {
  .quick-view-modal { display: none !important; }
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; }
  .main { display: block; }
  .content { padding: 0 !important; }
  .card { page-break-inside: avoid; border: 0 !important; padding: 0 0 10px !important; }
  table { min-width: 0; font-size: 10px; }
  th, td { padding: 6px 7px; }
}
.print-report-header { display: none; }
@media print {
  .print-report-header { display: block; text-align: center; margin-bottom: 14px; border-bottom: 2px solid #111827; padding-bottom: 10px; }
  .print-report-header strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
  .print-report-header h1 { margin: 5px 0 3px; font-size: 22px; }
  .print-report-header p { margin: 0; font-size: 11px; color: #333; }
}

/* Performance Evaluation & Weekly Dashboard */
.eval-cycle-highlight { border: 1px solid var(--line); background: #fbfcfd; border-radius: 16px; padding: 16px; }
.eval-cycle-highlight h3 { margin: 10px 0 4px; font-size: 20px; }
.eval-cycle-highlight p { margin: 0 0 14px; color: var(--muted); }
.wrap-cell { white-space: normal; min-width: 220px; }
.builder-inline-form { margin-top: 16px; padding: 15px; border: 1px dashed var(--line); border-radius: 16px; background: #fbfcfd; }
.builder-details { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; padding: 0 13px 13px; }
.builder-details > summary { cursor: pointer; padding: 12px 0; font-weight: 850; color: var(--primary); }
.builder-details.add-box { background: #f5faf7; border-style: dashed; }
.compact-form { margin: 4px 0 10px; }
.compact-form textarea { min-height: 76px; }
.check-field { display: flex; align-items: center; padding-top: 24px; }
.check-field label { display: flex; align-items: center; gap: 8px; margin: 0; }
.check-field input[type="checkbox"] { width: auto; }
.criteria-list { display: grid; gap: 10px; }
.criterion-card { border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: hidden; }
.criterion-card > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; list-style: none; }
.criterion-card > summary::-webkit-details-marker { display: none; }
.criterion-card > summary span:first-child { min-width: 0; }
.criterion-card > summary b { display: block; overflow-wrap: anywhere; }
.criterion-card > summary small { display: block; color: var(--muted); margin-top: 4px; }
.criterion-card[open] > summary { background: #f5faf7; border-bottom: 1px solid var(--line); }
.criterion-card form, .criterion-card .criterion-guidance { margin: 13px; }
.criterion-code { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 5px 9px; font-size: 11px; white-space: nowrap; }
.criterion-guidance { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.criterion-guidance > div { border: 1px solid var(--line); background: #fbfcfd; border-radius: 12px; padding: 9px; font-size: 12px; line-height: 1.4; }
.criterion-guidance small { display: block; color: var(--primary); font-weight: 850; margin-bottom: 3px; }
.eval-person-card { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--line); margin-bottom: 16px; }
.eval-person-card > div { background: #fff; padding: 15px; min-width: 0; }
.eval-person-card small { display: block; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-size: 10px; font-weight: 850; }
.eval-person-card strong { display: block; font-size: 16px; margin: 5px 0; overflow-wrap: anywhere; }
.eval-person-card span { color: var(--muted); font-size: 12px; }
.eval-score-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.eval-score-summary > div { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px; }
.eval-score-summary small { display: block; color: var(--muted); font-weight: 800; }
.eval-score-summary strong { font-size: 28px; color: var(--primary); margin-right: 4px; }
.eval-score-summary span { color: var(--muted); font-size: 12px; }
.eval-rating-section { margin-top: 16px; padding: 0; overflow: hidden; }
.eval-rating-section .card-head { padding: 15px; margin: 0; border-bottom: 1px solid var(--line); background: #f5faf7; }
.section-score { text-align: right; color: var(--muted); font-size: 11px; }
.section-score span { display: block; }
.section-score strong { color: var(--primary); font-size: 20px; }
.rating-list { display: grid; }
.rating-row { display: grid; grid-template-columns: minmax(300px,1fr) 120px minmax(220px,.65fr); gap: 12px; padding: 14px 15px; border-top: 1px solid var(--line); align-items: start; }
.rating-row:first-child { border-top: 0; }
.rating-title { display: flex; justify-content: space-between; gap: 10px; }
.rating-title span { flex: 0 0 auto; background: var(--surface-2); color: var(--primary); border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 850; }
.rating-info p { color: var(--muted); margin: 6px 0; font-size: 12px; }
.rating-info details summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 800; }
.rating-control small { display: block; margin-top: 5px; color: var(--muted); }
.rating-remarks textarea { min-height: 78px; }
.sticky-actions { position: sticky; bottom: 76px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px; margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.weekly-matrix-wrap { border: 1px solid var(--line); border-radius: 16px; overflow: auto; max-height: 68vh; background: #fff; }
.weekly-matrix { min-width: 1700px; border-collapse: separate; border-spacing: 0; }
.weekly-matrix th { position: sticky; top: 0; z-index: 3; background: #173624; color: #fff; min-width: 112px; max-width: 150px; white-space: normal; line-height: 1.25; }
.weekly-matrix th small { display: block; opacity: .72; margin-top: 4px; }
.weekly-matrix td { background: #fff; vertical-align: middle; }
.weekly-matrix tr:nth-child(even) td { background: #fbfcfd; }
.weekly-matrix .sticky-col { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.weekly-matrix th.sticky-col { z-index: 4; background: #173624; }
.weekly-matrix .employee-col { min-width: 240px; max-width: 280px; }
.weekly-matrix .employee-col strong, .weekly-matrix .employee-col small { display: block; white-space: normal; }
.weekly-matrix select { min-width: 78px; padding: 8px; }
.weekly-remarks { min-width: 180px; min-height: 58px; padding: 8px; }
.source-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.source-comparison > div { border: 1px solid var(--line); border-radius: 15px; padding: 14px; }
.source-comparison span, .source-comparison small { display: block; color: var(--muted); }
.source-comparison strong { display: block; font-size: 28px; margin: 4px 0; color: var(--primary); }
.metric-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 9px; }
.metric-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.distribution-list { display: grid; gap: 10px; }
.distribution-list > div { display: grid; grid-template-columns: minmax(140px,.8fr) 1fr 34px; align-items: center; gap: 10px; font-size: 12px; }
.distribution-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.distribution-bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.kpi-dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.kpi-dashboard-card { border: 1px solid var(--line); border-radius: 15px; padding: 13px; display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; }
.kpi-dashboard-card div:first-child strong, .kpi-dashboard-card div:first-child span { display: block; }
.kpi-dashboard-card div:first-child span, .kpi-dashboard-card small { color: var(--muted); font-size: 11px; }
.kpi-dashboard-card > b { font-size: 22px; color: var(--primary); }
.kpi-dashboard-card .metric-bar, .kpi-dashboard-card > small { grid-column: 1 / -1; margin: 0; }
.rank-list { display: grid; }
.rank-list a { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.rank-list a:first-child { border-top: 0; }
.rank-list > a > b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--primary); }
.rank-list span strong, .rank-list span small { display: block; }
.rank-list span small { color: var(--muted); }
.rank-list em { font-style: normal; font-weight: 900; color: var(--primary); font-size: 18px; }
.trend-bars { min-height: 230px; display: flex; align-items: end; gap: 9px; padding-top: 12px; }
.trend-bars > div { flex: 1; min-width: 42px; text-align: center; display: grid; grid-template-rows: auto 170px auto; gap: 5px; }
.trend-bars > div > div { background: var(--surface-2); border-radius: 8px 8px 3px 3px; display: flex; align-items: end; overflow: hidden; }
.trend-bars i { display: block; width: 100%; background: var(--primary); border-radius: 8px 8px 0 0; }
.trend-bars span { font-size: 10px; color: var(--muted); }
.trend-bars strong { font-size: 11px; }

@media (max-width: 960px) {
  .eval-person-card, .eval-score-summary { grid-template-columns: 1fr; }
  .rating-row { grid-template-columns: 1fr 110px; }
  .rating-remarks { grid-column: 1 / -1; }
  .criterion-guidance, .kpi-dashboard-grid { grid-template-columns: 1fr; }
  .sticky-actions { bottom: 72px; justify-content: stretch; }
  .sticky-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .rating-row { grid-template-columns: 1fr; }
  .rating-control, .rating-remarks { grid-column: auto; }
  .source-comparison { grid-template-columns: 1fr; }
  .distribution-list > div { grid-template-columns: minmax(110px,.8fr) 1fr 26px; }
  .trend-bars { overflow-x: auto; }
  .trend-bars > div { flex: 0 0 50px; }
}
@media print {
  .sticky-actions { display: none !important; }
}

/* Evaluation Phase 4: friendly workspace, evidence, mappings and management report */
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 5px; }
.evaluation-page-head { align-items: flex-start; }
.evaluation-hero { display: grid; grid-template-columns: minmax(280px,1.15fr) minmax(380px,1.85fr); gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg,#f5faf7 0%,#fff 68%); box-shadow: 0 8px 24px rgba(23,54,36,.06); margin-bottom: 14px; }
.evaluation-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.evaluation-avatar { flex: 0 0 58px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--primary); color: #fff; font-size: 20px; font-weight: 900; letter-spacing: .04em; }
.evaluation-identity span,.evaluation-meta-grid span { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 900; }
.evaluation-identity h2 { margin: 3px 0 2px; font-size: 21px; overflow-wrap: anywhere; }
.evaluation-identity p { margin: 0; color: var(--muted); font-size: 12px; }
.evaluation-meta-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.evaluation-meta-grid > div { border-left: 1px solid var(--line); padding-left: 14px; min-width: 0; }
.evaluation-meta-grid strong { display: block; margin: 5px 0 3px; font-size: 14px; overflow-wrap: anywhere; }
.evaluation-meta-grid small { display: block; color: var(--muted); font-size: 11px; }
.workflow-stepper { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin: 0 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 17px; overflow: hidden; }
.workflow-step { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 7px; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; }
.workflow-step + .workflow-step { border-left: 1px solid var(--line); }
.workflow-step i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-style: normal; font-weight: 900; }
.workflow-step.done { color: #176a3a; background: #f5faf7; }
.workflow-step.done i { background: #dff3e6; color: #176a3a; }
.workflow-step.active { color: var(--primary); background: #edf7f0; }
.workflow-step.active i { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(23,54,36,.10); }
.evaluation-instructions { display: flex; gap: 9px; align-items: flex-start; }
.evaluation-instructions b { white-space: nowrap; }
.eval-score-summary-modern > div { display: flex; align-items: center; gap: 12px; min-width: 0; box-shadow: 0 5px 16px rgba(17,24,39,.035); }
.eval-score-summary-modern > div > div { min-width: 0; }
.summary-icon { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #edf7f0; color: var(--primary) !important; font-size: 18px !important; font-weight: 900; }
.inline-progress { display: block; height: 7px; width: 100%; min-width: 120px; margin-top: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.inline-progress b { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .2s ease; }
.weekly-evidence-card { margin-top: 16px; overflow: hidden; }
.weekly-evidence-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.weekly-evidence-overview > div { padding: 13px; border: 1px solid var(--line); background: #fbfcfd; border-radius: 14px; }
.weekly-evidence-overview small,.weekly-evidence-overview span { display: block; color: var(--muted); font-size: 10px; }
.weekly-evidence-overview strong { display: block; margin: 4px 0; color: var(--primary); font-size: 22px; }
.weekly-kpi-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.weekly-kpi-strip > div { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.weekly-kpi-strip span { display: block; min-height: 30px; font-size: 10px; color: var(--muted); line-height: 1.35; }
.weekly-kpi-strip strong { display: block; color: var(--primary); font-size: 18px; }
.weekly-kpi-strip small { color: var(--muted); font-size: 9px; }
.weekly-apply-form { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 14px; background: #edf7f0; border: 1px dashed #9ec6aa; }
.weekly-apply-form span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.compact-empty { padding: 20px; }
.compact-empty strong,.compact-empty span { display: block; }
.compact-empty span { color: var(--muted); margin-top: 4px; }
.evaluation-section-nav { position: sticky; top: 8px; z-index: 7; display: flex; gap: 7px; overflow-x: auto; padding: 8px; margin: 16px 0 4px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.96); box-shadow: 0 6px 20px rgba(17,24,39,.06); backdrop-filter: blur(10px); }
.evaluation-section-nav a { flex: 0 0 auto; padding: 8px 11px; border-radius: 10px; background: var(--surface-2); color: var(--primary); font-size: 11px; font-weight: 850; }
.eval-rating-section-modern { scroll-margin-top: 78px; border-radius: 18px; box-shadow: 0 7px 22px rgba(17,24,39,.04); }
.eval-section-header { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(135deg,#edf7f0,#f9fcfa); border-bottom: 1px solid var(--line); }
.eval-section-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 900; }
.eval-section-header > div:nth-child(2) > span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.eval-section-header h2 { margin: 2px 0; font-size: 18px; }
.eval-section-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.eval-section-header .section-score small { display: block; }
.rating-list-modern { gap: 0; }
.rating-row-modern { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); gap: 0; padding: 0; border-top: 1px solid var(--line); transition: background .15s ease; }
.rating-row-modern:first-child { border-top: 0; }
.rating-row-modern.is-unrated { background: #fff; }
.rating-row-modern.is-low { background: #fff8f7; }
.rating-row-modern.is-meets { background: #fffdf5; }
.rating-row-modern.is-good,.rating-row-modern.is-excellent { background: #fbfefc; }
.rating-main { padding: 16px; min-width: 0; }
.rating-entry-panel { padding: 16px; border-left: 1px solid var(--line); background: rgba(255,255,255,.72); }
.rating-heading { display: grid; grid-template-columns: 31px 1fr; gap: 10px; align-items: flex-start; }
.criterion-index { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--primary); font-size: 10px; font-weight: 900; }
.rating-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 4px 41px; }
.rating-tags span { padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 800; }
.rating-tags .tag-required { background: #fff1e8; color: #9a4a19; }
.rating-tags .tag-suggestion { background: #e8f3ff; color: #155b8e; }
.rating-guide { margin: 9px 0 0 41px; }
.rating-guide summary { cursor: pointer; color: var(--primary); font-size: 11px; font-weight: 850; }
.rating-guide .criterion-guidance { margin-top: 8px; }
.weekly-suggestion-detail { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0 41px; padding: 10px; border: 1px solid #bed8ee; border-radius: 12px; background: #f4f9ff; }
.weekly-suggestion-detail strong,.weekly-suggestion-detail span { display: block; }
.weekly-suggestion-detail strong { font-size: 11px; color: #155b8e; }
.weekly-suggestion-detail span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.system-evidence { margin: 9px 0 0 41px; padding: 9px 10px; border-left: 3px solid var(--primary); background: #f5faf7; border-radius: 0 10px 10px 0; }
.system-evidence strong,.system-evidence span { display: block; }
.system-evidence strong { font-size: 10px; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.system-evidence span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.rating-entry-panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rating-entry-panel label small { color: var(--muted); font-weight: 600; }
.rating-entry-panel select { min-height: 45px; font-weight: 800; }
.weighted-output { display: flex; justify-content: space-between; gap: 8px; padding: 7px 9px; margin-top: 7px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.weighted-output b { color: var(--primary); }
.rating-entry-panel .rating-remarks { margin-top: 12px; }
.rating-entry-panel .rating-remarks textarea { min-height: 88px; resize: vertical; }
.rating-row-modern.is-low .rating-entry-panel .rating-remarks textarea { border-color: #d88a78; background: #fff; }
.evaluation-summary-card { margin-top: 16px; scroll-margin-top: 78px; }
.summary-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.summary-field { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfd; }
.summary-field-positive { background: #f7fcf8; }
.summary-field-development { background: #fffaf5; }
.summary-field-full { grid-column: 1 / -1; }
.summary-field label { font-size: 13px; }
.summary-field p { min-height: 30px; margin: 4px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.summary-field textarea { min-height: 120px; background: #fff; }
.evaluation-action-bar { align-items: center; }
.action-help { margin-right: auto; max-width: 330px; }
.action-help strong,.action-help span { display: block; }
.action-help strong { font-size: 11px; }
.action-help span { color: var(--muted); font-size: 10px; }
.acknowledgment-card { margin-top: 16px; scroll-margin-top: 78px; }
.acknowledgment-actions { margin-top: 12px; }
.acknowledgment-status { display: grid; grid-template-columns: minmax(220px,.65fr) 1.35fr; gap: 12px; }
.acknowledgment-status > div { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; }
.acknowledgment-status span,.acknowledgment-status small { display: block; color: var(--muted); font-size: 10px; }
.acknowledgment-status strong { display: block; margin: 5px 0; }
.acknowledgment-status p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; }
.mapping-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; padding: 0; overflow: hidden; background: var(--line); margin-bottom: 14px; }
.mapping-legend > div { background: #fff; padding: 14px; }
.mapping-legend strong,.mapping-legend span { display: block; }
.mapping-legend span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.mapping-section { margin-top: 14px; padding: 0; overflow: hidden; }
.mapping-section .card-head { padding: 14px; margin: 0; background: #f5faf7; border-bottom: 1px solid var(--line); }
.mapping-list { display: grid; }
.mapping-row { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 14px; padding: 14px; border-top: 1px solid var(--line); }
.mapping-row:first-child { border-top: 0; }
.mapping-criterion strong,.mapping-criterion small { display: block; }
.mapping-criterion strong { margin: 7px 0 4px; }
.mapping-criterion small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.mapping-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.mapping-chip { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; cursor: pointer; margin: 0; }
.mapping-chip:has(input:checked) { border-color: #8cbaa0; background: #edf7f0; }
.mapping-chip input { flex: 0 0 auto; width: auto; margin-top: 2px; }
.mapping-chip span { font-size: 10px; line-height: 1.35; }
.mapping-chip b { display: block; color: var(--primary); font-size: 9px; margin-bottom: 2px; }
.report-filter-grid { flex-wrap: wrap; }
.report-filter-grid > * { flex: 1 1 145px; }
.report-panels,.report-section { margin-top: 16px; }
.department-performance-list { display: grid; gap: 11px; }
.department-performance-list > div { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.department-performance-list strong,.department-performance-list span { display: block; }
.department-performance-list span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.department-performance-list > div > b { color: var(--primary); font-size: 19px; }
.department-performance-list .metric-bar { grid-column: 1 / -1; margin: 0; }

@media (max-width: 1080px) {
  .evaluation-hero { grid-template-columns: 1fr; }
  .evaluation-meta-grid > div:first-child { border-left: 0; padding-left: 0; }
  .weekly-kpi-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .rating-row-modern { grid-template-columns: 1fr; }
  .rating-entry-panel { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(180px,.45fr) 1fr; gap: 12px; }
  .rating-entry-panel .rating-remarks { margin-top: 0; }
  .mapping-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .evaluation-hero { padding: 14px; border-radius: 16px; }
  .evaluation-meta-grid { grid-template-columns: 1fr; }
  .evaluation-meta-grid > div { border-left: 0; border-top: 1px solid var(--line); padding: 9px 0 0; }
  .workflow-stepper { grid-template-columns: 1fr; }
  .workflow-step { justify-content: flex-start; padding: 9px 12px; }
  .workflow-step + .workflow-step { border-left: 0; border-top: 1px solid var(--line); }
  .weekly-evidence-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .weekly-kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .weekly-apply-form { align-items: stretch; flex-direction: column; }
  .evaluation-section-nav { top: 4px; }
  .eval-section-header { grid-template-columns: 38px 1fr; }
  .eval-section-number { width: 38px; height: 38px; }
  .eval-section-header .section-score { grid-column: 1 / -1; text-align: left; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.75); }
  .rating-main,.rating-entry-panel { padding: 13px; }
  .rating-entry-panel { grid-template-columns: 1fr; }
  .rating-tags,.rating-guide,.weekly-suggestion-detail,.system-evidence { margin-left: 0; }
  .weekly-suggestion-detail { align-items: stretch; flex-direction: column; }
  .summary-form-grid,.acknowledgment-status,.mapping-legend { grid-template-columns: 1fr; }
  .summary-field-full { grid-column: auto; }
  .summary-field p { min-height: 0; }
  .mapping-options { grid-template-columns: 1fr; }
  .evaluation-action-bar { position: sticky; bottom: 68px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .evaluation-action-bar .action-help { grid-column: 1 / -1; max-width: none; }
  .evaluation-action-bar .btn { width: 100%; }
}
@media (max-width: 460px) {
  .evaluation-identity { align-items: flex-start; }
  .evaluation-avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
  .weekly-evidence-overview,.weekly-kpi-strip { grid-template-columns: 1fr; }
  .eval-score-summary-modern > div { padding: 12px; }
  .summary-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .evaluation-action-bar { grid-template-columns: 1fr; }
}
@media print {
  .evaluation-section-nav,.weekly-apply-form,.evaluation-page-head .actions,.mapping-form .sticky-actions { display: none !important; }
  .evaluation-hero,.weekly-evidence-card,.eval-rating-section-modern,.evaluation-summary-card,.acknowledgment-card { box-shadow: none !important; }
}
