/* ── TrackAttend Design System ─────────────────────────────────────────────── */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-muted: rgba(37,99,235,.08);
  --secondary: #0EA5E9;
  --success: #10B981;
  --success-light: rgba(16,185,129,.1);
  --warning: #F59E0B;
  --warning-light: rgba(245,158,11,.1);
  --error: #EF4444;
  --error-light: rgba(239,68,68,.1);
  --purple: #8B5CF6;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --divider: #F1F5F9;
  --text1: #0F172A;
  --text2: #64748B;
  --text3: #94A3B8;

  --sidebar-w: 230px;
  --topbar-h: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-primary: 0 8px 24px rgba(37,99,235,.2);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ──────────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }

.login-bg { position: fixed; inset: 0; z-index: 0; background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #E0F2FE 100%); }
.login-bg-shape { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .4; }
.login-bg-shape.s1 { width: 500px; height: 500px; background: var(--primary); top: -150px; left: -100px; opacity: .08; }
.login-bg-shape.s2 { width: 400px; height: 400px; background: var(--secondary); bottom: -100px; right: 200px; opacity: .1; }
.login-bg-shape.s3 { width: 300px; height: 300px; background: var(--success); top: 50%; right: -80px; opacity: .08; }

.login-container {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 440px; gap: 0;
  width: 100%; max-width: 960px; min-height: 100vh;
  padding: 40px 24px;
  align-items: center;
}

.login-left { padding: 40px 48px 40px 0; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 48px; }
.brand-icon {
  width: 48px; height: 48px; background: var(--primary); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}
.brand-icon svg { width: 24px; height: 24px; stroke: #fff; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.brand-tagline { font-size: 11px; color: var(--text3); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; margin-top: 1px; }

.login-hero-text h1 { font-size: 42px; font-weight: 800; line-height: 1.15; letter-spacing: -1px; margin-bottom: 16px; color: var(--text1); }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-hero-text p { font-size: 15px; color: var(--text2); line-height: 1.7; margin-bottom: 36px; max-width: 400px; }

.login-features { display: flex; flex-direction: column; gap: 16px; }
.feat-item { display: flex; align-items: center; gap: 14px; }
.feat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feat-icon svg { width: 18px; height: 18px; }
.feat-title { font-size: 14px; font-weight: 600; }
.feat-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }

.login-right { display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--surface); border-radius: var(--radius-xl);
  border: 1px solid var(--border); padding: 40px;
  width: 100%; box-shadow: var(--shadow-md);
}
.login-card-header { margin-bottom: 28px; }
.login-card-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.login-card-header p { font-size: 14px; color: var(--text2); margin-top: 4px; }

.role-switcher {
  display: flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 4px; gap: 4px; margin-bottom: 24px;
}
.role-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px; border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .2s;
  font-family: inherit; color: var(--text2); background: none;
}
.role-btn svg { width: 16px; height: 16px; }
.role-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 7px; letter-spacing: .1px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text3); pointer-events: none; }
.form-input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; background: var(--bg);
  color: var(--text1); outline: none; transition: all .2s;
}
.form-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text3); padding: 4px;
  display: flex; align-items: center; transition: color .2s;
}
.toggle-pass:hover { color: var(--text1); }
.toggle-pass svg { width: 16px; height: 16px; }

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); width: 14px; height: 14px; }
.link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.link:hover { color: var(--primary-dark); text-decoration: underline; }

.login-demo-info { margin-top: 20px; text-align: center; }
.demo-badge {
  display: inline-block; font-size: 12px; color: var(--text3);
  background: var(--bg); border: 1px dashed var(--border); border-radius: 20px;
  padding: 5px 14px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md); font-size: 14px;
  font-weight: 600; font-family: inherit; cursor: pointer; border: none;
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-primary); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: none; color: var(--text1); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg); border-color: var(--text3); }
.btn-ghost { background: none; color: var(--text2); border: none; }
.btn-ghost:hover { background: var(--bg); color: var(--text1); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-error { background: var(--error); color: #fff; }
.btn-error:hover { background: #DC2626; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); background: none; border: 1px solid var(--border); color: var(--text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .2s; }
.btn-icon:hover { background: var(--bg); color: var(--text1); }
.btn-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon.danger:hover { background: var(--error-light); color: var(--error); border-color: rgba(239,68,68,.3); }

.btn-spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Layout ──────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 50; transition: transform .3s;
}
.sidebar-logo {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-logo-text { font-size: 16px; font-weight: 800; letter-spacing: -.3px; color: var(--text1); }
.sidebar-logo-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; padding: 6px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; color: var(--text2);
  font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
  text-decoration: none; position: relative;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text1); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active svg { stroke: var(--primary); }
.nav-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center; }
.nav-badge.red { background: var(--error); }

.sidebar-bottom { padding: 14px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md); cursor: pointer; transition: .2s; }
.sidebar-user:hover { background: var(--bg); }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text3); }
.sidebar-logout { background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px; border-radius: 6px; transition: .15s; display: flex; align-items: center; }
.sidebar-logout:hover { background: var(--error-light); color: var(--error); }
.sidebar-logout svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Topbar */
.topbar {
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: fixed; top: 0; left: var(--sidebar-w);
  right: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; flex: 1; }
.topbar-breadcrumb { font-size: 12px; color: var(--text3); margin-top: 1px; }
.topbar-date { font-size: 12.5px; color: var(--text2); background: var(--bg); border: 1px solid var(--border); padding: 5px 14px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.topbar-notif { position: relative; background: none; border: 1px solid var(--border); padding: 7px; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; color: var(--text2); transition: .15s; }
.topbar-notif:hover { background: var(--bg); }
.topbar-notif svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--error); color: #fff; font-size: 10px; font-weight: 700; width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }

/* Main content */
.main-content { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.page-content { padding: 24px; max-width: 1400px; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card-sm { padding: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title a, .card-title .card-action { font-size: 12.5px; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: none; }
.card-title a:hover { text-decoration: underline; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  cursor: pointer; transition: all .2s; text-decoration: none; display: block;
}
.stat-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(37,99,235,.1); transform: translateY(-1px); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.stat-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text2); margin-top: 5px; font-weight: 500; }
.stat-trend { font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--error); }

/* ── Badges / Pills ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-present { background: var(--success-light); color: var(--success); }
.badge-late { background: var(--warning-light); color: var(--warning); }
.badge-absent { background: var(--error-light); color: var(--error); }
.badge-active { background: rgba(14,165,233,.1); color: var(--secondary); }
.badge-inactive { background: var(--divider); color: var(--text3); }
.badge-halfday { background: rgba(139,92,246,.1); color: var(--purple); }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-input { width: 100%; padding: 9px 14px 9px 36px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 13.5px; font-family: inherit; background: var(--bg); color: var(--text1); outline: none; transition: all .2s; }
.search-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.form-select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 13px; font-family: inherit; background: var(--bg); color: var(--text1); outline: none; cursor: pointer; transition: .2s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-select:focus { border-color: var(--primary); background-color: var(--surface); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .6px; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--bg); }

.emp-cell { display: flex; align-items: center; gap: 10px; }
.emp-av { width: 33px; height: 33px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.emp-name { font-size: 13.5px; font-weight: 600; }
.emp-sub { font-size: 11.5px; color: var(--text3); margin-top: 1px; }

.table-actions { display: flex; align-items: center; gap: 4px; }

/* ── Attend Hero ─────────────────────────────────────────────────────────────── */
.attend-hero {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 55%, #0284C7 100%);
  border-radius: var(--radius-xl); padding: 28px 32px; color: #fff;
  margin-bottom: 20px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.attend-hero::before { content: ''; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.05); }
.attend-hero::after { content: ''; position: absolute; bottom: -60px; left: 60px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.04); }
.hero-left { position: relative; z-index: 1; }
.hero-label { font-size: 11px; font-weight: 600; opacity: .7; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.hero-clock { font-size: 48px; font-weight: 800; letter-spacing: -2px; line-height: 1; font-family: 'DM Mono', monospace; }
.hero-date { font-size: 13px; opacity: .75; margin-top: 4px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 12px; font-size: 14px;
  font-weight: 700; cursor: pointer; border: none;
  transition: all .2s; font-family: inherit;
}
.hero-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-btn-checkin { background: #fff; color: var(--primary); }
.hero-btn-checkin:hover { background: #EFF6FF; transform: translateY(-1px); }
.hero-btn-checkout { background: rgba(255,255,255,.15); color: #fff; border: 1.5px solid rgba(255,255,255,.3); }
.hero-btn-checkout:hover { background: rgba(255,255,255,.25); }

.hero-right { position: relative; z-index: 1; text-align: right; flex-shrink: 0; }
.hero-status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 20px; margin-bottom: 10px; }
.hero-status-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill-in { background: rgba(16,185,129,.25); border: 1px solid rgba(16,185,129,.4); color: #6EE7B7; }
.pill-out { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.hero-since { font-size: 12.5px; opacity: .65; }

/* ── Location Card ───────────────────────────────────────────────────────────── */
.location-card { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.map-preview {
  height: 140px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #EFF6FF, #DBEAFE 40%, #E0F2FE);
  display: flex; align-items: center; justify-content: center;
}
.map-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 40px 40px; opacity: .5; }
.map-pin-wrap { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; }
.pulse-ring { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 2px solid rgba(37,99,235,.3); animation: pulse-out 2s ease-out infinite; }
.pulse-ring2 { animation-delay: 1s; }
@keyframes pulse-out { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.map-pin-marker { width: 44px; height: 44px; background: var(--primary); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(37,99,235,.4); }
.map-pin-inner { width: 14px; height: 14px; background: #fff; border-radius: 50%; transform: rotate(45deg); }

.location-info { padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.location-icon { width: 36px; height: 36px; background: var(--primary-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.location-icon svg { width: 17px; height: 17px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.location-name { font-size: 13.5px; font-weight: 600; }
.location-coords { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.location-verified { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--success); margin-left: auto; background: var(--success-light); padding: 5px 12px; border-radius: 20px; white-space: nowrap; }
.location-verified svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ── Attendance Rows ─────────────────────────────────────────────────────────── */
.attend-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--divider); cursor: pointer; transition: .12s; }
.attend-row:last-child { border-bottom: none; }
.attend-row:hover { background: none; opacity: .8; }
.attend-bar { width: 4px; height: 48px; border-radius: 2px; flex-shrink: 0; }
.attend-info { flex: 1; }
.attend-day { font-size: 14px; font-weight: 600; }
.attend-times { font-size: 12px; color: var(--text3); margin-top: 2px; }
.attend-right { text-align: right; }
.attend-dur { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* ── Live Map ────────────────────────────────────────────────────────────────── */
.live-map-wrap {
  background: linear-gradient(160deg, #EFF6FF, #DBEAFE 40%, #E0F2FE);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.live-map-wrap .map-grid { opacity: .4; }
.office-marker { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.office-dot { width: 56px; height: 56px; border-radius: 50%; background: rgba(37,99,235,.12); border: 2px solid rgba(37,99,235,.25); display: flex; align-items: center; justify-content: center; }
.office-center { width: 20px; height: 20px; background: var(--primary); border-radius: 6px; box-shadow: 0 2px 8px rgba(37,99,235,.4); }
.radius-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 150px; height: 150px; border-radius: 50%; border: 1.5px dashed rgba(37,99,235,.25); pointer-events: none; }
.emp-marker { position: absolute; cursor: pointer; }
.emp-marker:hover .emp-popup { opacity: 1; transform: translateX(-50%) translateY(-3px); }
.marker-av { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.emp-popup { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 11.5px; font-weight: 600; white-space: nowrap; opacity: 0; transition: all .2s; pointer-events: none; box-shadow: var(--shadow-md); }

.map-live-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; backdrop-filter: blur(4px); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); } 50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); } }

/* ── Progress Bars ───────────────────────────────────────────────────────────── */
.progress-row { margin-bottom: 14px; }
.progress-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.progress-label { font-weight: 600; }
.progress-val { font-weight: 700; color: var(--text2); }
.progress-bar { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .8s cubic-bezier(.4,0,.2,1); }

/* ── Mini Chart Bars ─────────────────────────────────────────────────────────── */
.bar-chart-wrap { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.bar-chart-wrap .bar { flex: 1; border-radius: 5px 5px 0 0; transition: .3s; cursor: pointer; }
.bar-chart-wrap .bar:hover { opacity: .75; }
.bar-day-labels { display: flex; gap: 6px; margin-top: 6px; }
.bar-day-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text3); font-weight: 500; }

/* ── Tracking list ───────────────────────────────────────────────────────────── */
.track-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--divider); cursor: pointer; transition: .12s; }
.track-item:last-child { border-bottom: none; }
.track-item:hover { opacity: .8; }
.track-av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.track-name { font-size: 13.5px; font-weight: 600; }
.track-meta { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.online-indicator { width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-left: auto; flex-shrink: 0; animation: blink 2s infinite; }

/* ── Profile ─────────────────────────────────────────────────────────────────── */
.profile-hero { background: linear-gradient(135deg, #1E40AF, #2563EB); border-radius: var(--radius-xl); padding: 32px; color: #fff; display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.profile-av { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; flex-shrink: 0; }
.profile-name { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.profile-title { font-size: 13.5px; opacity: .75; margin-top: 4px; }
.profile-stats { display: flex; gap: 28px; margin-top: 18px; }
.pstat-val { font-size: 22px; font-weight: 800; }
.pstat-label { font-size: 11px; opacity: .65; margin-top: 2px; }

/* ── Report Cards ────────────────────────────────────────────────────────────── */
.report-card { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all .2s; text-decoration: none; }
.report-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(37,99,235,.08); transform: translateY(-1px); }
.report-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.report-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-title { font-size: 14.5px; font-weight: 700; }
.report-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-xl); padding: 32px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.18); animation: modal-in .2s ease; }
@keyframes modal-in { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.modal .modal-sub { font-size: 13.5px; color: var(--text2); margin-bottom: 24px; }
.modal-footer { display: flex; gap: 10px; margin-top: 24px; }
.modal-footer .btn { flex: 1; justify-content: center; }
.modal-field { margin-bottom: 16px; }
.modal-label { font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 7px; display: block; }
.modal-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text1); outline: none; transition: .2s; }
.modal-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.modal-select { width: 100%; padding: 10px 30px 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text1); outline: none; transition: .2s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.modal-select:focus { border-color: var(--primary); background-color: var(--surface); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  background: var(--text1); color: #fff;
  opacity: 0; transform: translateY(12px); transition: all .3s;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #065F46; }
.toast-error { background: #991B1B; }
.toast-warning { background: #78350F; }
.toast-info { background: #1E3A5F; }
.toast svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Misc Utilities ──────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text2); }
.text-xs { font-size: 11.5px; color: var(--text3); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mono { font-family: 'DM Mono', monospace; }
.divider { height: 1px; background: var(--divider); margin: 12px 0; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.info-row:last-child { border-bottom: none; }
.info-key { font-size: 13px; color: var(--text2); }
.info-val { font-size: 13.5px; font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; border: 1.5px solid; cursor: pointer; transition: .15s; }
.chip.active { background: var(--primary-light); color: var(--primary); border-color: rgba(37,99,235,.3); }
.chip:not(.active) { background: var(--surface); color: var(--text2); border-color: var(--border); }
.chip:hover:not(.active) { border-color: var(--text3); color: var(--text1); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { width: 64px; height: 64px; background: var(--primary-muted); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty-icon svg { width: 28px; height: 28px; stroke: var(--primary); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.empty-sub { font-size: 13.5px; color: var(--text2); max-width: 280px; margin: 0 auto; }

/* Page transitions */
.fade-in { animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .login-container { grid-template-columns: 1fr; padding: 20px; }
  .login-left { display: none; }
  .sidebar { transform: translateX(-100%); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
}

/* ── Additional UI improvements ─────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text1);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
}
.modal-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text1);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.modal-input:focus { border-color: var(--primary); }
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}
.modal-field { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--bg); color: var(--text2);
  border: 1.5px solid var(--border);
  transition: .15s; user-select: none;
}
.chip.active, .chip:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.form-select {
  padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 13px; font-family: inherit;
  background: var(--surface); color: var(--text1);
  cursor: pointer; outline: none;
}
.form-select:focus { border-color: var(--primary); }

/* Topbar date */
.topbar-date { font-size: 12.5px; color: var(--text3); white-space: nowrap; }

/* Map live badge (static position variant) */
.map-live-badge { display:flex; align-items:center; gap:6px; padding:5px 10px;
  background:rgba(16,185,129,.1); border:1.5px solid rgba(16,185,129,.25);
  border-radius:20px; font-size:12px; font-weight:600; color:var(--success); }

/* online indicator dot */
.online-indicator { width:9px; height:9px; border-radius:50%; flex-shrink:0; }

/* Track items */
.track-item { display:flex; align-items:center; gap:10px; padding:9px 6px;
  cursor:pointer; border-radius:8px; transition:.15s; }
.track-item:hover { background:var(--bg); }
.track-av { width:34px; height:34px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; font-size:11px; font-weight:700;
  color:#fff; flex-shrink:0; }
.track-name { font-size:13px; font-weight:600; }
.track-meta { font-size:11.5px; color:var(--text3); margin-top:1px; }

/* Profile hero */
.profile-hero { border-radius:16px; padding:28px; display:flex;
  align-items:center; gap:20px; flex-wrap:wrap; }
.profile-av { width:72px; height:72px; border-radius:50%; background:rgba(255,255,255,.2);
  display:flex; align-items:center; justify-content:center; font-size:24px;
  font-weight:800; color:#fff; border:3px solid rgba(255,255,255,.3); flex-shrink:0; }
.profile-name { font-size:22px; font-weight:800; color:#fff; }
.profile-title { font-size:13px; color:rgba(255,255,255,.75); margin-top:3px; }
.profile-stats { display:flex; gap:24px; margin-top:16px; }
.pstat-val { font-size:20px; font-weight:800; color:#fff; }
.pstat-label { font-size:11px; color:rgba(255,255,255,.65); margin-top:1px; }

/* report cards */
.report-card { display:flex; align-items:center; gap:12px; padding:14px 16px;
  border:1.5px solid var(--border); border-radius:12px; cursor:pointer;
  transition:.15s; background:var(--surface); }
.report-card:hover { border-color:var(--primary); background:var(--primary-light); }
.report-icon { width:38px; height:38px; border-radius:10px; display:flex;
  align-items:center; justify-content:center; flex-shrink:0; }
.report-title { font-size:13.5px; font-weight:700; }
.report-sub { font-size:12px; color:var(--text3); margin-top:2px; }

/* table improvements */
.emp-cell { display:flex; align-items:center; gap:10px; }
.emp-av { width:34px; height:34px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; font-size:11px; font-weight:700;
  color:#fff; flex-shrink:0; }
.emp-name { font-size:13.5px; font-weight:600; }
.emp-sub { font-size:11.5px; color:var(--text3); margin-top:1px; }

/* badge improvements */
.badge-active   { background:rgba(16,185,129,.12); color:#059669; }
.badge-inactive { background:rgba(239,68,68,.1);   color:#dc2626; }
