  :root {
    --blue: #1a6bff;
    --blue-light: #e8f0ff;
    --blue-dark: #0d4fd6;
    --red: #e63939;
    --red-light: #ffeaea;
    --green: #1ab87a;
    --green-light: #e6f9f1;
    --yellow: #f5a623;
    --yellow-light: #fff8e8;
    --bg: #f4f6fb;
    --sidebar-bg: #fff;
    --card-bg: #fff;
    --text: #1a1f2e;
    --text-muted: #7b8499;
    --border: #e4e8f0;
    --sidebar-w: 220px;
    --topbar-h: 70px;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(26,107,255,0.07);
    --shadow-md: 0 4px 24px rgba(26,107,255,0.12);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; }

  /* ── TOPBAR ── */
  .topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  }
  .topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; color: var(--text); }
  .topbar-logo-icon { width: 28px; height: 28px; background: var(--blue); border-radius: 7px; display: flex; align-items: center; justify-content: center; }
  .topbar-logo-icon svg { fill: #fff; width: 16px; height: 16px; }
  .topbar-role { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); margin-left: 4px; }
  .topbar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
  .topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .topbar-avatar svg { width: 20px; height: 20px; fill: var(--text-muted); }
  .topbar-name { font-weight: 600; font-size: 14px; }
  .topbar-chevron { color: var(--text-muted); font-size: 12px; }

  /* ── SIDEBAR ── */
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--sidebar-bg);
    border-right: 1px solid var(--border); padding: 24px 0;
    overflow-y: auto; z-index: 90;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px; font-weight: 500; color: var(--text-muted);
    cursor: pointer; border-radius: 0 8px 8px 0; margin-right: 12px;
    transition: all .17s; font-size: 13.5px; user-select: none;
    text-decoration: none;
  }
  .sidebar-item:hover { background: var(--blue-light); color: var(--blue); }
  .sidebar-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
  .sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }
  .sidebar-item.active svg { stroke: var(--blue); }
  .sidebar-item svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* ── MAIN ── */
  .main {
    margin-left: var(--sidebar-w); padding-top: var(--topbar-h);
    min-height: 100vh;
  }
  .page { display: none; padding: 36px 40px; }
  .page.active { display: block; }
  .page-title { font-size: 24px; font-weight: 700; margin-bottom: 28px; letter-spacing: -0.5px; }

  /* ── Buttons ── */
  .form-group { margin-bottom: 18px; }
  .form-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px; letter-spacing: .3px; }
  .form-input {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--text);
    background: #fafbfd; outline: none; transition: border .16s;
  }
  .form-input:focus { border-color: var(--blue); background: #fff; }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 20px; border: none; border-radius: 8px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .16s; }
  .btn-primary { background: var(--blue); color: #fff; }
  .btn-primary:hover { background: var(--blue-dark); }
  .btn-danger { background: var(--red); color: #fff; }
  .btn-danger:hover { background: #c42d2d; }
  .btn-full { width: 100%; }
  .btn-sm { padding: 7px 14px; font-size: 13px; }

  /* ── PROFILE ── */
  .profile-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; display: flex; gap: 40px; align-items: flex-start; }
  .profile-photo { width: 150px; height: 180px; border-radius: 10px; background: var(--border); object-fit: cover; flex-shrink: 0; }
  .profile-photo-placeholder { width: 150px; height: 180px; border-radius: 10px; background: linear-gradient(135deg, #dde5f7, #c5d3f0); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .profile-photo-placeholder svg { width: 48px; height: 48px; fill: #a0aec0; }
  .profile-info { flex: 1; }
  .profile-row { margin-bottom: 12px; font-size: 15px; }
  .profile-row strong { font-weight: 600; }
  .edit-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .edit-form-grid .span2 { grid-column: 1 / -1; }

  /* ── BADGE ── */
  .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
  .badge-pending { background: var(--yellow-light); color: #b87a00; }
  .badge-approved { background: var(--green-light); color: #0d8a58; }
  .badge-rejected { background: var(--red-light); color: #b02020; }
  .badge-dot { width: 7px; height: 7px; border-radius: 50%; }
  .badge-pending .badge-dot { background: var(--yellow); }
  .badge-approved .badge-dot { background: var(--green); }
  .badge-rejected .badge-dot { background: var(--red); }

  /* ── TABLE ── */
  .table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .table-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
  .table-header-left { display: flex; align-items: center; gap: 12px; }
  .table-title { font-weight: 700; font-size: 15px; }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; padding: 12px 18px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: #f8f9fd; border-bottom: 1px solid var(--border); letter-spacing: .3px; }
  td { padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #fafbfe; }
  .table-link { color: var(--blue); text-decoration: none; font-weight: 500; }
  .table-link:hover { text-decoration: underline; }
  .table-footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
  .table-footer-info { }
  .cb { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--border); cursor: pointer; }
  .cb.checked { background: var(--blue); border-color: var(--blue); }
  .icon-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: none; }
  .icon-btn svg { width: 14px; height: 14px; fill: #fff; }
  .more-btn { color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
  .avatar-circle { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #c5d3f0, #a0b4e0); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #3a5ba0; }

  /* ── DROPDOWN ── */
  .prog-dropdown { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; background: none; border: none; cursor: pointer; font-family: inherit; color: var(--text); }
  .prog-dropdown svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; }

  /* ── DONUT CARDS ── */
  .donut-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 22px; }
  .donut-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
  .donut-card-label { font-size: 13px; font-weight: 500; color: var(--text-muted); text-align: center; }
  .donut-wrap { position: relative; width: 100px; height: 100px; }
  .donut-wrap svg { width: 100px; height: 100px; transform: rotate(-90deg); }
  .donut-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; }
  .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .stat-cell { padding: 18px 22px; border-right: 1px solid var(--border); }
  .stat-cell:last-child { border-right: none; }
  .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
  .stat-val { font-size: 22px; font-weight: 700; }
  .stats-row-2 { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }

  /* ── PROG LIST ── */
  .prog-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .prog-item { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--bg); margin: 12px; border-radius: 8px; }
  .prog-item:last-child { border-bottom: none; }
  .prog-item-num { font-weight: 700; font-size: 18px; color: var(--text-muted); margin-right: 18px; min-width: 24px; }
  .prog-item-info { flex: 1; }
  .prog-item-name { font-weight: 700; font-size: 15px; }
  .prog-item-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
  .prog-cb { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--border); cursor: pointer; flex-shrink: 0; background: #fff; }

  /* ── ACTIVITY FORM ── */
  .form-section { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px; max-width: 780px; }
  .form-section-title { font-weight: 700; font-size: 15px; margin-bottom: 22px; text-align: center; }
  .time-picker { display: flex; align-items: center; gap: 6px; }
  .time-spin { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .time-spin-val { font-size: 22px; font-weight: 700; min-width: 38px; text-align: center; font-family: 'DM Mono', monospace; }
  .time-spin-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 2px 6px; border-radius: 4px; }
  .time-spin-btn:hover { background: var(--blue-light); color: var(--blue); }
  .time-sep { font-size: 20px; font-weight: 700; margin: 0 2px; }
  .time-ampm { font-size: 14px; font-weight: 700; padding: 4px 8px; border-radius: 6px; border: 1.5px solid var(--border); cursor: pointer; background: var(--bg); }
  .date-input-wrap { position: relative; display: flex; align-items: center; }
  .date-input-wrap svg { position: absolute; right: 12px; width: 16px; height: 16px; fill: var(--text-muted); pointer-events: none; }
  .time-block { background: var(--bg); border-radius: 10px; padding: 14px 18px; }
  .time-block-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .file-add { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1.5px dashed var(--border); border-radius: 8px; cursor: pointer; color: var(--text-muted); font-size: 13.5px; }
  .file-add:hover { border-color: var(--blue); color: var(--blue); }
  .file-add-plus { font-size: 20px; font-weight: 300; }

  /* ── SEARCH ── */
  .search-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 8px; flex: 1; background: #fff; }
  .search-bar input { border: none; outline: none; font-family: inherit; font-size: 13.5px; flex: 1; color: var(--text); background: transparent; }
  .search-bar svg { width: 15px; height: 15px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; }
  .action-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

  /* ── MINI PROFILE ── */
  .mini-profile { display: flex; align-items: center; gap: 20px; padding: 20px 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
  .mini-photo { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #dde5f7, #c5d3f0); display: flex; align-items: center; justify-content: center; }
  .mini-photo svg { width: 28px; height: 28px; fill: #a0aec0; }
  .mini-info strong { font-size: 15px; font-weight: 700; }
  .mini-info p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

  /* ── GRADE INPUT ── */
  .grade-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 20px; }
  .grade-input { padding: 10px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: 600; width: 140px; outline: none; }
  .grade-input:focus { border-color: var(--blue); }

  /* ── OVERLAY ── */
  .overlay { position: fixed; inset: 0; background: rgba(10,15,30,0.5); z-index: 200; display: none; align-items: center; justify-content: center; }
  .overlay.show { display: flex; }
  .modal { background: #fff; border-radius: 14px; padding: 28px 32px; min-width: 320px; box-shadow: 0 8px 40px rgba(0,0,0,0.18); }
  .modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

  /* ── PAGINATION ── */
  .pagination { display: flex; align-items: center; gap: 4px; }
  .pg-btn { width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
  .pg-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
  .pg-btn:hover:not(.active) { background: var(--blue-light); color: var(--blue); }
  .pg-ellipsis { color: var(--text-muted); padding: 0 4px; }

  /* ── TOPBAR ACTION BUTTONS ── */
  .topbar-btns { display: flex; gap: 10px; margin-bottom: 22px; justify-content: flex-end; }

  /* ── FILTER ICON ── */
  .filter-btn { width: 36px; height: 36px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
  .filter-btn svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; }
  .filter-badge { position: absolute; top: -5px; right: -5px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

  /* scrollbar */
  ::-webkit-scrollbar { width: 5px; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

  /* animate page transitions */
  .page { animation: fadeIn .2s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

  .prog-cb {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    background: #fff;
    transition: all .15s;
  }

  .prog-cb.checked {
      background: var(--blue);
      border-color: var(--blue);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
      background-size: 13px;
      background-repeat: no-repeat;
      background-position: center;
  }

  .cb.checked {
      background: var(--blue);
      border-color: var(--blue);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
      background-size: 13px;
      background-repeat: no-repeat;
      background-position: center;
  }