/* =========================================================
   UTUO COIMBATORE FIELD MONITORING & COLLECTOR DASHBOARD STYLES
   Color Palette:
   Deep Navy: #114E72, Primary Blue: #1A6B9A, Success: #1B7A4A,
   Warning: #B45309, Purple: #7C3AED, Danger: #DC2626
   ========================================================= */

:root {
  --primary-navy: #114E72;
  --primary-blue: #1A6B9A;
  --accent-green: #1B7A4A;
  --accent-orange: #B45309;
  --accent-purple: #7C3AED;
  --accent-red: #DC2626;
  --bg-page: #F0F2F5;
  --bg-card: #FFFFFF;
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --text-dark: #1C2B3A;
  --text-muted: #6B7280;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Tamil', sans-serif;
}

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

html {
  overflow-x: hidden;
  width: 100%;
}

body, button, input, select, textarea, table, th, td {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-page);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
.app-header {
  background: var(--primary-navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hdr-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tn-emblem {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.emblem-svg {
  width: 42px;
  height: 42px;
}

.hdr-titles .main-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.hdr-titles .sub-title {
  font-size: 11px;
  opacity: 0.85;
  color: #D1D5DB;
}

.hdr-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 30px;
}

.nav-btn .nav-text-mobile {
  display: none;
}

.nav-btn .nav-text-full {
  display: inline;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-btn.active {
  background: #ffffff;
  color: var(--primary-navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nav-btn.active small {
  color: var(--primary-blue);
}

.export-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Logout Button */
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 20px;
  color: #FCA5A5;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #fff;
  border-color: rgba(220, 38, 38, 0.5);
}

.logout-icon {
  font-size: 14px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #E2E8F0;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10B981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* =========================================================
   OFFLINE BANNER
   ========================================================= */
.offline-banner {
  background: #FEF3C7;
  border-bottom: 2px solid var(--accent-orange);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #92400E;
}

.offline-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-btn {
  padding: 6px 14px;
  background: var(--accent-orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.sync-btn:hover {
  background: #92400E;
}

/* =========================================================
   LAYOUT WRAPPERS & CARDS
   ========================================================= */
.app-main {
  padding: 20px 16px 80px;
}

.uto-wrap {
  max-width: 780px;
  margin: 0 auto;
}

.uto-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.uto-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4A5568;
  margin-bottom: 14px;
  border-bottom: 1.5px solid var(--border-light);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.uto-section-title .num {
  color: var(--primary-blue);
  font-size: 16px;
  font-weight: 800;
}

/* =========================================================
   FORM CONTROLS
   ========================================================= */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 14px;
  color: #2D3748;
}

label:first-child {
  margin-top: 0;
}

.uto-required::after {
  content: " *";
  color: var(--accent-red);
}

select, input[type="text"], textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text-dark);
}

select:focus, input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(26, 107, 154, 0.15);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 580px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* =========================================================
   CATEGORY TOGGLE & MODULE CARDS GRID
   ========================================================= */
.uto-cat-toggle {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--primary-blue);
  margin-top: 8px;
}

.uto-cat-toggle label {
  flex: 1;
  padding: 11px 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--primary-blue);
  transition: 0.15s;
  margin: 0;
}

.uto-cat-toggle input {
  display: none;
}

.uto-cat-toggle input:checked + label {
  background: var(--primary-blue);
  color: #ffffff;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mod-card {
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #4B5563;
  transition: all 0.15s ease;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 85px;
}

.mod-card:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: #F0F7FF;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(26, 107, 154, 0.12);
}

.mod-card.selected {
  border-color: var(--primary-blue);
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 107, 154, 0.3);
}

.mod-card .icon {
  font-size: 24px;
}

.mod-card .sub {
  font-size: 10.5px;
  font-weight: 400;
  opacity: 0.75;
}

.mod-card.selected .sub {
  color: #E2E8F0;
  opacity: 0.9;
}

/* =========================================================
   DIMENSIONS & DYNAMIC QUESTIONS
   ========================================================= */
.uto-dim-block {
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}

.uto-dim-block.uto-process { background: #E8F3FA; border-left: 4px solid var(--primary-blue); }
.uto-dim-block.uto-output  { background: #E6F4ED; border-left: 4px solid var(--accent-green); }
.uto-dim-block.uto-outcome { background: #FEF3C7; border-left: 4px solid var(--accent-orange); }
.uto-dim-block.uto-quality { background: #EDE9FE; border-left: 4px solid var(--accent-purple); }

.uto-dim-block h3 {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.uto-dim-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
}

.uto-process .uto-dim-badge { background: var(--primary-blue); }
.uto-output  .uto-dim-badge { background: var(--accent-green); }
.uto-outcome .uto-dim-badge { background: var(--accent-orange); }
.uto-quality .uto-dim-badge { background: var(--accent-purple); }

.uto-process h3 { color: var(--primary-blue); }
.uto-output  h3 { color: var(--accent-green); }
.uto-outcome h3 { color: var(--accent-orange); }
.uto-quality h3 { color: var(--accent-purple); }

.uto-q-item {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
  transition: border-color 0.15s;
}

.uto-q-item:hover {
  border-color: #B0C4DE;
}

.uto-q-item.uto-unanswered {
  outline: 2px solid var(--accent-red);
  outline-offset: -1px;
}

.uto-q-text {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.5;
  color: #1C2B3A;
}

.uto-q-en {
  font-size: 11.5px;
  color: #718096;
  font-style: italic;
  margin-bottom: 10px;
}

/* YES / NO Interactive Buttons */
.uto-ans-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 10px;
  margin-bottom: 10px;
  width: fit-content;
}

.uto-ans-opt {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 100px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background-color: #F3F4F6;
  color: #4B5563;
  border: 1.5px solid var(--border-medium) !important;
  border-radius: var(--radius-sm) !important;
  position: relative;
  user-select: none;
  transition: all 0.15s ease;
}

.uto-ans-opt input[type=radio] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

.uto-ans-opt.uto-yes.uto-checked {
  background-color: var(--accent-green) !important;
  border-color: var(--accent-green) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(27, 122, 74, 0.3);
}

.uto-ans-opt.uto-no.uto-checked {
  background-color: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

input[type="text"].uto-remark {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px dashed var(--border-medium);
  border-radius: 6px;
  background: #F9FAFB;
  color: #4B5563;
}

input[type="text"].uto-remark:focus {
  border-style: solid;
  border-color: var(--primary-blue);
  background: #fff;
  color: var(--text-dark);
  box-shadow: 0 0 0 3px rgba(26, 107, 154, 0.1);
}

.uto-val-label {
  font-size: 11px;
  font-weight: 700;
  color: #4B5563;
  margin-bottom: 4px;
}

.uto-value-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: #FFFDE7;
  color: #1C2B3A;
  margin-bottom: 10px;
}

.uto-value-input:focus {
  border-color: var(--accent-orange);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

/* =========================================================
   URGENT FLAG & PHOTO UPLOAD
   ========================================================= */
.urgent-toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-red);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.urgent-text strong {
  display: block;
  font-size: 13.5px;
}

.urgent-text .sub-hint {
  font-size: 11.5px;
  color: #7F1D1D;
  display: block;
  margin-top: 2px;
}

/* Photo Upload to S3 */
.photo-upload-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-medium);
}

.photo-dropzone {
  border: 2px dashed var(--primary-blue);
  background: #F0F7FF;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.photo-dropzone:hover {
  background: #E1EFFE;
  border-color: var(--primary-navy);
}

.photo-dropzone .upload-icon {
  font-size: 32px;
}

.photo-dropzone .upload-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-blue);
}

.photo-dropzone .upload-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.photo-previews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.photo-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-medium);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   SUBMIT BUTTON & MESSAGES
   ========================================================= */
.submit-action-row {
  margin-top: 20px;
}

.uto-submit-btn {
  width: 100%;
  background: var(--accent-green);
  color: #ffffff;
  border: none;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(27, 122, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.uto-submit-btn:hover {
  background: #15633C;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(27, 122, 74, 0.35);
}

.uto-submit-btn:disabled {
  background: #9CA3AF;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.uto-msg {
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}

.uto-msg.uto-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; display: block; }
.uto-msg.uto-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; display: block; }
.uto-msg.uto-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; display: block; }

.uto-counter {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

.uto-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.uto-placeholder-msg {
  text-align: center;
  color: #9CA3AF;
  font-size: 13.5px;
  padding: 30px 10px;
}

/* =========================================================
   DASHBOARD VIEW STYLES
   ========================================================= */
.dash-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10px;
}

.dash-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
}

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

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

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary { background: var(--primary-navy); color: #fff; }
.btn-primary:hover { background: #0c3c58; }

.btn-secondary { background: #E5E7EB; color: #374151; }
.btn-secondary:hover { background: #D1D5DB; }

.btn-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.btn-danger:hover { background: #FCA5A5; }

/* 5 KPI Cards */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary-navy);
  border: 1px solid var(--border-light);
  border-top-width: 4px;
}

.kpi.g { border-top-color: #059669; }
.kpi.a { border-top-color: #D97706; }
.kpi.p { border-top-color: #7C3AED; }
.kpi.r { border-top-color: #DC2626; }

.kpi-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1;
}

.kpi.g .kpi-num { color: #059669; }
.kpi.a .kpi-num { color: #D97706; }
.kpi.p .kpi-num { color: #7C3AED; }
.kpi.r .kpi-num { color: #DC2626; }

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
  line-height: 1.25;
}

.kpi-label small {
  font-size: 10px;
  font-weight: 400;
  color: #9CA3AF;
}

/* Dashboard Tabs */
.dash-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-medium);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 6px;
}

.tab-text-mobile {
  display: none;
}

.tab-text-full {
  display: inline;
}

.scroll-helper-badge {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-light);
  margin-top: 12px;
}

.pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.tab-btn {
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--primary-navy);
}

.tab-btn.active {
  color: var(--primary-navy);
  border-bottom-color: var(--primary-navy);
  font-weight: 700;
}

/* Generic Card in Dashboard */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4B5563;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* 6 Charts Grid */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 850px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-card .ct {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

.chart-badge {
  font-size: 10px;
  font-weight: 700;
  background: #EFF6FF;
  color: var(--primary-blue);
  padding: 3px 8px;
  border-radius: 10px;
}

.chart-canvas-wrap {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Heatmap */
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.heatmap-table-wrap {
  overflow-x: auto;
  font-size: 11px;
}

.heatmap-table-wrap table {
  border-collapse: collapse;
  min-width: 600px;
  width: 100%;
}

.heatmap-table-wrap th, .heatmap-table-wrap td {
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.heatmap-table-wrap th {
  background: #F3F4F6;
  font-weight: 600;
  font-size: 10.5px;
  white-space: nowrap;
}

.heatmap-table-wrap td.hg { background: #D1FAE5; color: #065F46; font-weight: 700; }
.heatmap-table-wrap td.ha { background: #FEF3C7; color: #92400E; font-weight: 700; }
.heatmap-table-wrap td.hr { background: #FEE2E2; color: #991B1B; font-weight: 700; }
.heatmap-table-wrap td.hn { background: #F9FAFB; color: #9CA3AF; }

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  background: #fff;
}

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

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

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl th {
  background: var(--primary-navy);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.tbl tr:hover td {
  background: #F0F7FF;
}

.score {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.score.hi { background: #D1FAE5; color: #065F46; }
.score.md { background: #FEF3C7; color: #92400E; }
.score.lo { background: #FEE2E2; color: #991B1B; }

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
}

.badge.r { background: #FEE2E2; color: #991B1B; }
.badge.g { background: #D1FAE5; color: #065F46; }

.action-btn-sm {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: var(--primary-blue);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn-sm:hover {
  background: var(--primary-blue);
  color: #fff;
}

/* =========================================================
   MODALS & OVERLAYS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card.small-modal {
  max-width: 420px;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: var(--primary-navy);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.modal-close-btn:hover {
  opacity: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13.5px;
}

.modal-footer {
  padding: 12px 20px;
  background: #F9FAFB;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  gap: 14px;
}

.spinner, .btn-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid #E5E7EB;
  border-top-color: var(--primary-navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border-width: 2.5px;
  border-top-color: #ffffff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-label {
  font-size: 13.5px;
  color: #4B5563;
  font-weight: 600;
}

.empty {
  text-align: center;
  padding: 48px;
  color: #9CA3AF;
}

.empty .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* =========================================================
   COMPREHENSIVE MOBILE RESPONSIVE DESIGN SYSTEM
   Optimized for smartphones (320px - 768px), touch tablets,
   and field inspection usability
   ========================================================= */

@media (max-width: 768px) {
  /* Prevent iOS automatic zoom on form input focus */
  select, input[type="text"], input[type="number"], textarea {
    font-size: 16px !important;
  }

  body {
    font-size: 13.5px;
  }

  .app-main {
    padding: 10px 8px 70px;
  }

  /* Header & Symmetrical 2-State Navigation */
  .header-inner {
    padding: 8px 10px;
    gap: 10px;
  }

  .hdr-branding {
    gap: 8px;
  }

  .tn-emblem {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .emblem-svg {
    width: 34px;
    height: 34px;
  }

  .hdr-titles .main-title {
    font-size: 14.5px;
    line-height: 1.25;
  }

  .hdr-titles .sub-title {
    font-size: 10px;
    line-height: 1.2;
  }

  .hdr-nav {
    width: 100%;
    display: flex;
    justify-content: stretch;
    gap: 6px;
    padding: 4px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .nav-btn {
    flex: 1 1 50%;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    white-space: nowrap;
  }

  .nav-btn .nav-text-mobile {
    display: inline !important;
  }

  .nav-btn .nav-text-full {
    display: none !important;
  }

  .header-export {
    display: none !important;
  }

  .logout-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .logout-text {
    display: none;
  }

  /* Form Container & Cards */
  .uto-wrap {
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .uto-card {
    padding: 16px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .uto-section-title {
    font-size: 12.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .contact-pill {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  /* Category Toggle & Module Cards */
  .uto-cat-toggle {
    margin-top: 6px;
  }

  .uto-cat-toggle label {
    padding: 11px 4px;
    font-size: 12.5px;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-top: 10px;
  }

  .mod-card {
    min-height: 74px;
    padding: 10px 6px;
    font-size: 11.5px;
    border-radius: 8px;
  }

  .mod-card .icon {
    font-size: 20px;
  }

  .mod-card .sub {
    font-size: 9.5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Question Items & Full-Width Thumb-Friendly Touch Targets */
  .uto-dim-block {
    padding: 12px 10px;
    margin-top: 12px;
    border-radius: 8px;
  }

  .uto-dim-block h3 {
    font-size: 12.5px;
    margin-bottom: 10px;
    gap: 6px;
  }

  .uto-q-item {
    padding: 12px 10px;
    margin-bottom: 10px;
    border-radius: 6px;
  }

  .uto-q-text {
    font-size: 13px;
    line-height: 1.45;
  }

  .uto-ans-row {
    width: 100% !important;
    display: flex !important;
    gap: 8px;
  }

  .uto-ans-opt {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 12px 6px !important;
    font-size: 13.5px;
    min-height: 44px;
    border-radius: 8px !important;
    text-align: center;
  }

  .uto-value-input {
    min-height: 44px;
    padding: 10px;
  }

  input[type="text"].uto-remark {
    min-height: 38px;
    padding: 8px 10px;
  }

  /* Urgent Toggle & Photo Upload */
  .urgent-toggle-row {
    padding: 12px 10px;
    gap: 10px;
  }

  .urgent-text strong {
    font-size: 12.5px;
  }

  .urgent-text .sub-hint {
    font-size: 10.5px;
  }

  .photo-dropzone {
    padding: 16px 10px;
  }

  .photo-dropzone .upload-icon {
    font-size: 28px;
  }

  .photo-dropzone .upload-title {
    font-size: 12.5px;
  }

  .photo-previews-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .uto-submit-btn {
    padding: 16px;
    font-size: 15px;
    border-radius: 8px;
    min-height: 50px;
  }

  /* Dashboard View on Mobile */
  .dash-container {
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .dash-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }

  .dash-page-title {
    font-size: 15px;
  }

  .dash-sub {
    font-size: 10.5px;
  }

  .dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .dash-actions .btn:nth-child(3) {
    grid-column: span 2;
  }

  .dash-actions .btn {
    justify-content: center;
    padding: 9px 8px;
    font-size: 11.5px;
  }

  /* 5 KPI Cards in Mobile: 2 Columns with 5th spanning full width */
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-bottom: 14px;
  }

  .kpi-strip .kpi:last-child {
    grid-column: span 2;
  }

  .kpi {
    padding: 12px 8px;
    border-radius: 8px;
  }

  .kpi-num {
    font-size: 26px;
  }

  .kpi-label {
    font-size: 10.5px;
    margin-top: 4px;
  }

  /* Horizontally Scrollable Dashboard Tabs with Pill Design */
  .dash-tabs {
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 14px !important;
    padding: 4px 2px 8px 2px !important;
    border-bottom: none !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .dash-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .tab-btn {
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
    background: #FFFFFF !important;
    color: #4B5563 !important;
    border: 1.5px solid #D1D5DB !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 0 !important;
  }

  .tab-btn.active {
    background: #114E72 !important;
    color: #FFFFFF !important;
    border-color: #114E72 !important;
    box-shadow: 0 2px 8px rgba(17, 78, 114, 0.3) !important;
  }

  .tab-text-mobile {
    display: inline !important;
  }

  .tab-text-full {
    display: none !important;
  }

  /* Charts */
  .chart-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin-bottom: 14px;
  }

  .chart-card {
    padding: 12px 10px;
    border-radius: 8px;
  }

  .chart-card .ct {
    font-size: 12px;
  }

  .chart-canvas-wrap {
    height: 240px;
  }

  .chart-canvas-wrap.tall-chart {
    height: 320px;
  }

  /* Heatmap with Frozen First Column */
  .heatmap-legend {
    gap: 8px;
    font-size: 10.5px;
    margin-bottom: 10px;
  }

  .heatmap-table-wrap {
    font-size: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }

  .heatmap-table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .heatmap-table-wrap th, .heatmap-table-wrap td {
    padding: 6px 7px;
  }

  .heatmap-table-wrap th:first-child,
  .heatmap-table-wrap td:first-child {
    position: sticky !important;
    left: 0 !important;
    background: #FFFFFF !important;
    z-index: 5 !important;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
  }

  .heatmap-table-wrap th:first-child {
    background: #F3F4F6 !important;
    z-index: 10 !important;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-bar select, .filter-bar input {
    width: 100% !important;
    min-height: 42px;
  }

  /* Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }

  .tbl {
    font-size: 11.5px;
  }

  .tbl th, .tbl td {
    padding: 8px 8px;
  }

  .pagination-bar {
    justify-content: center;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    order: -1;
  }

  .pagination-bar .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  /* Modals */
  .modal-overlay {
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-header h3 {
    font-size: 13.5px;
  }

  .modal-body {
    padding: 14px 10px;
  }

  .modal-footer {
    padding: 10px 12px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .hdr-titles .main-title {
    font-size: 13px;
  }

  .nav-btn {
    font-size: 11px;
    padding: 8px 4px;
  }

  .mod-card {
    min-height: 68px;
    font-size: 10.5px;
  }

  .uto-ans-opt {
    font-size: 12px;
    padding: 10px 4px !important;
  }
}

/* =========================================================
   COLLECTOR DASHBOARD DATE FILTER BAR
   ========================================================= */
.dash-date-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.date-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.date-filter-group input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dark);
  background: #fdfdfd;
}

.filter-status-tag {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================
   PRINT STYLES - SINGLE PAGE ACKNOWLEDGMENT RECEIPT
   ========================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt !important;
  }

  /* Hide everything except the modal */
  body > *:not(#detail-modal) {
    display: none !important;
  }

  #detail-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #detail-modal .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: 1.5px solid #222 !important;
    border-radius: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    page-break-inside: avoid !important;
  }

  #detail-modal .modal-header {
    background: #114E72 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    padding: 10px 16px !important;
  }

  #detail-modal .modal-header h3 {
    font-size: 14pt !important;
    color: #fff !important;
  }

  #detail-modal .modal-close-btn,
  #detail-modal .modal-footer {
    display: none !important;
  }

  #detail-modal .modal-body {
    padding: 16px !important;
  }

  #detail-modal table.tbl {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10.5pt !important;
  }

  #detail-modal table.tbl td {
    padding: 7px 10px !important;
    border: 1px solid #ddd !important;
  }

  #detail-modal .score,
  #detail-modal .badge {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* =========================================================
   ENTERPRISE USER MANAGEMENT & ATR STYLES
   ========================================================= */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.user-profile-badge .role-pill {
  background: #f39c12;
  color: #111827;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.enterprise-banner {
  background: linear-gradient(135deg, #114E72 0%, #1A6B9A 100%);
  color: #fff;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.enterprise-banner h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}

.enterprise-banner p {
  font-size: 12.5px;
  color: #E0E7FF;
  margin: 0;
}

/* User & Ticket KPI Strips */
.ent-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ent-kpi-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.ent-kpi-card.urgent-border {
  border-left: 4px solid #DC2626;
}

.ent-kpi-card.success-border {
  border-left: 4px solid #16A34A;
}

.ent-kpi-card.info-border {
  border-left: 4px solid #2563EB;
}

.ent-kpi-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1.1;
}

.ent-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #6B7280;
  margin-top: 4px;
}

/* Filter Toolbar */
.ent-toolbar {
  background: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.ent-search-input {
  flex: 1 1 240px;
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.ent-select {
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
}

/* User Role Badges */
.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.role-badge.super_admin, .role-badge.role-super { background: #F3E8FF; color: #6B21A8; border: 1px solid #D8B4FE; }
.role-badge.taluk_nodal, .role-badge.role-taluk { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.role-badge.department_nodal, .role-badge.role-dept { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.role-badge.field_officer, .role-badge.role-field { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.status-badge.sb-act { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.status-badge.sb-inact { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }

/* Ticket Status Badges */
.tkt-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.tkt-status.OPEN { background: #FEE2E2; color: #991B1B; }
.tkt-status.IN_PROGRESS { background: #FEF3C7; color: #92400E; }
.tkt-status.RESOLVED { background: #DCFCE7; color: #166534; }
.tkt-status.CLOSED { background: #F3F4F6; color: #4B5563; }

.tkt-severity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
}
.tkt-severity.URGENT { background: #EF4444; color: #fff; }
.tkt-severity.NORMAL { background: #E5E7EB; color: #374151; }

/* Ticket Card */
.tkt-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tkt-card:hover {
  box-shadow: var(--shadow-md);
}

.tkt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.tkt-site-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-navy);
}

.tkt-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.tkt-meta-strip {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  color: #6B7280;
  flex-wrap: wrap;
}

.tkt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #F9FAFB;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 4px;
}


/* =========================================================
   INDUSTRY STANDARD UI ENHANCEMENTS & EXCEL HUB STYLES
   ========================================================= */

/* Subheader Breadcrumb & Live Status Bar */
.breadcrumb-bar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 62px;
  z-index: 90;
}

.breadcrumb-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.bc-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748B;
  font-weight: 500;
}

.bc-home {
  color: #1E293B;
  font-weight: 700;
}

.bc-sep {
  color: #CBD5E1;
}

.bc-active {
  color: var(--primary-navy);
  font-weight: 700;
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

.bc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-clock {
  color: #64748B;
  font-size: 11.5px;
  font-weight: 600;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.network-badge.online {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.network-badge.offline {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Modernized Header Navigation Pills */
.hdr-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.22);
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-btn {
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.nav-btn.active {
  background: #FFFFFF !important;
  color: #114E72 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22) !important;
}

.nav-btn.active span,
.nav-btn.active .nav-text-full,
.nav-btn.active .nav-text-mobile {
  color: #114E72 !important;
  font-weight: 800 !important;
}

.nav-btn.active small {
  color: #1A6B9A !important;
  font-weight: 700 !important;
}

.nav-btn.data-hub-btn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #D1FAE5;
}

.nav-btn.data-hub-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #FFFFFF;
}

.nav-btn.data-hub-btn.active {
  background: #10B981 !important;
  color: #FFFFFF !important;
  border-color: #10B981 !important;
}

/* TOP PROGRESS BAR (INDUSTRY STANDARD) */
.top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #10B981, #F59E0B);
  z-index: 99999;
  transition: width 0.25s ease, opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.top-progress-bar.loading {
  display: block !important;
  width: 70%;
  animation: indeterminateBar 1.5s infinite linear;
}

.top-progress-bar.done {
  width: 100%;
  opacity: 0;
}

@keyframes indeterminateBar {
  0% { left: 0; width: 0%; }
  50% { left: 25%; width: 65%; }
  100% { left: 100%; width: 0%; }
}

/* SLEEK BUTTON SPINNER */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.btn-secondary .btn-spinner {
  border: 2px solid rgba(17, 78, 114, 0.25);
  border-top-color: #114E72;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Modernized Section Cards */
.uto-card {
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.uto-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.uto-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--primary-navy);
  border-bottom: 2px solid #F1F5F9;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.uto-section-title .num {
  background: var(--primary-navy);
  color: #FFFFFF;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* Polished Yes / No Answer Buttons */
.uto-ans-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 8px;
}

.uto-ans-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid #D1D5DB;
  background: #FFFFFF;
  color: #374151;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.uto-ans-opt:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
}

.uto-ans-opt.uto-yes.uto-checked {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3) !important;
}

.uto-ans-opt.uto-no.uto-checked {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
}

/* =========================================================
   EXCEL & DATA MANAGEMENT HUB MODAL
   ========================================================= */
.excel-hub-card {
  max-width: 820px;
  width: 95%;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.eh-header {
  background: linear-gradient(135deg, #0B334D 0%, #114E72 100%);
  color: #FFFFFF;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.eh-title-wrap h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eh-title-wrap p {
  font-size: 12px;
  color: #E2E8F0;
  margin: 0;
  line-height: 1.4;
}

.eh-tab-strip {
  display: flex;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 6px 20px 0;
  gap: 8px;
}

.eh-tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.eh-tab-btn:hover {
  color: var(--primary-navy);
}

.eh-tab-btn.active {
  color: var(--primary-navy);
  border-bottom-color: var(--primary-navy);
  background: #FFFFFF;
  border-radius: 8px 8px 0 0;
}

.eh-body {
  padding: 24px;
  max-height: calc(85vh - 160px);
  overflow-y: auto;
}

/* Export Option Cards */
.eh-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.eh-option-card {
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.eh-option-card:hover {
  border-color: #0284C7;
  background: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.eh-option-card.selected {
  border-color: #059669;
  background: #F0FDF4;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.eh-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  background: #E2E8F0;
  color: #475569;
}

.eh-option-card.selected .eh-card-badge {
  background: #059669;
  color: #FFFFFF;
}

.eh-card-icon {
  font-size: 28px;
  margin-bottom: 2px;
}

.eh-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #1E293B;
  margin: 0;
}

.eh-card-desc {
  font-size: 12px;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

/* Filter Controls Box */
.eh-filter-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.eh-filter-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eh-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

/* Import Step Wizard */
.eh-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: #F1F5F9;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
}

.eh-step.active {
  color: var(--primary-navy);
}

.eh-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #CBD5E1;
  color: #1E293B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-right: 6px;
}

.eh-step.active .eh-step-num {
  background: var(--primary-navy);
  color: #FFFFFF;
}

/* Enhanced Import Dropzone */
.eh-dropzone {
  border: 2px dashed #94A3B8;
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 18px;
}

.eh-dropzone:hover, .eh-dropzone.dragover {
  border-color: #0284C7;
  background: #EFF6FF;
  transform: scale(1.01);
}

.eh-dropzone-icon {
  font-size: 44px;
  margin-bottom: 10px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.eh-dropzone-title {
  font-size: 15px;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 4px;
}

.eh-dropzone-subtitle {
  font-size: 12px;
  color: #64748B;
}

.eh-format-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.eh-format-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #E2E8F0;
  color: #475569;
}

/* Footer Action Bar */
.eh-footer {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .breadcrumb-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .bc-actions {
    width: 100%;
    justify-content: space-between;
  }
  .eh-option-grid {
    grid-template-columns: 1fr;
  }
}
