@font-face {
  font-family: 'Times New Roman';
  src: url('/assets/fonts/Times_New_Roman.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Khmer OS Battambang';
  src: url('/assets/fonts/KhmerOS_battambang.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow:
    rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;

  --sans: 'Times New Roman', 'Khmer OS Battambang', serif;
  --heading: 'Khmer OS Battambang', 'Times New Roman', serif;
  --mono: ui-monospace, Consolas, monospace;

  letter-spacing: 0.18px;
  color-scheme: light dark;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  @media (max-width: 1024px) {
    font-size: 16px;
  }
}

.main-wrapper {
  font: 18px/145% var(--sans);
}

/* Language specific font overrides */
.lang-en {
  --sans: 'Times New Roman', serif;
  --heading: 'Times New Roman', serif;
}

.lang-kh {
  --sans: 'Khmer OS Battambang', sans-serif;
  --heading: 'Khmer OS Battambang', serif;
}

/* ── Bilingual text utility classes ───────────────────────────────────────── */
/* Use .text-en for English-primary cells (fallback to Khmer font if needed)  */
.text-en {
  font-family: 'Times New Roman', 'Khmer OS Battambang', sans-serif;
}

/* Use .text-kh for Khmer-primary cells (fallback to Times New Roman)          */
.text-kh {
  font-family: 'Khmer OS Battambang', 'Times New Roman', sans-serif;
}

/* Input fields for Khmer text entry */
input.input-kh,
textarea.input-kh {
  font-family: 'Khmer OS Battambang', 'Times New Roman', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, 0.15);
    --accent-border: rgba(192, 132, 252, 0.5);
    --social-bg: rgba(47, 48, 58, 0.5);
    --shadow:
      rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }

  #social .button-icon {
    filter: invert(1) brightness(2);
  }
}

body, html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body.admin-layout,
body.admin-layout html {
  overflow: hidden;
  height: 100vh;
}

#root {
  min-height: 100%;
  width: 100%;
}

body.admin-layout #root {
  height: 100vh;
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--heading);
  font-weight: 500;
  color: var(--text-h);
}

h1 {
  font-size: 56px;
  letter-spacing: -1.68px;
  margin: 32px 0;
  @media (max-width: 1024px) {
    font-size: 36px;
    margin: 20px 0;
  }
}
h2 {
  font-size: 24px;
  line-height: 118%;
  letter-spacing: -0.24px;
  margin: 0 0 8px;
  @media (max-width: 1024px) {
    font-size: 20px;
  }
}
.page-header h2 {
  font-size: 14px;
}
p {
  margin: 0;
}

code,
.counter {
  font-family: var(--mono);
  display: inline-flex;
  border-radius: 4px;
  color: var(--text-h);
}

code {
  font-size: 15px;
  line-height: 135%;
  padding: 4px 8px;
  background: var(--code-bg);
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  color: var(--text-h);
  font-size: 14px;
}

/* Employee Account Page Styles */
.info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #1e40af;
}
.info-banner i {
  color: #2563eb;
  font-size: 14px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #10b981;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.card-header-meta {
  font-size: 12px;
  color: #6b7280;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.group-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  user-select: none;
}
.group-option:hover {
  border-color: #2563eb;
  background: #f8fafc;
}
.group-option.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.group-option-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.group-option.is-selected .group-option-check {
  background: #2563eb;
  border-color: #2563eb;
}
.group-option-check i {
  color: white;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}
.group-option.is-selected .group-option-check i {
  opacity: 1;
}

.group-option-content {
  flex: 1;
  min-width: 0;
}
.group-option-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #111827;
}
.group-option-desc {
  font-size: 11.5px;
  color: #6b7280;
  margin-top: 2px;
}
.group-option-count {
  font-size: 11px;
  color: #9ca3af;
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 999px;
  flex-shrink: 0;
}
.group-option.is-selected .group-option-count {
  background: white;
  color: #2563eb;
}

.is-monospace {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.02em;
}

.khmer-font {
  font-family: 'Khmer OS Battambang', 'Times New Roman', sans-serif;
}

.req {
  color: #ef4444;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Hint text for form labels */
.filter-label .hint {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-left: 4px;
}

/* Input with icon prefix */
.input-affix {
  position: relative;
}
.input-affix i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
  pointer-events: none;
}
.input-affix .filter-input {
  padding-left: 34px;
}

/* Stats Grid Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-info h4 {
  margin: 0 0 4px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-h);
}

.stat-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* Quick Access Cards Styles */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.quick-access-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-access-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.quick-access-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-access-icon.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.quick-access-icon.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.quick-access-icon.purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.quick-access-info {
  flex: 1;
}

.quick-access-info h4 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-h);
}

.quick-access-info p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}

.mt-20 {
  margin-top: 20px;
}
