/* ===== Resolve Ticket Page – Desktop & Mobile ===== */
.close-ticket-page {
  padding: 1.5rem 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100%;
  animation: closeTicketFadeIn 0.3s ease-out;
}

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

/* ----- Breadcrumb ----- */
.close-ticket-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.close-ticket-breadcrumb-link {
  color: var(--primary, #0d9488);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.close-ticket-breadcrumb-link:hover {
  color: var(--primary-dark, #0f766e);
  text-decoration: underline;
}

.close-ticket-breadcrumb-sep {
  color: var(--text-muted, #94a3b8);
  user-select: none;
}

.close-ticket-breadcrumb-current {
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

/* ----- Header ----- */
.close-ticket-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.close-ticket-header-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.close-ticket-header-icon svg {
  width: 28px;
  height: 28px;
}

.close-ticket-header-text {
  flex: 1;
  min-width: 0;
}

.close-ticket-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.close-ticket-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  max-width: 520px;
}

.close-ticket-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.close-ticket-btn-secondary {
  padding: 0.6rem 1.2rem;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #334155);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.close-ticket-btn-secondary:hover {
  background: var(--hover-bg, #f8fafc);
  border-color: #cbd5e1;
}

.close-ticket-btn-primary {
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--primary, #f21b23) 0%, #d91820 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.close-ticket-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

/* ----- Resolve by ID section ----- */
.close-by-id-section {
  background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.close-by-id-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.close-by-id-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
  border-radius: 10px;
}

.close-by-id-icon svg {
  width: 20px;
  height: 20px;
}

.close-by-id-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.close-by-id-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.close-by-id-input {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  color: var(--text-primary, #0f172a);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.close-by-id-input::placeholder {
  color: #94a3b8;
}

.close-by-id-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.close-by-id-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.close-by-id-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.close-by-id-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.close-by-id-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: closeTicketSpin 0.7s linear infinite;
}

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

/* ----- Error ----- */
.close-ticket-error {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(185, 28, 28, 0.08);
  color: #b91c1c;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.close-ticket-error-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b91c1c;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ----- List section ----- */
.close-ticket-list-section {
  margin-bottom: 2rem;
}

.close-ticket-list-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.close-ticket-list-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.close-ticket-list-count {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  background: var(--hover-bg, #f1f5f9);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 500;
}

.close-ticket-list-wrap {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* ----- Ticket cards ----- */
.close-ticket-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.close-ticket-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
  transition: background 0.2s;
}

.close-ticket-card:last-child {
  border-bottom: none;
}

.close-ticket-card:hover {
  background: var(--hover-bg, #f8fafc);
}

.close-ticket-card-main {
  flex: 1;
  min-width: 0;
}

.close-ticket-card-id {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #0d9488);
  margin-bottom: 0.25rem;
}

.close-ticket-card-subject {
  margin: 0 0 0.35rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  line-height: 1.35;
}

.close-ticket-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.2rem;
}

.close-ticket-card-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.close-ticket-card-date {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}

.close-ticket-card-action {
  flex-shrink: 0;
}

.close-ticket-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.close-ticket-card-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

.close-ticket-card-btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.close-ticket-card-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: closeTicketSpin 0.7s linear infinite;
}

/* ----- Empty state ----- */
.close-ticket-empty {
  padding: 3rem 2rem;
  text-align: center;
}

.close-ticket-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #0d9488;
  border-radius: 50%;
}

.close-ticket-empty-icon svg {
  width: 32px;
  height: 32px;
}

.close-ticket-empty-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.close-ticket-empty-desc {
  margin: 0 0 1.25rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
}

.close-ticket-empty-link {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: transparent;
  color: var(--primary, #0d9488);
  border: 1px solid rgba(13, 148, 136, 0.4);
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.close-ticket-empty-link:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: #0d9488;
}

/* ----- Loading ----- */
.close-ticket-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 1rem;
}

.close-ticket-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--border-color, #e2e8f0);
  border-top-color: var(--primary, #0d9488);
  border-radius: 50%;
  animation: closeTicketSpin 0.8s linear infinite;
}

.close-ticket-loading-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #64748b);
}

/* ========== Tablet ========== */
@media (max-width: 768px) {
  .close-ticket-page {
    padding: 1.25rem 1.5rem 2.5rem;
  }

  .close-ticket-header {
    gap: 1rem;
  }

  .close-ticket-header-icon {
    width: 48px;
    height: 48px;
  }

  .close-ticket-header-icon svg {
    width: 24px;
    height: 24px;
  }

  .close-ticket-header h1 {
    font-size: 1.5rem;
  }

  .close-by-id-section {
    padding: 1.25rem 1.5rem;
  }

  .close-ticket-card {
    padding: 1.1rem 1.25rem;
  }
}

/* ========== Mobile ========== */
@media (max-width: 640px) {
  .close-ticket-page {
    padding: 1rem 1rem 2rem;
  }

  .close-ticket-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .close-ticket-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .close-ticket-header-icon {
    margin: 0 auto;
  }

  .close-ticket-header-text {
    text-align: center;
  }

  .close-ticket-subtitle {
    margin: 0 auto;
  }

  .close-ticket-header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .close-ticket-btn-secondary,
  .close-ticket-btn-primary {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    min-height: 48px;
  }

  .close-by-id-section {
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 14px;
  }

  .close-by-id-header {
    margin-bottom: 0.85rem;
  }

  .close-by-id-icon {
    width: 36px;
    height: 36px;
  }

  .close-by-id-icon svg {
    width: 18px;
    height: 18px;
  }

  .close-by-id-title {
    font-size: 1rem;
  }

  .close-by-id-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .close-by-id-input {
    min-width: 100%;
    padding: 0.85rem 1rem;
    font-size: 16px;
  }

  .close-by-id-submit {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 1rem;
  }

  .close-ticket-list-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .close-ticket-list-title {
    font-size: 1.05rem;
  }

  .close-ticket-list-wrap {
    border-radius: 14px;
  }

  .close-ticket-cards {
    gap: 0;
  }

  .close-ticket-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem;
    margin: 0 0.75rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: none;
  }

  .close-ticket-card:last-child {
    margin-bottom: 0.75rem;
  }

  .close-ticket-card:hover {
    background: var(--card-bg, #fff);
  }

  .close-ticket-card-action {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color, #f1f5f9);
  }

  .close-ticket-card-btn {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
  }

  .close-ticket-empty {
    padding: 2.5rem 1.25rem;
  }

  .close-ticket-empty-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
  }

  .close-ticket-empty-icon svg {
    width: 28px;
    height: 28px;
  }

  .close-ticket-empty-title {
    font-size: 1.05rem;
  }

  .close-ticket-empty-desc {
    font-size: 0.9rem;
  }

  .close-ticket-empty-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .close-ticket-header h1 {
    font-size: 1.35rem;
  }

  .close-ticket-btn-secondary,
  .close-ticket-btn-primary {
    min-width: 100%;
  }
}

/* ================================ DARK THEME (night mode) ================================ */
body.night-mode .close-ticket-page {
  background: rgba(58, 56, 56, 0.95);
  min-height: 100%;
}
body.night-mode .close-ticket-breadcrumb-link {
  color: #f87171;
}
body.night-mode .close-ticket-breadcrumb-link:hover {
  color: #fca5a5;
}
body.night-mode .close-ticket-breadcrumb-sep,
body.night-mode .close-ticket-breadcrumb-current {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .close-ticket-header h1 {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .close-ticket-subtitle {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .close-ticket-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
}
body.night-mode .close-ticket-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
}
body.night-mode .close-by-id-section {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}
body.night-mode .close-by-id-title {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .close-by-id-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
}
body.night-mode .close-by-id-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
body.night-mode .close-by-id-input:focus {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}
body.night-mode .close-ticket-error {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.4);
}
body.night-mode .close-ticket-list-title {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .close-ticket-list-count {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
}
body.night-mode .close-ticket-list-wrap {
  background: rgba(58, 56, 56, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}
body.night-mode .close-ticket-card {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.night-mode .close-ticket-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
body.night-mode .close-ticket-card-id {
  color: #f87171;
}
body.night-mode .close-ticket-card-subject {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .close-ticket-card-meta,
body.night-mode .close-ticket-card-date {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .close-ticket-empty-title {
  color: rgba(255, 255, 255, 0.98);
}
body.night-mode .close-ticket-empty-desc {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .close-ticket-empty-icon {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}
body.night-mode .close-ticket-empty-link {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
}
body.night-mode .close-ticket-empty-link:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
  color: #fca5a5;
}
body.night-mode .close-ticket-loading-text {
  color: rgba(255, 255, 255, 0.9);
}
body.night-mode .close-ticket-spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: #f87171;
}
@media (max-width: 640px) {
  body.night-mode .close-ticket-card {
    background: rgba(58, 56, 56, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
  }
  body.night-mode .close-ticket-card-action {
    border-top-color: rgba(255, 255, 255, 0.1);
  }
}
