/* QuantumEdge Solar Field Survey - Modern CSS Design System */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --bg-dark: #090d16;
  --bg-card: #131b2e;
  --bg-light: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 25px rgba(37,99,235,0.15);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f1f5f9;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Top Bar */
.navbar {
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Super Admin - Dark Blue Navbar */
.navbar.role-super_admin {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #1d4ed8 100%);
  box-shadow: 0 2px 16px rgba(30,58,138,0.45);
}
.navbar.role-super_admin .brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-pill {
  background: rgba(255,255,255,0.12);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}
.user-pill > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.role-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.role-super_admin { background: #8b5cf6; color: #fff; }
.role-district_coordinator { background: #3b82f6; color: #fff; }
.role-block_coordinator { background: #10b981; color: #fff; }
.role-field_executive { background: #f59e0b; color: #fff; }

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: #334155;
}

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

.btn-success {
  background: var(--accent-green);
  color: #fff;
}

.btn-warning {
  background: var(--accent);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

/* App Container */
.main-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  flex: 1;
}

/* Professional & Animated Login Card */
.login-wrapper {
  max-width: 440px;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 38px 32px 32px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #6366f1, #3b82f6, #10b981);
}

.login-card-animated {
  animation: loginCardSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e40af, #6366f1);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
  animation: pulseBrand 3s ease-in-out infinite;
}

@keyframes pulseBrand {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); }
  50% { transform: scale(1.05); box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5); }
}

.login-header h2 {
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-header p {
  color: #64748b;
  font-size: 0.83rem;
}

.login-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  border-bottom: none;
}

.tab-btn {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.83rem;
  color: #64748b;
  cursor: pointer;
  border-radius: 9px;
  border: none;
  margin-bottom: 0;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: #1e293b;
}

.tab-btn.active {
  color: #1e40af;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-form-animated {
  animation: fadeInForm 0.35s ease forwards;
}

@keyframes fadeInForm {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Input Fields with Left Icons & Password Eye Toggle */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}

.input-with-icon .form-control {
  padding-left: 38px;
}

.pass-wrapper .form-control {
  padding-right: 44px;
}

.pass-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: #64748b;
  border-radius: 6px;
  transition: all 0.2s ease;
  z-index: 3;
}

.pass-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  transform: scale(1.1);
}

/* Animated Submit Button */
.btn-animated {
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-animated:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.42);
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.btn-animated:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.demo-login-box {
  margin-top: 25px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 15px;
  border-radius: var(--radius-md);
  text-align: center;
}

.demo-login-box h4 {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: #fff;
  padding: 18px 16px 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}

.stat-card.accent-green::before  { background: var(--accent-green); }
.stat-card.accent-amber::before   { background: var(--accent); }
.stat-card.accent-purple::before  { background: var(--accent-purple); }
.stat-card.accent-red::before     { background: var(--accent-red); }

.stat-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.stat-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 5px;
}

/* ── Clickable Stat Cards (Super Admin) ── */
.sa-stat-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
}
.sa-stat-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #93c5fd;
}
.sa-stat-clickable:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.sa-stat-clickable.stat-card-active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25), 0 4px 16px rgba(0,0,0,0.1);
}

/* Icon floating top-right */
.stat-card-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.3rem;
  opacity: 0.25;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sa-stat-clickable:hover .stat-card-icon {
  opacity: 0.55;
  transform: scale(1.15);
}

/* Arrow indicator bottom-right */
.stat-card-arrow {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.85rem;
  color: #94a3b8;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sa-stat-clickable:hover .stat-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Executive Target Ring Card */
.target-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.target-info h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.target-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}

.target-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Section Cards & Form Containers */
.card-section {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Offline Sync Status Badge */
.offline-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #fde68a;
}

.online-banner {
  background: #d1fae5;
  color: #065f46;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #a7f3d0;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* Status Badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.status-Draft { background: #e2e8f0; color: #475569; }
.status-Submitted { background: #dbeafe; color: #1e40af; }
.status-Under Verification { background: #fef3c7; color: #92400e; }
.status-Correction Required { background: #ffedd5; color: #c2410c; }
.status-Verified { background: #e0e7ff; color: #3730a3; }
.status-Approved { background: #d1fae5; color: #065f46; }
.status-Rejected { background: #fee2e2; color: #991b1b; }

/* Signature & Camera Canvas Boxes */
.signature-box, .camera-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 10px;
  text-align: center;
  position: relative;
}

canvas.sig-canvas {
  width: 100%;
  height: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: crosshair;
}

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

.photo-preview-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: 100px;
}

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

.photo-watermark-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.6rem;
  padding: 3px;
  text-align: center;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  animation: modalSlide 0.25s ease-out;
}

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

/* Mobile Friendly Navigation Bar for Field Executive */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0f172a;
  color: #94a3b8;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  z-index: 100;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
  cursor: pointer;
  gap: 4px;
}

.mobile-nav-item.active {
  color: #3b82f6;
  font-weight: bold;
}



/* ===================================================================
   SUPER ADMIN – Complete Design System
   Desktop : single-line table row with inline action buttons
   Mobile  : CSS card transformation (tr → card, td → labeled row)
   =================================================================== */

/* ── Sub-Tab Navigation ── */
.sa-tab-btn {
  padding: 11px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 0.88rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.sa-tab-btn:hover          { color: #1e3a8a; background: #eff6ff; }
.sa-tab-btn.sa-tab-active  { color: #1e3a8a; border-bottom-color: #1e3a8a; background: #eff6ff; }

/* ── Filter Bar ── */
.sa-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Table Cell Base ── */
.sa-survey-row td {
  vertical-align: middle;
  padding: 10px 12px;
  font-size: 0.83rem;
}
.sa-survey-row:hover { background: #f8fafc; }

/* Survey ID */
.sa-survey-id   { display: block; font-weight: 700; font-size: 0.8rem; color: #1e3a8a; }
.sa-survey-date { display: block; font-size: 0.71rem; color: #94a3b8; margin-top: 2px; }

/* Customer */
.sa-customer-name   { display: block; font-weight: 600; color: #0f172a; }
.sa-customer-mobile { display: block; font-size: 0.75rem; color: #64748b; margin-top: 2px; }

/* Executive */
.sa-exec-name { display: block; font-weight: 500; color: #0f172a; }
.sa-exec-id   { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }

/* Location */
.sa-district { display: block; font-weight: 500; color: #0f172a; }
.sa-block    { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }

/* Status */
.sa-td-status { white-space: nowrap; }

/* ── INLINE ACTIONS (Desktop single line) ── */
.sa-td-actions   { white-space: nowrap; }
.sa-inline-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

/* thin vertical divider between primary & secondary actions */
.sa-act-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── SA Action Button Base ── */
.sa-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.5;
  flex-shrink: 0;
}
.sa-act-btn:hover        { opacity: 0.88; transform: translateY(-1px); }
.sa-act-btn[disabled]    { cursor: default; opacity: 0.65; transform: none; }

/* Approve */
.sa-act-approve          { background: #10b981; color: #fff; }
.sa-act-approve:hover    { background: #059669; opacity: 1; }
/* Already approved */
.sa-act-approved         { background: #d1fae5; color: #065f46; }

/* Reject */
.sa-act-reject           { background: #ef4444; color: #fff; }
.sa-act-reject:hover     { background: #dc2626; opacity: 1; }
/* Already rejected */
.sa-act-rejected         { background: #fee2e2; color: #991b1b; }

/* View */
.sa-act-view             { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.sa-act-view:hover       { background: #dbeafe; opacity: 1; }

/* PDF */
.sa-act-pdf              { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.sa-act-pdf:hover        { background: #e2e8f0; opacity: 1; }

/* Delete */
.sa-act-del              { background: #fff1f2; color: #ef4444; border: 1px solid #fecaca; }
.sa-act-del:hover        { background: #fee2e2; opacity: 1; }

/* ── Status Badges ── */
.status-badge.status-active              { background: #d1fae5; color: #065f46; }
.status-badge.status-suspended           { background: #fee2e2; color: #991b1b; }
.status-badge.status-Approved            { background: #d1fae5; color: #065f46; }
.status-badge.status-Rejected            { background: #fee2e2; color: #991b1b; }
.status-badge.status-Submitted           { background: #dbeafe; color: #1e40af; }
.status-badge.status-Verified            { background: #ede9fe; color: #6d28d9; }
.status-badge.status-Draft               { background: #f1f5f9; color: #475569; }
.status-badge.status-CorrectionRequired  { background: #fef3c7; color: #92400e; }

/* backward compat */
.action-group           { display: flex; gap: 5px; flex-wrap: wrap; }
.action-group .btn      { padding: 5px 9px; font-size: 0.75rem; border-radius: 5px; white-space: nowrap; }

/* =================================================================
   RESPONSIVE — 768px and below
   Full Super Admin mobile redesign
   ================================================================= */
@media (max-width: 768px) {

  /* ── Layout ── */
  .main-layout  { padding: 10px; margin-bottom: 20px; }
  .mobile-nav   { display: flex; }
  .hide-mobile  { display: none !important; }

  /* ── Navbar mobile ── */
  .navbar { padding: 9px 12px; gap: 8px; }
  .brand  { font-size: 0.95rem; }
  .brand span:first-child { font-size: 0.95rem; }
  .brand-badge { display: none; }   /* hide "Solar Field Survey" tag on tiny screens */

  /* Hide Check-In attendance btn for non-field-executive roles on mobile */
  .navbar.role-super_admin #attendanceBtn,
  .navbar.role-district_coordinator #attendanceBtn,
  .navbar.role-block_coordinator #attendanceBtn { display: none !important; }

  /* Compact user pill on mobile */
  .user-pill { padding: 4px 10px; font-size: 0.78rem; gap: 5px; }
  .user-pill > span:first-child { max-width: 80px; }
  .user-pill .btn { padding: 4px 8px; font-size: 0.72rem; }

  /* ── Network banner ── */
  #networkBanner { margin: 0 !important; border-radius: 0 !important; font-size: 0.8rem; padding: 6px 12px; }

  /* ── Stats grid — 2 balanced columns ── */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card { padding: 14px 12px 12px 14px; }
  .stat-value { font-size: 1.55rem; }
  .stat-title { font-size: 0.68rem; }
  .stat-desc  { font-size: 0.68rem; }

  /* ── Card sections ── */
  .card-section { padding: 12px !important; margin-bottom: 12px; }
  .card-title   { flex-direction: column; align-items: flex-start !important; gap: 8px; }
  .card-title .btn { width: 100%; justify-content: center; }

  /* ── SA Sub-tab navigation — horizontal scroll ── */
  #superAdminPanel > div:first-child {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 14px;
  }
  #superAdminPanel > div:first-child::-webkit-scrollbar { display: none; }
  .sa-tab-btn { padding: 10px 16px; font-size: 0.82rem; white-space: nowrap; }

  /* ── SA Filter bar — single column ── */
  .sa-filter-bar {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px;
    margin-bottom: 12px;
  }

  /* ── SA Survey Table → Cards ── */
  .sa-survey-table { border: none; }
  .sa-survey-table thead { display: none; }
  .sa-survey-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .sa-survey-table tbody tr:hover { background: #fafafa; }
  .sa-survey-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border: none !important;
    font-size: 0.82rem;
  }
  .sa-survey-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 75px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .sa-td-actions {
    border-top: 1px solid #f1f5f9 !important;
    margin-top: 8px;
    padding-top: 10px !important;
  }
  .sa-td-actions::before { display: none; }
  .sa-inline-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .sa-act-btn { padding: 7px 10px; font-size: 0.75rem; flex: 1 1 calc(50% - 6px); justify-content: center; }
  .sa-act-divider { display: none; }

  /* ── SA User Management Table → Cards ── */
  .sa-users-table { border: none !important; }
  .sa-users-table thead { display: none; }
  .sa-users-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  .sa-users-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border: none !important;
    font-size: 0.82rem;
  }
  .sa-users-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 75px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  /* Actions cell in user table */
  .sa-users-table td[data-label="Actions"] {
    border-top: 1px solid #f1f5f9 !important;
    margin-top: 8px;
    padding-top: 10px !important;
    flex-direction: column;
  }
  .sa-users-table td[data-label="Actions"]::before { display: none; }
  .sa-users-table .action-group { width: 100%; gap: 6px; }
  .sa-users-table .action-group .btn,
  .sa-users-table .action-group button { flex: 1 1 calc(50% - 6px); justify-content: center; font-size: 0.75rem; }

  /* ── Survey Form Modal — mobile fixes ── */
  #surveyFormModal .modal-content {
    padding: 16px !important;
    border-radius: 16px !important;
  }
  #surveyFormModal .form-grid {
    grid-template-columns: 1fr !important;
  }
  #surveyFormModal .form-grid > [style*="grid-column"] {
    grid-column: 1 !important;
  }
  #surveyFormModal .signature-box canvas {
    width: 100% !important;
    height: 110px !important;
  }
}

/* =================================================================
   RESPONSIVE — 480px and below (very small phones)
   ================================================================= */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 1.4rem; }
  .sa-act-btn { flex: 1 1 100%; }
  .sa-tab-btn { padding: 8px 12px; font-size: 0.78rem; }
  .user-pill > span:first-child { max-width: 60px; }
}

/* =================================================================
   ATTENDANCE MANAGEMENT — Super Admin Portal
   ================================================================= */

/* Summary cards grid */
.att-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.att-sum-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.att-sum-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.att-sum-icon { font-size: 1.5rem; margin-bottom: 6px; }
.att-sum-val  { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.att-sum-label{ font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; margin-top: 4px; }

/* Card accent colours */
.att-present::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#10b981; }
.att-late::before    { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#f59e0b; }
.att-halfday::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#3b82f6; }
.att-absent::before  { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#ef4444; }
.att-leave::before   { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#8b5cf6; }
.att-total::before   { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:#1e40af; }

.att-present .att-sum-val { color: #059669; }
.att-late    .att-sum-val { color: #d97706; }
.att-halfday .att-sum-val { color: #2563eb; }
.att-absent  .att-sum-val { color: #dc2626; }
.att-leave   .att-sum-val { color: #7c3aed; }
.att-total   .att-sum-val { color: #1e40af; }

/* Live attendance table */
.att-live-table th,
.att-leave-table th { background: #f8fafc; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Status badge overrides for attendance */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* =================================================================
   ATTENDANCE — Mobile Responsive
   ================================================================= */
@media (max-width: 900px) {
  .att-summary-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .att-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .att-sum-val { font-size: 1.5rem; }

  .att-live-table thead,
  .att-leave-table thead { display: none; }

  .att-live-table tbody tr,
  .att-leave-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .att-live-table tbody td,
  .att-leave-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border: none !important;
    font-size: 0.82rem;
  }
  .att-live-table tbody td::before,
  .att-leave-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 75px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .att-live-table td[data-label="Actions"] { flex-direction: column; border-top: 1px solid #f1f5f9 !important; margin-top: 8px; padding-top: 10px !important; }
  .att-live-table td[data-label="Actions"]::before { display: none; }
}

/* =================================================================
   DISTRICT COORDINATOR PANEL STYLES
   ================================================================= */

/* Suspend badge on SA tab button */
.suspend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* DC user table mobile */
@media (max-width: 700px) {
  .dc-user-table thead { display: none; }
  .dc-user-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .dc-user-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border: none !important;
    font-size: 0.82rem;
  }
  .dc-user-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 70px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .dc-user-table td[data-label="Actions"] { flex-direction: column; border-top: 1px solid #f1f5f9 !important; margin-top: 8px; padding-top: 10px !important; }
  .dc-user-table td[data-label="Actions"]::before { display: none; }
}

/* Create user form card */
#dcCreateUserPanel { transition: all 0.2s ease; }
#dcCreateUserPanel .form-label { font-size: 0.78rem; font-weight: 700; color: #475569; margin-bottom: 4px; display: block; }

/* Live map controls */
#dcLeafletMap .leaflet-popup-content-wrapper { font-family: Inter, sans-serif; border-radius: 10px; }

/* =================================================================
   BLOCK COORDINATOR MOBILE & BEAUTIFUL DESIGN UPGRADES
   ================================================================= */

/* ── BC Sub-Tab Navigation Bar ── */
.bc-tab-nav {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bc-tab-nav::-webkit-scrollbar { display: none; }

.bc-tab-nav .sa-tab-btn {
  border: none !important;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.bc-tab-nav .sa-tab-btn:hover {
  color: #0f172a;
  background: rgba(255,255,255,0.6);
}
.bc-tab-nav .sa-tab-btn.sa-tab-active {
  color: #2563eb;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12), 0 1px 3px rgba(0,0,0,0.06);
}

/* ── BC Add Field Executive Inline Panel ── */
#bcCreateUserPanel {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1 !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 18px !important;
  animation: fadeInDown 0.25s ease-out;
}

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

/* ── Mobile responsiveness for BC Panel (<768px) ── */
@media (max-width: 768px) {
  #blockCoordPanel {
    padding: 2px 0;
  }

  .bc-tab-nav {
    padding: 4px;
    margin-bottom: 14px;
  }
  .bc-tab-nav .sa-tab-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  /* Filter bar single column on mobile */
  #blockCoordPanel .sa-filter-bar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  /* ── BC Verification Queue Table → Mobile Cards ── */
  .bc-survey-table { border: none !important; }
  .bc-survey-table thead { display: none; }
  .bc-survey-table tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .bc-survey-table tbody tr:active {
    transform: scale(0.99);
  }
  .bc-survey-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border: none !important;
    font-size: 0.84rem;
  }
  .bc-survey-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 90px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .bc-survey-table td[data-label="Verification Actions"] {
    border-top: 1px dashed #e2e8f0 !important;
    margin-top: 8px;
    padding-top: 12px !important;
    flex-direction: column;
  }
  .bc-survey-table td[data-label="Verification Actions"]::before { display: none; }
  .bc-survey-table td[data-label="Verification Actions"] .action-group {
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
  }
  .bc-survey-table td[data-label="Verification Actions"] .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    font-size: 0.78rem;
    padding: 8px 10px;
    border-radius: 8px;
  }

  /* ── BC Field Executive Table → Mobile Cards ── */
  .bc-users-table { border: none !important; }
  .bc-users-table thead { display: none; }
  .bc-users-table tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .bc-users-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border: none !important;
    font-size: 0.84rem;
  }
  .bc-users-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 90px;
    flex-shrink: 0;
    padding-top: 2px;
  }
  .bc-users-table td[data-label="Actions"] {
    border-top: 1px dashed #e2e8f0 !important;
    margin-top: 8px;
    padding-top: 12px !important;
    flex-direction: column;
  }
  .bc-users-table td[data-label="Actions"]::before { display: none; }
  .bc-users-table td[data-label="Actions"] .action-group {
    width: 100%;
  }
  .bc-users-table td[data-label="Actions"] .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.78rem;
    padding: 8px 10px;
    border-radius: 8px;
  }
}

/* ════════════════════════════════════════════════
   TARGET SYSTEM STYLES
   ════════════════════════════════════════════════ */

/* Period Tab Buttons (Day / Week / Month) */
.target-period-tab {
  flex: 1;
  padding: 7px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.target-period-tab:hover { background: rgba(255,255,255,0.7); }
.target-period-tab.target-period-active {
  background: #fff;
  color: #1e40af;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* Mini stat cards in FE target row */
.mini-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 12px;
  border-radius: 8px;
  gap: 2px;
  min-width: 90px;
  white-space: nowrap;
}

/* Responsive FE target card */
@media (max-width: 600px) {
  .target-card {
    padding: 14px;
  }
  .mini-stat-card { min-width: 70px; padding: 5px 8px; }
  #feRingCircle, svg[viewBox='0 0 36 36'] { width: 70px; height: 70px; }
}

/* =================================================================
   PREMIUM PROFESSIONAL DESIGN SYSTEM — GLOBAL UPGRADE
   Covers: Super Admin → District Coord → Block Coord → Field Exec
   ================================================================= */

/* ── Import Google Font (Inter) ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Body / Page Background ── */
body {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 50%, #f0fdf4 100%);
  background-attachment: fixed;
}

/* ══════════════════════════════════════
   NAVBAR — Premium Glassmorphism
   ══════════════════════════════════════ */
.navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.05) inset !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}

.navbar.role-super_admin {
  background: linear-gradient(135deg, #1e1b4b 0%, #1e3a8a 50%, #1d4ed8 100%) !important;
  box-shadow: 0 4px 24px rgba(30,58,138,0.5) !important;
}
.navbar.role-district_coordinator {
  background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0ea5e9 100%) !important;
  box-shadow: 0 4px 24px rgba(3,105,161,0.45) !important;
}
.navbar.role-block_coordinator {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%) !important;
  box-shadow: 0 4px 24px rgba(6,95,70,0.45) !important;
}
.navbar.role-field_executive {
  background: linear-gradient(135deg, #78350f 0%, #92400e 50%, #f59e0b 100%) !important;
  box-shadow: 0 4px 24px rgba(120,53,15,0.45) !important;
}

.brand {
  letter-spacing: -0.03em;
  font-size: 1.1rem !important;
}

/* ══════════════════════════════════════
   STAT CARDS — Premium Glow & Gradient
   ══════════════════════════════════════ */
.stat-card {
  background: #fff !important;
  border: 1px solid rgba(226,232,240,0.7) !important;
  border-radius: 16px !important;
  padding: 20px 18px 16px 22px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04) !important;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), box-shadow 0.22s ease !important;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}
.stat-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12) !important;
}
.stat-card::before {
  width: 5px !important;
  border-radius: 0 0 0 16px !important;
}
.stat-value {
  font-size: 2.1rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #0f172a, #1e40af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card.accent-green .stat-value  { background: linear-gradient(135deg,#065f46,#10b981); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.stat-card.accent-amber .stat-value  { background: linear-gradient(135deg,#92400e,#f59e0b); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.stat-card.accent-purple .stat-value { background: linear-gradient(135deg,#4c1d95,#8b5cf6); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.stat-card.accent-red .stat-value    { background: linear-gradient(135deg,#7f1d1d,#ef4444); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }

/* ══════════════════════════════════════
   CARD SECTIONS — Premium Elevated
   ══════════════════════════════════════ */
.card-section {
  background: #fff !important;
  border-radius: 18px !important;
  border: 1px solid rgba(226,232,240,0.8) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04) !important;
  padding: 28px !important;
}
.card-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #0f172a !important;
  padding-bottom: 14px !important;
  border-bottom: 2px solid #f1f5f9 !important;
  margin-bottom: 22px !important;
}

/* ══════════════════════════════════════
   BUTTONS — Premium Shimmer & Depth
   ══════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35) !important;
  transition: all 0.22s cubic-bezier(0.16,1,0.3,1) !important;
  border-radius: 10px !important;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37,99,235,0.45) !important;
  background: linear-gradient(135deg, #1d4ed8, #4338ca) !important;
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 3px 10px rgba(16,185,129,0.3) !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,185,129,0.4) !important; }
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  box-shadow: 0 3px 10px rgba(239,68,68,0.3) !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(239,68,68,0.4) !important; }
.btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
  box-shadow: 0 3px 10px rgba(245,158,11,0.3) !important;
  border-radius: 10px !important;
}
.btn-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}
.btn-secondary:hover { background: #e2e8f0 !important; transform: translateY(-1px); }

/* SA action buttons enhanced */
.sa-act-btn {
  border-radius: 8px !important;
  font-size: 0.74rem !important;
  padding: 5px 11px !important;
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1) !important;
  font-weight: 700 !important;
}
.sa-act-approve { background: linear-gradient(135deg,#059669,#10b981) !important; box-shadow: 0 2px 8px rgba(16,185,129,0.25) !important; }
.sa-act-reject  { background: linear-gradient(135deg,#dc2626,#ef4444) !important; box-shadow: 0 2px 8px rgba(239,68,68,0.25) !important; }
.sa-act-view    { background: linear-gradient(135deg,#eff6ff,#dbeafe) !important; color: #1e40af !important; border: 1px solid #bfdbfe !important; }
.sa-act-pdf     { background: linear-gradient(135deg,#f8fafc,#f1f5f9) !important; color: #475569 !important; border: 1px solid #e2e8f0 !important; }
.sa-act-del     { background: linear-gradient(135deg,#fff1f2,#fee2e2) !important; color: #dc2626 !important; border: 1px solid #fecaca !important; }
.sa-act-btn:hover { transform: translateY(-2px) scale(1.03) !important; opacity: 1 !important; }

/* ══════════════════════════════════════
   TABLES — Premium Striped & Animated
   ══════════════════════════════════════ */
.data-table th, .sa-survey-table th, .sa-users-table th,
.bc-survey-table th, .bc-users-table th, .att-live-table th,
.dc-user-table th {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
  font-size: 0.73rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  color: #374151 !important;
  padding: 13px 14px !important;
  border-bottom: 2px solid #e2e8f0 !important;
}
.data-table tbody tr, .sa-survey-row, .sa-users-table tbody tr,
.bc-survey-table tbody tr, .bc-users-table tbody tr,
.att-live-table tbody tr, .dc-user-table tbody tr {
  transition: background 0.15s ease, transform 0.15s ease !important;
}
.data-table tbody tr:hover, .sa-survey-table tbody tr:hover,
.sa-users-table tbody tr:hover, .bc-survey-table tbody tr:hover,
.bc-users-table tbody tr:hover, .att-live-table tbody tr:hover,
.dc-user-table tbody tr:hover {
  background: linear-gradient(135deg, #f0f9ff, #f8faff) !important;
}
.data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* ══════════════════════════════════════
   TABS — Premium Pill Style
   ══════════════════════════════════════ */
.sa-tab-btn {
  border-radius: 10px !important;
  border-bottom: 3px solid transparent !important;
  font-weight: 700 !important;
  font-size: 0.87rem !important;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1) !important;
  padding: 10px 20px !important;
}
.sa-tab-btn:hover {
  background: linear-gradient(135deg,#eff6ff,#dbeafe) !important;
  color: #1e40af !important;
}
.sa-tab-btn.sa-tab-active {
  background: linear-gradient(135deg,#eff6ff,#dbeafe) !important;
  color: #1e40af !important;
  border-bottom-color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12) !important;
}

/* ══════════════════════════════════════
   STATUS BADGES — Premium Pill
   ══════════════════════════════════════ */
.status-badge {
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.02em !important;
  padding: 4px 12px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

/* ══════════════════════════════════════
   FORM INPUTS — Premium Focus Ring
   ══════════════════════════════════════ */
.form-control, select.form-control {
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #fafbfc !important;
  font-size: 0.93rem !important;
  transition: all 0.2s ease !important;
  padding: 11px 14px !important;
}
.form-control:focus, select.form-control:focus {
  border-color: #2563eb !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1) !important;
}

/* ══════════════════════════════════════
   SA FILTER BAR — Clean Card
   ══════════════════════════════════════ */
.sa-filter-bar {
  background: linear-gradient(135deg,#f8fafc,#f1f5f9) !important;
  border-radius: 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
.sa-filter-bar .form-control {
  border-radius: 8px !important;
  font-size: 0.83rem !important;
}

/* ══════════════════════════════════════
   MODAL — Premium Redesign
   ══════════════════════════════════════ */
.modal-content {
  background: #fff !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25), 0 10px 30px rgba(0,0,0,0.12) !important;
  border: 1px solid rgba(226,232,240,0.7) !important;
  /* NOTE: padding and overflow are set per-modal below */
}

/* Survey Details Modal — padded by .sd-header internally, clip outer overflow */
#surveyDetailsModal .modal-content {
  padding: 0 !important;
  overflow: hidden !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
}

/* Survey Form Modal — needs scrollable content with proper padding */
#surveyFormModal .modal-content {
  padding: 28px !important;
  overflow-y: auto !important;
  max-height: 92vh !important;
}

/* Other generic modals (create user, etc.) */
#saCreateUserModal .modal-content,
#setTargetModal .modal-content {
  padding: 24px !important;
  overflow-y: auto !important;
  max-height: 92vh !important;
}

.modal-backdrop {
  background: rgba(10, 15, 30, 0.7) !important;
  backdrop-filter: blur(8px) !important;
}
@keyframes modalSlide {
  from { transform: translateY(30px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ══════════════════════════════════════
   SURVEY DETAILS MODAL — Premium Layout
   ══════════════════════════════════════ */
.sd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(135deg, #1e1b4b, #1e3a8a, #1d4ed8);
  padding: 24px 28px;
  color: #fff;
}
.sd-survey-id {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: #fff;
}
.sd-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sd-by, .sd-date {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: 999px;
}
.sd-qr-wrap {
  text-align: center;
  flex-shrink: 0;
}
.sd-qr {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  border: 3px solid rgba(255,255,255,0.3);
  display: block;
}
.sd-qr-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sd-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 28px;
}
@media (max-width: 560px) {
  .sd-info-grid { grid-template-columns: 1fr; }
  .sd-header { flex-direction: column; gap: 16px; }
}
.sd-info-card {
  border-radius: 14px;
  padding: 18px;
  border: 1.5px solid;
}
.sd-card-blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
}
.sd-card-amber {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fde68a;
}
.sd-info-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #374151;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid rgba(0,0,0,0.07);
}
.sd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.sd-info-row:last-child { border-bottom: none; }
.sd-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 75px;
}
.sd-val {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  word-break: break-word;
}
.sd-remarks { font-style: italic; color: #475569 !important; }
.sd-remarks-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border: 1.5px solid #c7d2fe;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 28px 0;
}
.sd-remarks-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.sd-remarks-title {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3730a3;
  margin-bottom: 4px;
}
.sd-remarks-text {
  font-size: 0.9rem;
  color: #1e1b4b;
  line-height: 1.5;
}
.sd-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1.5px solid #f1f5f9;
  margin-top: 24px;
}

/* ══════════════════════════════════════
   ATTENDANCE CARDS — Premium
   ══════════════════════════════════════ */
.att-sum-card {
  border-radius: 16px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
  border: 1.5px solid rgba(226,232,240,0.8) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.att-sum-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12) !important;
}
.att-sum-val { font-size: 2rem !important; font-weight: 800 !important; }

/* ══════════════════════════════════════
   TARGET CARD — Premium Dark
   ══════════════════════════════════════ */
.target-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a8a 100%) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 32px rgba(15,23,42,0.3) !important;
  padding: 24px !important;
}

/* ══════════════════════════════════════
   NETWORK BANNERS — Refined
   ══════════════════════════════════════ */
.offline-banner {
  border-radius: 12px !important;
  background: linear-gradient(135deg,#fef3c7,#fde68a) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(245,158,11,0.2) !important;
}
.online-banner {
  border-radius: 12px !important;
  background: linear-gradient(135deg,#d1fae5,#a7f3d0) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2) !important;
}

/* ══════════════════════════════════════
   ROLE BADGES — Premium Glossy
   ══════════════════════════════════════ */
.role-super_admin        { background: linear-gradient(135deg,#6d28d9,#8b5cf6) !important; }
.role-district_coordinator { background: linear-gradient(135deg,#1d4ed8,#3b82f6) !important; }
.role-block_coordinator  { background: linear-gradient(135deg,#059669,#10b981) !important; }
.role-field_executive    { background: linear-gradient(135deg,#d97706,#f59e0b) !important; }

/* ══════════════════════════════════════
   SCROLLBAR — Ultra Thin Premium
   ══════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.55); }

/* ══════════════════════════════════════
   GPS LINK & INSTANT ADDRESS DISPLAY
   ══════════════════════════════════════ */
.sd-gps-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.18s ease;
}
.sd-gps-link:hover { color: #1d4ed8; text-decoration: underline; }

/* Full address card below GPS row */
.sd-addr-full-row {
  margin-top: 10px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sd-addr-full-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #166534;
}
.sd-addr-full-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #14532d;
  line-height: 1.55;
}

/* "Open in Maps" pill link */
.sd-map-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 5px 14px;
  border-radius: 999px;
  transition: all 0.18s ease;
  width: fit-content;
  margin-top: 2px;
}
.sd-map-link:hover {
  background: #dbeafe;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37,99,235,0.2);
}

