/* ============================================================
   Velnox Attend — Styles
   ============================================================ */

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

:root {
  --primary: #70B261;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --bg: #f3f4f6;
  --white: #ffffff;
  --sidebar-w: 240px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8fafc 0%, #eaf5e7 100%);
}

.landing-header {
  padding: 28px 40px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  background: #16a34a;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.landing-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.landing-logo p {
  font-size: 0.85rem;
  color: var(--muted);
}

.landing-main {
  flex: 1;
  padding: 60px 40px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.landing-hero {
  text-align: center;
  margin-bottom: 40px;
}

.landing-hero h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.landing-hero p {
  color: var(--muted);
  font-size: 1rem;
}

.company-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.company-card-wrap {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 2px solid var(--border);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.company-card-wrap:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.company-card-info {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.company-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.company-card-body { flex: 1; }
.company-card-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.company-card-body p  { color: var(--muted); font-size: 0.88rem; margin-bottom: 4px; }

.company-subdomain {
  font-size: 0.78rem;
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: monospace;
}

.company-card-buttons {
  display: flex;
  gap: 10px;
}

.company-card-buttons .btn {
  flex: 1;
  justify-content: center;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  background: #fff;
}

.footer-sub { font-size: 0.78rem; margin-top: 4px; opacity: 0.7; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body { background: #f0f2f5; }

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

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-brand {
  padding: 28px 32px 24px;
  text-align: center;
  color: #fff;
}

.login-logo-img {
  display: block;
  width: 140px;
  height: auto;
  margin: 0 auto 14px;
  object-fit: contain;
}

.login-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.login-brand h2 { font-size: 1.4rem; margin-bottom: 4px; color: #333; }
.login-brand p  { font-size: 0.9rem; color: #888; }

.login-form {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 5px;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */

.admin-body { background: var(--bg); overflow: hidden; }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: #1e2130;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}

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

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-text h3 { font-size: 0.95rem; font-weight: 600; }
.sidebar-brand-text p  { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}

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

.nav-item.active {
  color: #fff;
  font-weight: 600;
}

.nav-icon { font-size: 1.05rem; flex-shrink: 0; }

.sidebar-bottom {
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.nav-logout { color: rgba(255,255,255,0.4); }
.nav-logout:hover { background: rgba(220,38,38,0.15); color: #f87171; }

/* Mobile top bar */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
}

.hamburger {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
}

/* Admin main */
.admin-main {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
}

#admin-content {
  padding: 28px 32px;
  max-width: 1100px;
}

/* ============================================================
   PAGE HEADERS & CARDS
   ============================================================ */

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

.page-header h2 { font-size: 1.6rem; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 1rem; font-weight: 600; }

/* ============================================================
   STATS
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-body { display: flex; flex-direction: column; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* ============================================================
   DASHBOARD GRIDS
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.emp-list { padding: 8px 0; }

.emp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.emp-row:last-child { border-bottom: none; }
.emp-row-info { flex: 1; }
.emp-row-info strong { display: block; font-size: 0.92rem; }
.emp-row-info span { font-size: 0.8rem; color: var(--muted); }

.activity-list { padding: 8px 0; }

.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.activity-row:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-in  { background: #16a34a; }
.dot-out { background: #dc2626; }

.activity-info { flex: 1; }
.activity-info strong { display: block; font-size: 0.88rem; }
.activity-info span { font-size: 0.78rem; color: var(--muted); }
.activity-time { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: #f9fafb;
  padding: 11px 16px;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  vertical-align: middle;
}

.data-table tr:hover td { background: #fafafa; }

.empty-cell {
  text-align: center;
  padding: 48px 20px !important;
  color: var(--muted);
}

.emp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-in      { background: #dcfce7; color: #166534; }
.badge-out     { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-site    { background: #dbeafe; color: #1e40af; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }

.btn-signin {
  background: #16a34a;
  color: #fff;
  border-color: transparent;
}
.btn-signin:hover { opacity: 0.88; }

.btn-signout {
  background: #dc2626;
  color: #fff;
  border-color: transparent;
}
.btn-signout:hover { opacity: 0.88; }

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn-danger-sm {
  background: #fee2e2;
  color: #dc2626;
  border-color: transparent;
}
.btn-danger-sm:hover { background: #fecaca; }

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s;
}
.btn-icon:hover { background: #f3f4f6; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea { resize: vertical; }

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

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  background: #fff;
}

.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--primary); }

/* ============================================================
   SITES GRID
   ============================================================ */

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.site-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-card-header {
  padding: 18px 20px;
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.site-card-header span { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.site-card-header h3 { font-size: 1rem; font-weight: 600; margin-bottom: 3px; }
.site-card-header p  { font-size: 0.8rem; opacity: 0.85; }

.site-card-body { padding: 20px; }

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.qr-wrap img, .qr-wrap canvas {
  border-radius: 8px;
  border: 4px solid #f3f4f6;
}

.qr-fallback {
  width: 160px;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.qr-url-box {
  margin-bottom: 12px;
}

.qr-url-box input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--muted);
  background: #f9fafb;
  cursor: pointer;
  outline: none;
}

.site-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   INCIDENTS
   ============================================================ */

.incidents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.incident-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid #dc2626;
}

.incident-photo img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
}
.incident-photo img:hover { opacity: 0.9; }

.incident-body { padding: 16px; }

.incident-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.incident-time { font-size: 0.8rem; color: var(--muted); }

.incident-desc {
  font-size: 0.92rem;
  margin-bottom: 12px;
  line-height: 1.55;
  color: #374151;
}

.incident-reporter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Photo input */
.photo-input-wrap { display: flex; flex-direction: column; gap: 10px; }

.photo-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px dashed;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
}
.photo-label:hover { opacity: 0.8; }

.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.hidden { display: none !important; }

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }
.toast.info    { background: #1d4ed8; }

/* ============================================================
   EMPLOYEE AVATAR
   ============================================================ */

.emp-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-size: 1rem;
  width: 40px;
  height: 40px;
}

.emp-avatar.sm { width: 30px; height: 30px; font-size: 0.75rem; }
.emp-avatar.lg { width: 48px; height: 48px; font-size: 1.1rem; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
}

.empty-state p    { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-state span { font-size: 0.85rem; }

/* ============================================================
   TEXT UTILITIES
   ============================================================ */

.text-muted { color: var(--muted); }
.small      { font-size: 0.78rem; }

/* ============================================================
   ERROR PAGE
   ============================================================ */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.error-icon { font-size: 3rem; }
.error-page h2 { font-size: 1.4rem; }

/* ============================================================
   CHECK-IN PAGE
   ============================================================ */

.checkin-body { background: #f0f4f8; }

.checkin-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkin-header {
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.checkin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checkin-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  padding: 4px;
  flex-shrink: 0;
}

.checkin-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.checkin-brand h1 { font-size: 1.25rem; font-weight: 700; }
.checkin-brand p  { font-size: 0.85rem; opacity: 0.9; }
.checkin-addr     { font-size: 0.75rem; opacity: 0.75; margin-top: 1px; }

.checkin-clock { text-align: right; }
.clock-time { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 0.78rem; opacity: 0.8; }

.checkin-main {
  flex: 1;
  padding: 24px 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.checkin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.checkin-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 18px 20px 4px;
}

.checkin-help {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 20px 14px;
}

.checkin-search {
  padding: 0 16px 12px;
}

.checkin-search input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #f9fafb;
  transition: border-color 0.15s;
}
.checkin-search input:focus { border-color: var(--primary); background: #fff; }

.checkin-list { border-top: 1px solid var(--border); }

.checkin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.12s;
}

.checkin-row:last-child { border-bottom: none; }
.checkin-row:hover { background: #fafafa; }
.checkin-row.is-signed-in { background: #f0fdf4; }

.checkin-row-info { flex: 1; min-width: 0; }
.checkin-row-info strong { display: block; font-size: 0.95rem; font-weight: 600; }
.checkin-row-info span   { font-size: 0.8rem; color: var(--muted); display: block; }

.signed-in-time {
  font-size: 0.75rem !important;
  color: #16a34a !important;
  font-weight: 600;
  margin-top: 2px;
}

.checkin-row-action { flex-shrink: 0; }

.incident-trigger { text-align: center; margin-bottom: 16px; }

.btn-incident {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border: 2px solid;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-incident:hover { opacity: 0.8; }

.checkin-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ============================================================
   EMPLOYEE LOGIN — Check-in PIN Screen
   ============================================================ */

.login-checkin-card {
  text-align: center;
  padding: 36px 28px 32px;
}

.login-checkin-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.login-checkin-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.emp-login-form {
  text-align: left;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pin-input {
  letter-spacing: 10px;
  font-size: 1.6rem;
  text-align: center;
  font-family: monospace;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* ============================================================
   EMPLOYEE PERSONAL DASHBOARD
   ============================================================ */

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.btn-logout-emp {
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 8px;
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
  line-height: 1.4;
}
.btn-logout-emp:hover { background: rgba(255,255,255,0.32); }

/* Greeting card */
.emp-greeting-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.emp-greeting-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Today's shift card */
.shift-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid;
  overflow: hidden;
  margin-bottom: 14px;
}

.shift-card-label {
  color: #fff;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.shift-card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shift-big-time {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: block;
}

/* No-shift placeholder */
.no-shift-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

/* Sign in / out action card */
.checkin-action-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}

.signed-in-status {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  padding: 6px 0;
}

.btn-block-lg {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.1rem;
  border-radius: 10px;
  justify-content: center;
  letter-spacing: 0.2px;
}

/* Roster cards on employee dashboard */
.roster-card {
  margin-bottom: 14px;
}

.shift-date-badge {
  background: #f3f4f6;
  color: #374151;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  min-width: 76px;
}

/* ============================================================
   ROSTER — Admin
   ============================================================ */

.roster-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-label {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 6px;
  white-space: nowrap;
  color: var(--text);
}

.roster-pub-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Draft badge — extends .badge */
.badge-draft {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Clickable badge to toggle publish */
.btn-toggle-pub {
  cursor: pointer;
  border: none;
  font-family: inherit;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
}
.btn-toggle-pub:hover  { opacity: 0.82; }
.btn-toggle-pub:active { transform: scale(0.96); }

.btn-publish {
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity 0.15s;
}
.btn-publish:hover { opacity: 0.88; }

/* Roster table date column */
.date-cell {
  vertical-align: top;
  padding-top: 14px !important;
  white-space: nowrap;
  border-right: 2px solid #f3f4f6 !important;
  min-width: 110px;
}

/* Visual separator at start of each new day */
.day-first-row td {
  border-top: 2px solid #e5e7eb !important;
}

/* Shift time display */
.shift-time {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* ============================================================
   PIN DISPLAY & FORM HELPERS (Admin)
   ============================================================ */

.pin-display {
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 5px;
  background: #f3f4f6;
  padding: 3px 9px;
  border-radius: 6px;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.hint-inline {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-topbar { display: flex; }

  .sidebar.open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    animation: slideIn 0.22s ease;
  }

  .sidebar-backdrop { display: block; }

  .admin-main { height: calc(100vh - 56px); margin-top: 0; }

  #admin-content { padding: 16px; }

  .admin-layout { flex-direction: column; }
}

@media (max-width: 640px) {
  .landing-header { padding: 16px 20px; }
  .landing-main   { padding: 32px 20px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .sites-grid     { grid-template-columns: 1fr; }
  .incidents-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar { gap: 8px; }
  .filter-bar input,
  .filter-bar select { width: 100%; }

  .modal { padding: 20px; border-radius: 12px; }

  .checkin-header { flex-wrap: wrap; gap: 10px; align-items: center; }
  .checkin-brand  { flex: 1; min-width: 0; }
  .header-right   { align-items: flex-end; }
  .checkin-clock  { align-self: flex-end; }

  .checkin-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .checkin-row-action { width: 100%; }
  .checkin-row-action .btn { width: 100%; justify-content: center; }

  /* Roster admin responsive */
  .roster-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .week-nav {
    justify-content: center;
    gap: 6px;
  }

  .roster-pub-summary {
    justify-content: center;
  }

  .date-cell { min-width: 90px; }

  /* Employee dashboard mobile */
  .emp-greeting-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .shift-big-time { font-size: 1.6rem; }

  .login-checkin-card { padding: 28px 18px 24px; }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
