/* ==========================================================================
   HỆ THỐNG TRUYỀN THÔNG NỘI BỘ - THPT MẠC ĐĨNH CHI
   Design System & Styling
   ========================================================================== */

:root {
  --primary-color: #0b3c61;
  --primary-hover: #072a45;
  --secondary-color: #0077ed;
  --accent-gold: #e5a93c;
  --accent-gold-light: #fff8e6;
  
  --bg-gradient: linear-gradient(135deg, #f4f7fb 0%, #e9eef5 100%);
  --surface-card: #ffffff;
  --surface-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #0077ed;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-white: #ffffff;
  
  --success-color: #10b981;
  --success-bg: #ecfdf5;
  --danger-color: #ef4444;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(11, 60, 97, 0.1), 0 4px 6px -4px rgba(11, 60, 97, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(11, 60, 97, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header / Hero Banner
   ========================================================================== */
.hero-header {
  background: linear-gradient(135deg, #072a45 0%, #0b3c61 50%, #115383 100%);
  color: var(--text-white);
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(7, 42, 69, 0.25);
}

.hero-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: #f4f7fb;
  border-radius: 24px 24px 0 0;
}

.header-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fce7b2;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.school-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.portal-subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 0.8rem;
  color: #e0ecf8;
}

.motto-tag {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Main Form Container
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 840px;
  width: 100%;
  margin: -1.5rem auto 3rem;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

.form-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Role Selector (Segmented control) */
.role-selector-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  background: var(--surface-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.tab-btn:hover {
  background: #edf2f7;
  transform: translateY(-1px);
}

.tab-btn.active {
  background: #eef6fc;
  border-color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(0, 119, 237, 0.15);
}

.tab-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.tab-info {
  display: flex;
  flex-direction: column;
}

.tab-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-color);
}

.tab-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Form Elements */
.submission-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.legend-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  width: 100%;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--secondary-color);
  color: var(--text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.input-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.input-label.required::after {
  content: " *";
  color: var(--danger-color);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.help-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.custom-input,
.custom-select,
.custom-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-main);
  transition: var(--transition);
}

.custom-input:focus,
.custom-select:focus,
.custom-textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(0, 119, 237, 0.15);
}

.custom-textarea {
  resize: vertical;
  min-height: 110px;
}

/* ==========================================================================
   Upload Area (Drag & Drop)
   ========================================================================== */
.drop-zone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--secondary-color);
  background: #eff6ff;
  transform: scale(1.005);
}

.drop-icon {
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
}

.drop-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.drop-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.highlight-browse {
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: underline;
}

.drop-note {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* File Previews */
.file-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 1.25rem;
}

.file-preview-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.file-thumbnail {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background: #f1f5f9;
}

.file-icon-placeholder {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 1.8rem;
}

.file-name-truncate {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-remove-file {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-remove-file:hover {
  transform: scale(1.15);
}

/* ==========================================================================
   Submit Button & Action
   ========================================================================== */
.submit-wrapper {
  text-align: center;
  margin-top: 0.5rem;
}

.btn-primary {
  width: 100%;
  padding: 1.1rem 2rem;
  background: linear-gradient(135deg, #0b3c61 0%, #0077ed 100%);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 119, 237, 0.3);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #072a45 0%, #005bb5 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 237, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.submit-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ==========================================================================
   Modals (Success & Progress)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.modal-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

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

/* Checkmark Animation */
.success-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
}

.checkmark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: var(--success-color);
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 var(--success-color);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--success-color);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.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 0 0 0 30px #ecfdf5; } }

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Ticket Card in Modal */
.ticket-badge-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0effe 100%);
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ticket-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0369a1;
  margin-bottom: 6px;
}

.ticket-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ticket-code {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0b3c61;
  letter-spacing: 0.04em;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 1px solid #93c5fd;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover {
  background: #e0f2fe;
}

.ticket-instruction {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Summary Details */
.summary-details {
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-key {
  color: var(--text-muted);
}

.detail-val {
  font-weight: 600;
  color: var(--text-main);
}

.badge-status {
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.link-drive {
  color: var(--secondary-color);
  text-decoration: none;
}

.link-drive:hover {
  text-decoration: underline;
}

.btn-secondary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

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

/* Progress Modal */
.progress-card {
  max-width: 440px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.large {
  width: 50px;
  height: 50px;
  border-width: 4px;
  border-color: #e2e8f0;
  border-top-color: var(--secondary-color);
  margin: 0 auto 1.5rem;
}

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

.progress-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
}

.progress-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0077ed, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #072a45;
  color: #94a3b8;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer strong {
  color: #f1f5f9;
}

.copyright {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 6px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 640px) {
  .hero-header {
    padding: 2.2rem 1rem 3rem;
  }
  
  .school-title {
    font-size: 1.6rem;
  }
  
  .portal-subtitle {
    font-size: 0.98rem;
  }
  
  .segmented-control {
    grid-template-columns: 1fr;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .form-section {
    padding: 1.25rem;
  }
  
  .drop-zone {
    padding: 1.8rem 1rem;
  }
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.top-nav-bar {
  background: #062035;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 1.5rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-school {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #93c5fd;
}

.nav-admin-btn, .nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.nav-admin-btn:hover, .nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Admin Dashboard Layout
   ========================================================================== */
.admin-body {
  background: #f1f5f9;
}

.admin-nav-container {
  max-width: 1300px;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-divider {
  color: #475569;
}

.nav-app-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-logout {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: #ef4444;
  color: white;
}

.admin-main {
  max-width: 1300px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  width: 100%;
}

/* PIN Screen */
.pin-screen {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pin-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.pin-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.pin-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.3rem;
}

.pin-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pin-input {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
}

.pin-error {
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-blue { background: #e0f2fe; }
.bg-amber { background: #fef3c7; }
.bg-red { background: #fee2e2; }
.bg-green { background: #dcfce7; }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Toolbar & Filters */
.admin-toolbar {
  background: white;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  flex: 1;
  min-width: 260px;
}

.search-box svg {
  color: var(--text-muted);
}

.search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: white;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  background: #e2e8f0;
}

/* Admin Table */
.table-container {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table thead {
  background: #f8fafc;
  border-bottom: 2px solid var(--border-color);
}

.admin-table th {
  padding: 0.85rem 1rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #475569;
  white-space: nowrap;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.table-ticket-code {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--primary-color);
  background: #f0f7ff;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.dept-cell {
  display: flex;
  flex-direction: column;
}

.event-title-cell {
  font-weight: 600;
  color: #1e293b;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.handler-tag {
  font-size: 0.82rem;
  color: #334155;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue   { background: #e0f2fe; color: #0284c7; }
.badge-purple { background: #f3e8ff; color: #9333ea; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-orange { background: #ffedd5; color: #ea580c; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-gray   { background: #f1f5f9; color: #475569; }

.badge-rev {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.badge-rev.rev-warning {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  animation: pulseWarning 1.5s infinite;
}

@keyframes pulseWarning {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.btn-action-review {
  background: #0077ed;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-action-review:hover {
  background: #005bb5;
  transform: translateY(-1px);
}

/* Empty & Loading States */
.loading-state, .empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Review Modal Card */
.review-modal-card {
  max-width: 900px;
  text-align: left;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.modal-ticket-badge {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.modal-review-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-color);
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.review-modal-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.75rem;
}

.col-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.info-item {
  display: flex;
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
}

.info-label {
  width: 100px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.info-value {
  font-weight: 600;
  color: var(--text-main);
}

.drive-access-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin: 1rem 0;
}

.drive-card-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 6px;
}

.btn-drive-open {
  display: inline-block;
  background: #16a34a;
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-drive-open:hover {
  background: #15803d;
}

.caption-view-box {
  margin-top: 1rem;
}

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

.caption-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-copy-sm {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 2px 8px;
  cursor: pointer;
}

.caption-display {
  width: 100%;
  height: 120px;
  padding: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  resize: vertical;
  font-family: inherit;
}

.revision-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.modal-footer-btns {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
}

/* Hộp tùy chọn gửi email tự động trong Modal Admin */
.email-action-box {
  background: #f0f7ff;
  border: 1px solid #bae0fd;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1.2rem;
}

.email-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.email-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  user-select: none;
}

.email-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #0284c7;
  cursor: pointer;
}

.email-target-info {
  font-size: 0.78rem;
  color: #0284c7;
  margin-top: 5px;
  padding-left: 25px;
}

.email-target-info strong {
  color: #0369a1;
}

.btn-send-email-direct {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}

.btn-send-email-direct:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-send-email-direct:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 820px) {
  .review-modal-body {
    grid-template-columns: 1fr;
  }
}

