/* ===== TRACKPO v2 — MAIN STYLESHEET ===== */

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { font-size: 14px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.25s, color 0.25s;
  overflow-x: hidden;
}

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  padding: 20px;
  gap: 20px;
}

/* ===== SIDEBAR — ICON-ONLY PILL ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-radius: 28px;
  position: sticky;
  top: 20px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  padding: 20px 0;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.sidebar-logo { margin-bottom: 24px; }
.sidebar-logo-mark {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
}

.sidebar-brand, .sidebar-brand-name, .sidebar-brand-sub { display: none; } /* icon-only, sorok label */

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  align-items: center;
}

.sidebar-nav li a {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 19px;
  transition: all 0.15s;
  cursor: pointer;
}

.sidebar-nav li a .nav-icon { font-size: 19px; }

.sidebar-nav li a:hover { background: var(--primary-light); color: var(--primary); }

.sidebar-nav li a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.sidebar-user {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 16px;
}

.user-avatar {
  width: 40px; height: 40px;
  background: var(--primary-darker);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  cursor: pointer;
}

.user-info, .user-name, .user-role { display: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: calc(100% - var(--sidebar-w) - 20px);
  overflow-x: hidden;
}

/* ===== TOP HEADER ===== */
.top-header {
  position: sticky; top: 20px; z-index: 50;
  background: transparent;
  padding: 0 0 32px;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: none;
}

.top-header-left { display: flex; flex-direction: column-reverse; gap: 0px; }

.greeting-sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: lowercase;
}
.greeting-sub::first-letter { text-transform: uppercase; }

.client-name-big {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.9px;
  line-height: 1.1;
  text-transform: uppercase;
}

.top-header-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px;
  position: relative; transition: all 0.15s;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.btn-logout {
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--primary-darker);
  border: none;
  color: #fff;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
}
.btn-logout:hover { background: var(--primary-dark); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 0;
  padding-bottom: 40px;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header, .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card-title, .section-title {
  font-size: 15.5px; font-weight: 700;
  color: var(--text-primary);
}

/* ===== INFO BAR ===== */
.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  background: var(--bg-card);
  border: none;
  border-radius: 18px;
  padding: 16px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.period-label { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.period-label::before { content: ''; }

.last-update-info { font-size: 12.5px; color: var(--text-secondary); }
.last-update-info .fresh { color: var(--primary); font-weight: 600; }
.last-update-info .stale { color: var(--red); font-weight: 600; }

/* ===== ALERT ===== */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 18px;
  margin-bottom: 12px;
  font-size: 13.5px; font-weight: 500;
}
.alert-banner.warning { background: #FDF3E3; color: #92600A; }
.alert-banner.danger { background: var(--red-light); color: var(--red); }
.alert-dismiss { background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; opacity: 0.6; }

/* ===== FILTER BAR ===== */
.filter-section { margin-bottom: 20px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.filter-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.filter-btn:hover { color: var(--primary); }
.filter-btn.active, .filter-btn.rekod-active {
  background: var(--primary);
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 14px rgba(22,163,74,0.3);
}

.custom-date-row { display: none; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.custom-date-row.show { display: flex; }
.custom-date-row input[type="date"] {
  padding: 10px 14px;
  background: var(--bg-card); border: none;
  border-radius: 12px; color: var(--text-primary);
  font-size: 13px; font-family: var(--font); outline: none;
  box-shadow: var(--shadow-sm);
}
.btn-clear-date {
  padding: 10px 14px; border-radius: 12px;
  border: none;
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 13px; cursor: pointer; font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

/* ===== FILTER DROPDOWN ===== */
.filter-dropdown-wrap { position: relative; display: inline-block; }

.filter-dropdown-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.filter-dropdown-btn:hover { color: var(--primary); }

.filter-dropdown-arrow { font-size: 10px; transition: transform 0.2s; color: var(--text-tertiary); }
.filter-dropdown-btn.open .filter-dropdown-arrow { transform: rotate(180deg); }

.filter-dropdown-menu {
  position: fixed;
  background: var(--bg-card);
  border: none;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  min-width: 190px;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transition: all 0.15s;
}
.filter-dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.filter-dropdown-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.1s;
  color: var(--text-primary); gap: 8px;
}
.filter-dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.filter-dropdown-item.selected { color: var(--primary); background: var(--primary-light); }
.filter-dropdown-item .check { opacity: 0; color: var(--primary); }
.filter-dropdown-item.selected .check { opacity: 1; }

/* ===== PLATFORM LOGOS (pill toggle) ===== */
.platform-logos {
  display: flex; gap: 4px; align-items: center;
  background: var(--bg-card);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.platform-logo-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
  color: var(--text-secondary);
}
.platform-logo-btn.active {
  background: var(--primary);
  color: #fff;
}

.platform-logo-btn .logo-dot { display: none; }

.filter-row-combined {
  display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-divider { display: none; }

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: none;
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  overflow: hidden;
}

.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Featured card — primary hijau solid */
.kpi-card.featured {
  background: linear-gradient(155deg, var(--primary), var(--primary-dark));
  color: #fff;
  grid-column: span 2;
}
.kpi-card.featured .kpi-label,
.kpi-card.featured .kpi-sub,
.kpi-card.featured .kpi-value { color: #fff; }
.kpi-card.featured .kpi-icon { background: rgba(255,255,255,0.2); }
.kpi-card.featured .kpi-change.up,
.kpi-card.featured .kpi-change {
  background: rgba(255,255,255,0.95); color: var(--primary-dark);
}
.kpi-card.featured .kpi-progress { background: rgba(255,255,255,0.25); }

.kpi-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.kpi-icon.purple { background: var(--primary-light); }
.kpi-icon.green { background: rgba(255,255,255,0.2); }
.kpi-icon.blue { background: var(--blue-light); }
.kpi-icon.red { background: var(--red-light); }
.kpi-icon.orange { background: var(--orange-light); }
.kpi-icon.gold { background: var(--gold-light); }
.kpi-icon.teal { background: rgba(20,184,166,0.1); }

.kpi-change {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary);
}
.kpi-change.up { background: var(--green-light); color: var(--green); }
.kpi-change.down { background: var(--red-light); color: var(--red); }
.kpi-change.neutral { background: var(--primary-light); color: var(--primary); }

.kpi-label {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 30px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1.2px; line-height: 1;
  margin-bottom: 8px;
}

.kpi-sub { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }

.kpi-progress {
  height: 6px; background: var(--border);
  border-radius: 999px; margin-top: 16px; overflow: hidden;
}
.kpi-progress-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; background: #fff; }
.fill-purple { background: var(--primary); }
.fill-gold { background: var(--primary); }
.fill-green { background: var(--primary); }
.fill-red { background: var(--red); }
.fill-yellow { background: var(--orange); }

.progress-bar { background: var(--border); border-radius: 999px; height: 6px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.badge-green { background: var(--green); color: #fff; }
.badge-red { background: var(--red); color: #fff; }
.badge-yellow { background: var(--orange-light); color: var(--orange); }
.badge-gold { background: var(--gold-light); color: var(--gold); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-purple { background: var(--primary-light); color: var(--primary); }

/* ===== CHART SECTION ===== */
.chart-tabs {
  display: inline-flex; background: var(--bg);
  border-radius: 999px; padding: 5px; gap: 2px;
  margin-bottom: 20px;
}
.chart-tab {
  padding: 9px 18px; border: none;
  border-radius: 999px; background: transparent;
  color: var(--text-secondary); font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
  text-align: center; font-family: var(--font); white-space: nowrap;
}
.chart-tab.active {
  background: var(--primary); color: #fff;
  font-weight: 700; box-shadow: 0 4px 12px rgba(22,163,74,0.25);
}

.group-by-bar { display: flex; gap: 6px; margin-bottom: 16px; }
.group-btn {
  padding: 7px 16px; border-radius: 10px;
  border: none;
  background: var(--bg); color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.group-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }

.chart-container { position: relative; height: 260px; }

/* ===== BEST DAY ===== */
.best-day-list { display: flex; flex-direction: column; gap: 10px; }
.best-day-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg); border-radius: 16px;
  border: none; min-width: 0;
}
.best-day-rank { font-size: 20px; }
.best-day-date { font-size: 13.5px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; }
.best-day-value { font-size: 14.5px; font-weight: 800; color: var(--primary); white-space: nowrap; flex-shrink: 0; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-secondary); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-size: 13px; }

/* ===== UTILITIES ===== */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-primary-color { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 35, 27, 0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; opacity: 0; pointer-events: none;
  transition: opacity 0.2s; backdrop-filter: blur(4px);
}
.loading-overlay.show { opacity: 1; pointer-events: all; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 14px 18px; border-radius: 16px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
  min-width: 220px; max-width: 340px;
  pointer-events: all;
  background: var(--bg-card);
}
.toast.success { color: var(--green); }
.toast.error { color: var(--red); }
.toast.warning { color: var(--orange); }
.toast.info { color: var(--primary); }

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== RESPONSIVE — TABLET/DESKTOP KPI ===== */
@media (min-width: 769px) and (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card.featured { grid-column: span 2; }
}
@media (min-width: 1201px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .app-layout { padding: 0; gap: 0; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100%; }
  .top-header { position: sticky; top: 0; padding: 16px 16px 12px; background: var(--bg); z-index: 50; }
  .client-name-big { font-size: 22px; }
  .page-content { padding: 0 16px; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
  .kpi-card { padding: 18px; border-radius: 20px; }
  .kpi-card.featured { grid-column: span 2; }
  .kpi-value { font-size: 24px; }
  .kpi-icon { width: 36px; height: 36px; font-size: 16px; }

  .filter-row-combined { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-row-combined::-webkit-scrollbar { display: none; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-bar::-webkit-scrollbar { display: none; }

  .chart-tabs { overflow-x: auto; max-width: 100%; }
  .chart-container { height: 220px; }

  .card { padding: 18px; border-radius: 20px; margin-bottom: 14px; }
  .info-bar { padding: 12px 16px; }
}
/* ===== TRACKPO v2 — STYLESHEET BAHAGIAN 2 ===== */
/* Sambungan dari style.css Bahagian 1 — gabung jadi satu fail style.css */

/* ===== BAJET ===== */
.bajet-balance { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; margin: 6px 0; }
.bajet-balance.positive { color: var(--primary); }
.bajet-balance.negative { color: var(--red); }
.bajet-balance.warning { color: var(--orange); }

.topup-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 8px;
}
.topup-item:last-child { border-bottom: none; }
.topup-amount { color: var(--primary); font-weight: 800; font-size: 14.5px; }
.topup-date { color: var(--text-secondary); font-size: 11.5px; margin-top: 2px; }

/* ===== TABLE TABS (pill) ===== */
.table-tabs {
  display: inline-flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 5px;
  gap: 2px;
  margin-bottom: 20px !important;
}
.table-tab {
  padding: 10px 20px; border: none; background: transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; border-radius: 999px;
  margin-bottom: 0; transition: all 0.15s; font-family: var(--font);
}
.table-tab:hover { color: var(--primary); }
.table-tab.active { color: #fff; background: var(--primary); font-weight: 700; }

/* ===== DATA CARDS (Dashboard tab view) ===== */
.topup-item[style*="flex-direction:column"] {
  background: var(--bg);
  border-radius: 18px;
  padding: 16px !important;
  margin-bottom: 10px;
  border-bottom: none !important;
}

/* ===== TABLE (Rekod Data) ===== */
.table-wrapper {
  overflow-x: auto; background: var(--bg-card);
  border: none;
  border-radius: 20px; box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 14px 18px; text-align: left;
  color: var(--text-secondary); font-weight: 700;
  font-family: var(--font-mono);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: var(--primary-light); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 14px 18px; white-space: nowrap; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 20px; }
.page-btn {
  width: 34px; height: 34px; border-radius: 10px;
  border: none;
  background: var(--bg); color: var(--text-primary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn.active, .page-btn:hover { background: var(--primary); color: #fff; font-weight: 700; }
.page-info { font-size: 11px; color: var(--text-secondary); padding: 0 8px; }

/* ===== BUTTONS ===== */
.btn {
  padding: 13px 24px; border-radius: 999px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px; font-family: var(--font); letter-spacing: -0.1px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(22,163,74,0.28);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { color: var(--primary); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: rgba(226,68,68,0.2); }
.btn-full { width: 100%; }

.btn-edit {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; min-height: 40px; min-width: 60px;
  border-radius: 10px; border: none;
  background: var(--gold-light); color: var(--gold);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: var(--font); transition: all 0.15s; white-space: nowrap;
}
.btn-edit:hover { background: var(--gold); color: #fff; }

.btn-delete {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; min-height: 40px; min-width: 60px;
  border-radius: 10px; border: none;
  background: var(--red-light); color: var(--red);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: var(--font); transition: all 0.15s; white-space: nowrap;
}
.btn-delete:hover { background: var(--red); color: #fff; }

/* ===== MODAL — CENTERED FLOATING ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 35, 27, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(6px);
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  background: var(--bg-card);
  border-radius: 28px;
  width: 100%; max-width: 520px; max-height: 88vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 24px 64px rgba(16, 35, 27, 0.3);
}
.modal-overlay.open .modal-sheet { transform: scale(1) translateY(0); }

.modal-handle { display: none; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 28px 0; margin-bottom: 24px;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-title { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }

.modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg); border: none;
  cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all 0.15s; flex-shrink: 0;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

@media (max-width: 768px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-sheet {
    border-radius: 24px 24px 0 0; max-width: 100%; max-height: 92vh;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal-sheet { transform: translateY(0); }
  .modal-handle {
    display: block; width: 36px; height: 4px;
    background: var(--border-strong); border-radius: 999px;
    margin: 14px auto 4px;
  }
  .modal-header { padding: 18px 22px 0; margin-bottom: 20px; }
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; padding: 0 28px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.8px;
  font-family: var(--font-mono);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 16px;
  background: var(--bg-input); border: 1.5px solid var(--border-strong);
  border-radius: 14px; color: var(--text-primary);
  font-size: 14px; font-family: var(--font); outline: none; transition: all 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light);
}
.form-group input[readonly] { opacity: 0.45; cursor: not-allowed; }
.form-hint { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 28px; margin-bottom: 20px; }
.form-row .form-group { padding: 0; margin-bottom: 0; }

.form-divider { height: 1px; background: var(--border); margin: 4px 28px 20px; }
.form-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px; padding: 0 28px; margin-bottom: 16px;
  font-family: var(--font-mono);
}

.toggle-group {
  display: flex; background: var(--bg); border-radius: 999px;
  padding: 5px; gap: 3px; margin: 0 28px 20px;
}
.toggle-btn {
  flex: 1; padding: 11px; border: none; border-radius: 999px;
  background: transparent; color: var(--text-secondary); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: var(--font);
}
.toggle-btn.active { background: var(--primary); color: #fff; font-weight: 700; }

.checkbox-group { display: flex; flex-direction: column; gap: 12px; }
.checkbox-item { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; color: var(--text-primary); }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

.modal-sheet .btn-primary.btn-full { margin: 24px 28px 32px; width: calc(100% - 56px); }

@media (max-width: 768px) {
  .form-group { padding: 0 20px; margin-bottom: 18px; }
  .form-row { padding: 0 20px; gap: 12px; }
  .toggle-group { margin: 0 20px 18px; }
  .form-divider { margin: 4px 20px 18px; }
  .form-section-label { padding: 0 20px; }
  .modal-sheet .btn-primary.btn-full { margin: 20px 20px 28px; width: calc(100% - 40px); }
}

/* ===== FAB (Desktop) ===== */
.fab-container {
  position: fixed; bottom: 32px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  pointer-events: none;
}
.fab-container > * { pointer-events: all; }

.fab-menu {
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.fab-menu.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.fab-item { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.fab-item-label {
  background: var(--bg-card); border: none;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-md); white-space: nowrap;
  color: var(--text-primary);
}
.fab-item-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-card); border: none;
  font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.fab-item-btn:hover { background: var(--primary-light); }

.fab-main {
  width: 58px; height: 58px;
  background: var(--primary);
  border-radius: 50%; border: none;
  font-size: 27px; color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(22,163,74,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.fab-main:hover { transform: scale(1.05); }
.fab-main.open { transform: rotate(45deg); }

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
  position: fixed; bottom: 12px; left: 12px; right: 12px;
  height: var(--nav-h);
  background: var(--bg-card);
  border-radius: 28px;
  z-index: 999;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.2s;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; border-radius: 14px;
  cursor: pointer; color: var(--text-secondary);
  text-decoration: none; font-size: 10px; font-weight: 600;
  transition: all 0.15s; min-width: 44px;
}
.nav-item .nav-icon { font-size: 19px; }
.nav-item.active { color: var(--primary); }

.nav-fab-item {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; font-weight: 700;
  cursor: pointer; margin-top: -18px;
  box-shadow: 0 6px 18px rgba(22,163,74,0.4);
  border: none; transition: transform 0.2s;
}

@media (max-width: 768px) { .bottom-nav { transform: translateY(0); } .fab-container { display: none !important; } }
@media (min-width: 769px) { .bottom-nav { transform: translateY(150%) !important; } .fab-container { display: flex; } }

/* ===== SETTINGS ===== */
.settings-section {
  background: var(--bg-card); border: none;
  border-radius: 22px; padding: 26px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.settings-title {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 18px;
  font-family: var(--font-mono);
}
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 14.5px; font-weight: 600; }
.settings-row-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: background 0.2s; }
.switch-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; background: white; border-radius: 50%;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ===== COMPARISON ===== */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.comparison-kpi { background: var(--bg-card); border: none; border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); }
.comparison-label { font-size: 11px; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.comparison-a { font-size: 23px; font-weight: 800; letter-spacing: -0.6px; }
.comparison-b { font-size: 13px; color: var(--text-secondary); }
.comparison-values { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.comparison-change { font-size: 13px; font-weight: 700; margin-top: 6px; }
.comparison-change.up { color: var(--primary); }
.comparison-change.down { color: var(--red); }
.comparison-change.flat { color: var(--text-secondary); }

@media (max-width: 768px) { .comparison-grid { grid-template-columns: 1fr; } }

/* ===== WEEKLY ===== */
.weekly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.weekly-stat { background: var(--bg); border-radius: 18px; padding: 18px; border: none; }
.weekly-stat-label { font-size: 11px; color: var(--text-secondary); font-weight: 700; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.6px; }
.weekly-stat-value { font-size: 23px; font-weight: 800; letter-spacing: -0.6px; }
.weekly-stat-change { font-size: 11px; margin-top: 4px; }
.weekly-stat-change.up { color: var(--primary); }
.weekly-stat-change.down { color: var(--red); }
.weekly-stat-change.flat { color: var(--text-secondary); }

/* ===== TOP BAR (legacy compat) ===== */
.top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.client-name-header { font-size: 21px; font-weight: 800; }

/* ===== POST DROPDOWN ===== */
.post-dropdown {
  position: fixed;
  background: var(--bg-card); border: none;
  border-radius: 16px; box-shadow: var(--shadow-lg);
  z-index: 2000; max-height: 220px; overflow-y: auto; overflow-x: hidden;
}
.post-dropdown.hidden { display: none; }
.post-dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border); }
.post-dropdown-item:last-child { border-bottom: none; }
.post-dropdown-item:hover { background: var(--primary-light); }
.post-dropdown-name { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-dropdown-count { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 9px; border-radius: 999px; flex-shrink: 0; margin-left: 8px; }
/* ===== TRACKPO v2 — STYLESHEET BAHAGIAN 3 (ADMIN) ===== */

/* ===== ADMIN STATS BAR ===== */
.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: none;
  border-radius: 22px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-icon { font-size: 22px; margin-bottom: 12px; display: block; }

.admin-stat-value {
  font-size: 38px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1.6px; line-height: 1;
  margin-bottom: 6px;
}
.admin-stat-card.stat-purple .admin-stat-value { color: var(--primary); }
.admin-stat-card.stat-red .admin-stat-value { color: var(--red); }
.admin-stat-card.stat-orange .admin-stat-value { color: var(--orange); }

.admin-stat-label {
  font-size: 11px; color: var(--text-secondary); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  font-family: var(--font-mono);
}

.admin-stat-card.clickable { cursor: pointer; transition: all 0.2s; }
.admin-stat-card.clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-click-hint { font-size: 10px; color: var(--orange); margin-top: 8px; font-weight: 700; opacity: 0.85; }

/* ===== CLIENT GRID + GROUPING ===== */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.client-card {
  background: var(--bg-card);
  border: none;
  border-left: 4px solid var(--primary);
  border-radius: 22px; padding: 24px;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.client-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.client-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.client-name { font-size: 15.5px; font-weight: 800; margin-bottom: 3px; }
.client-pakej { font-size: 11.5px; color: var(--text-secondary); }

.health-circle {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; border: 3px solid; flex-shrink: 0;
}
.health-excellent { border-color: var(--primary); color: var(--primary); }
.health-good { border-color: var(--blue); color: var(--blue); }
.health-average { border-color: var(--orange); color: var(--orange); }
.health-poor { border-color: var(--red); color: var(--red); }

.last-update-badge { font-size: 11.5px; color: var(--text-secondary); }
.last-update-badge.fresh { color: var(--primary); font-weight: 600; }
.last-update-badge.stale { color: var(--red); font-weight: 600; }

.btn-action-primary {
  padding: 9px 18px; min-height: 40px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.btn-action-primary:hover { background: var(--primary-dark); }

.btn-action-ghost {
  padding: 9px 13px; min-height: 40px; border-radius: 999px;
  background: var(--bg); color: var(--text-secondary); font-size: 16px;
  border: none; cursor: pointer; font-family: var(--font); transition: all 0.15s;
}
.btn-action-ghost:hover { background: var(--primary-light); color: var(--primary); }

/* ===== ADMIN HEADER ICON BUTTONS (mobile) ===== */
.admin-icon-btn {
  width: 42px; height: 42px; border-radius: 14px;
  border: none; background: var(--bg-card); color: var(--text-primary);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.admin-icon-btn:hover { background: var(--primary-light); color: var(--primary); }

.admin-btn-desktop { display: inline-flex; }
.admin-btn-mobile { display: none; }
@media (max-width: 768px) {
  .admin-btn-desktop { display: none !important; }
  .admin-btn-mobile { display: flex; }
}

/* ===== MOBILE CARD LIST (for tables on mobile) ===== */
.mobile-card-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }

.mobile-data-card {
  background: var(--bg-card); border: none; border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.mobile-data-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.mobile-data-card-title { font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }
.mobile-data-card-sub { font-size: 11.5px; color: var(--text-secondary); }
.mobile-data-card-body { padding: 12px 18px; }
.mobile-data-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.mobile-data-row:last-child { border-bottom: none; }
.mobile-data-row span:first-child { color: var(--text-secondary); font-size: 12px; }
.mobile-data-row span:last-child { font-weight: 600; }
.mobile-data-card-actions { display: flex; gap: 8px; padding: 14px 18px; background: var(--bg); }
.mobile-data-card-actions .btn-edit, .mobile-data-card-actions .btn-delete { flex: 1; }

/* ===== MOBILE ADMIN FIXES ===== */
@media (max-width: 768px) {
  .admin-stats-bar { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .admin-stat-card { padding: 16px 8px; border-radius: 18px; }
  .admin-stat-value { font-size: 26px; letter-spacing: -1px; }
  .stat-icon { font-size: 17px; margin-bottom: 6px; }
  .admin-stat-label { font-size: 9px; }
  .stat-click-hint { font-size: 9px; }
  .client-grid { grid-template-columns: 1fr; }
}

/* ===== ICON SYSTEM (SVG replace emoji) ===== */
.ic {
  width: 20px; height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.ic-inline { width: 16px; height: 16px; margin-right: 4px; margin-bottom: 2px; }
.ic-empty { width: 40px; height: 40px; opacity: 0.35; }
.ic-check { width: 12px; height: 12px; }

.sidebar-nav li a .ic { width: 21px; height: 21px; }
.kpi-icon .ic { width: 20px; height: 20px; }
.nav-item .ic { width: 20px; height: 20px; }
.icon-btn .ic { width: 18px; height: 18px; }
.fab-item-btn .ic, .fab-main .ic { width: 20px; height: 20px; }
.admin-icon-btn .ic { width: 18px; height: 18px; }
.filter-dropdown-item .ic-inline { margin-right: 6px; }