/* Material Design 3 (M3) Design System for WAG Resepsionis Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  /* M3 Light Theme Tokens (Teal/Emerald with Rose Accent - TLN Identity) */
  --md-sys-color-primary: #006a60;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #72f8e5;
  --md-sys-color-on-primary-container: #00201c;
  
  --md-sys-color-secondary: #4a635f;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #cce8e3;
  --md-sys-color-on-secondary-container: #05201c;

  --md-sys-color-tertiary: #b02e60;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd9e2;
  --md-sys-color-on-tertiary-container: #3e001d;

  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-warning: #995a00;
  --md-sys-color-warning-container: #ffddb6;
  --md-sys-color-on-warning-container: #321b00;

  --md-sys-color-surface: #f4fbf8;
  --md-sys-color-on-surface: #161d1b;
  --md-sys-color-surface-variant: #dae5e2;
  --md-sys-color-on-surface-variant: #3f4947;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #eef5f2;
  --md-sys-color-surface-container: #e8efec;
  --md-sys-color-surface-container-high: #e2eae6;
  --md-sys-color-surface-container-highest: #dce4e1;

  --md-sys-color-outline: #6f7977;
  --md-sys-color-outline-variant: #bec9c6;
  --md-sys-color-shadow: rgba(0, 0, 0, 0.08);

  /* Status Tokens */
  --status-active-bg: #e6f7f1;
  --status-active-text: #007755;
  --status-left-bg: #ffebee;
  --status-left-text: #c62828;
  --status-past-bg: #f1f3f4;
  --status-past-text: #5f6368;

  --cv-approved-bg: #e8f5e9;
  --cv-approved-text: #2e7d32;
  --cv-pending-bg: #fff8e1;
  --cv-pending-text: #f57f17;
  --cv-rejected-bg: #fbe9e7;
  --cv-rejected-text: #d84315;
  --cv-unknown-bg: #f3e5f5;
  --cv-unknown-text: #7b1fa2;

  /* Elevation Shadows */
  --md-sys-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --md-sys-elevation-2: 0 3px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --md-sys-elevation-3: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

  /* Shapes */
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 28px;
  --md-shape-full: 9999px;
}

[data-theme="dark"] {
  --md-sys-color-primary: #53dbc8;
  --md-sys-color-on-primary: #003731;
  --md-sys-color-primary-container: #005048;
  --md-sys-color-on-primary-container: #72f8e5;

  --md-sys-color-secondary: #b1ccc7;
  --md-sys-color-on-secondary: #1c3531;
  --md-sys-color-secondary-container: #324b47;
  --md-sys-color-on-secondary-container: #cce8e3;

  --md-sys-color-tertiary: #ffb1c4;
  --md-sys-color-on-tertiary: #66002f;
  --md-sys-color-tertiary-container: #8c1447;
  --md-sys-color-on-tertiary-container: #ffd9e2;

  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;

  --md-sys-color-surface: #0e1514;
  --md-sys-color-on-surface: #deedea;
  --md-sys-color-surface-variant: #3f4947;
  --md-sys-color-on-surface-variant: #bec9c6;
  --md-sys-color-surface-container-lowest: #090f0e;
  --md-sys-color-surface-container-low: #161d1c;
  --md-sys-color-surface-container: #1b2120;
  --md-sys-color-surface-container-high: #252c2a;
  --md-sys-color-surface-container-highest: #303735;

  --md-sys-color-outline: #899390;
  --md-sys-color-outline-variant: #3f4947;
  --md-sys-color-shadow: rgba(0, 0, 0, 0.4);

  --status-active-bg: rgba(0, 180, 120, 0.2);
  --status-active-text: #69f0ae;
  --status-left-bg: rgba(255, 82, 82, 0.2);
  --status-left-text: #ff8a80;
  --status-past-bg: rgba(255, 255, 255, 0.08);
  --status-past-text: #cfd8dc;

  --cv-approved-bg: rgba(76, 175, 80, 0.2);
  --cv-approved-text: #81c784;
  --cv-pending-bg: rgba(255, 179, 0, 0.2);
  --cv-pending-text: #ffd54f;
  --cv-rejected-bg: rgba(244, 67, 54, 0.2);
  --cv-rejected-text: #e57373;
  --cv-unknown-bg: rgba(156, 39, 176, 0.2);
  --cv-unknown-text: #ce93d8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Header & Top Bar */
.m3-top-app-bar {
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.branding-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  color: white;
  border-radius: var(--md-shape-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--md-sys-elevation-1);
}

.branding-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.02em;
}

.branding-text .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: var(--md-shape-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Icon Buttons */
.m3-icon-button {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-icon-button:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

/* Main Container */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Hero Section */
.dashboard-hero {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--md-sys-color-on-surface);
}

.hero-title p {
  color: var(--md-sys-color-outline);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.hero-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.last-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--md-sys-color-surface-container-high);
  padding: 0.4rem 0.85rem;
  border-radius: var(--md-shape-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.btn-sync-now {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: 1px solid var(--md-sys-color-primary);
  padding: 0.4rem 0.9rem;
  border-radius: var(--md-shape-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-sync-now:hover {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.btn-sync-now:active {
  transform: translateY(0);
}

.btn-sync-now.syncing {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-outline);
}

.btn-sync-now.syncing .sync-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #00c853;
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 200, 83, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}

/* Group Navigation / Switcher (M3 Segmented Tabs) */
.group-switcher-section {
  margin-bottom: 1.5rem;
}

.group-switcher-card {
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-large);
  padding: 1.1rem 1.35rem;
  box-shadow: var(--md-elevation-1);
}

.group-switcher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.group-switcher-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.group-switcher-title .material-symbols-rounded {
  color: var(--md-sys-color-primary);
  font-size: 1.25rem;
}

.badge-prototype {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--md-shape-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 106, 96, 0.2);
}

.group-tabs,
.group-tabs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.group-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--md-shape-medium);
  border: 1.5px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}

.group-tab:hover:not(:disabled) {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-1px);
}

.group-tab.active {
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 3px 8px rgba(0, 106, 96, 0.15);
}

.group-tab.active .tab-icon {
  color: var(--md-sys-color-primary);
}

.group-tab.active .tab-title {
  font-weight: 700;
  color: var(--md-sys-color-on-primary-container);
}

.group-tab.active .tab-count {
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.tab-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.tab-count {
  font-size: 0.75rem;
  color: var(--md-sys-color-outline);
}

.group-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.active-dot {
  background-color: #00c853;
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.3);
}

.tab-planned-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background-color: rgba(120, 144, 156, 0.15);
  color: var(--md-sys-color-outline);
  margin-top: 0.1rem;
  width: fit-content;
}

.group-tab.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-style: dashed;
  background-color: transparent;
}

/* Group Badges in Table */
.badge-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--md-shape-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-group-ikhwan {
  background-color: rgba(2, 136, 209, 0.12);
  color: #0277bd;
  border: 1px solid rgba(2, 136, 209, 0.28);
}

[data-theme="dark"] .badge-group-ikhwan {
  background-color: rgba(2, 136, 209, 0.22);
  color: #81d4fa;
  border-color: rgba(129, 212, 250, 0.3);
}

.badge-group-akhwat {
  background-color: rgba(233, 30, 99, 0.12);
  color: #c2185b;
  border: 1px solid rgba(233, 30, 99, 0.28);
}

[data-theme="dark"] .badge-group-akhwat {
  background-color: rgba(233, 30, 99, 0.22);
  color: #f48fb1;
  border-color: rgba(244, 143, 177, 0.3);
}

/* M3 Stat Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.m3-stat-card {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.m3-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
  background-color: var(--md-sys-color-surface-container);
}

.m3-stat-card.active-card {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

.m3-stat-card.card-history-archive {
  border-style: dashed;
  opacity: 0.88;
  background-color: var(--md-sys-color-surface-container-lowest);
}

.m3-stat-card.card-history-archive:hover {
  opacity: 1;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--md-shape-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--md-sys-color-on-surface);
}

.stat-subtitle {
  font-size: 0.78rem;
  color: var(--md-sys-color-outline);
  margin-top: 0.35rem;
}

/* Control & Filter Bar */
.control-bar-card {
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--md-sys-elevation-1);
}

.search-and-quick-filter {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* M3 Docked Search Field */
.m3-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-adornment {
  position: absolute;
  left: 1rem;
  color: var(--md-sys-color-outline);
  pointer-events: none;
  font-size: 1.2rem;
}

.m3-search-input {
  width: 100%;
  padding: 0.8rem 2.8rem 0.8rem 2.8rem;
  border-radius: var(--md-shape-full);
  border: 1px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.m3-search-input:focus {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-lowest);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--md-shape-full);
  display: none;
}

.clear-search-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

/* Modern M3 Dropdowns Filter Row */
.filter-dropdowns-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.m3-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}

.m3-select-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: 0.25rem;
}

.select-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-prefix-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 1.15rem;
  color: var(--md-sys-color-outline);
  pointer-events: none;
}

.select-chevron {
  position: absolute;
  right: 0.75rem;
  font-size: 1.25rem;
  color: var(--md-sys-color-outline);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.m3-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.65rem 2.2rem 0.65rem 2.4rem;
  border-radius: var(--md-shape-md);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.m3-select:hover {
  border-color: var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface-container-high);
}

.m3-select:focus {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-lowest);
  box-shadow: 0 0 0 3px rgba(0, 106, 96, 0.15);
}

.select-box-wrap:focus-within .select-chevron {
  transform: rotate(180deg);
  color: var(--md-sys-color-primary);
}

.filter-action-wrap {
  display: flex;
  align-items: center;
  margin-bottom: 0.1rem;
}

/* Action Chip Toggle */
.m3-chip {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--md-shape-sm);
  padding: 0.6rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  height: 38px;
}

.m3-chip:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.m3-chip.action-chip {
  border-color: var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-error);
}

.m3-chip.action-chip:hover {
  border-color: var(--md-sys-color-error);
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.m3-chip.action-chip.selected {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: var(--md-sys-color-error);
  box-shadow: 0 1px 3px rgba(186, 26, 26, 0.2);
}

/* Data Table Container */
.table-card {
  background-color: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-lg);
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-1);
}

.table-header-bar {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.result-count {
  color: var(--md-sys-color-outline);
  font-size: 0.85rem;
  font-weight: 500;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.m3-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.m3-data-table th {
  background-color: var(--md-sys-color-surface-container-low);
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-sys-color-outline);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  white-space: nowrap;
}

.m3-data-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.m3-data-table th.sortable-th:hover {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

.th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sort-icon {
  font-size: 1.05rem !important;
  color: var(--md-sys-color-outline);
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.sortable-th:hover .sort-icon {
  opacity: 1;
  color: var(--md-sys-color-primary);
}

.sortable-th.active-sort {
  color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container);
}

.sortable-th.active-sort .sort-icon {
  opacity: 1;
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

/* Sort Status Indicator under table title */
.sort-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--md-sys-color-outline);
  margin-top: 0.25rem;
  font-weight: 500;
}

.btn-reset-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
  border-radius: var(--md-shape-full);
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-reset-sort:hover {
  opacity: 0.85;
}

.m3-data-table td {
  padding: 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  vertical-align: middle;
}

.m3-data-table tr:hover {
  background-color: var(--md-sys-color-surface-container-low);
}

/* Member Column */
.member-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Avatar Ikhwan: Biru */
.avatar-circle.avatar-ikhwan {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1.5px solid #bfdbfe;
}

[data-theme="dark"] .avatar-circle.avatar-ikhwan {
  background-color: #1e3a8a;
  color: #dbeafe;
  border: 1.5px solid #3b82f6;
}

/* Avatar Akhwat: Pink */
.avatar-circle.avatar-akhwat {
  background-color: #fce7f3;
  color: #9d174d;
  border: 1.5px solid #fbcfe8;
}

[data-theme="dark"] .avatar-circle.avatar-akhwat {
  background-color: #831843;
  color: #fce7f3;
  border: 1.5px solid #ec4899;
}

.member-info .name {
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1.2;
}

.member-info .tag {
  font-size: 0.76rem;
  color: var(--md-sys-color-outline);
  margin-top: 0.15rem;
}

/* Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--md-shape-full);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-active { background-color: var(--status-active-bg); color: var(--status-active-text); }
.badge-admin { background-color: rgba(245, 158, 11, 0.16); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .badge-admin { background-color: rgba(245, 158, 11, 0.25); color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.badge-graduated { background-color: rgba(16, 185, 129, 0.16); color: #047857; border: 1px solid rgba(16, 185, 129, 0.35); }
[data-theme="dark"] .badge-graduated { background-color: rgba(16, 185, 129, 0.25); color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.badge-left { background-color: var(--status-left-bg); color: var(--status-left-text); }
.badge-past { background-color: var(--status-past-bg); color: var(--status-past-text); }

.badge-cv-approved { background-color: var(--cv-approved-bg); color: var(--cv-approved-text); }
.badge-cv-pending { background-color: var(--cv-pending-bg); color: var(--cv-pending-text); }
.badge-cv-rejected { background-color: var(--cv-rejected-bg); color: var(--cv-rejected-text); }
.badge-cv-unknown { background-color: var(--cv-unknown-bg); color: var(--cv-unknown-text); }

/* CV Status Cell & Klik2CV Button (Icon-only, compact & hemat tempat) */
.cv-status-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.btn-cv-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-full);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.btn-cv-icon-link .material-symbols-rounded {
  font-size: 0.95rem;
}

.btn-cv-icon-link:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .btn-cv-icon-link {
  background-color: var(--md-sys-color-surface-container-high);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.25);
}

[data-theme="dark"] .btn-cv-icon-link:hover {
  background-color: #0369a1;
  color: #ffffff;
  border-color: #38bdf8;
}

/* Kolom PIC Follow-up */
.pic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.55rem;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-radius: var(--md-shape-full);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.pic-empty {
  font-size: 0.85rem;
  color: var(--md-sys-color-outline);
  font-weight: 500;
  display: inline-block;
  padding-left: 0.25rem;
}

/* Kolom Umur di WAG */
.wag-age-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wag-age-val {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wag-age-val.age-long {
  color: #b45309; /* > 30 hari: butuh perhatian khusus / fokus follow up */
}

[data-theme="dark"] .wag-age-val.age-long {
  color: #fbbf24;
}

.wag-age-sub {
  font-size: 0.72rem;
  color: var(--md-sys-color-outline);
}

/* Penanda Mismatch Gender (CV vs Sheet) */
.gender-mismatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
  margin-top: 0.2rem;
}

[data-theme="dark"] .gender-mismatch-badge {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

/* Table Actions */
.table-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--md-shape-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-whatsapp {
  background-color: #25d366;
  color: white;
}

.btn-whatsapp:hover {
  background-color: #20ba59;
}

.btn-detail {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
  margin-left: 0.4rem;
}

.btn-detail:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background-color: var(--md-sys-color-surface-container-low);
  font-size: 0.85rem;
  color: var(--md-sys-color-outline);
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-btn {
  background-color: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-shape-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Dialog / Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-backdrop.show {
  display: flex;
}

.m3-dialog {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-xl);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--md-sys-elevation-3);
  padding: 1.75rem;
  position: relative;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.dialog-body-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  background-color: var(--md-sys-color-surface-container-lowest);
  padding: 0.85rem;
  border-radius: var(--md-shape-md);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
}

.detail-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-top: 0.2rem;
  word-break: break-all;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.m3-button {
  padding: 0.6rem 1.25rem;
  border-radius: var(--md-shape-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-filled:hover {
  filter: brightness(1.1);
}

.btn-tonal {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.btn-tonal:hover {
  background-color: var(--md-sys-color-outline-variant);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--md-sys-color-outline);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }
  .hero-title h2 {
    font-size: 1.3rem;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dialog-body-grid {
    grid-template-columns: 1fr;
  }
  .detail-item.full-width {
    grid-column: span 1;
  }
}

/* ==========================================================================
   Login Screen Overlay (Proteksi PII — Konsep prakom2600 / nms2600)
   ========================================================================== */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--md-sys-color-surface-container-high);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--md-sys-color-outline-variant);
  text-align: center;
  animation: modalFadeIn 0.25s ease-out;
}

.login-icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.85rem;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--md-sys-color-outline);
  margin-bottom: 1.25rem;
}

.login-banner-info {
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  text-align: left;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border-left: 3px solid var(--md-sys-color-primary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--md-sys-color-outline);
  font-size: 1.25rem;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.85rem;
  border: 1.5px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.login-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s, transform 0.1s, filter 0.2s;
}

.login-btn:hover {
  filter: brightness(1.08);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 500;
  animation: modalFadeIn 0.2s ease-out;
}

