/* ====================================================
   ລະບົບຕິດຕາມ ແລະ ວາງແຜນວຽກປະຈຳວັນ — App Styles
   ==================================================== */

/* ---------- Font Face: Phetsarath ---------- */
@font-face {
  font-family: 'Phetsarath OT';
  src: url('../fonts/Phetsarath-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Phetsarath OT';
  src: url('../fonts/Phetsarath-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Fonts ---------- */
:root {
  --font-lao: "Phetsarath OT", "Saysettha OT", sans-serif;
  --font-en:  'Inter', sans-serif;
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
  --topbar-height: 56px;
  --primary: #3B82F6;
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #06B6D4;
}
/*html[lang="lo"] body { font-family: "var(--font-lao)"; }*/
/*html[lang="en"] body { font-family: var(--font-en); }*/
html[lang="en"] body { 
  font-family: var(--font-en);
}

body { 
  font-size: 0.875rem;
  font-family: var(--font-lao);
}

/* ---------- Sidebar ---------- */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  transition: width 0.25s ease;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #111827 !important;
}

#sidebar.sidebar-hidden {
  width: 0;
  overflow: hidden;
}

.sidebar-brand span { font-size: .8rem; }

#sidebar .nav-link {
  font-size: .82rem;
  padding: .45rem .75rem;
  border-radius: .4rem;
  margin-bottom: 2px;
  white-space: nowrap;
  transition: background .15s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
}

#sidebar .nav-link.active {
  background: var(--primary);
  font-weight: 600;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ---------- Login page ---------- */
.login-page {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
  min-height: 100vh;
}

.login-card {
  animation: fadeInUp 0.5s ease;
}

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

/* ---------- Stat cards ---------- */
.stat-card { transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,.1) !important; }

.stat-icon { width: 56px; height: 56px; display:flex; align-items:center; justify-content:center; }

.bg-primary-soft { background: rgba(59,130,246,.12); }
.bg-success-soft { background: rgba(16,185,129,.12); }
.bg-warning-soft { background: rgba(245,158,11,.12); }
.bg-danger-soft  { background: rgba(239,68,68,.12); }
.bg-info-soft    { background: rgba(6,182,212,.12); }

/* ---------- Tables ---------- */
.table th { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(59,130,246,.04); cursor:pointer; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; }

/* ---------- Cards ---------- */
.card { border-radius: .75rem !important; }
.card-header { border-radius: .75rem .75rem 0 0 !important; }
.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,.08) !important; }

/* ---------- Avatar ---------- */
.avatar-sm { width: 32px; height: 32px; flex-shrink: 0; }

/* ---------- Notification dropdown ---------- */
.notif-dropdown { border-radius: .75rem !important; }

/* ---------- Priority colors ---------- */
.priority-low      { color: #10B981; }
.priority-medium   { color: #3B82F6; }
.priority-high     { color: #F59E0B; }
.priority-critical { color: #EF4444; }

/* ---------- Timer running badge ---------- */
.timer-running { animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%,100% { opacity:1; }
  50%      { opacity:.5; }
}

/* ---------- Article content ---------- */
.article-content {
  font-size: .9rem;
  line-height: 1.8;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---------- Custom progress ---------- */
.progress { border-radius: 10px; }
.progress-bar { border-radius: 10px; }

/* ---------- Btn xs ---------- */
.btn-xs { padding: .15rem .4rem; font-size: .7rem; }

/* ---------- Forms ---------- */
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(59,130,246,.2); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  #sidebar { position: fixed; z-index: 1050; height: 100vh; }
  #sidebar.sidebar-hidden { transform: translateX(-100%); width: var(--sidebar-width); }
  #app-wrapper { flex-direction: column; }
}

@media (max-width: 576px) {
  .display-6 { font-size: 1.5rem !important; }
  .topbar h6 { font-size: .75rem; }
}

/* ---------- Print ---------- */
@media print {
  #sidebar, .topbar, .btn, form { display:none !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---------- Dark overlay for sidebar on mobile ---------- */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
}

/* ---------- Misc ---------- */
.fs-7 { font-size: .7rem; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
