/* ============================================================
   VSAS - style.css (Full Integrated)
   ============================================================ */


/* ===== CSS VARIABLES ===== */
:root {
  --vsas-green:  #17018A;
  --vsas-red:    #C8102E;
  --vsas-yellow: #FFD700;
  --vsas-dark:   #1a1a1a;
  --vsas-dark2:  #1e3a2f;
  --vsas-light:  #f8f9fa;
}


/* ===== RESET / BASE ===== */
* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: #f4f6f9;
  color: #333;
  font-size: 14px;
}
a { text-decoration: none; }


/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-vsas {
  background: linear-gradient(135deg, var(--vsas-green), #005a2b);
  border-bottom: 3px solid var(--vsas-yellow);
  min-height: 56px;
  padding: 0 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.navbar-vsas .navbar-brand,
.navbar-vsas .nav-link { color: #fff !important; }
.navbar-vsas .nav-link:hover { color: var(--vsas-yellow) !important; }


/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.vsas-wrapper {
  display: flex;
  min-height: calc(100vh - 56px);
  position: relative;
}


/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--vsas-dark2);
  color: #fff;
  position: fixed;
  top: 56px;
  left: -260px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  z-index: 1050;
  transition: left 0.3s ease;
  padding-top: 1rem;
}
.sidebar.show { left: 0; }
.sidebar .nav-link {
  color: #cce8d9;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 2px 8px;
  transition: background 0.2s, color 0.2s;
  font-size: 14px;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: var(--vsas-green);
  color: #fff !important;
  font-weight: 600;
}
.sidebar .nav-link i { width: 20px; text-align: center; }
.sidebar .nav-link .badge {
  background-color: var(--vsas-yellow);
  color: #000;
}


/* ============================================================
   SIDEBAR OVERLAY
   ============================================================ */
#sidebarOverlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 56px);
  background: rgba(0,0,0,0.5);
  z-index: 1040;
}
#sidebarOverlay.active { display: block; }


/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 24px;
  transition: margin-left 0.3s ease;
}

@media (min-width: 992px) {
  .sidebar {
    left: 0;
  }

  .vsas-wrapper.sidebar-collapsed .sidebar {
    left: -260px;
  }

  .main-content {
    margin-left: 260px;
  }

  .vsas-wrapper.sidebar-collapsed .main-content {
    margin-left: 0;
  }

  #sidebarOverlay {
    display: none !important;
  }

  .sidebar-desktop-close {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0;
  }
}


/* ============================================================
   USER DROPDOWN MENU
   ============================================================ */
#vsasUserMenu a:hover { background: #f5f5f5; }


/* ============================================================
   BUTTONS
   ============================================================ */
.btn-vsas-primary {
  background: var(--vsas-green);
  color: #fff;
  border: none;
  border-radius: 6px;
}
.btn-vsas-primary:hover {
  background: #005a2b;
  color: #fff;
}
.btn-vsas-danger {
  background: var(--vsas-red);
  color: #fff;
  border: none;
  border-radius: 6px;
}
.btn-vsas-danger:hover {
  background: #a00d24;
  color: #fff;
}
.btn-vsas-warning {
  background: var(--vsas-yellow);
  color: #000;
  border: none;
  border-radius: 6px;
}
.btn-vsas-warning:hover {
  background: #e6c200;
  color: #000;
}


/* ============================================================
   CARDS
   ============================================================ */
.card {
  border: 1px solid #e8ecef;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.card-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
}
.card-footer {
  border-radius: 0 0 12px 12px !important;
  padding: 12px 20px;
  background: #fff;
}

/* Stats Cards */
.card-stat {
  border-left: 4px solid var(--vsas-green);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.card-stat.red    { border-left-color: var(--vsas-red); }
.card-stat.yellow { border-left-color: var(--vsas-yellow); background: #fffdf0; }


/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
}
.badge-draft              { background: #6c757d; color: #fff; }
.badge-pending_endorsement { background: var(--vsas-yellow); color: #000; }
.badge-pending_approval    { background: #fd7e14; color: #fff; }
.badge-approved            { background: var(--vsas-green); color: #fff; }
.badge-rejected            { background: var(--vsas-red); color: #fff; }


/* ============================================================
   TABLES
   ============================================================ */
.table-vsas thead {
  background-color: var(--vsas-green);
  color: #fff;
}
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}
table.dataTable thead th {
  background: var(--vsas-green);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid #005a2b;
}
table.dataTable tbody tr:hover { background: #f0fff6; }
table.dataTable                { border-collapse: collapse !important; }
table.dataTable td,
table.dataTable th             { padding: 10px 12px !important; vertical-align: middle !important; }


/* ============================================================
   FORMS
   ============================================================ */
.form-control,
.form-select {
  border: 1px solid #dde2e8;
  border-radius: 8px;
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--vsas-green);
  box-shadow: 0 0 0 3px rgba(0,132,61,0.15);
}
.form-label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  color: #444;
}


/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--vsas-dark2);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px;
  color: #888;
}


/* ============================================================
   ALERTS
   ============================================================ */
.vsas-alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  border: none;
}


/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #00843D 0%, #005a2b 50%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  border-radius: 16px;
  border-top: 5px solid var(--vsas-yellow);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


/* ============================================================
   ACTIVITY LIST – Eye Catching Style
   ============================================================ */
.act-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.act-item {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.act-item:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.act-item.is-registered {
  border-left: 4px solid var(--vsas-green);
  background: #f0fff6;
}
.act-item.is-full { opacity: 0.75; }

/* Date Column */
.act-item-date {
  min-width: 72px;
  width: 72px;
  background: var(--vsas-dark2);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  flex-shrink: 0;
  text-align: center;
}
.act-item.is-registered .act-item-date { background: var(--vsas-green); }
.act-item-day   { font-size: 32px; font-weight: 800; line-height: 1; }
.act-item-month { font-size: 13px; font-weight: 600; text-transform: uppercase; opacity: 0.9; margin-top: 2px; }
.act-item-year  { font-size: 11px; opacity: 0.6; margin-top: 2px; }
.act-item-tag {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.act-item-tag.today { background: var(--vsas-yellow); color: #000; }
.act-item-tag.soon  { background: rgba(255,255,255,0.2); color: #fff; }

/* Body */
.act-item-body     { flex: 1; padding: 16px 18px; min-width: 0; }
.act-item-title    { font-size: 16px; font-weight: 700; color: var(--vsas-dark2); margin-bottom: 8px; line-height: 1.3; }
.act-item-meta     { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #555; margin-bottom: 6px; }
.act-item-meta i   { margin-right: 4px; }
.act-item-sub      { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #888; margin-bottom: 8px; }

/* Progress Bar */
.act-item-progress {
  height: 4px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.act-item-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Actions Column */
.act-item-actions {
  min-width: 110px;
  width: 110px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  border-left: 1px solid #f0f0f0;
}


/* ============================================================
   ACTIVITY DETAIL PAGE
   ============================================================ */
.detail-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 10px;
  height: 100%;
}
.detail-info-item i      { font-size: 18px; margin-top: 2px; flex-shrink: 0; color: var(--vsas-green); }
.detail-info-label       { font-size: 11px; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.detail-info-value       { font-size: 14px; font-weight: 600; color: #222; }


/* ============================================================
   ACTIVITY MANAGE PAGE
   ============================================================ */
.act-manage-header {
  padding: 16px 20px;
  background: #fff;
  transition: background 0.15s;
}
.act-manage-header:hover       { background: #f8f9fa; }
.act-manage-header.has-pending { border-left: 4px solid #fd7e14; }
.reg-row                       { transition: background 0.15s; }
.reg-row:hover                 { background: #f8fff9; }
.reg-row:last-child            { border-bottom: none !important; }


/* ============================================================
   COMMITTEE GROUP HEADER  (activity list + dashboard shared)
   ============================================================ */
.act-committee-group {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  background: #fff;
  border: 1px solid #e8ecef;
}
.act-committee-header {
  background: #fff;
  border: none;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 2px solid var(--c-color, #00843D);
}
.act-committee-header:hover { background: #f8f9fa; }

.act-committee-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-color, #00843D);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-color,#00843D) 20%, transparent);
}
.act-committee-name-zh { font-size: 16px; font-weight: 700; color: #1e3a2f; }
.act-committee-name-en { font-size: 12px; color: #888; margin-left: 8px; }
.act-committee-count {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--c-color,#00843D) 15%, #fff);
  color: var(--c-color, #00843D);
  white-space: nowrap;
}
.act-committee-chevron {
  font-size: 14px;
  color: #888;
  transition: transform 0.25s ease;
}
.act-committee-header[aria-expanded="false"] .act-committee-chevron {
  transform: rotate(180deg);
}
.act-committee-group .act-list { padding: 4px 12px 12px; }
.act-committee-group .act-item { border-radius: 10px; }


/* ============================================================
   ACTIVITY BADGES  (committee / sub / urgent)
   ============================================================ */
.act-item-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.act-badge-committee,
.act-badge-sub,
.act-badge-urgent {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.act-badge-sub {
  background: #f0f4ff;
  color: #3a5bd9;
  border: 1px solid #c5d0f7;
}
.act-badge-urgent {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe69c;
  animation: pulse-urgent 1.5s infinite;
}
@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}


/* ============================================================
   DASHBOARD – Welcome Header
   ============================================================ */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #e8f5e9, #f0fff4);
  border: 1px solid #c8e6c9;
  border-radius: 14px;
  padding: 16px 20px;
}
.dash-welcome-left { display: flex; align-items: center; gap: 14px; }
.dash-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--vsas-green);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,132,61,.25);
}


/* ============================================================
   DASHBOARD – Stat Cards
   ============================================================ */
.dash-stat-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: transform .15s, box-shadow .15s;
}
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
}
.dash-stat-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, #00843D);
  border-radius: 0 0 12px 12px;
}
.dash-stat-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.dash-stat-num   { font-size: 24px; font-weight: 800; line-height: 1; color: #1a1a1a; }
.dash-stat-label { font-size: 11px; color: #888; margin-top: 2px; }


/* ============================================================
   DASHBOARD – Empty State
   ============================================================ */
.dash-empty {
  background: #fff;
  border: 2px dashed #d0d7de;
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
}
.dash-empty-icon  { font-size: 48px; color: #c8d0d8; margin-bottom: 12px; }
.dash-empty-title { font-size: 15px; font-weight: 600; color: #555; margin-bottom: 4px; }
.dash-empty-sub   { font-size: 13px; color: #aaa; }


/* ============================================================
   DASHBOARD – Sub-committee label inside group
   ============================================================ */
.dash-subcommittee-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 4px;
}
.dash-subcommittee-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.dash-subcommittee-line {
  flex: 1;
  height: 1px;
  background: #e8e8e8;
}


/* ============================================================
   DASHBOARD – Activity Card
   ============================================================ */
.dash-act-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow .2s, transform .2s;
}
.dash-act-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.dash-act-topbar { height: 4px; flex-shrink: 0; }
.dash-act-inner  { padding: 14px; display: flex; flex-direction: column; flex: 1; }

/* Date box */
.dash-act-head     { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.dash-act-datebox  {
  min-width: 52px; width: 52px; height: 60px;
  border-radius: 8px;
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0; text-align: center;
}
.dash-act-day { font-size: 20px; font-weight: 800; line-height: 1; }
.dash-act-mon { font-size: 10px; font-weight: 600; line-height: 1.4; }
.dash-act-yr  { font-size: 9px; opacity: .7; }
.dash-act-tag {
  margin-top: 3px;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 20px;
  text-transform: uppercase;
}
.dash-act-tag.today { background: var(--vsas-yellow); color: #000; }
.dash-act-tag.soon  { background: rgba(255,255,255,.25); color: #fff; }

.dash-act-title-wrap { flex: 1; min-width: 0; }
.dash-act-title    { font-size: 14px; font-weight: 700; color: #1e3a2f; line-height: 1.3; }
.dash-act-title-en { font-size: 11px; color: #aaa; }

/* Info rows */
.dash-act-info { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.dash-act-info-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #555;
}
.dash-act-info-row i { flex-shrink: 0; width: 14px; text-align: center; }

/* Quota bar */
.dash-act-quota { margin-bottom: 10px; }
.dash-act-progress {
  height: 5px; background: #e9ecef;
  border-radius: 4px; overflow: hidden;
}
.dash-act-progress-bar { height: 100%; border-radius: 4px; transition: width .3s ease; }

/* Card footer */
.dash-act-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}


/* ============================================================
   DASHBOARD – Mini Badges + Status Pill
   ============================================================ */
.dash-mini-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}
.dash-badge-urgent {
  background: #fff3cd; color: #856404;
  border: 1px solid #ffe69c;
  animation: pulse-urgent 1.5s infinite;
}
.dash-status-pill {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}


/* ============================================================
   DASHBOARD – Modal Info Box
   ============================================================ */
.dash-modal-info-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  height: 100%;
}
.dash-modal-info-label { font-size: 11px; color: #888; margin-bottom: 2px; }
.dash-modal-info-val   { font-weight: 600; color: #222; }


/* ============================================================
   DASHBOARD – Recent Registrations
   ============================================================ */
.dash-recent-row {
  display: flex; align-items: center;
  gap: 14px; padding: 14px 20px;
  transition: background .15s;
}
.dash-recent-row:hover { background: #f8fff9; }
.dash-recent-date { width: 50px; flex-shrink: 0; text-align: center; }
.dash-recent-day  { font-size: 18px; font-weight: 700; color: var(--vsas-green); line-height: 1; }
.dash-recent-mon  { font-size: 10px; color: #888; white-space: nowrap; }
.dash-recent-title { font-size: 13px; font-weight: 600; color: #222; margin-bottom: 3px; }
.dash-recent-meta {
  font-size: 11px; color: #999;
  display: flex; flex-wrap: wrap; gap: 8px;
}


/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 576px) {
  .main-content { padding: 16px; }
  .card-header  { padding: 12px 16px; }
  .card-footer  { padding: 10px 16px; }
  .fs-2         { font-size: 1.5rem !important; }

  /* Activity item → vertical on mobile */
  .act-item             { flex-direction: column; border-left: none !important; }
  .act-item.is-registered { border-top: 4px solid var(--vsas-green); }
  .act-item-date {
    width: 100%; flex-direction: row; gap: 8px;
    padding: 10px 16px; justify-content: flex-start;
    min-width: unset;
  }
  .act-item-day          { font-size: 24px; }
  .act-item-month,
  .act-item-year         { font-size: 13px; margin-top: 0; }
  .act-item-tag          { margin-top: 0; margin-left: 4px; }
  .act-item-actions {
    width: 100%; min-width: unset;
    flex-direction: row;
    border-left: none; border-top: 1px solid #f0f0f0;
    padding: 12px 16px; gap: 8px;
  }
  .act-item-actions .btn,
  .act-item-actions form { flex: 1; }
  .act-item-actions .btn { width: 100%; }

  /* Committee header */
  .act-committee-name-en       { display: none; }
  .act-committee-header        { padding: 12px 14px; }
  .act-committee-group .act-list { padding: 4px 6px 10px; }

  /* Detail info */
  .detail-info-item { padding: 10px 12px; }

  /* Dashboard */
  .dash-welcome    { padding: 12px 14px; }
  .dash-stat-num   { font-size: 20px; }
  .dash-stat-icon  { width: 36px; height: 36px; font-size: 15px; }
  .dash-act-inner  { padding: 10px; }
  .dash-recent-row { padding: 12px 14px; }
}
/* ============================================================
   ACTIVITY MANAGE PAGE
   ============================================================ */
.amg-block {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Header */
.amg-header {
  padding: 18px 20px 14px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.amg-datebox {
  min-width: 52px; width: 52px; height: 60px;
  border-radius: 8px; color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0; text-align: center;
}
.amg-day   { font-size: 20px; font-weight: 800; line-height: 1; }
.amg-mon   { font-size: 10px; font-weight: 600; }
.amg-yr    { font-size: 9px; opacity: .7; }
.amg-title { font-size: 16px; font-weight: 700; color: #1e3a2f; margin-bottom: 4px; }
.amg-meta  { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #666; }

/* 3-Layer progress */
.amg-layers {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px 16px;
  flex-wrap: wrap;
  gap: 4px;
}
.amg-layer-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.amg-layer-step.active { background: #e8f5e9; }
.amg-layer-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #dee2e6;
  color: #888;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.amg-layer-step.active .amg-layer-dot { color: #fff; }
.amg-layer-name   { font-size: 11px; font-weight: 700; color: #444; }
.amg-layer-person { font-size: 11px; color: #888; }
.amg-layer-arrow  { color: #ccc; font-size: 12px; margin: 0 4px; }
.amg-my-layer-badge { font-weight: 700 !important; }

/* Bulk bar */
.amg-bulk-bar {
  padding: 10px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8ecef;
}

/* Table */
.amg-table thead th {
  background: var(--vsas-green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px !important;
  white-space: nowrap;
}
.amg-table tbody td { vertical-align: middle !important; padding: 10px 12px !important; }
.amg-reg-row.can-act { background: #fffef5; }
.amg-reg-row.can-act:hover { background: #fffbe6; }

/* Layer status pill */
.amg-layer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: default;
}

/* XS button */
.btn-xs {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 576px) {
  .amg-header    { padding: 14px; }
  .amg-layers    { padding: 8px 10px; }
  .amg-bulk-bar  { padding: 8px 12px; }
  .amg-layer-step { padding: 4px 6px; }
  .amg-layer-name { display: none; }
}

/* ── Multi-layer additions ── */
.amg-you-badge {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
  margin-left: 4px;
}
.amg-layer-pending {
  font-size: 10px; font-weight: 700;
  color: #f59e0b; margin-top: 1px;
}
.amg-my-layer {
  box-shadow: 0 0 0 2px currentColor;
}
.amg-bulk-layer-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 8px;
}
.amg-bulk-layer-label {
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.amg-reject-context {
  min-height: 20px;
}

/* Active layer dot highlight */
.amg-layer-step.active .amg-layer-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--layer-color, #00843D) 25%, transparent);
}

@media (max-width: 576px) {
  .amg-bulk-layer-group { width: 100%; justify-content: space-between; }
  .amg-bulk-layer-label { min-width: 80px; }
}


/* Rejection reason cell */
.amg-reject-reason-cell {
  text-align: left;
  max-width: 180px;
}
.amg-reject-reason-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
}
.amg-reject-reason-by {
  font-size: 10px;
  color: #999;
  margin-bottom: 2px;
}
.amg-reject-reason-text {
  font-size: 11px;
  color: #c62828;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  cursor: help;
}

/* Reload overlay spinner */
#reloadOverlay { display: none; }

/* ── Section Divider ── */
.amg-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.amg-section-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.amg-section-line {
  flex: 1;
  height: 1px;
  background: #e8ecef;
}

/* ── Collapsible header cursor ── */
.amg-header-clickable {
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.amg-header-clickable:hover { background: #fafafa; }
.amg-collapse-chevron {
  flex-shrink: 0;
  color: #aaa;
  font-size: 14px;
  padding-top: 4px;
  transition: color .15s;
}
.amg-header-clickable:hover .amg-collapse-chevron { color: #555; }

/* ── Section 2 List ── */
.amg-s2-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.amg-s2-item {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.amg-s2-row {
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.amg-s2-row:hover { background: #f8f9fa; }
.amg-s2-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 8px;
  flex-shrink: 0;
  text-align: center;
  min-width: 70px;
}
.amg-s2-day { font-size: 20px; font-weight: 800; line-height: 1; }
.amg-s2-mon { font-size: 10px; font-weight: 600; white-space: nowrap; }
.amg-s2-detail {
  border-top: 1px solid #f0f0f0;
}
.amg-s2-chevron { flex-shrink: 0; }
.amg-s2-layer-info {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 6px;
  font-size: 11px;
}

/* ── Smaller table variant ── */
.amg-table-sm thead th { font-size: 11px !important; padding: 8px 10px !important; }
.amg-table-sm tbody td { padding: 8px 10px !important; }

/* ── Reject reason cell ── */
.amg-reject-reason-cell { text-align: left; max-width: 180px; }
.amg-reject-reason-label { font-size: 11px; font-weight: 700; margin-bottom: 2px; white-space: nowrap; }
.amg-reject-reason-by    { font-size: 10px; color: #999; margin-bottom: 2px; }
.amg-reject-reason-text  {
  font-size: 11px; color: #c62828; font-style: italic;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 170px; cursor: help;
}

@media (max-width: 576px) {
  .amg-s2-date  { min-width: 56px; padding: 4px 8px; }
  .amg-s2-day   { font-size: 16px; }
  .amg-s2-row   { padding: 10px 12px; }
}
/* Quota stat boxes in modal */
.amg-quota-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  min-width: 80px;
  text-align: center;
}
.amg-quota-stat-label {
  font-size: 10px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}
.amg-quota-stat-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
/* ── Hours Input Page ── */
.hi-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.hi-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.hi-card-body { padding: 20px; }
.hi-card-body.p-0 { padding: 0; }
.hi-card-title { font-weight: 700; font-size: 15px; color: #1e3a2f; }
.hi-card-sub   { font-size: 12px; color: #888; margin-top: 2px; }
.hi-step-badge {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--vsas-green, #00843D);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Activity Grid */
.hi-activity-grid { display: flex; flex-direction: column; gap: 8px; }
.hi-activity-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.hi-activity-card:hover { background: #f0faf4; border-color: #a5d6a7; }
.hi-activity-done { opacity: .6; cursor: default; }
.hi-activity-done:hover { background: inherit; border-color: #e8ecef; }
.hi-act-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 44px; text-align: center;
  background: #f8f9fa; border-radius: 8px;
  padding: 6px 8px;
}
.hi-act-day  { font-size: 18px; font-weight: 800; line-height: 1; color: #1e3a2f; }
.hi-act-mon  { font-size: 10px; font-weight: 600; color: #888; }
.hi-act-title{ font-weight: 600; font-size: 14px; color: #1e3a2f; }
.hi-act-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #888; margin-top: 2px; }

/* Selected bar */
.hi-selected-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  font-size: 14px;
}

/* Hours stepper */
.hi-hours-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.hi-step-btn {
  width: 32px; height: 32px;
  background: #f8f9fa;
  border: none;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: background .1s;
  flex-shrink: 0;
}
.hi-step-btn:hover { background: #e9ecef; }
.hi-hours-input {
  width: 60px;
  border: none;
  border-left: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 4px;
  height: 32px;
}
.hi-hours-input:focus { outline: none; background: #fff8e1; }

/* Hours display (manual) */
.hi-hours-display {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #1e3a2f;
}

@media (max-width: 576px) {
  .hi-card-body { padding: 14px; }
  .hi-act-title { font-size: 13px; }
  .hi-hours-input { width: 45px; font-size: 12px; }
  .hi-step-btn { width: 28px; height: 28px; font-size: 14px; }
}

/* ════════════════════════════════
   Hours Input Page Styles
════════════════════════════════ */
.hi-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.hi-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
}
.hi-card-body   { padding: 20px; }
.hi-card-body.p-0 { padding: 0; }
.hi-card-title  { font-weight: 700; font-size: 15px; color: #1e3a2f; }
.hi-card-sub    { font-size: 12px; color: #888; margin-top: 2px; }

.hi-step-badge {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--vsas-green, #00843D);
  color: #fff;
  font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Activity Grid */
.hi-activity-grid { display: flex; flex-direction: column; gap: 8px; }

.hi-activity-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  background: #fff;
}
.hi-activity-card:hover:not(.hi-activity-done) {
  background: #f0faf4;
  border-color: #a5d6a7;
  box-shadow: 0 2px 8px rgba(0,132,61,.1);
}
.hi-activity-done {
  opacity: .6;
  cursor: default;
  background: #fafafa;
}

.hi-act-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 46px; text-align: center;
  background: #f1f3f5; border-radius: 8px;
  padding: 8px;
}
.hi-act-day { font-size: 20px; font-weight: 800; line-height: 1; color: #1e3a2f; }
.hi-act-mon { font-size: 10px; font-weight: 600; color: #888; text-transform: uppercase; }
.hi-act-yr  { font-size: 10px; color: #aaa; }

.hi-act-title {
  font-weight: 600; font-size: 14px; color: #1e3a2f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 400px;
}
.hi-act-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: #888; margin-top: 4px;
}

/* Selected activity info bar */
.hi-selected-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
}

/* Hours stepper */
.hi-hours-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}
.hi-step-btn {
  width: 32px; height: 34px;
  background: #f8f9fa;
  border: none; border-radius: 0;
  font-size: 16px; font-weight: 700;
  cursor: pointer; line-height: 1;
  transition: background .1s;
}
.hi-step-btn:hover  { background: #e9ecef; }
.hi-step-btn:active { background: #dee2e6; }
.hi-hours-input {
  width: 62px; height: 34px;
  border: none;
  border-left: 1px solid #dee2e6;
  border-right: 1px solid #dee2e6;
  text-align: center;
  font-weight: 700; font-size: 14px;
  padding: 4px 2px;
}
.hi-hours-input:focus { outline: none; background: #fff8e1; }
.hi-hours-input::-webkit-inner-spin-button,
.hi-hours-input::-webkit-outer-spin-button { opacity: 0; }

/* Hours display */
.hi-hours-display {
  display: flex; align-items: center;
  height: 38px; padding: 0 14px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 15px; color: #1e3a2f;
}

@media (max-width: 576px) {
  .hi-card-body       { padding: 12px; }
  .hi-card-header     { padding: 12px 14px; }
  .hi-act-title       { max-width: 200px; }
  .hi-activity-card   { padding: 10px 12px; gap: 10px; }
}
/* ════════════════════════════════
   Hours Management Page Styles
════════════════════════════════ */
.hm-action-bar {
  background: #fff;
  border: 2px solid #00843D;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 2px 12px rgba(0,132,61,.15);
  position: sticky;
  top: 70px;
  z-index: 100;
}

.hm-group-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.hm-group-card:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,.09);
}

.hm-group-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f0;
}

.hm-group-title {
  font-weight: 700;
  font-size: 15px;
  color: #1e3a2f;
  margin: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}
.hm-group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.hm-group-detail {
  border-top: 1px solid #f0f0f0;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .hm-group-header {
    flex-direction: column;
    gap: 12px;
  }
  .hm-group-title { max-width: 100%; white-space: normal; }
}
#uploadModal .modal-body {
    max-height: 65vh;
    overflow-y: auto;
}

/* ============================================================
   DOCUMENT LIBRARY – Toggle / Collapse
   ============================================================ */
.toggle-icon {
  transition: transform 0.25s ease;
  font-size: 13px;
  color: #6c757d;
  flex-shrink: 0;
}
.toggle-icon.collapsed {
  transform: rotate(180deg);
}
