/* ==========================================================================
   STYLING CHUẨN TRANG KHẢO SÁT & QUẢN TRỊ CÁN BỘ - UBND XÃ SƠN HÀ
   ========================================================================== */

:root {
  --primary-color: #0f2942;       /* Deep Executive Navy */
  --primary-hover: #1e3a5f;
  --accent-red: #da251d;          /* Vietnam Flag Red */
  --accent-gold: #f59e0b;         /* Gold Star */
  --accent-gold-light: #fef3c7;
  --success-color: #10b981;       /* Emerald Green */
  --success-light: #ecfdf5;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-hover: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(15,41,66,0.08);
  --shadow-lg: 0 12px 30px rgba(15,41,66,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.hidden,
.app-page.hidden,
.modal-overlay.hidden {
  display: none !important;
}

html {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Compact Utility Bar */
.utility-bar {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 0.4rem 0;
  font-size: 0.8rem;
  border-bottom: 2px solid var(--accent-red);
}
.utility-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.agency-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 0.825rem;
}
.star-icon {
  color: var(--accent-gold);
  font-size: 1rem;
}
.utility-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-utility {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-gold);
  color: var(--primary-color);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-utility:hover {
  background: #eab308;
  transform: translateY(-1px);
}
.btn-utility.logged-in {
  background: #10b981;
  color: #ffffff;
}

/* Compact Hero Banner */
.hero-header {
  background: linear-gradient(135deg, #0f2942 0%, #1e3a5f 100%);
  color: #ffffff;
  padding: 1.25rem 0 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.national-emblem {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, #da251d 60%, #b91c1c 100%);
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(218, 37, 29, 0.4);
  margin-bottom: 0.5rem;
}
.emblem-star {
  color: var(--accent-gold);
  font-size: 1.3rem;
  line-height: 1;
}
.emblem-text {
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: -3px;
  color: var(--accent-gold);
}

.header-titles .sub-heading {
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.95;
}
.header-titles .motto {
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.15rem;
  opacity: 0.85;
}
.divider-gold {
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
  margin: 0.5rem auto;
  border-radius: 2px;
}
.main-heading {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}
.heading-desc {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-gold-light);
  margin-top: 0.1rem;
}

/* Main Content Wrapper */
.main-wrapper {
  padding: 1.25rem 0 3rem;
  flex: 1;
}

.purpose-card {
  background: var(--card-bg);
  border-left: 4px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.purpose-icon {
  background: #fef2f2;
  color: var(--accent-red);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.purpose-text h3 {
  font-size: 0.95rem;
  color: var(--primary-color);
  margin-bottom: 0.15rem;
  font-weight: 700;
}
.purpose-text p {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Sticky Progress Indicator */
.sticky-progress {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red) 0%, var(--accent-gold) 100%);
  transition: width 0.3s ease-out;
}

/* Compact Card Section */
.card-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-color);
  padding: 0 0.25rem;
  margin-bottom: 0.75rem;
}
.step-num {
  background: var(--primary-color);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.badge-optional {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
}
.section-instruction {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Grids & Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

@media (max-width: 640px) {
  .col-6 { grid-column: span 12; }
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
}
.label-heading {
  font-size: 0.9rem !important;
  margin-bottom: 0.5rem !important;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(15, 41, 66, 0.12);
}
.inline-input {
  border: none;
  border-bottom: 2px solid var(--border-color);
  background: transparent;
  padding: 0.15rem 0.4rem;
  font-family: inherit;
  font-size: 0.875rem;
  width: 60%;
  margin-left: 0.4rem;
  color: inherit;
}
.inline-input:focus {
  outline: none;
  border-color: var(--primary-color);
}
.inline-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Selection Grids */
.options-grid {
  display: grid;
  gap: 0.6rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }

@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .col-span-2 { grid-column: span 1; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: 1; }
}

.radio-card, .checkbox-card {
  position: relative;
  cursor: pointer;
  user-select: none;
  display: block;
}
.radio-card input[type="radio"], 
.checkbox-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.card-box {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.card-boxhighlight {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  background: #fffbe6;
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary-color);
}

/* Card Active/Checked Selection States */
.card-box {
  transition: all 0.2s ease;
}
.card-box:hover {
  border-color: #0284c7;
  background-color: #f0f9ff;
}

.card-box:has(input:checked),
.card-box.is-selected,
.radio-card:has(input:checked),
.checkbox-card:has(input:checked) {
  background-color: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.18) !important;
}

.radio-card input:checked + .card-box,
.checkbox-card input:checked + .card-box {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
}

/* Inline Input Box inside "Khác:" cards */
.card-box-other {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}
.card-label-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}
.card-label-inner input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.form-control-inline {
  position: relative !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  flex: 1;
  width: 100%;
  min-width: 120px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff !important;
  color: var(--text-main) !important;
  font-weight: 400;
  transition: all 0.2s ease;
  z-index: 5;
}
.card-box:has(input:checked) .form-control-inline,
.card-box.is-selected .form-control-inline {
  border-color: #0284c7 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
}
.form-control-inline:focus {
  outline: none;
  border-color: #0284c7 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25) !important;
}

/* Category Box for TTHC */
.tthc-category-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}
.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e2e8f0;
}
.category-badge {
  background: var(--accent-red);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.category-header h4 {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 700;
}
.tthc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tthc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #ffffff;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tthc-item:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.tthc-item:has(input:checked),
.tthc-item.is-selected {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12) !important;
}

.tthc-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #0284c7;
  cursor: pointer;
  flex-shrink: 0;
}
.tthc-text {
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Rating Scale */
.rating-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .rating-scale { grid-template-columns: 1fr; }
}
.rating-item {
  position: relative;
  cursor: pointer;
  text-align: center;
}
.rating-item input {
  position: absolute;
  opacity: 0;
}
.rating-box, .rating-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.4rem;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.rating-box .emoji, .rating-card .emoji {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.rating-box .text, .rating-card .text {
  font-size: 0.8rem;
  font-weight: 600;
}
.rating-item input:checked + .rating-box,
.rating-card:has(input:checked),
.rating-card.is-selected {
  border-color: #eab308 !important;
  background: #fef08a !important;
  color: #854d0e !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3) !important;
  transform: translateY(-2px);
}

.question-block {
  margin-bottom: 1.25rem;
}
.q-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.65rem;
}
.mt-3 { margin-top: 0.65rem; }
.mt-4 { margin-top: 1.25rem; }
.hidden { display: none !important; }
.text-left { text-align: left; }
.w-full { width: 100%; }

.sub-input-box {
  background: #fffbe6;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

/* Commitment & Submit */
.commitment-box {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.commitment-box svg {
  color: var(--success-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.submit-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-red) 0%, #b91c1c 100%);
  color: #ffffff;
  border: none;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(218, 37, 29, 0.3);
  transition: all 0.2s ease;
}
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(218, 37, 29, 0.4);
}
.btn-reset {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
}

/* Detail Modal Layout */
.detail-body-wrapper {
  overflow-y: auto;
  max-height: 70vh;
  padding-right: 0.5rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}
.detail-box.full-width {
  grid-column: span 2;
}
@media (max-width: 600px) {
  .detail-box.full-width { grid-column: span 1; }
}
.detail-box-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.detail-box-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
}
.detail-list-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  padding: 0.4rem 0.7rem;
  margin-top: 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}
.text-right { text-align: right; }

/* Modals System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-sm {
  max-width: 380px !important;
}
.modal-lg {
  max-width: 920px !important;
  text-align: left !important;
  padding: 1.25rem !important;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Staff Login Modal Specifics */
.modal-header-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
}
.login-badge {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}
.modal-header-login h2 {
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 800;
}
.login-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.login-error-msg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

/* Success Modal Details */
.success-icon-wrapper {
  margin: 0 auto 1rem;
  width: 60px;
  height: 60px;
}
.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success-color);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: #fff;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--success-color);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0px 0px 0px 40px var(--success-color); } }

.modal-card h2 {
  font-size: 1.35rem;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
  font-weight: 800;
}
.success-msg {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}
.survey-ref-code {
  display: inline-block;
  background: var(--accent-gold-light);
  color: #92400e;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--accent-gold);
}
.sub-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

/* Admin Modal Header & Actions */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.modal-header h3 {
  font-size: 1.05rem;
  color: var(--primary-color);
  font-weight: 800;
}
.badge-staff-status {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-logout {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-logout:hover {
  background: #fee2e2;
}
.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.85rem 0;
  border-bottom: 2px solid var(--border-color);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
}
.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--accent-red);
}

.tab-content {
  display: none;
  overflow-y: auto;
  flex: 1;
  padding-top: 0.35rem;
}
.tab-content.active {
  display: block;
}

/* QR Code & Poster Panel */
.qr-creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .qr-creator-grid { grid-template-columns: 1fr; }
}

.qr-config-panel {
  background: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.qr-config-panel h4 {
  font-size: 0.95rem;
  color: var(--primary-color);
  margin-bottom: 0.85rem;
  font-weight: 700;
}
.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: block;
}
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-secondary:hover {
  background: #f1f5f9;
}

/* Printable Poster */
.poster-preview-panel {
  display: flex;
  justify-content: center;
}
.poster-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border: 3px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-align: center;
}
.poster-banner-top {
  background: var(--primary-color);
  color: #ffffff;
  padding: 0.85rem 0.6rem;
}
.poster-star {
  color: var(--accent-gold);
  font-size: 1.2rem;
  line-height: 1;
}
.poster-banner-top h3 {
  font-size: 1rem;
  font-weight: 800;
}
.poster-banner-top p {
  font-size: 0.7rem;
  opacity: 0.9;
}
.poster-body {
  padding: 1rem 0.85rem;
}
.poster-body h2 {
  font-size: 1.05rem;
  color: var(--accent-red);
  font-weight: 800;
  line-height: 1.3;
}
.poster-divider {
  height: 2px;
  background: var(--accent-gold);
  width: 50px;
  margin: 0.4rem auto;
}
.poster-guide {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.85rem;
}

.qr-code-box {
  background: #ffffff;
  padding: 0.85rem;
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-md);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
#qrcodeCanvas canvas, #qrcodeCanvas img {
  width: 160px !important;
  height: 160px !important;
  display: block;
}
.qr-scan-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}
.poster-footer-notes .note-highlight {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
}
.poster-footer-notes .note-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Dashboard Panel Controls & Filters */
.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dash-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-responsive {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-table th, .data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
.data-table th {
  background: #f1f5f9;
  color: var(--primary-color);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.badge-target {
  background: #e2e8f0;
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
}
.btn-sm-view {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-sm-view:hover { background: #bae6fd; }

/* Executive Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Executive KPI Grid Cards */
.stat-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .stat-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .stat-summary-grid { grid-template-columns: 1fr; }
}

.stat-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.stat-kpi-card:hover {
  transform: translateY(-2px);
}
.stat-kpi-card.border-navy { border-left: 4px solid var(--primary-color); }
.stat-kpi-card.border-gold { border-left: 4px solid var(--accent-gold); }
.stat-kpi-card.border-emerald { border-left: 4px solid var(--success-color); }
.stat-kpi-card.border-rose { border-left: 4px solid #f43f5e; }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.bg-navy-light { background: #e0f2fe; color: #0369a1; }
.bg-gold-light { background: #fef3c7; color: #b45309; }
.bg-emerald-light { background: #d1fae5; color: #047857; }
.bg-rose-light { background: #ffe4e6; color: #be123c; }

.kpi-details {
  display: flex;
  flex-direction: column;
}
.kpi-title {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
}
.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Charts Wrapper & Cards */
.charts-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
  .charts-wrapper { grid-template-columns: 1fr; }
}

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f1f5f9;
}
.chart-header h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-color);
}
.chart-badge {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.chart-body {
  position: relative;
  height: 220px;
  width: 100%;
}

/* Intelligent Analytics & Action Plan Cards */
.analytics-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.analytics-title-group h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-color);
}
.analytics-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.analytics-section-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.card-title-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.card-title-icon .icon { font-size: 1.25rem; }
.card-title-icon h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-color);
}

.summary-paragraph {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-main);
}
.summary-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.highlight-chip {
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.chip-gold { background: #fef3c7; color: #92400e; }
.chip-emerald { background: #d1fae5; color: #065f46; }
.chip-navy { background: #e0f2fe; color: #0369a1; }

.bottlenecks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
@media (max-width: 768px) {
  .bottlenecks-grid { grid-template-columns: 1fr; }
}

.alert-card {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.alert-red { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }
.alert-amber { background: #fffbe6; border-left: 4px solid #f59e0b; color: #92400e; }
.alert-blue { background: #f0f9ff; border-left: 4px solid #0284c7; color: #075985; }

.alert-title { font-weight: 800; margin-bottom: 0.25rem; }
.alert-desc { font-size: 0.8rem; opacity: 0.9; line-height: 1.45; }

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) {
  .recommendations-grid { grid-template-columns: 1fr; }
}

.rec-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}
.rec-card.border-blue { border-top: 4px solid #3b82f6; }
.rec-card.border-gold { border-top: 4px solid #f59e0b; }
.rec-card.border-emerald { border-top: 4px solid #10b981; }
.rec-card.border-purple { border-top: 4px solid #8b5cf6; }

.rec-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}
.rec-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 0.5px;
  background: #e2e8f0;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  align-self: flex-start;
}
.rec-header h5 {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--primary-color);
}
.rec-list {
  padding-left: 1.1rem;
  font-size: 0.825rem;
  color: var(--text-main);
  line-height: 1.5;
}
.rec-list li { margin-bottom: 0.4rem; }

.suggestions-list-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
}
.suggestion-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}
.sug-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}
.sug-time { color: var(--text-muted); font-weight: 400; }
.sug-content { font-size: 0.85rem; font-style: italic; color: #b91c1c; margin-bottom: 0.35rem; }
.sug-footer { display: flex; gap: 0.4rem; }
.badge-mini {
  font-size: 0.7rem;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Filter Controls Bar */
.filter-controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}
.search-box { min-width: 180px; flex: 1; }
.filter-dropdown select {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.form-control-sm {
  padding: 0.35rem 0.6rem !important;
  font-size: 0.8rem !important;
  height: 34px;
}
.btn-sm {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.775rem !important;
}

/* Dark Mode Overrides */
#modalAdmin.dark-theme .modal-card {
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
}
#modalAdmin.dark-theme .modal-header {
  border-bottom-color: #334155;
}
#modalAdmin.dark-theme .modal-header h3 {
  color: #f8fafc;
}
#modalAdmin.dark-theme .btn-theme-toggle {
  border-color: #475569;
  color: #f8fafc;
}
#modalAdmin.dark-theme .tab-btn {
  color: #94a3b8;
}
#modalAdmin.dark-theme .tab-btn.active {
  color: #38bdf8;
  border-bottom-color: var(--accent-red);
}
#modalAdmin.dark-theme .stat-kpi-card {
  background: #1e293b;
  border-color: #334155;
}
#modalAdmin.dark-theme .kpi-title, #modalAdmin.dark-theme .kpi-sub {
  color: #94a3b8;
}
#modalAdmin.dark-theme .kpi-value {
  color: #f8fafc;
}
#modalAdmin.dark-theme .chart-card {
  background: #1e293b;
  border-color: #334155;
}
#modalAdmin.dark-theme .chart-header {
  border-bottom-color: #334155;
}
#modalAdmin.dark-theme .chart-header h4 {
  color: #f8fafc;
}
#modalAdmin.dark-theme .chart-badge {
  background: #334155;
  color: #cbd5e1;
}
#modalAdmin.dark-theme .analytics-section-card {
  background: #1e293b;
  border-color: #334155;
}
#modalAdmin.dark-theme .card-title-icon {
  border-bottom-color: #334155;
}
#modalAdmin.dark-theme .card-title-icon h4 {
  color: #f8fafc;
}
#modalAdmin.dark-theme .summary-paragraph {
  color: #cbd5e1;
}
#modalAdmin.dark-theme .rec-card {
  background: #0f172a;
  border-color: #334155;
}
#modalAdmin.dark-theme .rec-header h5 {
  color: #f8fafc;
}
#modalAdmin.dark-theme .rec-list {
  color: #cbd5e1;
}
#modalAdmin.dark-theme .suggestion-item {
  background: #0f172a;
  border-color: #334155;
}
#modalAdmin.dark-theme .sug-header {
  color: #38bdf8;
}
#modalAdmin.dark-theme .data-table th {
  background: #1e293b;
  color: #f8fafc;
  border-bottom-color: #334155;
}
#modalAdmin.dark-theme .data-table td {
  border-bottom-color: #334155;
  color: #cbd5e1;
}
#modalAdmin.dark-theme .data-table tbody tr:hover {
  background: #334155;
}
#modalAdmin.dark-theme .qr-config-panel {
  background: #1e293b;
  border-color: #334155;
}
#modalAdmin.dark-theme .qr-config-panel h4 {
  color: #f8fafc;
}
#modalAdmin.dark-theme .form-control {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: #cbd5e1;
  text-align: center;
  padding: 1.15rem 0;
  font-size: 0.8rem;
  border-top: 3px solid var(--accent-gold);
}

/* MOBILE RESPONSIVE ENHANCEMENTS */
@media (max-width: 640px) {
  .container { padding: 0 0.6rem; }
  .hero-header { padding: 1rem 0 0.85rem; }
  .main-heading { font-size: 1.2rem; }
  .heading-desc { font-size: 0.8rem; }
  .card-section { padding: 0.9rem 0.85rem; margin-bottom: 0.9rem; }
  .section-title { font-size: 0.95rem; }

  /* Mobile Touch Targets */
  .card-box, .tthc-item, .btn-utility, .btn-submit, .btn-primary, .btn-secondary, .tab-btn {
    min-height: 46px;
  }
  
  .submit-actions { flex-direction: column; width: 100%; }
  .btn-submit, .btn-reset { width: 100%; text-align: center; }

  .modal-lg { padding: 0.85rem !important; }
  .modal-tabs { flex-wrap: wrap; }
  .tab-btn { flex: 1; min-width: 120px; justify-content: center; padding: 0.4rem 0.6rem; font-size: 0.775rem; }
  
  .filter-controls-bar { flex-direction: column; align-items: stretch; }
  .search-box, .filter-dropdown { width: 100%; }
}

/* PRINT STYLES */
@media print {
  body * { visibility: hidden; }
  #modalAdmin, #modalAdmin * { visibility: visible; }
  #modalAdmin {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #fff; padding: 0;
  }
  .modal-card { max-width: 100% !important; box-shadow: none !important; padding: 0 !important; }
  .modal-header, .modal-tabs, .qr-config-panel, .btn-close-modal, .analytics-header-bar button { display: none !important; }
  .tab-content { display: block !important; }
  .poster-preview-panel { width: 100%; display: flex; justify-content: center; align-items: center; padding: 2cm; }
  .poster-card { width: 100%; max-width: 18cm !important; border: 4px solid #000 !important; }
  #qrcodeCanvas canvas, #qrcodeCanvas img { width: 240px !important; height: 240px !important; }
}

/* ==========================================================================
   FULL-PAGE ADMINISTRATIVE EXECUTIVE DASHBOARD & SIDEBAR STYLES
   ========================================================================== */

/* Page View Visibility */
.app-page {
  width: 100%;
  min-height: 100vh;
  transition: opacity 0.25s ease;
}
.app-page.hidden {
  display: none !important;
}

/* Administrative Full Dashboard Layout */
.admin-dashboard-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: #f8fafc;
  color: var(--text-main);
  font-family: 'Be Vietnam Pro', sans-serif;
}

/* Left Sidebar Navigation */
.admin-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #0f2942;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-top {
  padding: 1.25rem 1rem;
}

/* Sidebar Branding */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1rem;
}
.brand-star {
  font-size: 1.5rem;
  color: var(--accent-gold);
  line-height: 1;
}
.brand-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

/* User Status Badge */
.sidebar-user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.725rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 1.25rem;
}
.badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* Sidebar Menu Navigation */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.menu-label {
  font-size: 0.675rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  padding-left: 0.5rem;
}

.sidebar-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.sidebar-nav-item.active {
  background: linear-gradient(135deg, #da251d 0%, #b91c1c 100%);
  color: #ffffff;
  font-weight: 700;
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(218, 37, 29, 0.4);
}
.sidebar-nav-item svg {
  flex-shrink: 0;
}

.sidebar-nav-item.item-accent {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px dashed rgba(56, 189, 248, 0.45);
}
.sidebar-nav-item.item-accent:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  border-color: #38bdf8;
}

/* Sidebar Footer Controls */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-sidebar-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.btn-sidebar-control:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.btn-sidebar-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Right Main Area */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.topbar-left {
  display: flex;
  flex-direction: column;
}
.topbar-left h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
}
.topbar-clock {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 500;
}

.admin-content-body {
  flex: 1;
  padding: 1.5rem 1.75rem;
  background: #f8fafc;
}

/* Dark Theme Styles for Full Page Admin */
body.dark-theme .admin-dashboard-layout {
  background: #0f172a;
  color: #f8fafc;
}
body.dark-theme .admin-sidebar {
  background: #091322;
  border-right-color: #1e293b;
}
body.dark-theme .admin-topbar {
  background: #1e293b;
  border-bottom-color: #334155;
  color: #f8fafc;
}
body.dark-theme .topbar-left h2 {
  color: #f8fafc;
}
body.dark-theme .topbar-clock {
  color: #94a3b8;
}
body.dark-theme .admin-content-body {
  background: #0f172a;
}
body.dark-theme .stat-kpi-card {
  background: #1e293b;
  border-color: #334155;
}
body.dark-theme .stat-kpi-card .kpi-value {
  color: #f8fafc;
}
body.dark-theme .chart-card {
  background: #1e293b;
  border-color: #334155;
}
body.dark-theme .chart-header {
  border-bottom-color: #334155;
}
body.dark-theme .chart-header h4 {
  color: #f8fafc;
}
body.dark-theme .analytics-section-card {
  background: #1e293b;
  border-color: #334155;
}
body.dark-theme .card-title-icon h4 {
  color: #f8fafc;
}
body.dark-theme .summary-paragraph {
  color: #cbd5e1;
}
body.dark-theme .rec-card {
  background: #0f172a;
  border-color: #334155;
}
body.dark-theme .rec-header h5 {
  color: #f8fafc;
}
body.dark-theme .rec-list {
  color: #cbd5e1;
}
body.dark-theme .suggestion-item {
  background: #0f172a;
  border-color: #334155;
}
body.dark-theme .data-table th {
  background: #1e293b;
  color: #f8fafc;
  border-bottom-color: #334155;
}
body.dark-theme .data-table td {
  border-bottom-color: #334155;
  color: #cbd5e1;
}
body.dark-theme .data-table tbody tr:hover {
  background: #334155;
}

/* Mobile & Responsive Modern Sidebar Styling */
@media (max-width: 900px) {
  .admin-dashboard-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 0.75rem;
  }
  .sidebar-top {
    padding: 1rem 0.85rem;
  }
  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .menu-label {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
  }
  .sidebar-nav-item {
    width: auto;
    flex: 1 1 auto;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 20px;
  }
  .sidebar-footer {
    flex-direction: row;
    padding: 0.5rem 0.85rem;
  }
  .btn-sidebar-control, .btn-sidebar-logout {
    flex: 1;
    border-radius: 20px;
  }
  .admin-topbar {
    padding: 0.85rem 1rem;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .admin-content-body {
    padding: 1rem 0.85rem;
  }
}

/* Validation Modal & Warning Styling */
.warning-icon {
  font-size: 3rem;
  line-height: 1;
}
.text-gold {
  color: #d97706;
}
.validation-missing-box {
  background: #fffbe6;
  border: 1.5px solid #fde047;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  max-height: 220px;
  overflow-y: auto;
}
.validation-missing-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: #92400e;
  font-weight: 600;
  border-bottom: 1px dashed #fef08a;
}
.validation-missing-item:last-child {
  border-bottom: none;
}
.validation-missing-item .bullet {
  color: #d97706;
  font-size: 1rem;
}

/* Highlight section animation when redirected */
@keyframes sectionPulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(2, 132, 199, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}
.highlight-missing-section {
  animation: sectionPulse 1.2s ease 2;
  border-color: #0284c7 !important;
}

/* Cloud JSON Sync & Accent Buttons */
.cloud-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.775rem;
  font-weight: 700;
  margin-right: 0.5rem;
}
.sync-dot {
  font-size: 0.85rem;
  color: #10b981;
  animation: pulseDot 1.5s infinite;
}
.sync-dot.syncing {
  color: #f59e0b;
}
.sync-dot.error {
  color: #ef4444;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.btn-xs-sync {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 2px;
  transition: transform 0.3s ease;
}
.btn-xs-sync:hover {
  transform: rotate(180deg);
}
.btn-accent-gold {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}
.btn-accent-gold:hover {
  background: #fde68a !important;
}
/* Modern Mobile & Phone Responsiveness Optimizations */
@media (max-width: 768px) {
  /* Global Page & Container spacing */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Citizen Header & Branding */
  .app-header {
    padding: 1.25rem 1rem;
    border-radius: 0 0 16px 16px;
  }
  .header-brand {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .brand-logo {
    width: 68px;
    height: 68px;
  }
  .brand-text h1 {
    font-size: 1.15rem;
    line-height: 1.3;
  }
  .brand-text h2 {
    font-size: 0.85rem;
  }
  .top-action-bar {
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
  }
  .btn-top-admin {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  /* Form Container Cards */
  .form-section-card {
    padding: 1.25rem 0.9rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
  }
  .section-title h3 {
    font-size: 1.05rem;
  }

  /* Form Grids on Mobile -> 1 Column Layout */
  .grid-3-col, 
  .grid-2-col, 
  .tthc-grid, 
  .grid-4-col {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  /* Rating Grid: 2 columns or 1 column */
  .rating-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  /* Touch Cards (Option Selectors) */
  .card-box, .tthc-item, .rating-card {
    padding: 0.85rem 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 12px;
  }
  .card-box:active, .tthc-item:active, .rating-card:active {
    transform: scale(0.98);
    background: #e0f2fe;
  }

  /* Progress Bar Sticky on Mobile */
  .progress-container {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-radius: 0 0 12px 12px;
  }

  /* Submit Button full width on mobile */
  .form-actions-bar {
    padding: 1rem 0;
  }
  .btn-submit-survey {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border-radius: 28px;
  }

  /* Admin Dashboard Mobile View */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  .stat-kpi-card {
    padding: 1rem 0.85rem;
  }
  .stat-kpi-card .kpi-value {
    font-size: 1.35rem;
  }
  .charts-grid-2x2 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  .chart-card {
    height: 320px;
    padding: 1rem;
  }
  .dashboard-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .dashboard-actions-row .btn-primary,
  .dashboard-actions-row .btn-secondary,
  .dashboard-actions-row .cloud-sync-status {
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }

  /* Admin Topbar Mobile */
  .admin-topbar {
    padding: 0.75rem 0.9rem;
    gap: 0.5rem;
  }
  .topbar-left h2 {
    font-size: 1.05rem;
  }

  /* Mobile Data Table Scrollable Container */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border-color);
  }
  .data-table {
    min-width: 750px;
  }

  /* Modal Optimization for Mobile */
  .modal-content {
    width: 94% !important;
    max-width: 100% !important;
    padding: 1.25rem 1rem !important;
    max-height: 88vh !important;
    border-radius: 18px !important;
  }
  .detail-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .rating-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .brand-text h1 {
    font-size: 1.05rem;
  }
}

/* 14-Question Survey Specific Styling & Group Banners */
.survey-group-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.banner-group-a { background: linear-gradient(135deg, #0f2942 0%, #1e3a5f 100%); border-left: 5px solid #38bdf8; }
.banner-group-b { background: linear-gradient(135deg, #065f46 0%, #047857 100%); border-left: 5px solid #34d399; }
.banner-group-c { background: linear-gradient(135deg, #7c2d12 0%, #9a3412 100%); border-left: 5px solid #fb923c; }
.banner-group-d { background: linear-gradient(135deg, #581c87 0%, #6b21a8 100%); border-left: 5px solid #c084fc; }

.question-card-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.question-card-box:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 41, 66, 0.08);
}
.question-card-box.is-answered {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.q-header-line {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.badge-q-tag {
  background: var(--primary-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.q-title-text {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.45;
}

/* 5 Rating Options Grid */
.rating-5-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}
@media (max-width: 768px) {
  .rating-5-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}
@media (max-width: 480px) {
  .rating-5-grid {
    grid-template-columns: 1fr;
  }
}

.rating-opt-card {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.35rem;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}
.rating-opt-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rating-opt-card .emoji {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  transition: transform 0.2s ease;
}
.rating-opt-card .label-txt {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.rating-opt-card:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}
.rating-opt-card:hover .emoji {
  transform: scale(1.15);
}

/* Satisfaction Level Specific Active Colors */
.rating-opt-card:has(input:checked),
.rating-opt-card.is-selected {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.rating-opt-card[data-val="1"]:has(input:checked),
.rating-opt-card[data-val="1"].is-selected {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}
.rating-opt-card[data-val="1"]:has(input:checked) .label-txt { color: #991b1b !important; font-weight: 800; }

.rating-opt-card[data-val="2"]:has(input:checked),
.rating-opt-card[data-val="2"].is-selected {
  background: #fff7ed !important;
  border-color: #f97316 !important;
  color: #9a3412 !important;
}
.rating-opt-card[data-val="2"]:has(input:checked) .label-txt { color: #9a3412 !important; font-weight: 800; }

.rating-opt-card[data-val="3"]:has(input:checked),
.rating-opt-card[data-val="3"].is-selected {
  background: #fefce8 !important;
  border-color: #eab308 !important;
  color: #854d0e !important;
}
.rating-opt-card[data-val="3"]:has(input:checked) .label-txt { color: #854d0e !important; font-weight: 800; }

.rating-opt-card[data-val="4"]:has(input:checked),
.rating-opt-card[data-val="4"].is-selected {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}
.rating-opt-card[data-val="4"]:has(input:checked) .label-txt { color: #0369a1 !important; font-weight: 800; }

.rating-opt-card[data-val="5"]:has(input:checked),
.rating-opt-card[data-val="5"].is-selected {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}
.rating-opt-card[data-val="5"]:has(input:checked) .label-txt { color: #065f46 !important; font-weight: 800; }

/* Status Badges for Responses Table & Detail Modal */
.badge-sat-5 { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.775rem; }
.badge-sat-4 { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.775rem; }
.badge-sat-3 { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.775rem; }
.badge-sat-2 { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.775rem; }
.badge-sat-1 { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 700; font-size: 0.775rem; }

/* Thank You Banner Box */
.thankyou-banner-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  color: #166534;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
  line-height: 1.5;
}
.thankyou-banner-box .thankyou-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ========================================================================== */
/* QR CODE CREATOR & A4 PRINTABLE POSTER STYLING                              */
/* ========================================================================== */
.qr-creator-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 992px) {
  .qr-creator-grid {
    grid-template-columns: 1fr;
  }
}

.qr-config-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.qr-config-panel h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.poster-preview-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: var(--radius-lg);
  border: 2px dashed #cbd5e1;
}

.poster-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 3px solid #0f2942;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(15, 41, 66, 0.18);
  font-family: 'Be Vietnam Pro', sans-serif;
  text-align: center;
  position: relative;
}

.poster-banner-top {
  background: linear-gradient(135deg, #0b1e33 0%, #0f2942 60%, #1e3a5f 100%);
  color: #ffffff;
  padding: 1.25rem 1rem 1rem;
  position: relative;
  border-bottom: 3px solid var(--accent-gold);
}
.poster-star {
  color: #f59e0b;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.poster-banner-top h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
}
.poster-agency-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 1px;
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.poster-body {
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

#prevPosterSub {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #b91c1c !important;
  line-height: 1.4 !important;
  margin: 0.25rem 0 0.5rem !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  width: 100% !important;
  text-align: center !important;
  box-sizing: border-box !important;
  padding: 0 0.5rem !important;
}

.poster-divider {
  width: 80px;
  height: 3.5px;
  background: linear-gradient(90deg, #dc2626 0%, #f59e0b 100%);
  border-radius: 4px;
  margin: 0.5rem auto 0.75rem;
}

.poster-guide {
  font-size: 0.925rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  margin: 0.25rem 0 1rem;
  padding: 0 0.5rem;
}

.qr-code-box {
  background: #ffffff;
  border: 2.5px dashed #0f2942;
  border-radius: 16px;
  padding: 1.1rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#qrcodeCanvas {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#qrcodeCanvas canvas {
  display: none !important;
}

#qrcodeCanvas img {
  display: block !important;
  margin: 0 auto !important;
  border-radius: 8px;
  max-width: 100% !important;
  height: auto !important;
}

.qr-scan-badge {
  background: #dc2626;
  color: #ffffff;
  font-size: 0.825rem;
  font-weight: 800;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.poster-footer-notes {
  margin-top: 1.25rem;
  width: 100%;
}
.poster-footer-notes .note-highlight {
  font-size: 0.925rem;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 0.25rem;
}
.poster-footer-notes .note-sub {
  font-size: 0.825rem;
  font-weight: 600;
  color: #64748b;
  font-style: italic;
}

/* Print Styles for A4 Poster */
@media print {
  body * {
    visibility: hidden !important;
  }
  #printablePoster, #printablePoster * {
    visibility: visible !important;
  }
  #printablePoster {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
    width: 90% !important;
    max-width: 650px !important;
    box-shadow: none !important;
    border: 3px solid #0f2942 !important;
  }
}

/* ========================================================================== */
/* SYSTEM MODALS (LOGIN, VALIDATION, SUCCESS, DETAIL)                         */
/* ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999999 !important;
  padding: 1rem !important;
  animation: fadeInModal 0.25s ease-out forwards;
}

.modal-backdrop.hidden {
  display: none !important;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 2rem 2.25rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
  width: 100% !important;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-card.modal-sm { max-width: 420px !important; }
.modal-card.modal-md { max-width: 580px !important; }
.modal-card.modal-lg { max-width: 860px !important; }

/* Login Modal Specific Styling */
.modal-header-login {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-badge {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.modal-header-login h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f2942;
  margin: 0;
}
.login-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.login-error-msg {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.85rem;
  text-align: center;
}
.login-error-msg.hidden {
  display: none !important;
}

/* Widescreen Desktop Enhancements (Full Screen Display) */
@media (min-width: 992px) {
  .container {
    max-width: 1400px;
    padding: 0 2rem;
  }
  .hero-header {
    padding: 2.25rem 0 1.75rem;
  }
  .main-heading {
    font-size: 1.85rem;
    letter-spacing: 0.5px;
  }
  .heading-desc {
    font-size: 1.05rem;
  }
  .purpose-card {
    padding: 1.25rem 1.75rem;
    font-size: 0.975rem;
  }
  .card-section {
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    border-radius: var(--radius-lg);
  }
  .question-card-box {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
  }
  .q-title-text {
    font-size: 1.025rem;
    line-height: 1.5;
  }
  .badge-q-tag {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
  }
  .rating-5-grid {
    gap: 0.75rem;
  }
  .rating-opt-card {
    padding: 0.85rem 0.5rem;
    min-height: 76px;
    border-width: 2px;
  }
  .rating-opt-card .emoji {
    font-size: 1.85rem;
    margin-bottom: 0.35rem;
  }
  .rating-opt-card .label-txt {
    font-size: 0.875rem;
  }
  .form-control, .form-select {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  .submit-actions {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }
  .btn-submit {
    padding: 1rem 3rem;
    font-size: 1.1rem;
  }
}



