/* ============================================
   ELINON STAFF ROSTER & TIMESHEET ERP
   Modern & Elegant Theme
   ============================================ */

:root {
  --rst-primary: #6366f1;
  --rst-primary-light: #818cf8;
  --rst-primary-dark: #4f46e5;
  --rst-secondary: #1e293b;
  --rst-secondary-light: #334155;
  --rst-accent: #f43f5e;
  --rst-success: #10b981;
  --rst-warning: #f59e0b;
  --rst-info: #3b82f6;
  --rst-bg: #f1f5f9;
  --rst-card-bg: #fff;
  --rst-text: #1e293b;
  --rst-text-muted: #64748b;
  --rst-border: #e2e8f0;
  --rst-shadow: 0 1px 3px rgb(0,0,0,0.06), 0 1px 2px rgb(0,0,0,0.04);
  --rst-shadow-lg: 0 10px 15px -3px rgb(0,0,0,0.08), 0 4px 6px -2px rgb(0,0,0,0.04);
  --rst-radius: 10px;
  --rst-radius-sm: 6px;
}

body.embedded-view .sidebar { display: none !important; }
body.embedded-view .main-content { margin-left: 0 !important; padding: 24px; width: 100%; }

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

body {
  font-family: Inter, sans-serif;
  background-color: var(--rst-bg);
  color: var(--rst-text);
  line-height: 1.6;
}

.app-container { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--rst-secondary) 0%, #0f172a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

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

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--rst-primary), var(--rst-primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--rst-primary-light), #a5b4fc);
  -webkit-background-clip: text;
          background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.sidebar-docs-link {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 8px;
}
.sidebar-docs-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.nav-list { list-style: none; padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-item { margin-bottom: 1px; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: rgb(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.25s ease;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  margin-right: 8px;
}

.nav-link:hover { background: rgb(255,255,255,0.05); color: rgb(255,255,255,0.9); }

.nav-link.active {
  background: rgb(99,102,241,0.12);
  color: var(--rst-primary-light);
  border-left-color: var(--rst-primary);
  font-weight: 600;
}

.nav-link i { width: 20px; text-align: center; font-size: 0.95rem; }

/* ── Main Content ────────────────────────── */
.main-content { margin-left: 260px; flex: 1; padding: 28px 32px; }

.section { display: none; animation: fadeSlide 0.35s ease; }
.section.active { display: block; }

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

/* ── Header ──────────────────────────────── */
.header-area {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}

.page-title {
  font-size: 1.65rem; font-weight: 700; color: var(--rst-secondary);
  display: flex; align-items: center; gap: 10px;
}

.page-title .icon-wrap {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--rst-primary), var(--rst-primary-light));
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
}

/* ── Stats Grid ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--rst-card-bg);
  padding: 20px 22px;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow);
  border: 1px solid var(--rst-border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--rst-primary);
  border-radius: 0 4px 4px 0;
}

.stat-card.green::before { background: var(--rst-success); }
.stat-card.amber::before { background: var(--rst-warning); }
.stat-card.red::before   { background: var(--rst-accent); }
.stat-card.blue::before  { background: var(--rst-info); }

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--rst-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--rst-secondary);
  line-height: 1.1;
}

/* ── Cards ───────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 22px; }

.card {
  background: var(--rst-card-bg);
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow);
  border: 1px solid var(--rst-border);
  overflow: hidden;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--rst-border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 0.95rem;
  background: linear-gradient(180deg, #fafbfc, var(--rst-card-bg));
}

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

/* ── Tables ──────────────────────────────── */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--rst-border);
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--rst-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td { font-size: 0.9rem; }

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────── */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-muted   { background: #f1f5f9; color: #475569; }
.badge-primary { background: #e0e7ff; color: #3730a3; }

/* ── Buttons ─────────────────────────────── */
.btn {
  padding: 9px 18px;
  border-radius: var(--rst-radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--rst-primary), var(--rst-primary-dark));
  color: #fff;
  box-shadow: 0 1px 3px rgb(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgb(99,102,241,0.3); }

.btn-success { background: var(--rst-success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--rst-accent); color: #fff; }
.btn-danger:hover { background: #e11d48; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--rst-border);
  color: var(--rst-text);
}
.btn-outline:hover { background: #f8fafc; border-color: var(--rst-text-muted); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }
.btn-icon { padding: 6px 8px; }

/* ── Form Controls (inline) ──────────────── */
.form-control, .form-select {
  padding: 9px 14px;
  border: 1px solid var(--rst-border);
  border-radius: var(--rst-radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--rst-text);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--rst-primary);
  box-shadow: 0 0 0 3px rgb(99,102,241,0.12);
}

.form-label { font-size: 0.82rem; font-weight: 500; color: var(--rst-text-muted); margin-bottom: 4px; display: block; }

textarea.form-control { resize: vertical; }

/* ── Clock-In Live Widget ────────────────── */
.clock-widget {
  background: linear-gradient(135deg, var(--rst-secondary) 0%, #0f172a 100%);
  color: #fff;
  border-radius: var(--rst-radius);
  padding: 28px 30px;
  text-align: center;
  box-shadow: var(--rst-shadow-lg);
}

#ci-employee,
.clock-widget #ci-employee.form-select {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #cbd5e1;
}
#ci-employee option,
.clock-widget #ci-employee option {
  background: #ffffff;
  color: #000000;
}

.clock-widget .live-time {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  margin: 10px 0 6px;
}

.clock-widget .live-date {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 20px;
}

.clock-btn {
  padding: 14px 36px;
  border-radius: 50px;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.clock-btn.clock-in {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgb(16,185,129,0.4);
}

.clock-btn.clock-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(16,185,129,0.5);
}

.clock-btn.clock-out {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 15px rgb(244,63,94,0.4);
}

.clock-btn.clock-out:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(244,63,94,0.5);
}

.clock-btn.break-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 15px rgb(245,158,11,0.3);
}

.clock-btn.break-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(245,158,11,0.4);
}

.clock-status {
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.clock-status.clocked-in { background: rgb(16,185,129,0.15); color: #34d399; }
.clock-status.clocked-out { background: rgb(148,163,184,0.15); color: #94a3b8; }
.clock-status.on-break { background: rgb(245,158,11,0.15); color: #fbbf24; }

/* ── Verification Method Selector ────────── */
.verify-method-bar {
  background: var(--rst-card-bg);
  border-radius: var(--rst-radius);
  border: 1px solid var(--rst-border);
  box-shadow: var(--rst-shadow);
  padding: 16px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.verify-method-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rst-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verify-method-label i { color: var(--rst-primary); }

.verify-method-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.verify-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 50px;
  border: 2px solid var(--rst-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rst-text-muted);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.verify-option input[type="radio"] { display: none; }

.verify-option-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  background: #f1f5f9;
  transition: all 0.25s;
}

.verify-option:hover { border-color: var(--rst-primary-light); background: #f8faff; }

.verify-option.active {
  border-color: var(--rst-primary);
  background: linear-gradient(135deg, rgb(99,102,241,0.05), rgb(99,102,241,0.1));
  color: var(--rst-primary-dark);
  box-shadow: 0 2px 8px rgb(99,102,241,0.15);
}

.verify-option.active .verify-option-icon {
  background: var(--rst-primary);
  color: #fff;
}

/* ── Biometric Scanner Panel ─────────────── */
.bio-panel {
  margin: 18px 0;
  animation: fadeSlide 0.3s ease;
}

.bio-scanner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.bio-fingerprint-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid rgb(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: rgb(255,255,255,0.5);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.bio-fingerprint-ring.scanning {
  border-color: var(--rst-primary-light);
  color: var(--rst-primary-light);
  animation: bioPulse 1.5s infinite;
  box-shadow: 0 0 30px rgb(99,102,241,0.3);
}

.bio-fingerprint-ring.verified {
  border-color: var(--rst-success);
  color: var(--rst-success);
  box-shadow: 0 0 30px rgb(16,185,129,0.35);
}

.bio-fingerprint-ring.failed {
  border-color: var(--rst-accent);
  color: var(--rst-accent);
  box-shadow: 0 0 30px rgb(244,63,94,0.3);
  animation: bioShake 0.5s ease;
}

@keyframes bioPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes bioShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.bio-scan-line {
  position: absolute;
  left: 10%; right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--rst-primary-light), transparent);
  border-radius: 2px;
  top: -3px;
  opacity: 0;
  pointer-events: none;
}

.bio-fingerprint-ring.scanning .bio-scan-line {
  opacity: 1;
  animation: bioScanLine 1.5s ease-in-out infinite;
}

@keyframes bioScanLine {
  0% { top: 5%; }
  50% { top: 90%; }
  100% { top: 5%; }
}

.bio-status {
  font-size: 0.82rem;
  color: rgb(255,255,255,0.6);
  font-weight: 500;
  text-align: center;
  transition: color 0.3s;
}

.bio-status.scanning { color: var(--rst-primary-light); }
.bio-status.verified { color: var(--rst-success); }
.bio-status.failed { color: var(--rst-accent); }

/* ── Geofence Panel ──────────────────────── */
.geo-panel {
  margin: 18px 0;
  animation: fadeSlide 0.3s ease;
}

.geo-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}

.geo-indicator {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid rgb(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: rgb(255,255,255,0.5);
  position: relative;
  transition: all 0.4s;
}

.geo-indicator .geo-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: all 0.4s;
}

.geo-indicator.checking {
  border-color: var(--rst-info);
  color: var(--rst-info);
  animation: bioPulse 1.2s infinite;
}

.geo-indicator.checking .geo-pulse {
  border-color: rgb(59,130,246,0.3);
  animation: geoPulse 1.5s infinite;
}

.geo-indicator.inside {
  border-color: var(--rst-success);
  color: var(--rst-success);
  box-shadow: 0 0 20px rgb(16,185,129,0.3);
}

.geo-indicator.inside .geo-pulse { border-color: rgb(16,185,129,0.2); }

.geo-indicator.outside {
  border-color: var(--rst-accent);
  color: var(--rst-accent);
  box-shadow: 0 0 20px rgb(244,63,94,0.3);
}

.geo-indicator.outside .geo-pulse { border-color: rgb(244,63,94,0.2); }

@keyframes geoPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.geo-status-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgb(255,255,255,0.8);
}

.geo-distance {
  font-size: 0.78rem;
  color: rgb(255,255,255,0.5);
}

.geo-coords {
  font-size: 0.7rem;
  color: rgb(255,255,255,0.35);
  font-variant-numeric: tabular-nums;
}

/* ── Geofence Map Visual ─────────────────── */
.geo-map-visual {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  position: relative;
  overflow: hidden;
}

.geo-map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgb(99,102,241,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}

.geo-zone-circle {
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%);
  border: 2px dashed rgb(99,102,241,0.4);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(99,102,241,0.1), transparent 70%);
  transition: all 0.4s;
}

.geo-zone-circle.inside {
  border-color: rgb(16,185,129,0.6);
  background: radial-gradient(circle, rgb(16,185,129,0.15), transparent 70%);
}

.geo-zone-circle.outside {
  border-color: rgb(244,63,94,0.5);
  background: radial-gradient(circle, rgb(244,63,94,0.1), transparent 70%);
}

.geo-zone-label {
  position: absolute;
  bottom: -22px; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.68rem;
  color: rgb(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.geo-user-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: var(--rst-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 0 12px rgb(99,102,241,0.5);
  transition: all 0.6s ease;
  z-index: 2;
}

.geo-user-dot.inside {
  background: var(--rst-success);
  box-shadow: 0 0 16px rgb(16,185,129,0.6);
}

.geo-user-dot.outside {
  background: var(--rst-accent);
  box-shadow: 0 0 16px rgb(244,63,94,0.6);
}

/* ── Verify Badge ────────────────────────── */
.verify-badge {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgb(99,102,241,0.15);
  color: var(--rst-primary-light);
}

/* ── Verification Summary ────────────────── */
.verify-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.verify-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--rst-radius-sm);
  background: #f8fafc;
  border: 1px solid var(--rst-border);
}

.verify-summary-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.verify-summary-icon.bio { background: #e0e7ff; color: var(--rst-primary); }
.verify-summary-icon.geo { background: #dcfce7; color: var(--rst-success); }
.verify-summary-icon.both { background: #fef3c7; color: #d97706; }
.verify-summary-icon.std { background: #f1f5f9; color: #64748b; }

.verify-summary-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rst-secondary);
  line-height: 1;
}

.verify-summary-label {
  font-size: 0.72rem;
  color: var(--rst-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

/* ── Geo Config Modal Info ───────────────── */
.geo-config-info {
  padding: 12px 16px;
  border-radius: var(--rst-radius-sm);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.82rem;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.geo-config-info i {
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── Roster Schedule Grid ────────────────── */
.roster-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, 1fr);
  border: 1px solid var(--rst-border);
  border-radius: var(--rst-radius);
  overflow: hidden;
  font-size: 0.82rem;
}
.roster-grid[data-view="day"] {
  grid-template-columns: 180px 1fr;
}
.roster-grid[data-view="month"] {
  grid-template-columns: repeat(7, 1fr);
}
.roster-grid .rg-cell.drag-over {
  outline: 2px dashed var(--rst-primary);
  background: #eef2ff;
}
.roster-grid .rg-cell .shift-badge[draggable="true"] {
  cursor: grab;
}
.roster-view-toggle .btn.active {
  background: var(--rst-primary);
  color: #fff;
  border-color: var(--rst-primary);
}
.roster-month-cell {
  min-height: 88px;
  padding: 8px;
  border: 1px solid var(--rst-border);
  vertical-align: top;
  text-align: left;
}
.roster-month-cell .month-day-num {
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.roster-month-cell .month-shift-chip {
  display: block;
  font-size: 0.68rem;
  padding: 2px 4px;
  margin-bottom: 2px;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-grid .rg-head {
  background: #f8fafc;
  padding: 10px 8px;
  font-weight: 600;
  text-align: center;
  color: var(--rst-text-muted);
  border-bottom: 2px solid var(--rst-border);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.roster-grid .rg-name {
  padding: 10px 12px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--rst-border);
  border-right: 1px solid var(--rst-border);
  background: #fafbfc;
}

.roster-grid .rg-name .avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--rst-primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700;
}

.roster-grid .rg-cell {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--rst-border);
  border-right: 1px solid var(--rst-border);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}

.roster-grid .rg-cell:hover { background: #f0f4ff; }

.roster-grid .rg-cell:last-child { border-right: none; }

.shift-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.shift-morning { background: #fef3c7; color: #92400e; }
.shift-afternoon { background: #e0e7ff; color: #3730a3; }
.shift-night { background: #1e293b; color: #e2e8f0; }
.shift-off { background: #f1f5f9; color: #94a3b8; }

/* ── Timesheet ───────────────────────────── */
.ts-summary-bar {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-bottom: 18px;
}

.ts-summary-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--rst-card-bg);
  border-radius: var(--rst-radius-sm);
  border: 1px solid var(--rst-border);
  font-size: 0.85rem;
}

.ts-summary-item strong { font-size: 1rem; color: var(--rst-secondary); }

.ts-bar {
  height: 8px;
  background: var(--rst-border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.ts-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.ts-bar-fill.regular { background: var(--rst-success); }
.ts-bar-fill.overtime { background: var(--rst-warning); }
.ts-bar-fill.absent   { background: var(--rst-accent); }

/* ── Modals (Bootstrap overrides) ────────── */
.modal-content {
  border: none;
  border-radius: var(--rst-radius);
  box-shadow: var(--rst-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--rst-border);
  padding: 18px 24px;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
  border-top: 1px solid var(--rst-border);
  padding: 14px 24px;
}

.modal-title { font-weight: 600; font-size: 1.05rem; }

/* ── Responsive ──────────────────────────── */
@media (width <= 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .roster-grid { font-size: 0.75rem; }
  .roster-grid .rg-head, .roster-grid .rg-name, .roster-grid .rg-cell { padding: 6px 4px; }
  .verify-method-bar { flex-direction: column; align-items: flex-start; }
  .verify-summary-grid { grid-template-columns: repeat(2, 1fr); }

  .sidebar {
    width: 68px; min-width: 68px; overflow: hidden;
  }
  .sidebar .nav-text, .sidebar .sidebar-label { display: none; }
  .sidebar .nav-link { justify-content: center; padding: 12px 0; }
  .sidebar .nav-link i { margin-right: 0; }
  .main-content { margin-left: 68px; }
}

@media (width <= 900px) {
  .sidebar {
    position: fixed; left: -280px; top: 0;
    width: 260px; min-width: 260px; height: 100vh;
    z-index: 9999; transition: left 0.3s ease;
    box-shadow: 4px 0 24px rgb(0,0,0,0.3); overflow-y: auto;
    display: flex;
  }
  .sidebar.mobile-open { left: 0; }
  .sidebar.mobile-open .nav-text, .sidebar.mobile-open .sidebar-label { display: initial; }
  .sidebar.mobile-open .nav-link { justify-content: flex-start; padding: 12px 20px; }
  .sidebar.mobile-open .nav-link i { margin-right: 12px; }
  .main-content { margin-left: 0; padding: 16px; width: 100%; max-width: 100%; min-width: 0; }
  .app-container { overflow-x: clip; max-width: 100%; }
  .roster-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

@media (width <= 768px) {
  .stats-grid { grid-template-columns: 1fr; }
  .header-area { flex-direction: column; align-items: flex-start; }
  .verify-method-options { flex-direction: column; width: 100%; }
  .verify-option { width: 100%; justify-content: center; }
  .verify-summary-grid { grid-template-columns: 1fr 1fr; }
  .roster-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (width <= 600px) {
  .main-content { padding: 12px; }
  .verify-summary-grid { grid-template-columns: 1fr; }
  .roster-grid { font-size: 0.7rem; }
}

@media (width <= 480px) {
  .stats-grid { gap: 8px; }
}
