/* ===================== CISCO FORCE Mobile App CSS ===================== */
:root {
  --primary: #d4af37;
  --primary-dark: #b8960f;
  --primary-light: #f0d86e;
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-surface: #1f2937;
  --bg-modal: #161e2e;
  --text: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #374151;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #a855f7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --nav-height: 64px;
  --topbar-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; overflow:hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
input, select, textarea, button { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ===================== LOGIN SCREEN ===================== */
.screen { position:fixed; inset:0; z-index:1000; background:var(--bg); display:none; align-items:center; justify-content:center; }
.screen.active { display:flex; }
.login-container {
  width:100%; max-width:400px; padding:40px 24px; text-align:center;
}
.login-logo { width:100px; height:100px; margin-bottom:16px; border-radius:50%; object-fit:contain; background:#111827; padding:8px; }
.login-container h1 { font-size:24px; color:var(--primary); margin-bottom:4px; letter-spacing:2px; }
.login-subtitle { color:var(--text-secondary); margin-bottom:32px; font-size:14px; }
.login-form { display:flex; flex-direction:column; gap:16px; }
.input-group {
  display:flex; align-items:center; gap:12px;
  background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:0 16px; transition:border-color .2s;
}
.input-group:focus-within { border-color:var(--primary); }
.input-group svg { width:20px; height:20px; flex-shrink:0; color:var(--text-muted); }
.input-group input, .input-group select {
  flex:1; background:none; border:none; color:var(--text);
  padding:14px 0; outline:none; font-size:15px;
}
.input-group select { appearance:none; cursor:pointer; }
.input-group select option { background:var(--bg-card); color:var(--text); }
.btn-primary-full {
  width:100%; padding:14px; background:var(--primary); color:#000;
  border:none; border-radius:var(--radius-sm); font-weight:600;
  font-size:16px; cursor:pointer; transition:background .2s;
}
.btn-primary-full:hover { background:var(--primary-light); }
.btn-primary-full:active { transform:scale(0.98); }
.forgot-link { color:var(--text-muted); font-size:13px; background:none; border:none; cursor:pointer; text-align:center; width:100%; }
.login-footer { margin-top:24px; }
.offline-badge {
  display:inline-flex; align-items:center; gap:6px; padding:6px 14px;
  background:var(--bg-surface); border:1px solid var(--border);
  border-radius:20px; font-size:12px; color:var(--text-secondary);
}
.login-credentials { margin-top:12px; text-align:center; }
.login-credentials small { color:var(--text-muted); font-size:11px; }
.login-credentials strong { color:var(--primary); }

/* Login Enhancements */
.login-error {
  background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.3);
  border-radius:var(--radius-sm); padding:10px 14px; font-size:13px;
  color:#f87171; text-align:center;
}
.login-success {
  background:rgba(34,197,94,0.12); border:1px solid rgba(34,197,94,0.3);
  border-radius:var(--radius-sm); padding:10px 14px; font-size:13px;
  color:#4ade80; text-align:center;
}
.pass-toggle { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:4px; }
.pass-toggle svg { width:18px; height:18px; }
.login-options { display:flex; justify-content:space-between; align-items:center; }
.remember-me { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-secondary); cursor:pointer; }
.remember-me input { accent-color:var(--primary); }
.spinner {
  display:inline-block; width:18px; height:18px; border:2px solid rgba(0,0,0,0.2);
  border-top-color:#000; border-radius:50%; animation:spin .6s linear infinite;
}
.btn-primary-full { display:flex; align-items:center; justify-content:center; gap:8px; }
.btn-primary-full:disabled { opacity:0.6; cursor:not-allowed; }
.forgot-header { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.forgot-header h3 { font-size:18px; }
.back-btn { background:none; border:none; color:var(--text); cursor:pointer; padding:4px; }
.back-btn svg { width:22px; height:22px; }
.forgot-text { font-size:13px; color:var(--text-secondary); margin-bottom:8px; line-height:1.5; }
.change-pass-title { font-size:18px; text-align:center; margin-bottom:4px; }

/* Password Strength */
.password-strength { display:flex; align-items:center; gap:10px; }
.strength-bar { flex:1; height:4px; background:var(--bg-surface); border-radius:2px; overflow:hidden; }
.strength-fill { height:100%; width:0; border-radius:2px; transition:all .3s; }
.strength-fill.weak { width:25%; background:var(--danger); }
.strength-fill.fair { width:50%; background:var(--warning); }
.strength-fill.good { width:75%; background:var(--info); }
.strength-fill.strong { width:100%; background:var(--success); }
.strength-text { font-size:11px; color:var(--text-muted); min-width:60px; }

/* Session Badge (in drawer) */
.session-info { padding:8px 20px; font-size:11px; color:var(--text-muted); border-bottom:1px solid var(--border); }
.session-info span { color:var(--success); }

/* Admin Menu Item */
.admin-menu-item { color:var(--primary) !important; }
.drawer-divider { height:1px; background:var(--border); margin:8px 20px; }

/* ===================== ADMIN PANEL ===================== */
.admin-header-info {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px; margin-bottom:16px;
}
.admin-stat-row { display:flex; justify-content:space-around; text-align:center; }
.admin-stat { display:flex; flex-direction:column; }
.admin-stat-num { font-size:24px; font-weight:700; color:var(--primary); }
.admin-stat-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; }

.user-card { border-left:3px solid var(--border); }
.user-card.role-admin { border-left-color:var(--danger); }
.user-card.role-supervisor { border-left-color:var(--warning); }
.user-card.role-guard { border-left-color:var(--info); }
.user-card.role-client { border-left-color:var(--purple); }
.user-card .user-avatar {
  width:40px; height:40px; border-radius:50%; background:var(--bg-surface);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  font-size:16px; font-weight:700; color:var(--primary);
}
.user-card .user-card-body { display:flex; gap:12px; align-items:center; }
.user-card .user-card-info { flex:1; min-width:0; }
.user-card .user-card-info h4 { font-size:14px; margin-bottom:2px; }
.user-card .user-card-info p { font-size:12px; color:var(--text-secondary); }
.user-card .user-card-meta { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.user-card .user-card-actions { display:flex; gap:6px; margin-top:10px; }
.user-card .user-card-actions button {
  flex:1; padding:6px; font-size:11px; border-radius:6px; cursor:pointer;
  border:1px solid var(--border); background:var(--bg-surface); color:var(--text-secondary);
  transition:all .2s;
}
.user-card .user-card-actions button:hover { border-color:var(--primary); color:var(--primary); }
.user-card .user-card-actions button.btn-danger { color:var(--danger); }
.user-card .user-card-actions button.btn-danger:hover { border-color:var(--danger); }

.role-tag {
  display:inline-flex; padding:2px 8px; border-radius:10px;
  font-size:10px; font-weight:600; text-transform:uppercase;
}
.role-tag.admin { background:rgba(239,68,68,0.15); color:var(--danger); }
.role-tag.supervisor { background:rgba(245,158,11,0.15); color:var(--warning); }
.role-tag.guard { background:rgba(59,130,246,0.15); color:var(--info); }
.role-tag.client { background:rgba(168,85,247,0.15); color:var(--purple); }

/* Login Activity */
.login-history { padding:20px; }
.login-history-item { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:12px; }
.login-history-item .lh-time { color:var(--text-muted); min-width:100px; }
.login-history-item .lh-status { font-weight:600; }
.login-history-item .lh-status.success { color:var(--success); }
.login-history-item .lh-status.failed { color:var(--danger); }

/* ===================== APP SHELL ===================== */
.app-shell { height:100%; display:flex; flex-direction:column; }

/* ===================== TOP BAR ===================== */
.top-bar {
  display:flex; align-items:center; gap:12px;
  padding:0 16px; height:var(--topbar-height);
  padding-top:var(--safe-top);
  background:var(--bg-card); border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:100;
}
.top-title { flex:1; font-size:18px; font-weight:600; }
.icon-btn {
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  background:none; border:none; color:var(--text); cursor:pointer;
  border-radius:50%; transition:background .2s;
}
.icon-btn:hover { background:var(--bg-surface); }
.icon-btn svg { width:22px; height:22px; }
.top-actions { display:flex; align-items:center; gap:4px; }
.notif-btn { position:relative; }
.badge {
  position:absolute; top:4px; right:4px; background:var(--danger);
  color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px;
  border-radius:8px; display:flex; align-items:center; justify-content:center;
  padding:0 4px;
}
.sync-indicator { display:flex; align-items:center; }
.sync-indicator svg { width:18px; height:18px; color:var(--success); }
.sync-indicator.syncing svg { animation:spin 1s linear infinite; color:var(--primary); }
@keyframes spin { to { transform:rotate(360deg); } }

/* ===================== SIDE DRAWER ===================== */
.side-drawer { position:fixed; inset:0; z-index:200; pointer-events:none; }
.side-drawer.open { pointer-events:auto; }
.drawer-overlay {
  position:absolute; inset:0; background:rgba(0,0,0,0.6);
  opacity:0; transition:opacity .3s;
}
.side-drawer.open .drawer-overlay { opacity:1; }
.drawer-content {
  position:absolute; top:0; left:0; bottom:0; width:280px;
  background:var(--bg-card); transform:translateX(-100%);
  transition:transform .3s ease; display:flex; flex-direction:column;
  overflow-y:auto;
}
.side-drawer.open .drawer-content { transform:translateX(0); }
.drawer-header {
  padding:24px 20px; padding-top:calc(var(--safe-top) + 24px);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:14px;
}
.drawer-logo { width:48px; height:48px; border-radius:50%; object-fit:contain; background:var(--bg); padding:4px; }
.drawer-user { display:flex; flex-direction:column; }
.drawer-user strong { font-size:15px; }
.drawer-user small { color:var(--text-secondary); font-size:12px; }
.site-label { color:var(--primary); font-size:11px; margin-top:2px; }
.drawer-menu { list-style:none; padding:8px 0; flex:1; }
.drawer-menu li a {
  display:flex; align-items:center; gap:14px;
  padding:12px 20px; color:var(--text-secondary); font-size:14px;
  transition:all .2s;
}
.drawer-menu li a svg { width:20px; height:20px; flex-shrink:0; }
.drawer-menu li a:hover, .drawer-menu li a.active {
  color:var(--primary); background:rgba(212,175,55,0.08);
}
.drawer-footer { padding:16px 20px; border-top:1px solid var(--border); }
.drawer-logout {
  display:flex; align-items:center; gap:10px;
  background:none; border:none; color:var(--danger);
  font-size:14px; cursor:pointer; padding:8px 0;
}
.drawer-logout svg { width:20px; height:20px; }

/* ===================== NOTIFICATION PANEL ===================== */
.notif-panel {
  position:fixed; top:var(--topbar-height); right:0; width:320px; max-width:100%;
  max-height:70vh; background:var(--bg-card); border:1px solid var(--border);
  border-radius:0 0 var(--radius) var(--radius); z-index:150;
  box-shadow:var(--shadow); overflow-y:auto;
}
.notif-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px; border-bottom:1px solid var(--border);
}
.notif-header h3 { font-size:15px; }
.text-btn { background:none; border:none; color:var(--primary); font-size:13px; cursor:pointer; }
.notif-list { padding:4px 0; }
.notif-item {
  display:flex; gap:12px; padding:12px 16px;
  border-bottom:1px solid var(--border); cursor:pointer;
  transition:background .2s;
}
.notif-item:hover { background:var(--bg-surface); }
.notif-item.unread { border-left:3px solid var(--primary); }
.notif-icon {
  width:36px; height:36px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; flex-shrink:0;
}
.notif-icon svg { width:18px; height:18px; }
.notif-icon.alert { background:rgba(239,68,68,0.15); color:var(--danger); }
.notif-icon.info { background:rgba(59,130,246,0.15); color:var(--info); }
.notif-icon.success { background:rgba(34,197,94,0.15); color:var(--success); }
.notif-icon.warning { background:rgba(245,158,11,0.15); color:var(--warning); }
.notif-text { flex:1; min-width:0; }
.notif-text strong { font-size:13px; display:block; margin-bottom:2px; }
.notif-text small { color:var(--text-muted); font-size:11px; }

/* ===================== PAGE CONTAINER ===================== */
.page-container {
  flex:1; overflow-y:auto; overflow-x:hidden; padding:16px;
  padding-bottom:calc(var(--nav-height) + var(--safe-bottom) + 16px);
  -webkit-overflow-scrolling:touch;
}
.page { display:none; max-width:100%; overflow-x:hidden; }
.page.active { display:block; animation:fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
  display:flex; align-items:center; justify-content:space-around;
  height:var(--nav-height); padding-bottom:var(--safe-bottom);
  background:var(--bg-card); border-top:1px solid var(--border);
  position:sticky; bottom:0; z-index:100;
}
.nav-item {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  padding:8px 12px; transition:color .2s; font-size:10px;
}
.nav-item svg { width:22px; height:22px; }
.nav-item.active { color:var(--primary); }
.nav-item span { font-size:10px; }

/* ===================== DASHBOARD ===================== */
.dashboard-welcome h2 { font-size:20px; margin-bottom:4px; }
.dashboard-welcome p { color:var(--text-secondary); font-size:13px; margin-bottom:20px; }
.stats-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:20px; }
.stat-card {
  background:var(--bg-card); border-radius:var(--radius); padding:16px;
  display:flex; align-items:center; gap:12px; border:1px solid var(--border);
}
.stat-card svg { width:28px; height:28px; flex-shrink:0; }
.stat-info { display:flex; flex-direction:column; }
.stat-num { font-size:22px; font-weight:700; }
.stat-label { font-size:11px; color:var(--text-secondary); }
.stat-blue { border-left:3px solid var(--info); }
.stat-blue svg { color:var(--info); }
.stat-green { border-left:3px solid var(--success); }
.stat-green svg { color:var(--success); }
.stat-orange { border-left:3px solid var(--warning); }
.stat-orange svg { color:var(--warning); }
.stat-purple { border-left:3px solid var(--purple); }
.stat-purple svg { color:var(--purple); }

.section-title {
  font-size:15px; font-weight:600; margin-bottom:12px; color:var(--text-secondary);
  text-transform:uppercase; letter-spacing:1px;
}

.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:20px; }
.action-btn {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:16px 12px; background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); color:var(--text); cursor:pointer;
  transition:all .2s; font-size:12px;
}
.action-btn svg { width:24px; height:24px; color:var(--primary); }
.action-btn:hover { border-color:var(--primary); background:rgba(212,175,55,0.05); }
.action-btn:active { transform:scale(0.97); }

.activity-feed { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.activity-item {
  display:flex; gap:12px; padding:12px; background:var(--bg-card);
  border-radius:var(--radius-sm); border:1px solid var(--border);
}
.activity-dot { width:8px; height:8px; border-radius:50%; margin-top:6px; flex-shrink:0; }
.activity-dot.blue { background:var(--info); }
.activity-dot.green { background:var(--success); }
.activity-dot.orange { background:var(--warning); }
.activity-dot.red { background:var(--danger); }
.activity-dot.purple { background:var(--purple); }
.activity-info { flex:1; }
.activity-info strong { font-size:13px; display:block; }
.activity-info small { color:var(--text-muted); font-size:11px; }

.chart-container {
  background:var(--bg-card); border-radius:var(--radius); padding:16px;
  border:1px solid var(--border); margin-bottom:20px;
  max-width:100%; box-sizing:border-box; overflow:hidden;
}
.chart-container canvas {
  width:100%; max-width:100%; height:180px; display:block;
}

/* ===================== SHARED COMPONENTS ===================== */
.page-toolbar { display:flex; gap:10px; margin-bottom:16px; align-items:center; }
.search-box {
  flex:1; display:flex; align-items:center; gap:10px;
  background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:0 14px;
}
.search-box svg { width:18px; height:18px; color:var(--text-muted); flex-shrink:0; }
.search-box input {
  flex:1; background:none; border:none; color:var(--text);
  padding:10px 0; outline:none; font-size:14px;
}
.btn-fab {
  width:44px; height:44px; border-radius:50%; background:var(--primary);
  color:#000; border:none; font-size:24px; font-weight:300;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 12px rgba(212,175,55,0.3); transition:all .2s;
}
.btn-fab:hover { background:var(--primary-light); transform:scale(1.05); }
.btn-fab svg { width:20px; height:20px; }

.tab-bar { display:flex; gap:0; margin-bottom:16px; background:var(--bg-card); border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); }
.tab {
  flex:1; padding:10px 8px; background:none; border:none; color:var(--text-muted);
  font-size:13px; cursor:pointer; transition:all .2s; text-align:center;
}
.tab.active { color:var(--primary); background:rgba(212,175,55,0.1); border-bottom:2px solid var(--primary); }
.tab-content { display:none; }
.tab-content.active { display:block; }

.card-list { display:flex; flex-direction:column; gap:10px; }
.card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px; cursor:pointer;
  transition:all .2s;
}
.card:hover { border-color:var(--primary); background:var(--bg-card-hover); }
.card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
.card-header h4 { font-size:14px; flex:1; }
.card-body p { font-size:13px; color:var(--text-secondary); margin-bottom:4px; }
.card-footer { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.card-footer small { color:var(--text-muted); font-size:11px; }

.status-badge {
  display:inline-flex; padding:3px 10px; border-radius:12px;
  font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px;
}
.status-active { background:rgba(34,197,94,0.15); color:var(--success); }
.status-expected { background:rgba(59,130,246,0.15); color:var(--info); }
.status-expired { background:rgba(107,114,128,0.15); color:var(--text-muted); }
.status-open { background:rgba(239,68,68,0.15); color:var(--danger); }
.status-progress { background:rgba(245,158,11,0.15); color:var(--warning); }
.status-resolved { background:rgba(34,197,94,0.15); color:var(--success); }
.status-pending { background:rgba(168,85,247,0.15); color:var(--purple); }
.status-completed { background:rgba(34,197,94,0.15); color:var(--success); }

.priority-badge {
  display:inline-flex; padding:3px 10px; border-radius:12px;
  font-size:11px; font-weight:600; cursor:pointer;
}
.priority-low { background:rgba(59,130,246,0.15); color:var(--info); }
.priority-medium { background:rgba(245,158,11,0.15); color:var(--warning); }
.priority-high { background:rgba(239,68,68,0.15); color:var(--danger); }
.priority-critical { background:rgba(239,68,68,0.3); color:#ff6b6b; }

.empty-state {
  text-align:center; padding:60px 20px; color:var(--text-muted);
}
.empty-state svg { width:48px; height:48px; margin-bottom:12px; color:var(--border); }
.empty-state p { margin-bottom:16px; }

/* ===================== MODALS ===================== */
.modal {
  position:fixed; inset:0; z-index:300; display:flex; align-items:flex-end;
  justify-content:center; background:rgba(0,0,0,0.6);
  animation:fadeIn .2s ease;
}
.modal-content {
  width:100%; max-width:480px; max-height:90vh; overflow-y:auto;
  background:var(--bg-modal); border-radius:var(--radius) var(--radius) 0 0;
  animation:slideUp .3s ease;
}
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
.modal-sm { max-width:360px; }
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 20px; border-bottom:1px solid var(--border);
  position:sticky; top:0; background:var(--bg-modal); z-index:1;
}
.modal-header h3 { font-size:17px; }
.modal-close {
  width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  background:var(--bg-surface); border:none; color:var(--text);
  border-radius:50%; font-size:20px; cursor:pointer;
}
.modal-form { padding:20px; display:flex; flex-direction:column; gap:16px; }
.form-group { display:flex; flex-direction:column; gap:6px; }
.form-group label { font-size:13px; color:var(--text-secondary); font-weight:500; }
.form-group input, .form-group select, .form-group textarea {
  background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:12px 14px; color:var(--text);
  font-size:14px; outline:none; transition:border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color:var(--primary); }
.form-group select { appearance:none; cursor:pointer; }
.form-group select option { background:var(--bg-card); }
.form-group textarea { resize:vertical; }
.form-group input[type="file"] { padding:10px; }
.form-group input[type="checkbox"] { width:auto; margin-right:8px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.priority-select, .format-select { display:flex; gap:8px; flex-wrap:wrap; }
.priority-option, .format-option { cursor:pointer; }
.priority-option input, .format-option input { display:none; }
.priority-option input:checked + .priority-badge,
.format-option input:checked + span {
  outline:2px solid var(--primary); outline-offset:2px;
}
.format-option span {
  display:inline-flex; padding:8px 20px; background:var(--bg-surface);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:13px; color:var(--text);
}

.gps-field { display:flex; gap:8px; }
.gps-field input { flex:1; }
.btn-icon {
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--primary); cursor:pointer;
}
.btn-icon svg { width:20px; height:20px; }

.evidence-preview { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.evidence-thumb {
  width:60px; height:60px; border-radius:var(--radius-sm); overflow:hidden;
  border:1px solid var(--border);
}
.evidence-thumb img { width:100%; height:100%; object-fit:cover; }

/* QR Display */
.qr-display { padding:24px; text-align:center; }
.qr-display canvas { margin:0 auto 16px; border-radius:var(--radius-sm); background:#fff; padding:16px; }
.qr-name { font-size:16px; font-weight:600; }
.qr-time { color:var(--text-secondary); font-size:13px; margin-bottom:16px; }
.qr-actions { display:flex; gap:12px; justify-content:center; }
.btn-secondary {
  padding:10px 20px; background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text); cursor:pointer;
  font-size:13px; transition:all .2s;
}
.btn-secondary:hover { border-color:var(--primary); color:var(--primary); }

/* ===================== PATROL ===================== */
.patrol-active-card { margin-bottom:16px; }
.patrol-progress {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:16px; margin-bottom:12px;
}
.patrol-progress h4 { font-size:14px; margin-bottom:10px; }
.progress-bar {
  height:8px; background:var(--bg-surface); border-radius:4px; overflow:hidden;
  margin-bottom:6px;
}
.progress-fill { height:100%; background:var(--primary); border-radius:4px; transition:width .5s ease; }
.checkpoint-list { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.checkpoint-item {
  display:flex; align-items:center; gap:12px; padding:10px 14px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:13px;
}
.checkpoint-item.scanned { border-color:var(--success); }
.checkpoint-item.scanned .cp-icon { color:var(--success); }
.checkpoint-item.missed { border-color:var(--danger); opacity:0.7; }
.cp-icon { width:20px; height:20px; flex-shrink:0; }
.cp-info { flex:1; }
.cp-time { font-size:11px; color:var(--text-muted); }
.btn-primary {
  padding:10px 20px; background:var(--primary); color:#000; border:none;
  border-radius:var(--radius-sm); font-weight:600; cursor:pointer;
  transition:all .2s;
}
.btn-primary:hover { background:var(--primary-light); }

/* Scanner */
.scanner-area { padding:20px; text-align:center; }
.scanner-preview {
  position:relative; width:100%; aspect-ratio:1; max-width:300px;
  margin:0 auto 16px; border-radius:var(--radius);
  overflow:hidden; background:#000;
}
.scanner-frame {
  position:absolute; inset:20%; border:2px solid var(--primary);
  border-radius:8px; z-index:1;
  box-shadow:0 0 0 9999px rgba(0,0,0,0.5);
}
.scanner-preview video { width:100%; height:100%; object-fit:cover; }
.scanner-hint { color:var(--text-muted); font-size:13px; margin-bottom:12px; }
.scan-result {
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:12px; background:rgba(34,197,94,0.1); border-radius:var(--radius-sm);
  margin-bottom:12px;
}
.scan-result svg { width:24px; height:24px; }
.scan-result span { font-size:14px; color:var(--success); font-weight:600; }

/* ===================== ATTENDANCE ===================== */
.clock-section {
  text-align:center; padding:24px 16px; background:var(--bg-card);
  border:1px solid var(--border); border-radius:var(--radius); margin-bottom:16px;
}
.clock-display { margin-bottom:12px; }
#liveClock { display:block; font-size:48px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--primary); }
#liveDate { display:block; font-size:13px; color:var(--text-secondary); margin-top:4px; }
.clock-status { font-size:14px; color:var(--text-muted); margin-bottom:16px; }
.btn-clock {
  padding:16px 48px; border:none; border-radius:50px;
  font-size:18px; font-weight:700; cursor:pointer;
  transition:all .2s; text-transform:uppercase; letter-spacing:2px;
}
.btn-clock.clock-in { background:var(--success); color:#fff; }
.btn-clock.clock-out { background:var(--danger); color:#fff; }
.btn-clock:active { transform:scale(0.95); }
.gps-info { margin-top:12px; font-size:11px; color:var(--text-muted); }

/* Clock-in photo preview */
.clock-photo-preview { margin-top:16px; }
.clock-photo-preview img { width:100%; max-width:320px; border-radius:var(--radius); border:2px solid var(--primary); }
.clock-photo-preview small { display:block; margin-top:6px; color:var(--text-muted); font-size:11px; }

/* Camera Modal */
.camera-container { padding:0; }
.camera-viewfinder { position:relative; width:100%; background:#000; border-radius:var(--radius); overflow:hidden; }
.camera-viewfinder video { width:100%; display:block; border-radius:var(--radius); }
.camera-overlay {
  position:absolute; top:0; left:0; right:0; bottom:0;
  pointer-events:none; display:flex; flex-direction:column;
  justify-content:space-between; padding:12px;
  font-family:'Courier New', monospace; font-size:13px; font-weight:700;
  color:#fff; text-shadow:0 1px 4px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7);
}
.overlay-top, .overlay-bottom { display:flex; justify-content:space-between; align-items:center; }
.overlay-top { background:linear-gradient(to bottom, rgba(0,0,0,0.5), transparent); margin:-12px -12px 0; padding:10px 12px; }
.overlay-bottom { background:linear-gradient(to top, rgba(0,0,0,0.5), transparent); margin:0 -12px -12px; padding:10px 12px; }
.camera-preview { margin-top:12px; }
.camera-preview img { width:100%; border-radius:var(--radius); border:2px solid var(--success); }
.camera-actions { display:flex; gap:10px; padding:16px 0; flex-wrap:wrap; }
.camera-btn { flex:1; min-width:120px; display:flex; align-items:center; justify-content:center; gap:8px; }
.camera-btn svg { width:20px; height:20px; }

/* ===================== REPORTS ===================== */
.report-options { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.report-card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px 16px; text-align:center;
  cursor:pointer; transition:all .2s;
}
.report-card:hover { border-color:var(--primary); background:var(--bg-card-hover); }
.report-card svg { width:32px; height:32px; color:var(--primary); margin-bottom:10px; }
.report-card h4 { font-size:13px; margin-bottom:4px; }
.report-card p { font-size:11px; color:var(--text-muted); }
.report-preview { padding:20px; }

/* Client Portal Downloads */
.report-download-list { display:flex; flex-direction:column; gap:8px; }
.download-item {
  display:flex; align-items:center; gap:12px; padding:14px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius-sm);
}
.download-item svg { width:24px; height:24px; color:var(--primary); flex-shrink:0; }
.download-item div { flex:1; }
.download-item strong { font-size:13px; display:block; }
.download-item small { color:var(--text-muted); font-size:11px; }
.download-btn {
  width:36px; height:36px; border-radius:50%; background:rgba(212,175,55,0.1);
  border:none; color:var(--primary); cursor:pointer; display:flex;
  align-items:center; justify-content:center;
}
.download-btn svg { width:18px; height:18px; }

/* ===================== LOGBOOK ===================== */
.log-entry {
  border-left:3px solid var(--primary);
}
.log-entry.handover { border-left-color:var(--info); }
.log-entry.observation { border-left-color:var(--warning); }

/* ===================== ALERTS ===================== */
.alert-item {
  display:flex; gap:12px; padding:14px; background:var(--bg-card);
  border:1px solid var(--border); border-radius:var(--radius-sm);
}
.alert-item.critical { border-left:3px solid var(--danger); }
.alert-item.warning { border-left:3px solid var(--warning); }
.alert-item.info { border-left:3px solid var(--info); }
.alert-icon {
  width:36px; height:36px; border-radius:50%; display:flex;
  align-items:center; justify-content:center; flex-shrink:0;
}
.alert-icon svg { width:18px; height:18px; }

/* ===================== SITES ===================== */
.site-card { border-left:3px solid var(--primary); }
.site-card .site-status { display:flex; align-items:center; gap:6px; }
.site-card .site-status .dot { width:8px; height:8px; border-radius:50%; }
.site-card .site-status .dot.online { background:var(--success); }
.site-card .site-status .dot.offline { background:var(--text-muted); }

.role-card { display:flex; justify-content:space-between; align-items:center; }
.role-permissions { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.perm-tag {
  padding:2px 8px; background:var(--bg-surface); border-radius:10px;
  font-size:10px; color:var(--text-secondary);
}

/* ===================== AUDIT ===================== */
.filter-bar { display:flex; gap:10px; margin-bottom:16px; }
.filter-bar select, .filter-bar input {
  flex:1; background:var(--bg-surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:10px 12px; color:var(--text);
  font-size:13px; outline:none;
}
.filter-bar select option { background:var(--bg-card); }
.audit-list .card { font-size:12px; padding:10px 14px; }
.audit-list .audit-meta { color:var(--text-muted); font-size:11px; }
.audit-type-tag {
  display:inline-flex; padding:2px 8px; border-radius:10px;
  font-size:10px; font-weight:600; text-transform:uppercase;
  background:var(--bg-surface); color:var(--text-secondary); margin-right:6px;
}

/* ===================== CHECKLIST ===================== */
.checklist-builder .checklist-item-input { display:flex; gap:8px; margin-bottom:8px; }
.checklist-builder .checklist-item-input input { flex:1; }
.add-checklist-item {
  width:36px; height:36px; border-radius:50%; background:var(--primary);
  color:#000; border:none; font-size:20px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.checklist-items { list-style:none; }
.checklist-items li {
  display:flex; align-items:center; gap:10px; padding:8px 12px;
  background:var(--bg-surface); border-radius:var(--radius-sm);
  margin-bottom:6px; font-size:13px;
}
.checklist-items li .remove-item {
  margin-left:auto; background:none; border:none; color:var(--danger);
  cursor:pointer; font-size:16px;
}

/* ===================== TOAST ===================== */
.toast {
  position:fixed; bottom:calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left:50%; transform:translateX(-50%); padding:12px 24px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); font-size:14px; z-index:500;
  box-shadow:var(--shadow); animation:toastIn .3s ease;
  display:flex; align-items:center; gap:10px; max-width:90%;
}
.toast.success { border-color:var(--success); }
.toast.error { border-color:var(--danger); }
.toast.warning { border-color:var(--warning); }
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(20px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ===================== RESPONSIVE ===================== */
@media (min-width: 768px) {
  .page-container { padding:24px; max-width:800px; margin:0 auto; }
  .stats-row { grid-template-columns:repeat(4, 1fr); }
  .quick-actions { grid-template-columns:repeat(4, 1fr); }
  .modal-content { border-radius:var(--radius); margin:auto; max-height:85vh; }
  .report-options { grid-template-columns:repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .page-container { max-width:1000px; }
  .bottom-nav { display:none; }
}

/* PWA Install Banner */
.install-banner {
  position:fixed; bottom:calc(var(--nav-height) + 8px); left:8px; right:8px;
  padding:14px 16px; background:var(--bg-card); border:1px solid var(--primary);
  border-radius:var(--radius); display:flex; align-items:center; gap:12px;
  z-index:400; box-shadow:var(--shadow);
}
.install-banner p { flex:1; font-size:13px; }
.install-banner .btn-install { padding:8px 16px; background:var(--primary); color:#000; border:none; border-radius:var(--radius-sm); font-weight:600; cursor:pointer; }
.install-banner .btn-dismiss { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:18px; }
