/* Samsung Promoter App - Modern PWA Design */
:root {
  --samsung-blue: #1428A0;
  --samsung-blue-dark: #0e1e7a;
  --samsung-blue-light: #1a35c4;
  --samsung-sky: #4FC3F7;
  --accent: #00B0FF;
  --success: #00C853;
  --danger: #FF1744;
  --warning: #FFD600;
  --bg: #F0F2F8;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --sidebar-width: 260px;
  --header-height: 60px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20,40,160,0.08);
  --shadow-lg: 0 8px 32px rgba(20,40,160,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Samsung One', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--samsung-blue);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img { height: 28px; }

.sidebar-logo-text {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-logo-text span {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section-label {
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-left-color: var(--accent);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}
/* SVG icons inside nav */
.nav-item .nav-svg-icon {
  opacity: .75;
  transition: opacity .2s;
  flex-shrink: 0;
}
.nav-item:hover .nav-svg-icon,
.nav-item.active .nav-svg-icon { opacity: 1; }

.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .role { color: rgba(255,255,255,0.5); font-size: 11px; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.page-body {
  padding: 24px;
  flex: 1;
}

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ─── STAT CARDS ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before { background: var(--samsung-blue); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }
.stat-card.sky::before { background: var(--accent); }
/* dynamic stat cards without explicit class — use blue as default */
.stat-card:not(.blue):not(.green):not(.orange):not(.red):not(.sky)::before { background: var(--samsung-blue); }

.stat-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary { background: var(--samsung-blue); color: #fff; }
.btn-primary:hover { background: var(--samsung-blue-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.9); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.9); }
.btn-warning { background: var(--warning); color: #1a1a2e; }
.btn-warning:hover { filter: brightness(0.92); }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--samsung-blue); color: var(--samsung-blue); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── BIG ACTION BUTTONS (Checkin/Checkout) ──────────────── */
.attendance-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.attend-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.attend-btn .icon { font-size: 36px; }

.attend-btn.checkin {
  background: linear-gradient(135deg, #00C853, #00E676);
  color: #fff;
}

.attend-btn.checkout {
  background: linear-gradient(135deg, #FF1744, #FF5252);
  color: #fff;
}

.attend-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.attend-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ─── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus { border-color: var(--samsung-blue); box-shadow: 0 0 0 3px rgba(20,40,160,0.08); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── TABLE ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(20,40,160,0.025); }

/* ─── BADGES ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-blue { background: rgba(20,40,160,0.1); color: var(--samsung-blue); }
.badge-green { background: rgba(0,200,83,0.12); color: #00a846; }
.badge-red { background: rgba(255,23,68,0.1); color: #cc0033; }
.badge-orange { background: rgba(255,214,0,0.2); color: #b38700; }
.badge-gray { background: rgba(107,114,128,0.12); color: var(--text-muted); }

/* ─── ALERTS ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: rgba(0,200,83,0.1); color: #007a33; border: 1px solid rgba(0,200,83,0.3); }
.alert-error { background: rgba(255,23,68,0.08); color: #cc0033; border: 1px solid rgba(255,23,68,0.2); }
.alert-info { background: rgba(20,40,160,0.06); color: var(--samsung-blue); border: 1px solid rgba(20,40,160,0.15); }

/* ─── FILTERS BAR ───────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filters .form-group { margin: 0; }
.filters .form-control { min-width: 140px; }

/* ─── SVG ICON SYSTEM ────────────────────────────────────── */
.nav-svg-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: none;
}
.hamburger-icon { width: 22px; height: 22px; }
.btn-icon { width: 15px; height: 15px; }
.pw-eye  { width: 18px; height: 18px; }

/* sidebar app icon */
.sidebar-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
.sidebar-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  flex-shrink: 0;
}

/* install btn tweak */
.install-btn { display: flex; align-items: center; gap: 5px; }

/* nav logout subtle red hint */
.nav-item-logout { opacity: .8; }
.nav-item-logout:hover { color: #ff6b6b !important; background: rgba(255,107,107,.08) !important; opacity: 1; }

/* ─── LOGIN PAGE ────────────────────────────────────────── */
.login-bg {
  background: linear-gradient(150deg, #0b157a 0%, #1428A0 40%, #1a35c4 70%, #0d1260 100%);
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
.login-bg-shape {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.login-bg-shape-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.login-bg-shape-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(100,150,255,0.12) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.15);
  position: relative;
  z-index: 1;
}

/* Samsung logo */
.login-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}
.login-samsung-logo {
  width: 180px;
  height: auto;
  display: inline-block;
}

/* App identity block */
.login-app-identity {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid #f0f2f8;
}
.login-app-icon {
  width: 68px; height: 68px;
  background: linear-gradient(135deg, var(--samsung-blue) 0%, #2947d4 100%);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(20,40,160,.3);
}
.login-app-icon svg { width: 40px; height: 40px; }
.login-app-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--samsung-blue);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.login-app-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Form fields */
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field {}
.login-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-icon {
  position: absolute;
  left: 13px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}
.login-input-icon svg { width: 17px; height: 17px; }
.login-input {
  padding-left: 42px !important;
  padding-right: 42px;
  height: 48px;
  font-size: 15px;
  border-radius: 10px !important;
}
.login-pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  opacity: .55;
  transition: opacity .15s;
}
.login-pw-toggle:hover { opacity: 1; }

.login-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--samsung-blue) 0%, #2947d4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 6px 20px rgba(20,40,160,.35);
  transition: all .2s;
  font-family: inherit;
}
.login-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,40,160,.45); }
.login-submit-btn:active { transform: translateY(0); }

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; border-radius: 18px; }
  .login-samsung-logo { width: 150px; }
}

/* ─── STATUS INDICATOR ──────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.status-bar.checked-in {
  background: rgba(0,200,83,0.1);
  border: 1.5px solid rgba(0,200,83,0.3);
  color: #007a33;
}

.status-bar.checked-out {
  background: rgba(255,23,68,0.06);
  border: 1.5px solid rgba(255,23,68,0.2);
  color: #cc0033;
}

.status-bar.no-record {
  background: rgba(107,114,128,0.08);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.checked-in .status-dot { background: var(--success); }
.checked-out .status-dot { background: var(--danger); }
.no-record .status-dot { background: var(--text-muted); }

/* ─── TIMELINE ──────────────────────────────────────────── */
.timeline { list-style: none; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.timeline-dot.in { background: rgba(0,200,83,0.15); color: var(--success); }
.timeline-dot.out { background: rgba(255,23,68,0.1); color: var(--danger); }
.timeline-body { flex: 1; }
.timeline-type { font-size: 13px; font-weight: 700; }
.timeline-time { font-size: 12px; color: var(--text-muted); }

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ─── MOBILE NAV OVERLAY ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ─── MOBILE FAB ────────────────────────────────────────── */
.fab {
  display: none;
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--samsung-blue);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(20,40,160,0.4);
  z-index: 50;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}
.fab:hover { transform: scale(1.08); background: var(--samsung-blue-dark); }

/* ─── CHART AREA ────────────────────────────────────────── */
.chart-container { position: relative; height: 220px; }

/* ─── TOGGLE ────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  left: 3px; top: 3px;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── AVATAR ────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--samsung-blue);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-body { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .form-control { min-width: unset; }
  .fab { display: flex; }
  .hide-mobile { display: none !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .attendance-btns { grid-template-columns: 1fr 1fr; }
  .topbar-title { font-size: 15px; }
}

/* PWA standalone — ensure sidebar is hidden and no margin */
@media all and (display-mode: standalone) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .hamburger { display: flex !important; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
}

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

.kpi-card {
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.2); }

.kpi-icon  { font-size: 26px; line-height: 1; }
.kpi-value { font-size: 28px; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -1px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: rgba(255,255,255,0.78); line-height: 1.3; }

.kpi-blue   { background: linear-gradient(145deg, #1428A0 0%, #2947d4 100%); }
.kpi-green  { background: linear-gradient(145deg, #00843a 0%, #00C853 100%); }
.kpi-sky    { background: linear-gradient(145deg, #006db3 0%, #29b6f6 100%); }
.kpi-orange { background: linear-gradient(145deg, #e65100 0%, #ff9800 100%); }
.kpi-purple { background: linear-gradient(145deg, #4a148c 0%, #ab47bc 100%); }
.kpi-teal   { background: linear-gradient(145deg, #00695c 0%, #26c6da 100%); }

/* ─── CHART CARD ─────────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  min-width: 0;
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

.chart-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.chart-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.3;
}

.chart-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.chart-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}
.chart-btn:hover { border-color: var(--samsung-blue); color: var(--samsung-blue); background: rgba(20,40,160,0.04); }

.chart-body {
  height: 280px;
  padding: 12px 16px 16px;
  position: relative;
}

/* ─── FILTER CHIPS ─────────────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(20,40,160,0.07);
  color: var(--samsung-blue);
  border: 1.5px solid rgba(20,40,160,0.15);
  white-space: nowrap;
  text-decoration: none;
  cursor: default;
}

.filter-chip.chip-date {
  background: var(--bg);
  color: var(--text-muted);
  border-color: var(--border);
  font-weight: 500;
}
.filter-chip.chip-edit {
  background: var(--samsung-blue);
  color: #fff;
  border-color: var(--samsung-blue);
  cursor: pointer;
  transition: background 0.15s;
}
.filter-chip.chip-edit:hover { background: var(--samsung-blue-dark); }

/* ─── FILTER PANEL ─────────────────────────────────────────── */
.filter-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  border: 1.5px solid rgba(20,40,160,0.1);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  align-items: flex-end;
}

/* ─── CHART GRID ─────────────────────────────────────────── */
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
  min-width: 0;
}

/* ─── ANALYTICS RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .kpi-icon { font-size: 20px; }
  .chart-actions .chart-btn:first-child { display: none; } /* hide PNG on mobile */
  .chart-card-header { gap: 6px; }
  .chart-card-title { font-size: 13px; }
}

/* ─── PROMOTER HERO ─────────────────────────────────────── */
.promo-hero {
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.hero-idle { background: linear-gradient(135deg, #f0f2f8, #e8ecf8); border: 1.5px solid var(--border); }
.hero-in   { background: linear-gradient(135deg, #e6f9ee, #ccf2db); border: 1.5px solid rgba(0,200,83,.25); }
.hero-out  { background: linear-gradient(135deg, #fff0f2, #ffd6dc); border: 1.5px solid rgba(255,23,68,.15); }

.promo-hero-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--samsung-blue);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(20,40,160,.25);
}
.hero-in .promo-hero-avatar   { background: #00843a; }
.hero-out .promo-hero-avatar  { background: #cc0033; }

.promo-hero-info { min-width: 0; }
.promo-hero-name { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-hero-date { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; }
.promo-hero-status { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

.hero-status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.8);
}
.dot-green { background: #00C853; animation: pulse-green 2s infinite; }
.dot-red   { background: #FF1744; }
.dot-gray  { background: #9ca3af; }

@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 2px rgba(0,200,83,.3); }
  50%      { box-shadow: 0 0 0 5px rgba(0,200,83,.1); }
}

/* ─── ATTEND ACTION BUTTONS ──────────────────────────────── */
.attend-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.attend-action-grid form { display: contents; }

.attend-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-checkin {
  background: linear-gradient(135deg, #00843a 0%, #00C853 100%);
  color: #fff;
}
.btn-checkout {
  background: linear-gradient(135deg, #cc0033 0%, #FF1744 100%);
  color: #fff;
}
.btn-attend-done {
  background: var(--bg) !important;
  color: var(--text-muted) !important;
  box-shadow: none;
  border: 1.5px solid var(--border);
}
.attend-action-btn:hover:not(:disabled):not(.btn-attend-done) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.attend-action-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.attend-action-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.attend-action-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.attend-action-label { font-size: 15px; font-weight: 700; line-height: 1; }
.attend-action-sub   { font-size: 11px; opacity: .8; font-weight: 500; }

/* ─── ADD SALE CTA ───────────────────────────────────────── */
.add-sale-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--samsung-blue) 0%, #2947d4 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(20,40,160,.3);
  transition: all 0.2s;
}
.add-sale-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,40,160,.4); color: #fff; }

.add-sale-cta-icon  { font-size: 32px; line-height: 1; flex-shrink: 0; }
.add-sale-cta-text  { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.add-sale-cta-label { font-size: 16px; font-weight: 700; }
.add-sale-cta-sub   { font-size: 12px; opacity: .8; }
.add-sale-cta-arrow { font-size: 28px; opacity: .6; }

/* ─── PROMOTER STATS ─────────────────────────────────────── */
.promo-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.promo-stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.promo-stat-icon  { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.promo-stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.promo-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }

/* ─── ADMIN GRID ─────────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .admin-grid { grid-template-columns: 1fr; } }

/* ─── SALE FORM ──────────────────────────────────────────── */
.sale-form-wrap {
  max-width: 540px;
  margin: 0 auto;
}

.sale-form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.sale-back-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: all 0.15s;
}
.sale-back-btn:hover { border-color: var(--samsung-blue); color: var(--samsung-blue); }

.sale-form-title { font-size: 18px; font-weight: 800; margin: 0; }
.sale-form-sub   { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

.sale-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.sale-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--samsung-blue);
  margin-bottom: 12px;
}

/* Category pills */
.cat-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.cat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.cat-pill input { display: none; }
.cat-pill:hover { border-color: var(--samsung-blue); }
.cat-pill.active,
.cat-pill:has(input:checked) {
  border-color: var(--samsung-blue);
  background: rgba(20,40,160,.07);
}
.cat-pill-icon  { font-size: 22px; line-height: 1; }
.cat-pill-label { font-size: 11px; font-weight: 600; color: var(--text); }

/* Model search + select */
.model-search-input {
  margin-bottom: 8px;
  padding-left: 14px;
}
.model-select {
  height: 140px;
  border-radius: 8px;
  font-size: 13px;
}

/* Qty stepper */
.sale-qty-row {
  display: flex;
  gap: 12px;
}
.qty-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.qty-btn {
  width: 44px; height: 44px;
  border: none;
  background: var(--bg);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--border); }
.qty-input {
  border: none !important;
  border-radius: 0 !important;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  box-shadow: none !important;
}
.qty-input:focus { border-color: transparent !important; box-shadow: none !important; }

/* Submit */
.sale-submit-wrap { padding: 4px 0 8px; }
.btn-sale-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--samsung-blue) 0%, #2947d4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(20,40,160,.3);
  transition: all 0.2s;
  font-family: inherit;
}
.btn-sale-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(20,40,160,.4); }
.btn-sale-submit:active { transform: translateY(0); }

/* Mobile adjustments */
@media (max-width: 480px) {
  .cat-pills { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
  .cat-pill { padding: 8px 4px; }
  .cat-pill-icon { font-size: 18px; }
  .cat-pill-label { font-size: 10px; }
  .sale-qty-row { flex-direction: column; }
  .attend-action-btn { padding: 14px 14px; gap: 10px; }
  .attend-action-icon { font-size: 22px; }
  .attend-action-label { font-size: 13px; }
  .add-sale-cta { padding: 14px 16px; }
  .add-sale-cta-label { font-size: 14px; }
}

/* ─── PRINT ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .fab, .filters { display: none !important; }
  .main-content { margin: 0; }
}
