:root {
  --primary-color: #0075ff; 
  --primary-dark: #0056b3;
  --primary-light: #e6f2ff;
  --gradient-bg: linear-gradient(135deg, #0075ff 0%, #004db3 100%);
  
  --bg-body: #f4f7f9;
  --text-main: #2d3748;
  --text-sub: #718096;
  --white: #ffffff;
  --success: #38a169;
  --error: #e53e3e;
  --radius: 16px;
  --shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  --star-idle: #cbd5e0;
  --star-active: #ecc94b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  background-image: radial-gradient(#cbd5e0 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden;
}

/* --- MAIN CARD LAYOUT --- */
.card-container {
  background: var(--white);
  width: 85%; 
  max-width: 1200px;
  height: 680px; /* Đã giảm xuống 680px theo yêu cầu */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  position: relative;
  flex-direction: row;
  transition: all 0.3s ease;
}

/* --- LEFT PANEL (INFO) --- */
.panel-info {
  flex: 1.4; 
  min-width: 0;
  background: var(--gradient-bg);
  color: var(--white);
  padding: 30px; 
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; 
  height: 100%;
}

.panel-info::before {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 200px; height: 200px; background: rgba(255,255,255,0.1); border-radius: 50%;
  pointer-events: none;
}
.panel-info::after {
  content: ''; position: absolute; bottom: -40px; right: -40px;
  width: 160px; height: 160px; background: rgba(255,255,255,0.05); border-radius: 50%;
  pointer-events: none;
}

.brand-area { 
  z-index: 2; 
  margin-bottom: 20px;
  flex-shrink: 0; 
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ticket-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 5px; line-height: 1.2; }
.ticket-subtitle { font-size: 0.95rem; opacity: 0.9; font-weight: 300; font-family: monospace; }

/* INFO GRID */
.info-grid {
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
  
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1; 
  height: 100%;
  overflow-y: auto; 
  padding: 10px 20px;
}

.info-grid::-webkit-scrollbar { width: 4px; }
.info-grid::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }
.info-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.info-grid::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 13px 0; /* Tăng khoảng cách cơ bản */
  flex-shrink: 0;
  min-height: 48px;
}

/* Tăng khoảng cách đặc biệt cho các dòng có nội dung dài/expandable (Yêu cầu, Nguyên nhân, Note) */
.info-row:has(.text-clamped) {
  padding: 16px 0;
  min-height: 60px; /* Đảm bảo đủ chỗ cho 2 dòng text */
}

.info-row:last-child { border-bottom: none; }

.label { 
  opacity: 0.9; 
  font-weight: 500; 
  width: 35%; 
  padding-right: 10px;
}

.value-container {
  width: 65%;
  position: relative;
  text-align: right;
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: flex-end; 
  padding-right: 18px;
}

.value-text {
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
  text-align: justify; 
  text-align-last: right; 
  padding-right: 0; 
  transition: all 0.2s;
}

.text-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toggle-btn {
  display: none; 
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  position: absolute;
  bottom: 2px;
  right: 0;
  margin: 0;
  float: none;
  transition: transform 0.3s;
}

.toggle-btn:hover { color: #fff; }

.expanded .text-clamped {
  display: block; 
  overflow: visible;
}
.expanded .toggle-btn {
  transform: rotate(180deg);
}

/* --- RIGHT PANEL (FORM) --- */
.panel-form {
  flex: 1;
  min-width: 0;
  padding: 25px 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: var(--white);
  height: 100%;
}

.right-logo-box { margin-bottom: 20px; flex-shrink: 0; }
.right-logo-img { height: 40px; width: auto; display: block; }

.form-header { text-align: center; margin-bottom: 20px; width: 100%; flex-shrink: 0; }
.form-header h3 { font-size: 1.4rem; color: var(--text-main); font-weight: 700; }
.form-header p { color: var(--text-sub); margin-top: 5px; font-size: 0.95rem; }

.rating-area { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  margin-bottom: 20px;
  width: 100%;
  flex-shrink: 0;
}
.stars { display: flex; gap: 8px; }

.star {
  font-size: 2.5rem;
  color: var(--star-idle);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
}
.star:hover { transform: scale(1.15); }
.star.active { color: var(--star-active); }
.stars.disabled { pointer-events: none; opacity: 0.9; }

.rating-feedback {
  min-height: 22px;
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1rem;
}

textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid #edf2f7;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  height: 90px;
  margin-bottom: 20px;
  transition: all 0.3s;
  background: #f7fafc;
  flex-shrink: 0;
}
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea:disabled {
  background: #edf2f7;
  color: #718096;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 117, 255, 0.25);
  flex-shrink: 0;
}
.btn-submit:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-submit:active { transform: translateY(1px); }
.btn-submit:disabled { background: #cbd5e0; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-submit.btn-done { background: var(--success) !important; color: #fff; cursor: default; }

/* --- OVERLAYS & SKELETON --- */
.overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.98);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.show { opacity: 1; pointer-events: all; }

.icon-lg { font-size: 3rem; margin-bottom: 15px; display: block; }
.title-lg { font-size: 1.8rem; font-weight: 800; color: var(--primary-color); margin-bottom: 10px; }
.desc-lg { color: var(--text-sub); max-width: 400px; margin: 0 auto 20px; line-height: 1.5; }
.box-note { background: var(--primary-light); padding: 15px; border-radius: 8px; color: var(--primary-dark); font-size: 0.9rem; }

/* SKELETON */
.skeleton-layout {
  display: none;
  width: 100%; height: 100%;
  flex-direction: inherit;
  position: absolute;
  top: 0; left: 0;
  z-index: 40;
  background: #fff;
}
.skeleton-layout.show { display: flex; }

.sk-left { 
  flex: 1.4; 
  min-width: 0;
  background: var(--gradient-bg); 
  padding: 30px; 
  display: flex; 
  flex-direction: column; 
}

.sk-right { 
  flex: 1; 
  min-width: 0;
  padding: 25px 35px;
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center;
}

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }

.sk-box {
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; margin-bottom: 12px; width: 100%;
}
.sk-box-dark {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
}

.sk-loading-text { color: #ffffff; font-weight: 700; animation: pulse 1.5s infinite; margin-bottom: 20px;}
.sk-brand-area { height: 60px; margin-bottom: 20px; display: flex; flex-direction: column; justify-content: center; }
.sk-title { width: 70%; height: 30px; margin-bottom: 5px; }
.sk-subtitle { width: 40%; height: 15px; }

.sk-grid {
  background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 0; 
  flex: 1; height: 100%;
}
.sk-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sk-row:last-child { border: none; }
.sk-line-left { width: 30%; height: 12px; }
.sk-line-right { width: 50%; height: 12px; }

.sk-logo { width: 60px; height: 40px; border-radius: 0; margin-bottom: 20px; }
.sk-header { width: 60%; height: 25px; margin-bottom: 5px; }
.sk-text { width: 40%; height: 15px; margin-bottom: 20px; }
.sk-stars { width: 200px; height: 40px; margin-bottom: 20px; border-radius: 20px; }
.sk-input { width: 100%; height: 90px; border-radius: 12px; margin-bottom: 20px; }
.sk-btn { width: 100%; height: 50px; border-radius: 12px; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  body { padding: 15px; align-items: flex-start; }
  .card-container { 
    width: 100%; 
    height: auto; 
    min-height: 80vh; 
    flex-direction: column; 
  }
  .skeleton-layout { flex-direction: column; }
  .panel-info, .sk-left { padding: 25px; flex: none; height: auto; min-height: 350px; }
  .panel-form, .sk-right { padding: 25px; flex: none; height: auto; min-height: 400px; }
  
  .info-grid { max-height: 400px; overflow-y: auto; }
  .star { font-size: 2.5rem; }
  .value-text { text-align: left; text-align-last: left; }
  .value-container { align-items: flex-start; }
  .right-logo-box { margin-bottom: 20px; }
  .toggle-btn { float: none; margin-left: 0; }
}