/* ============================================================
   EMBROTRACK — MOBILE-FIRST PHONEPE-STYLE UI
   ============================================================ */
:root {
  --primary: #5f259f;
  --primary-dark: #451878;
  --primary-light: #f3ebff;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --green: #10b981;
  --green-dark: #059669;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --gray-lock: #94a3b8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif;
  background: #0f172a;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  line-height: 1.45;
}

/* लैपटॉप पर मोबाइल फ्रेम, फोन पर फुल स्क्रीन */
.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
}

.hidden { display: none !important; }

/* Splash Screen */
.splash-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: #fff;
  gap: 10px;
}
.splash-logo {
  font-size: 54px;
  background: rgba(255, 255, 255, 0.15);
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(95, 37, 159, 0.25);
}
.header-brand h1 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}
.header-brand small {
  font-size: 11px;
  opacity: 0.85;
  display: block;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

/* Main Content Area */
.page-content {
  padding: 14px 14px 96px;
}

/* Alert Banners */
.alert-banner {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-warning { background: var(--orange-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-danger { background: var(--red-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--green-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-info { background: var(--blue-light); color: #1e40af; border: 1px solid #93c5fd; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* KPI Grids */
.kpi-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.kpi-box {
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kpi-box .kpi-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.kpi-box .kpi-val {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}
.kpi-box.green { background: #ecfdf5; border-color: #a7f3d0; }
.kpi-box.green .kpi-val { color: var(--green-dark); }
.kpi-box.red { background: #fef2f2; border-color: #fecaca; }
.kpi-box.red .kpi-val { color: var(--red); }
.kpi-box.purple { background: var(--primary-light); border-color: #d8b4fe; }
.kpi-box.purple .kpi-val { color: var(--primary); }
.kpi-box.blue { background: #eff6ff; border-color: #bfdbfe; }
.kpi-box.blue .kpi-val { color: var(--blue); }

/* Auth Screens */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(175deg, var(--primary) 0%, var(--primary-dark) 36%, var(--bg) 36.2%);
  padding: 36px 18px 28px;
}
.auth-brand {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
}
.auth-brand .logo-badge {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 10px;
}
.auth-brand h1 { font-size: 24px; font-weight: 800; }
.auth-brand p { font-size: 13px; opacity: 0.9; margin-top: 3px; }
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

/* Forms */
.form-group { margin-bottom: 13px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--primary); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-light { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); }

/* Action State Cards (Labour Home) */
.state-card {
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1.5px solid transparent;
}
.state-card.state-active_blue { background: #eff6ff; border-color: var(--blue); cursor: pointer; }
.state-card.state-done_green { background: #ecfdf5; border-color: var(--green); pointer-events: none; }
.state-card.state-locked_gray, .state-card.state-no_previous_shift { background: #f1f5f9; border-color: #cbd5e1; color: var(--muted); pointer-events: none; }
.state-card.state-rejected_resubmit { background: #fffbeb; border-color: var(--orange); cursor: pointer; }

/* Chips (Downtime Reasons & Filter Tabs) */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.chip-btn {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.chip-btn.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.badge-green { background: var(--green-light); color: #065f46; }
.badge-red { background: var(--red-light); color: #991b1b; }
.badge-orange { background: var(--orange-light); color: #92400e; }
.badge-blue { background: var(--blue-light); color: #1e40af; }
.badge-gray { background: #e2e8f0; color: #475569; }
.badge-purple { background: var(--primary-light); color: var(--primary); }

/* Lists & Passbook Rows */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-title { font-size: 14px; font-weight: 700; }
.list-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.amt-credit { color: var(--green-dark); font-weight: 800; font-size: 15px; }
.amt-debit { color: var(--red); font-weight: 800; font-size: 15px; }

/* PhonePe-Style Fixed Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 68px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 2px;
  position: relative;
}
.nav-item .nav-icon { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--primary); }

/* Work Submit Nav States (Never Hidden) */
.nav-item.nav-done-green { color: var(--green-dark); pointer-events: none; }
.nav-item.nav-locked-gray { color: var(--gray-lock); pointer-events: none; opacity: 0.7; }
.nav-item.nav-resubmit { color: var(--orange); }

/* Center Raised Attendance Button (PhonePe Scanner Style) */
.nav-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: -26px;
}
.nav-center-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform 0.15s;
}
.nav-center-btn:active { transform: scale(0.93); }
.nav-center-btn.state-active_blue { background: linear-gradient(135deg, var(--blue), #1d4ed8); }
.nav-center-btn.state-done_green { background: linear-gradient(135deg, var(--green), var(--green-dark)); pointer-events: none; }
.nav-center-btn.state-locked_gray { background: var(--gray-lock); pointer-events: none; }
.nav-center-label { font-size: 10.5px; font-weight: 700; margin-top: 2px; color: var(--text); }

/* Camera & Face Scan Box */
.camera-box {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  margin-bottom: 12px;
}
.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.face-oval-guide {
  position: absolute;
  inset: 14% 24%;
  border: 3px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  pointer-events: none;
}

/* Photo Preview */
.photo-thumb {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f172a;
  margin: 8px 0;
  cursor: pointer;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  width: 100%;
  max-width: 430px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 18px 16px 26px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

/* Loader & Toasts */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-box {
  background: #fff;
  padding: 20px 26px;
  border-radius: 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 400px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 15px;
  border-radius: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.toast.success { background: var(--green-dark); }
.toast.error { background: var(--red); }
.toast.info { background: var(--primary); }

/* Subscription Lock Screen */
.lock-screen {
  min-height: 100vh;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
}

/* Table Scroll */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table th, .data-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table th { color: var(--muted); font-weight: 700; background: #f8fafc; }