:root {
  --navy: #1e3a8a;
  --navy-dark: #172554;
  --crimson: #b91c1c;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --amber: #f59e0b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: 'Baloo Bhai 2', 'Noto Sans Gujarati', 'Nirmala UI', 'Shruti', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  padding-bottom: 72px;
}

.app-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.header-title-wrap { min-width: 0; }
.header-kicker { font-size: 10.5px; opacity: 0.85; font-weight: 600; }
.header-title { font-size: 15.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.badge-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--crimson);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 5px;
  border: 1.5px solid #fff;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
}

.pill-online { background: rgba(34, 197, 94, 0.22); color: #dcfce7; }
.pill-offline { background: rgba(239, 68, 68, 0.3); color: #fee2e2; }
.pill-sync { background: rgba(251, 191, 36, 0.25); color: #fef3c7; cursor: pointer; border: none; }

.install-banner {
  background: #eff6ff;
  border-bottom: 1.5px solid #bfdbfe;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
  border: 1px solid #e2e8f0;
}

.card-tint {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.card-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 8px 0;
}

.muted { color: var(--muted); font-size: 12px; }

label {
  display: block;
  font-weight: 700;
  font-size: 12.5px;
  color: #334155;
  margin: 8px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.4px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  background: #fff;
}

input:disabled, select:disabled {
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-crimson { background: var(--crimson); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: #ea580c; color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.4px solid var(--border); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-equal { display: flex; gap: 8px; }
.row-equal > * { flex: 1; }

.chips-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }

.tab-chip {
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.3px solid var(--border);
  background: #fff;
  color: #334155;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.tab-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.group-hdr {
  background: #fff1f2;
  color: var(--crimson);
  font-weight: 800;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  margin: 12px 0 6px;
}

.readonly-field input {
  background: #ecfdf5;
  border-color: #a7f3d0;
  font-weight: 700;
}

.aras-card {
  background: #fffbeb;
  border: 1.4px solid #fcd34d;
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
}

.alert-banner {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.alert-err { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-ok { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }

.list-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fafafa;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-off { background: var(--danger-bg); color: var(--danger); }

.kendra-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2ff;
  color: var(--navy);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.k-chip button {
  background: none;
  border: none;
  color: var(--crimson);
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1.5px solid #e2e8f0;
  display: flex;
  z-index: 40;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.08);
}

.nav-btn {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.nav-btn.active { color: var(--navy); background: #eff6ff; }
.nav-btn .ico { font-size: 17px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.spinner-overlay.open { display: flex; }

.loader-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 340px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.spin {
  width: 26px;
  height: 26px;
  border: 3.5px solid #e2e8f0;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: var(--danger); transition: .2s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: .2s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

.mpr-ticker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #1e3a8a 0%, #880e4f 100%);
  color: #fff;
  border-radius: 11px;
  padding: 7px 11px;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
}
.mpr-ticker-badge {
  background: #fef08a;
  color: #78350f;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mpr-ticker-viewport { flex: 1; overflow: hidden; white-space: nowrap; }
.mpr-ticker-track {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  animation: mprPwaMarquee 26s linear infinite;
}
.mpr-ticker-bar:hover .mpr-ticker-track { animation-play-state: paused; }
@keyframes mprPwaMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.mpr-suggest-chip {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  margin: 3px 4px 0 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #c7d2fe;
  cursor: pointer;
  font-weight: 600;
}
.app-footer {
  margin-top: 18px;
  padding: 10px 8px;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
}
.app-footer a {
  color: #334155;
  text-decoration: underline;
  font-weight: 600;
}
.gsi-official-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.gsi-official-btn:hover { background: #f8fafc; }
.gsi-mount-box {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.guj-ime-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 5px 8px;
  margin: 4px 0 6px;
}
.guj-ime-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #1e3a8a;
}
.guj-ime-chip {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
}
.guj-ime-chip.primary {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}
