:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --bg-dropdown: #0f172a;
  --bg-input: #0a0f1d;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-focus: #6366f1;
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-pink: #ec4899;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
  --shadow-dropdown: 0 25px 50px -10px rgba(0, 0, 0, 0.85), 0 0 0 2px rgba(99, 102, 241, 0.5);
  --backdrop-blur: none;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-dropdown: #ffffff;
  --bg-input: #f8fafc;
  --border-color: #cbd5e1;
  --border-focus: #4f46e5;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.2);
  --primary-light: #6366f1;
  --shadow-main: 0 10px 25px -5px rgba(100, 116, 139, 0.15), 0 0 0 1px var(--border-color);
  --shadow-dropdown: 0 25px 50px -10px rgba(15, 23, 42, 0.25), 0 0 0 2px var(--primary);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* App Container */
.app-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Header Component */
.header-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-title-group h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f8fafc 30%, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-title-group h1 {
  background: linear-gradient(135deg, #0f172a 30%, #475569);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  font-size: 0.72rem;
  font-weight: 600;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.clock-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.4rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.clock-time {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--primary-light);
}

.clock-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

/* Main Search & Check-in Area */
.search-hero-section {
  position: relative;
  z-index: 100;
}

.search-container {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 10px 35px -10px var(--primary-glow), 0 0 0 2px var(--primary-glow);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-icon-decor {
  position: absolute;
  left: 1.1rem;
  color: var(--primary-light);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 1.1rem 12.5rem 1.1rem 3.4rem;
  font-size: 1.2rem;
  font-family: inherit;
  font-weight: 600;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-focus);
  background: rgba(15, 23, 42, 0.95);
}
[data-theme="light"] .search-input:focus {
  background: #ffffff;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 1.05rem;
}

.btn-clear-search {
  position: absolute;
  right: 180px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}
.btn-clear-search:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

.search-kbd-hints {
  position: absolute;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
}

.kbd-badge {
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: monospace;
}

.search-subtext {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-hints-list {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Autocomplete Results Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-dropdown);
  border: 2px solid var(--border-focus);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  animation: slideDown 0.18s ease-out;
}

.autocomplete-dropdown.active {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header-bar {
  padding: 0.75rem 1.25rem;
  background: #090e1a;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--primary-light);
  font-weight: 700;
  letter-spacing: 0.03em;
}
[data-theme="light"] .dropdown-header-bar {
  background: #f1f5f9;
  color: #4338ca;
}

.dropdown-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-batch-record {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  transition: all 0.15s ease;
}
.btn-batch-record:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.select-all-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.suggestion-item {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--bg-dropdown);
  cursor: pointer;
  transition: all 0.12s ease;
  gap: 0.75rem;
}

[data-theme="light"] .suggestion-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background: #1e293b;
  border-left: 5px solid var(--primary-light);
  padding-left: calc(1.25rem - 5px);
}
[data-theme="light"] .suggestion-item:hover,
[data-theme="light"] .suggestion-item.highlighted {
  background: #e2e8f0;
  border-left: 5px solid var(--primary);
}

.suggestion-item.selected-row {
  background: rgba(99, 102, 241, 0.22);
}

.suggestion-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.member-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1e293b;
  color: var(--primary-light);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.member-avatar.female {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.5);
}

.member-avatar.male {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}
[data-theme="light"] .suggestion-name {
  color: #0f172a;
}

.suggestion-name .match-highlight {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 0 2px;
  border-radius: 3px;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 800;
}
[data-theme="light"] .suggestion-name .match-highlight {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.15);
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #cbd5e1;
}
[data-theme="light"] .suggestion-meta {
  color: #475569;
}

.meta-pill {
  padding: 2px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  color: #e2e8f0;
}
[data-theme="light"] .meta-pill {
  background: #e2e8f0;
  color: #334155;
}

.suggestion-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-tag.recorded {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-tag.unrecorded {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.no-results {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.no-results-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

/* Stats Overview Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--primary));
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--stat-bg, rgba(99, 102, 241, 0.15));
  color: var(--stat-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

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

.stat-sub {
  font-size: 0.72rem;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 2px;
}

/* Filter, Age-Group & Action Toolbar */
.control-toolbar {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toolbar-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-group-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.age-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.chip-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary-light);
}

.chip-btn.active {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.chip-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.chip-btn:not(.active) .chip-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.toolbar-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  align-items: center;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.custom-select,
.custom-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.custom-select:focus,
.custom-input:focus {
  border-color: var(--border-focus);
}

.custom-select option {
  background: #111827;
  color: #f8fafc;
}
[data-theme="light"] .custom-select option {
  background: #ffffff;
  color: #0f172a;
}

.age-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.age-range-inputs input {
  width: 100%;
}

.toolbar-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.export-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px var(--accent-green-glow);
}
.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* Attendance Records Table Section */
.records-section {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-count {
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--primary-glow);
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.attendance-table th {
  padding: 0.9rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.attendance-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.attendance-table th.sortable:hover {
  color: var(--text-main);
}

.attendance-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.attendance-table tr {
  transition: background-color var(--transition-fast);
}

.attendance-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.06);
}

.row-index {
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 45px;
}

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

.member-name-text {
  font-weight: 600;
  color: var(--text-main);
}

.gender-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.gender-badge.m {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.gender-badge.f {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.age-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
}

.timestamp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.btn-table-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 420px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s, opacity 0.2s;
}

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

.toast.success {
  border-left: 4px solid var(--accent-green);
}

.toast.warning {
  border-left: 4px solid var(--accent-orange);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-msg-title {
  font-size: 0.88rem;
  font-weight: 700;
}

.toast-msg-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.toast-close:hover {
  color: #ffffff;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Print Styling */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .header-actions,
  .search-hero-section,
  .control-toolbar,
  .btn-table-action,
  .toast-container,
  .modal-backdrop {
    display: none !important;
  }

  .app-layout {
    padding: 0;
    max-width: 100%;
  }

  .header-card {
    border: none;
    box-shadow: none;
    padding: 0 0 1rem 0;
    border-bottom: 2px solid #000;
    background: transparent;
  }

  .records-section {
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .attendance-table th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border-bottom: 2px solid #000 !important;
  }

  .attendance-table td {
    border-bottom: 1px solid #ddd !important;
    color: #000000 !important;
  }

  .gender-badge, .age-badge, .timestamp-pill {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-layout {
    padding: 1rem;
    gap: 1.25rem;
  }

  .header-card {
    padding: 1rem;
  }

  .brand-title-group h1 {
    font-size: 1.2rem;
  }

  .search-input {
    font-size: 1rem;
    padding: 0.9rem 3.5rem 0.9rem 2.8rem;
  }

  .search-kbd-hints {
    display: none;
  }

  .toolbar-controls-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Admin Authentication Portal Styles
   ========================================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

[data-theme="light"] .login-overlay {
  background: rgba(241, 245, 249, 0.92);
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.login-overlay.hidden .login-card {
  transform: translateY(20px) scale(0.96);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon-box {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.login-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.login-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: alertFadeIn 0.25s ease-out;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.field-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-with-icon:focus-within .field-icon {
  color: var(--primary-light);
}

.custom-input.with-left-icon {
  padding-left: 2.85rem;
  width: 100%;
}

.custom-input.with-right-btn {
  padding-right: 3rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.login-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: -0.25rem;
}

[data-theme="light"] .login-security-badge {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
}

.btn-login-submit {
  width: 100%;
  padding: 0.95rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px var(--primary-glow);
  cursor: pointer;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.login-footer-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Header Admin Profile Badge & Logout */
.admin-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.admin-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.btn-logout {
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Password Confirmation Modal for Delete & Reset */
.confirm-modal-window {
  max-width: 480px;
}

.confirm-modal-header {
  gap: 0.85rem;
}

.confirm-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-modal-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.confirm-target-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 4px solid #ef4444;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.45;
}

[data-theme="light"] .confirm-target-box {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
  border-left: 4px solid #dc2626;
}

/* ==========================================================================
   Manual Member & Auto-Calculated Birthday Styles
   ========================================================================== */

.add-member-window {
  max-width: 520px;
}

.modal-header-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.required-star {
  color: #ef4444;
  font-weight: 700;
}

.quick-birthdate-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

[data-theme="light"] .quick-birthdate-card {
  background: rgba(79, 70, 229, 0.04);
  border-color: rgba(79, 70, 229, 0.2);
}

.quick-birthdate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.quick-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: -0.01em;
}

[data-theme="light"] .quick-title {
  color: var(--primary);
}

.quick-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.quick-bday-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.bday-num-input {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.bday-preview-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition-fast);
}

[data-theme="light"] .bday-preview-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.bday-preview-box.calculated {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bday-preview-icon {
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bday-preview-box.calculated .bday-preview-icon {
  color: #10b981;
}

.bday-preview-info {
  flex: 1;
  min-width: 0;
}

.bday-preview-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.bday-preview-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bday-preview-year-chip {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--text-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  animation: alertFadeIn 0.2s ease-out;
}

.bday-preview-year-chip strong {
  color: #38bdf8;
  font-size: 0.95rem;
}

.auto-record-option {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-save-member {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Local Folder Direct Disk Sync Styles */
.btn-folder-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-folder-sync:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-main);
}

.btn-folder-sync.connected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.folder-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.btn-folder-sync.connected .folder-sync-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
