/* ==========================================================================
   STYLING CHUẨN TRANG KHẢO SÁT & QUẢN TRỊ CÁN BỘ - UBND XÃ ĐẶNG THÙY TRÂM
   ========================================================================== */

: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;
}

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: 860px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 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, .checkbox-card input {
  position: absolute;
  opacity: 0;
}
.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);
}

.radio-card input:checked + .card-box,
.checkbox-card input:checked + .card-box {
  border-color: var(--primary-color);
  background: #f0f7ff;
  color: var(--primary-color);
  font-weight: 700;
}

.radio-card input:checked + .card-boxhighlight {
  border-color: var(--accent-gold);
  background: #fef08a;
  color: var(--primary-color);
}

.card-box.highlight-success {
  background: var(--success-light);
  border-color: var(--success-color);
  color: #065f46;
  font-weight: 700;
}
.card-box.highlight-gold {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
  color: #92400e;
  font-weight: 700;
}

/* 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: background 0.15s;
}
.tthc-item:hover {
  border-color: var(--primary-color);
  background: #f0f7ff;
}
.tthc-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-red);
  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 {
  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.15s;
}
.rating-box .emoji {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.rating-box .text {
  font-size: 0.8rem;
  font-weight: 600;
}
.rating-item input:checked + .rating-box {
  border-color: var(--accent-gold);
  background: #fef9c3;
}

.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 */
.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-summary-cards {
  display: flex;
  gap: 0.6rem;
}
.stat-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}
.stat-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
}
.btn-danger-outline {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.table-responsive {
  max-height: 320px;
  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;
}
.data-table tbody tr:hover {
  background: #f8fafc;
}

/* 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);
}

/* 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 { 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; }
}
