@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;500;600;700&family=Sarabun:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --color-bg: #F3F5F8;
  --color-surface: #FFFFFF;
  --color-sidebar: #101B2D;
  --color-sidebar-hover: #1B2C47;
  --color-primary: #1B3358;
  --color-primary-light: #2C4A73;
  --color-accent: #C08A2E;
  --color-accent-light: #E0B563;
  --color-success: #2F8F5B;
  --color-danger: #C1443D;
  --color-text: #1A2233;
  --color-text-muted: #5B6472;
  --color-border: #E2E6EC;
}

* { font-family: 'Sarabun', sans-serif; }
.font-display { font-family: 'Kanit', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

body {
  background: var(--color-bg);
  color: var(--color-text);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C7CEDA; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------
   Signature element: split-flap board clock (dashboard header)
   Echoes the departures-board feel of an attendance/time system.
------------------------------------------------------------- */
.flap-board {
  display: inline-flex;
  gap: 6px;
}
.flap-group {
  display: inline-flex;
  gap: 2px;
}
.flap {
  position: relative;
  width: 34px;
  height: 46px;
  background: #0C1524;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06), 0 2px 4px rgba(0,0,0,0.25);
}
.flap::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(0,0,0,0.55);
  transform: translateY(-0.5px);
  z-index: 3;
}
.flap span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 24px;
  color: var(--color-accent-light);
  letter-spacing: -1px;
}
.flap-colon {
  display: flex;
  align-items: center;
  color: var(--color-accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 24px;
  padding: 0 2px;
}

/* Sidebar active link */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #A9B4C6;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
}
.nav-link.active {
  background: var(--color-accent);
  color: #101B2D;
  font-weight: 600;
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

/* Table */
.data-table thead th {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: #F8F9FB;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14.5px;
}
.data-table tbody tr:hover { background: #FAFBFD; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.badge-success { background: #E4F5EC; color: var(--color-success); }
.badge-danger  { background: #FBEAE9; color: var(--color-danger); }
.badge-warning { background: #FDF2E1; color: #B5750E; }
.badge-neutral { background: #EEF1F5; color: var(--color-text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.05s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-light); }
.btn-accent { background: var(--color-accent); color: #1A1206; }
.btn-accent:hover { background: var(--color-accent-light); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { background: #F3F5F8; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,27,45,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.modal-box {
  background: #fff; border-radius: 14px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh; overflow-y: auto;
}

/* Toast */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 260px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toast-in 0.2s ease-out;
}
.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Ledger accent rule used on the login screen */
.ledger-lines {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent, transparent 27px,
    rgba(224,181,99,0.14) 27px, rgba(224,181,99,0.14) 28px
  );
}
