/* =====================================================
   Tema: Biru Korporat — sesuai warna logo
   PT Fathian Trans Perkasa (FTP)
   ===================================================== */
:root {
  --primary: #0e7ac4;        /* biru utama, sesuai logo FTP */
  --primary-dark: #0a5f96;   /* biru lebih gelap, untuk hover */
  --primary-light: #4aa8dd;  /* biru lebih terang, untuk aksen */
  --navy: #0a2e44;           /* navy gelap, khusus sidebar */
  --navy-dark: #071f30;
  --sidebar-w: 240px;
}

/* ---- Override warna primary bawaan Bootstrap supaya konsisten biru brand ---- */
:root, [data-bs-theme="light"] {
  --bs-primary: var(--primary);
  --bs-primary-rgb: 14, 122, 196;
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 14, 122, 196;
  --bs-link-hover-color: var(--primary-dark);
}
.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: 14, 122, 196;
}
.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary);
  --bs-btn-active-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: 14, 122, 196;
}
.bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link { background-color: var(--primary) !important; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.btn-check:checked + .btn-outline-secondary { background-color: #495057; border-color: #495057; }

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f2f5f8;
  margin: 0;
}

.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #a9c2d6;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .brand-company {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.sidebar-brand .brand-subtitle {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}
.sidebar-menu { list-style: none; padding: 10px 0; margin: 0; flex: 1; }
.sidebar-menu li a {
  display: block;
  padding: 12px 20px;
  color: #a9c2d6;
  text-decoration: none;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-menu li a i { width: 20px; margin-right: 10px; }
.sidebar-menu li a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-menu li.active a {
  background: rgba(14,122,196,0.25);
  color: #fff;
  border-left: 3px solid var(--primary-light);
  font-weight: 600;
}
.sidebar-footer { padding: 15px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { color: #f87171; text-decoration: none; }

/* Main content */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: #fff;
  padding: 14px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar h5 { color: var(--navy); font-weight: 700; }
.topbar-user { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.topbar-user i { font-size: 1.4rem; color: var(--primary); }
.page-content { padding: 25px; flex: 1; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Card header aksen */
.card-header.bg-white { border-bottom: 2px solid #eef3f7; }
.card-header.bg-white strong { color: var(--navy); }

/* Stat cards */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 15px;
  border-top: 3px solid var(--primary);
}
.stat-card .icon {
  width: 55px; height: 55px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; margin: 0; color: var(--navy); }
.stat-card .label { font-size: 0.85rem; color: #6b7280; margin: 0; }

/* Login page */
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 45%, var(--primary) 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  border-top: 4px solid var(--primary);
}
.login-card .icon-badge {
  width: 64px; height: 64px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 16px;
  box-shadow: 0 6px 16px rgba(14,122,196,0.4);
}
.login-card .login-brand-name { color: var(--navy); font-weight: 700; font-size: 1.35rem; }
.login-card .login-company { color: var(--primary); font-weight: 600; font-size: 1rem; letter-spacing: 0.3px; text-transform: uppercase; }

/* QR Card cetak */
.id-card {
  width: 340px;
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: #fff;
  margin: 0 auto;
  position: relative;
}
.id-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--primary);
  border-radius: 12px 12px 0 0;
}
.id-card .foto {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin-bottom: 10px;
}
.id-card #qrcode { display: flex; justify-content: center; margin: 15px 0; }
.id-card .kode { font-family: monospace; font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; color: var(--navy); }

/* Kode manpower/project di tabel */
.kode { font-family: monospace; color: var(--primary); font-weight: 600; }

@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar { display: none !important; }
  .main-content { margin-left: 0 !important; }
}
