/* ===== MyEmpInfo — Dark Glassmorphism Theme ===== */
:root {
  --bg-0: #0a0e1a;
  --bg-1: #0f1424;
  --bg-2: #151b30;
  --bg-card: rgba(22, 28, 48, 0.65);
  --bg-card-solid: #161c30;
  --bg-hover: rgba(40, 48, 78, 0.55);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #e7eaf3;
  --text-dim: #9aa3bd;
  --text-faint: #6b7592;

  --teal: #00d4a8;
  --teal-2: #19b791;
  --purple: #7c5cff;
  --pink: #ff5d8f;
  --yellow: #ffc94d;
  --blue: #4ec3ff;
  --red: #ff6b6b;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 40px -10px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 0 1px rgba(255,255,255,0.04), 0 20px 50px -20px rgba(0,0,0,0.7);

  --font: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --font-num: "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg-0: #f4f6fb;
  --bg-1: #ffffff;
  --bg-2: #eef1f8;
  --bg-card: rgba(255,255,255,0.85);
  --bg-card-solid: #ffffff;
  --bg-hover: rgba(0,0,0,0.04);
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.14);
  --text: #1a2138;
  --text-dim: #5b6483;
  --text-faint: #8b94b0;
  --shadow: 0 10px 40px -10px rgba(20,30,60,0.18);
  --shadow-glow: 0 0 0 1px rgba(0,0,0,0.05), 0 20px 50px -20px rgba(20,30,60,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(124,92,255,0.18), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(0,212,168,0.13), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(255,93,143,0.10), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(124,92,255,0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(0,212,168,0.08), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(255,93,143,0.06), transparent 55%),
    var(--bg-0);
}

/* Animated mesh glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,212,168,0.06) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(124,92,255,0.06) 0%, transparent 30%);
  animation: meshShift 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes meshShift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-30px, 30px); }
}

#root { position: relative; z-index: 1; min-height: 100vh; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ----- Glass card ----- */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.glass-hover {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
}
.glass-hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 60px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #1cd6a8, #19b791);
  color: #062017;
  border: none;
  font-weight: 600;
  box-shadow: 0 6px 22px -6px rgba(0,212,168,0.55);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #25e1b3, #1ec7a0);
  box-shadow: 0 10px 28px -6px rgba(0,212,168,0.65);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-danger {
  background: linear-gradient(135deg, #ff5d8f, #e84770);
  color: white;
  border: none;
  font-weight: 600;
}

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  justify-content: center;
}

/* ----- Inputs ----- */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color .15s, background .15s;
  outline: none;
}
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: rgba(0,0,0,0.03);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--teal);
  background: rgba(0,212,168,0.04);
}
.input::placeholder { color: var(--text-faint); }
.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}

/* ----- Chip ----- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.chip-teal   { background: rgba(0,212,168,0.12);  border-color: rgba(0,212,168,0.3);  color: var(--teal); }
.chip-purple { background: rgba(124,92,255,0.14); border-color: rgba(124,92,255,0.3); color: #a48cff; }
.chip-pink   { background: rgba(255,93,143,0.14); border-color: rgba(255,93,143,0.3); color: var(--pink); }
.chip-yellow { background: rgba(255,201,77,0.14); border-color: rgba(255,201,77,0.3); color: var(--yellow); }
.chip-blue   { background: rgba(78,195,255,0.14); border-color: rgba(78,195,255,0.3); color: var(--blue); }
.chip-red    { background: rgba(255,107,107,0.14); border-color: rgba(255,107,107,0.3); color: var(--red); }

/* ----- Numeric display ----- */
.num-display {
  font-family: var(--font-num);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ----- Top accent stripe on stat cards (from reference) ----- */
.stat-card {
  position: relative;
  padding: 22px 22px 20px;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent, var(--teal));
  box-shadow: 0 0 20px var(--accent, var(--teal));
  opacity: 0.85;
}

/* ----- Page transitions ----- */
.page-enter { animation: pageIn .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger > * { animation: fadeUp .55s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.stagger > *:nth-child(7) { animation-delay: .33s; }
.stagger > *:nth-child(8) { animation-delay: .38s; }

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

/* ----- Avatar ----- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c1, #2a3050), var(--c2, #1a2040));
  color: white;
  font-size: 13px;
  border: 1px solid var(--border);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* ----- Department dot colors ----- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* ----- Tab Pills ----- */
.tab-pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  font-family: var(--font);
}
.tab-pill:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.tab-pill.active {
  background: linear-gradient(135deg, #7c5cff, #5a3eff);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(124,92,255,0.6);
}

/* ----- Notif dot ----- */
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--pink);
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255,93,143,0.6); }
  100% { box-shadow: 0 0 0 8px rgba(255,93,143,0); }
}

/* ----- Skeleton loader ----- */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ----- Drawer ----- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,8,18,0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  animation: fadeIn .25s;
}
.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 480px;
  max-width: 95vw;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: slideIn .4s cubic-bezier(.2,.8,.2,1);
  box-shadow: -20px 0 60px -10px rgba(0,0,0,0.6);
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ----- Modal ----- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,8,18,0.65);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .25s;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 1080px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: popIn .35s cubic-bezier(.2,.9,.3,1.1);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ----- Toast ----- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
  pointer-events: none;
}
.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--teal);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.1);
  pointer-events: auto;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ----- Table ----- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 2;
}
.table tbody tr {
  transition: background .15s;
  cursor: pointer;
}
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr.selected { background: rgba(0,212,168,0.06); }

/* ----- Checkbox ----- */
.checkbox {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.checkbox.checked {
  background: var(--teal);
  border-color: var(--teal);
}
.checkbox.checked::after {
  content: "";
  width: 5px; height: 9px;
  border: solid #062017;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

/* ----- Loader / shine for buttons ----- */
.shine {
  position: relative;
  overflow: hidden;
}
.shine::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left .6s;
}
.shine:hover::after { left: 130%; }

/* ----- Tooltip ----- */
.tt {
  position: absolute;
  background: var(--bg-card-solid);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  pointer-events: none;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.5);
  z-index: 50;
  white-space: nowrap;
}

/* ----- Pulsing live dot ----- */
.live-dot {
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--teal);
  animation: live 1.6s infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(0,212,168,0.7); }
  100% { box-shadow: 0 0 0 8px rgba(0,212,168,0); }
}

/* ----- Utility ----- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.spacer { flex: 1; }
.cursor-pointer { cursor: pointer; }
