:root {
  --primary-color: #115e59;
  --primary-hover: #0f4c47;
  --accent-gold: #d4af37;
  --bg-gradient: linear-gradient(135deg, #061f1d 0%, #0b3f3b 100%);
  --card-bg: #ffffff;
  --font-headings: "Plus Jakarta Sans", sans-serif;
  --font-body: "Inter", sans-serif;
}

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

#pagePagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
}

#pagePagination .btn {
  min-width: 40px;
}

body {
  background-color: #f0f4f8;
  background-image:
    radial-gradient(
      circle at 20% 20%,
      rgba(17, 94, 89, 0.04) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(212, 175, 55, 0.04) 0%,
      transparent 40%
    );
  background-attachment: fixed;
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

body:has(.login-wrapper) {
  background: #0a1f0a;
  background: linear-gradient(135deg, #0a2e0a 0%, #1b5e20 50%, #0f3d0f 100%);
  overflow-x: hidden;
  position: relative;
}

.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

.bg-blob-1 {
  width: 500px;
  height: 500px;
  background: #2e7d32;
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.bg-blob-2 {
  width: 400px;
  height: 400px;
  background: #4caf50;
  bottom: -100px;
  right: -100px;
  animation-delay: -7s;
}

.bg-blob-3 {
  width: 350px;
  height: 350px;
  background: #fbbf24;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.15;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-30px, 30px) scale(0.95);
  }
}

/* ── Wrapper ─────────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ── Card ───────────────────────────────────────────────────────── */
.login-container {
  display: flex;
  max-width: 1100px;
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.6s ease-out;
}

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

.brand-side {
  flex: 1;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: white;
}

.brand-side::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(251, 191, 36, 0.15) 0%,
    transparent 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.brand-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    );
  background-size: 40px 40px;
  pointer-events: none;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.brand-logo {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-logo i {
  font-size: 26px;
  color: #fbbf24;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
}

.brand-name b {
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Brand content ──────────────────────────────────────────────── */
.brand-content {
  position: relative;
  z-index: 2;
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.92;
  margin-bottom: 32px;
  color: #ffffff;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: #ffffff;
}

.feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(251, 191, 36, 0.2); /* gold tint */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.feature-icon i {
  font-size: 14px;
  color: #fbbf24;
}

.brand-footer {
  position: relative;
  z-index: 2;
  font-size: 0.85rem;
  opacity: 0.85;
  color: #ffffff;
}

.form-side {
  flex: 1;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-header {
  margin-bottom: 32px;
}

.form-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.form-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
}

.input-group-custom {
  position: relative;
  margin-bottom: 20px;
}

.input-group-custom label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: #9ca3af;
  z-index: 2;
  transition: color 0.3s ease;
}

.form-control-custom {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  color: #1f2937;
  background: #f9fafb;
  transition: all 0.3s ease;
  outline: none;
}

.form-control-custom:focus {
  border-color: #2e7d32;
  background: white;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
}

.form-control-custom::placeholder {
  color: #9ca3af;
}

.password-toggle {
  position: absolute;
  right: 16px;
  color: #9ca3af;
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: #2e7d32;
}

/* ── Options row ────────────────────────────────────────────────── */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 0.875rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
}

.remember-me input {
  display: none;
}

.remember-me input:checked + .custom-checkbox {
  background: #2e7d32;
  border-color: #2e7d32;
}

.remember-me input:checked + .custom-checkbox::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.forgot-link {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: #1b5e20;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(251, 191, 36, 0.25),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.45);
}

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

.btn-login.loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn-login .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-login.loading .spinner {
  display: block;
}

.btn-login.loading .btn-text,
.btn-login.loading .btn-icon {
  display: none;
}

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

.divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider-text {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
}

.signup-link {
  text-align: center;
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0;
}

.signup-link a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.signup-link a:hover {
  color: #1b5e20;
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    max-width: 480px;
  }

  .brand-side {
    padding: 40px 30px;
    text-align: center;
  }

  .brand-header {
    justify-content: center;
  }

  .brand-title {
    font-size: 1.875rem;
  }

  .feature-list {
    display: none;
  }

  .form-side {
    padding: 40px 30px;
  }
}

@media (max-width: 480px) {
  .form-options {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .brand-side {
    padding: 30px 20px;
  }
  .form-side {
    padding: 30px 20px;
  }
}

/* End of Login */

/* Dashboard */
/* ==========================================================================
   DASHBOARD PAGE — COMPLETE CSS
   ========================================================================== */

/* ── PAGE WRAPPER ─────────────────────────────────────────────── */
.container-fluid[style*="background: linear-gradient"] {
  position: relative;
}

/* ── DASHBOARD HEADER ─────────────────────────────────────────── */
.dashboard-header {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
}

.dashboard-header .avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.dashboard-header .text-muted.small.mb-1 {
  font-size: 0.85rem !important;
  font-weight: 500;
}

.dashboard-header h2.fw-bold {
  font-family: var(--font-headings, "Plus Jakarta Sans"), sans-serif;
  line-height: 1.2;
  margin-bottom: 0.5rem !important;
}

.role-badge {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(67, 56, 202, 0.1);
}

/* ── HEADER ACTION BUTTONS ────────────────────────────────────── */
.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.btn-icon:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

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

.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

.date-pill {
  background: #f9fafb;
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.date-pill i {
  color: #6b7280;
}

/* ── STAT CARDS ───────────────────────────────────────────────── */
.row.g-3.mb-4 .stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: fadeInUp 0.4s ease backwards;
}

.row.g-3.mb-4 .stat-card:nth-child(1) {
  animation-delay: 0.05s;
}
.row.g-3.mb-4 .stat-card:nth-child(2) {
  animation-delay: 0.1s;
}
.row.g-3.mb-4 .stat-card:nth-child(3) {
  animation-delay: 0.15s;
}
.row.g-3.mb-4 .stat-card:nth-child(4) {
  animation-delay: 0.2s;
}

.row.g-3.mb-4 .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-content {
  flex-grow: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
  line-height: 1;
  font-family: var(--font-headings, "Plus Jakarta Sans"), sans-serif;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
  font-weight: 500;
}

.stat-trend i {
  font-size: 0.65rem;
}

.trend-up {
  color: #10b981;
}

/* Background watermark icon */
.stat-bg-icon {
  position: absolute;
  right: -15px;
  bottom: -25px;
  font-size: 6rem;
  opacity: 0.06;
  pointer-events: none;
  color: #111827;
}

/* ── STAT CARD COLOR VARIANTS ─────────────────────────────────── */
.stat-blue .stat-icon {
  background: #dbeafe;
  color: #2563eb;
}
.stat-blue .stat-bg-icon {
  color: #2563eb;
}

.stat-red .stat-icon {
  background: #fee2e2;
  color: #dc2626;
}
.stat-red .stat-bg-icon {
  color: #dc2626;
}

.stat-green .stat-icon {
  background: #d1fae5;
  color: #059669;
}
.stat-green .stat-bg-icon {
  color: #059669;
}

.stat-amber .stat-icon {
  background: #fef3c7;
  color: #d97706;
}
.stat-amber .stat-bg-icon {
  color: #d97706;
}

/* ── CARD CONTAINERS ──────────────────────────────────────────── */
.card {
  border-radius: 16px !important;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #f1f5f9 !important;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.06),
    0 8px 30px rgba(0, 0, 0, 0.04) !important;
}

/* ── CARD HEADER (Tickets Card) ───────────────────────────────── */
.card-header-custom {
  background: white;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-radius: 16px 16px 0 0 !important;
}

.card-header-custom h5 {
  color: #1f2937;
  font-size: 1.05rem;
  font-family: var(--font-headings, "Plus Jakarta Sans"), sans-serif;
}

.card-header-custom p {
  color: #6b7280;
  font-size: 0.85rem;
}

/* ── FILTER PILLS ─────────────────────────────────────────────── */
.filter-pills {
  display: inline-flex;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}

.filter-pill {
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-pill.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-pill:hover:not(.active) {
  color: #374151;
}

/* ── REFRESH BUTTON ───────────────────────────────────────────── */
.btn-refresh {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-refresh:hover {
  background: #f9fafb;
  color: #2563eb;
  border-color: #2563eb;
  transform: rotate(180deg);
}

/* ── MODERN TABLE (Recent Tickets) ─────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  min-height: 600px;
  width: 100%;
}

.table th,
.table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem; /* slightly smaller */
}

@media (max-width: 768px) {
  .btn-sm,
  .btn {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media (max-width: 768px) {
  .table th,
  .table td {
    font-size: 12px;
    padding: 6px;
  }
}

.modern-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.modern-table thead th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.85rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.modern-table thead th.text-center {
  text-align: center;
}

.modern-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
  white-space: nowrap;
}

.modern-table tbody tr {
  transition: all 0.15s ease;
}

.modern-table tbody tr:hover {
  background: #fafbfc;
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

.modern-table .ticket-no {
  font-family: "Courier New", monospace;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-block;
}

.modern-table .subject-cell {
  font-weight: 600;
  color: #1f2937;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modern-table .category-tag {
  background: #f3f4f6;
  color: #4b5563;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

/* ── STATUS BADGES ────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-open {
  background: #fef3c7;
  color: #d97706;
}

.status-progress {
  background: #dbeafe;
  color: #2563eb;
}

.status-resolved {
  background: #d1fae5;
  color: #059669;
}

.status-pending {
  background: #fee2e2;
  color: #dc2626;
}

/* ── LOADING STATE ────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.spinner-modern {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #2e7d32;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── QUICK ACTIONS CARD ───────────────────────────────────────── */
.card .card-body h6 {
  color: #1f2937;
  font-size: 0.95rem;
  font-family: var(--font-headings, "Plus Jakarta Sans"), sans-serif;
}

.quick-action-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-action-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid #f3f4f6;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.quick-action-item:hover {
  border-color: #e5e7eb;
  background: #fafbfc;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.quick-action-item:active {
  transform: translateX(0);
}

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action-item .fw-semibold {
  font-size: 0.9rem;
  color: #1f2937;
  font-weight: 600;
  line-height: 1.3;
}

.quick-action-item small {
  color: #6b7280;
  font-size: 0.75rem;
}

.bg-primary-subtle {
  background: #eff6ff;
}
.bg-success-subtle {
  background: #ecfdf5;
}
.bg-warning-subtle {
  background: #fffbeb;
}

/* ── ADVISORY CARD ────────────────────────────────────────────── */
.advisory-card {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(30, 41, 59, 0.2);
}

.advisory-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.advisory-card::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(
    circle,
    rgba(46, 125, 50, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.advisory-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.advisory-icon i {
  color: #fbbf24;
  font-size: 1.1rem;
}

.advisory-card h6 {
  font-size: 1rem;
  color: white;
  position: relative;
  z-index: 1;
}

.advisory-card p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.advisory-card p strong {
  color: #fbbf24;
  font-weight: 600;
}

/* ── ANIMATIONS ───────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .dashboard-header {
    padding: 1.25rem 1.5rem;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.85rem 1rem;
  }
}

@media (max-width: 768px) {
  /* ── PAGE PADDING ─────────────────────────────────────────── */
  .container-fluid[style*="background: linear-gradient"] {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* ── DASHBOARD HEADER ─────────────────────────────────────── */
  .dashboard-header {
    padding: 1.25rem;
    margin-bottom: 1rem !important;
  }

  .dashboard-header .d-flex.justify-content-between {
    gap: 1rem;
  }

  .dashboard-header .avatar-circle {
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
  }

  .dashboard-header h2.fw-bold {
    font-size: 1.25rem !important;
  }

  .dashboard-header .text-muted.small.mb-1 {
    font-size: 0.78rem !important;
  }

  .role-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }

  /* Header right side */
  .dashboard-header > div > div:last-child {
    width: 100%;
    justify-content: space-between !important;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .date-pill {
    padding: 0.55rem 0.9rem;
    font-size: 0.78rem;
    flex: 1;
    justify-content: center;
  }

  /* ── STAT CARDS ───────────────────────────────────────────── */
  .row.g-3.mb-4 {
    gap: 10px !important;
    margin-bottom: 1rem !important;
  }

  .stat-card {
    padding: 1.1rem !important;
    gap: 0.85rem !important;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    border-radius: 12px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
  }

  .stat-trend {
    font-size: 0.7rem;
  }

  .stat-bg-icon {
    font-size: 4.5rem;
    right: -10px;
    bottom: -20px;
  }

  /* ── MAIN CONTENT ROW ─────────────────────────────────────── */
  .row.g-3.mb-4:last-child {
    gap: 12px !important;
  }

  /* ── TICKETS CARD ─────────────────────────────────────────── */
  .card-header-custom {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }

  .card-header-custom h5 {
    font-size: 0.95rem;
  }

  .card-header-custom p {
    font-size: 0.78rem;
  }

  .card-header-custom > div:last-child {
    width: 100%;
    justify-content: space-between;
  }

  .filter-pills {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .btn-refresh {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  /* ── MODERN TABLE (SIDE-BY-SIDE ON MOBILE) ───────────────── */
  .table-responsive {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Fade gradient hint */
  .table-responsive::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.95)
    );
    pointer-events: none;
    z-index: 1;
  }

  .modern-table {
    display: table !important;
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 0.82rem;
  }

  .modern-table thead {
    display: table-header-group !important;
  }

  .modern-table tbody {
    display: table-row-group !important;
  }

  .modern-table tr {
    display: table-row !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .modern-table th,
  .modern-table td {
    display: table-cell !important;
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    vertical-align: middle !important;
    white-space: nowrap;
  }

  .modern-table th.text-center,
  .modern-table td.text-center {
    text-align: center !important;
  }

  .modern-table thead th {
    padding: 10px 12px !important;
    font-size: 10px !important;
  }

  /* Remove any leftover mobile-card ::before labels */
  .modern-table td::before,
  .modern-table tbody td::before {
    display: none !important;
    content: none !important;
  }

  /* Sticky first column (Ticket #) */
  .modern-table thead th:first-child,
  .modern-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: white !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .modern-table thead th:first-child {
    background: #f8fafc !important;
    z-index: 3;
  }

  /* Sticky last column (Status) */
  .modern-table thead th:last-child,
  .modern-table tbody td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: white !important;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .modern-table thead th:last-child {
    background: #f8fafc !important;
    z-index: 3;
  }

  .modern-table .ticket-no {
    padding: 3px 7px !important;
    font-size: 11px !important;
  }

  .modern-table .subject-cell {
    max-width: 180px;
  }

  .modern-table .category-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
  }

  .status-badge {
    padding: 0.25rem 0.65rem;
    font-size: 0.68rem;
  }

  /* Loading state in table */
  .modern-table tbody td[colspan] {
    padding: 2rem 1rem !important;
  }

  .spinner-modern {
    width: 32px;
    height: 32px;
    border-width: 2.5px;
  }

  /* ── QUICK ACTIONS CARD ───────────────────────────────────── */
  .card .card-body {
    padding: 1.25rem !important;
  }

  .card .card-body h6 {
    font-size: 0.9rem;
    margin-bottom: 0.85rem !important;
  }

  .quick-action-item {
    padding: 0.75rem;
    gap: 0.7rem;
  }

  .quick-action-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .quick-action-item .fw-semibold {
    font-size: 0.85rem;
  }

  .quick-action-item small {
    font-size: 0.7rem;
  }

  /* ── ADVISORY CARD ────────────────────────────────────────── */
  .advisory-card {
    padding: 1.25rem;
  }

  .advisory-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 0.7rem;
  }

  .advisory-card h6 {
    font-size: 0.95rem;
  }

  .advisory-card p {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .dashboard-header {
    padding: 1rem;
  }

  .dashboard-header .avatar-circle {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .dashboard-header h2.fw-bold {
    font-size: 1.1rem !important;
  }

  .stat-card {
    padding: 0.95rem !important;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .modern-table {
    min-width: 480px !important;
  }

  .modern-table th,
  .modern-table td {
    padding: 8px 10px !important;
    font-size: 11.5px !important;
  }

  .modern-table .subject-cell {
    max-width: 140px;
  }
}

@media (max-width: 380px) {
  /* Very small phones */
  .dashboard-header .d-flex.align-items-center.gap-3 {
    gap: 0.75rem !important;
  }

  .modern-table {
    min-width: 420px !important;
  }
}

/* ── SCROLLBAR STYLING ────────────────────────────────────────── */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── REDUCED MOTION ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/*End of Dashboard */

/*Ticketing */
.tk-page {
  min-height: 100vh;
  background: #f8fafc;
  padding: 24px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #1f2937;
}

.tk-card {
  background: white;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.tk-header {
  padding: 24px 28px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.tk-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tk-icon-box {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  flex-shrink: 0;
}

.tk-header-title h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.tk-header-title p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.tk-btn-primary {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-family: inherit;
}

.tk-btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(251, 191, 36, 0.25),
    transparent
  );
  transition: left 0.6s ease;
}

.tk-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.35);
}

.tk-btn-primary:hover::before {
  left: 100%;
}

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

/* ── STATS ────────────────────────────────────────────────────── */
.tk-stats {
  padding: 20px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  border-bottom: 1px solid #f1f5f9;
}

.tk-stat {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.tk-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.tk-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tk-stat.active .tk-stat-icon {
  background: #dbeafe;
  color: #1e40af;
}
.tk-stat.resolved .tk-stat-icon {
  background: #e8f5e9;
  color: #2e7d32;
}
.tk-stat.pending .tk-stat-icon {
  background: #fef3c7;
  color: #b45309;
}

.tk-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.tk-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
  margin-top: 2px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.tk-stat-value .fa-spin {
  font-size: 18px;
  color: #9ca3af;
}

/* ── TOOLBAR ──────────────────────────────────────────────────── */
.tk-toolbar {
  padding: 16px 28px;
  background: #fafbfc;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.tk-toolbar label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
  white-space: nowrap;
}

.tk-toolbar select,
.tk-toolbar input {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: white;
  color: #1f2937;
  transition: all 0.2s ease;
  min-width: 200px;
  font-family: inherit;
}

.tk-toolbar select:focus,
.tk-toolbar input:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.tk-toolbar input::placeholder {
  color: #9ca3af;
}

/* ── TABLE WRAPPER (CRITICAL FOR MOBILE) ──────────────────────── */
.tk-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: white;
}

/* Right edge fade gradient */
.tk-table-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.95)
  );
  pointer-events: none;
  z-index: 1;
}

/* ── TABLE (DESKTOP DEFAULT) ──────────────────────────────────── */
.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tk-table thead th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.tk-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
  white-space: nowrap;
}

.tk-table tbody tr {
  transition: background 0.15s ease;
}

.tk-table tbody tr:hover {
  background: #fafbfc;
}

.tk-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── TABLE INNER ELEMENTS ─────────────────────────────────────── */
.tk-ticket-no {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.tk-subject {
  font-weight: 600;
  color: #1f2937;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ── STATUS BADGES ────────────────────────────────────────────── */
.tk-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tk-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tk-badge.pending {
  background: #fef3c7;
  color: #b45309;
}
.tk-badge.active {
  background: #dbeafe;
  color: #1e40af;
}
.tk-badge.resolved {
  background: #e8f5e9;
  color: #2e7d32;
}
.tk-badge.closed {
  background: #f3f4f6;
  color: #4b5563;
}
.tk-badge.high {
  background: #fee2e2;
  color: #b91c1c;
}

/* ── ACTION BUTTONS ───────────────────────────────────────────── */
.tk-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  margin: 0 2px;
  font-family: inherit;
}

.tk-btn-icon:hover {
  border-color: #2e7d32;
  color: #2e7d32;
  background: #e8f5e9;
  transform: translateY(-1px);
}

.tk-btn-icon.danger:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fee2e2;
}

/* ── FOOTER & PAGINATION ──────────────────────────────────────── */
.tk-footer {
  padding: 16px 28px;
  display: flex;
  justify-content: flex-end;
  background: white;
  border-top: 1px solid #f1f5f9;
}

.tk-pagination {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.tk-pagination .page-item {
  list-style: none;
}

.tk-pagination .page-link {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #1f2937;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-block;
}

.tk-pagination .page-item.active .page-link {
  background: #2e7d32;
  color: white;
  border-color: #2e7d32;
}

.tk-pagination .page-link:hover:not(.disabled) {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #2e7d32;
}

.tk-pagination .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ════════════════════════════════════════════════════════════════
   MODAL STYLES (BASE)
   ════════════════════════════════════════════════════════════════ */
.tk-modal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  background: white;
}

.tk-modal .modal-header {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  padding: 18px 24px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tk-modal .modal-header h5 {
  font-weight: 700;
  font-size: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.tk-modal .modal-header h5 i {
  color: #fbbf24;
  font-size: 15px;
}

.tk-modal .modal-header .close {
  color: white;
  opacity: 1;
  text-shadow: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  padding: 0;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s;
}

.tk-modal .modal-header .close:hover {
  opacity: 0.7;
}

.tk-modal .modal-header .close span {
  color: white;
}

.tk-modal .modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
  background: #f8fafc;
}

.tk-modal .modal-body.p-0 {
  padding: 0 !important;
  max-height: 80vh;
}

.tk-modal .modal-footer {
  background: #fafbfc;
  border-top: 1px solid #e5e7eb;
  padding: 16px 24px;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── FORM CONTROLS IN MODAL ───────────────────────────────────── */
.tk-modal .form-group {
  margin-bottom: 0;
}

.tk-modal .form-group label,
.tk-modal label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tk-modal .form-control {
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #1f2937;
  transition: all 0.2s ease;
  width: 100%;
  background: white;
  font-family: inherit;
  line-height: 1.4;
}

.tk-modal .form-control:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
  outline: none;
  background: white;
}

.tk-modal .form-control[readonly] {
  background: #f1f5f9;
  color: #6b7280;
  cursor: not-allowed;
}

.tk-modal .form-control:disabled {
  background: #f9fafb;
  color: #9ca3af;
}

.tk-modal textarea.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.tk-modal .form-control::placeholder {
  color: #9ca3af;
}

.tk-modal input[type="file"].form-control {
  padding: 7px 12px;
  cursor: pointer;
}

.tk-modal input[type="file"].form-control::-webkit-file-upload-button {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.tk-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}

.tk-btn-success {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
}

.tk-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.35);
}

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

.tk-btn-danger {
  background: white;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.tk-btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.tk-btn-secondary {
  background: white;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.tk-btn-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* ── WORKSPACE (Edit Modal Split Layout) ──────────────────────── */
.tk-workspace {
  display: flex;
  min-height: 70vh;
}

.tk-workspace-left {
  flex: 7;
  padding: 24px;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  background: #f8fafc;
}

.tk-workspace-right {
  flex: 5;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
  min-width: 0;
}

/* Chat Header */
.tk-chat-header {
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.tk-chat-header span {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tk-chat-header span i {
  color: #2e7d32;
}

.tk-live-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tk-live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2e7d32;
  animation: tk-pulse 1.5s infinite;
}

@keyframes tk-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(46, 125, 50, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
  }
}

/* Chat Stream */
.tk-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 350px;
  max-height: 500px;
}

.tk-chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease;
}

.tk-chat-bubble.agent {
  align-self: flex-start;
  background: white;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  color: #1f2937;
}

.tk-chat-bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.tk-chat-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

/* Chat Form */
.tk-chat-form {
  padding: 14px 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.tk-chat-form .input-group {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  transition: border-color 0.2s;
  background: white;
}

.tk-chat-form .input-group:focus-within {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.tk-chat-form input {
  border: none !important;
  padding: 10px 14px;
  font-size: 13.5px;
  flex: 1;
  outline: none;
  background: white;
  font-family: inherit;
  color: #1f2937;
}

.tk-chat-form input:focus {
  box-shadow: none !important;
}

.tk-chat-form input::placeholder {
  color: #9ca3af;
}

.tk-chat-form .input-group-append {
  display: flex;
}

.tk-chat-form button {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  border: none;
  padding: 0 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
}

.tk-chat-form button:hover {
  background: linear-gradient(135deg, #1b5e20 0%, #14532d 100%);
}

.tk-chat-form button:active {
  transform: scale(0.98);
}

/* Attachment Preview */
.tk-attachment {
  height: 130px;
  border: 1.5px dashed #e5e7eb;
  border-radius: 10px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 13px;
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
}

.tk-attachment:hover {
  border-color: #2e7d32;
  background: #fafbfc;
}

.tk-attachment a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 10px;
}

.tk-attachment img {
  max-height: 100px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}

#noAttachmentText {
  position: absolute;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

/* ── ANIMATIONS ───────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SCROLLBAR STYLING ────────────────────────────────────────── */
.tk-table-wrap::-webkit-scrollbar,
.tk-chat-stream::-webkit-scrollbar,
.tk-workspace-left::-webkit-scrollbar,
.tk-modal .modal-body::-webkit-scrollbar {
  height: 8px;
  width: 6px;
}

.tk-table-wrap::-webkit-scrollbar-track,
.tk-chat-stream::-webkit-scrollbar-track,
.tk-workspace-left::-webkit-scrollbar-track,
.tk-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.tk-table-wrap::-webkit-scrollbar-thumb,
.tk-chat-stream::-webkit-scrollbar-thumb,
.tk-workspace-left::-webkit-scrollbar-thumb,
.tk-modal .modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.tk-table-wrap::-webkit-scrollbar-thumb:hover,
.tk-chat-stream::-webkit-scrollbar-thumb:hover,
.tk-workspace-left::-webkit-scrollbar-thumb:hover,
.tk-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — KEEP TABLE SIDE-BY-SIDE
   ════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 992px) {
  .tk-table-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tk-table {
    min-width: 760px;
  }

  /* Sticky first column (Ticket No) */
  .tk-table thead th:first-child,
  .tk-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: white !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .tk-table thead th:first-child {
    background: #f8fafc !important;
    z-index: 3;
  }

  /* Sticky last column (Actions) */
  .tk-table thead th:last-child,
  .tk-table tbody td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: white !important;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .tk-table thead th:last-child {
    background: #f8fafc !important;
    z-index: 3;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .tk-page {
    padding: 12px;
  }

  /* ── HEADER ─────────────────────────────────────────────── */
  .tk-header {
    padding: 16px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tk-header-title {
    gap: 12px;
  }

  .tk-icon-box {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .tk-header-title h3 {
    font-size: 1.2rem;
  }

  .tk-header-title p {
    font-size: 12px;
  }

  .tk-btn-primary {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
  }

  /* ── STATS ──────────────────────────────────────────────── */
  .tk-stats {
    padding: 14px 16px;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
  }

  .tk-stat {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    gap: 8px;
  }

  .tk-stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
  }

  .tk-stat-value {
    font-size: 18px;
  }

  .tk-stat-label {
    font-size: 9.5px;
    margin-bottom: 2px;
  }

  /* ── TOOLBAR ────────────────────────────────────────────── */
  .tk-toolbar {
    padding: 12px 16px;
    gap: 10px;
  }

  .tk-toolbar > div {
    flex: 1;
    min-width: 0;
  }

  .tk-toolbar label {
    font-size: 10px;
    margin-right: 6px;
  }

  .tk-toolbar select,
  .tk-toolbar input {
    min-width: 0;
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
  }

  /* ══ TABLE — SIDE-BY-SIDE ON MOBILE ══ */
  .tk-table-wrap {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tk-table-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.95)
    );
    pointer-events: none;
    z-index: 1;
  }

  .tk-table {
    display: table !important;
    width: 100%;
    min-width: 720px;
    table-layout: auto;
    border-collapse: collapse;
  }

  .tk-table thead {
    display: table-header-group !important;
  }

  .tk-table tbody {
    display: table-row-group !important;
  }

  .tk-table tr {
    display: table-row !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .tk-table th,
  .tk-table td {
    display: table-cell !important;
    padding: 10px 12px !important;
    font-size: 12.5px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap;
  }

  .tk-table thead th {
    padding: 10px 12px !important;
    font-size: 10px !important;
  }

  /* Remove any Bootstrap table-responsive conflicts */
  .tk-table.table-responsive {
    display: table !important;
  }

  /* REMOVE the ugly ::before labels */
  .tk-table td::before,
  .tk-table tbody td::before {
    display: none !important;
    content: none !important;
  }

  /* Sticky first column */
  .tk-table thead th:first-child,
  .tk-table tbody td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: white !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .tk-table thead th:first-child {
    background: #f8fafc !important;
    z-index: 3 !important;
  }

  /* Sticky last column */
  .tk-table thead th:last-child,
  .tk-table tbody td:last-child {
    position: sticky !important;
    right: 0 !important;
    z-index: 2 !important;
    background: white !important;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .tk-table thead th:last-child {
    background: #f8fafc !important;
    z-index: 3 !important;
  }

  /* Compact content */
  .tk-ticket-no {
    padding: 3px 7px !important;
    font-size: 11px !important;
  }

  .tk-subject {
    max-width: 160px;
  }

  .tk-badge {
    padding: 3px 8px !important;
    font-size: 10px !important;
  }

  .tk-btn-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }

  /* ── FOOTER & PAGINATION ─────────────────────────────────── */
  .tk-footer {
    padding: 12px 16px;
    justify-content: center;
  }

  .tk-pagination .page-link {
    padding: 5px 10px;
    font-size: 12px;
  }

  /* ── MODALS ─────────────────────────────────────────────── */
  .tk-modal .modal-body {
    padding: 16px;
  }

  .tk-modal .modal-footer {
    padding: 12px 16px;
  }

  .tk-modal .modal-header {
    padding: 14px 18px;
  }

  .tk-modal .modal-header h5 {
    font-size: 14px;
  }

  /* ── WORKSPACE GOES VERTICAL ────────────────────────────── */
  .tk-workspace {
    flex-direction: column;
    min-height: auto;
  }

  .tk-workspace-left {
    flex: none;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    max-height: 50vh;
    min-height: 300px;
  }

  .tk-workspace-right {
    flex: none;
    min-height: 400px;
  }

  .tk-chat-stream {
    min-height: 280px;
    max-height: 350px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .tk-page {
    padding: 8px;
  }

  .tk-header {
    padding: 14px;
  }

  .tk-icon-box {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .tk-header-title h3 {
    font-size: 1.1rem;
  }

  .tk-stats {
    padding: 10px;
    gap: 8px;
  }

  .tk-stat {
    padding: 10px 12px;
  }

  .tk-stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .tk-stat-value {
    font-size: 16px;
  }

  .tk-toolbar {
    padding: 10px 12px;
  }

  .tk-table {
    min-width: 620px !important;
  }

  .tk-table th,
  .tk-table td {
    padding: 8px 10px !important;
    font-size: 11.5px !important;
  }

  .tk-subject {
    max-width: 120px;
  }

  .tk-btn-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .tk-workspace-left {
    padding: 14px;
    max-height: 45vh;
  }

  .tk-chat-form {
    padding: 10px 12px;
  }

  .tk-chat-form button {
    padding: 0 12px;
    font-size: 12px;
  }

  .tk-chat-form button span {
    display: none;
  }
}

/* Very tiny phones */
@media (max-width: 380px) {
  .tk-table {
    min-width: 560px !important;
  }

  .tk-stat {
    padding: 8px 10px;
  }

  .tk-stat-value {
    font-size: 15px;
  }
}

/* ── REDUCED MOTION ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/*End of Ticketing */

/*Ticket Report */
.rp-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: 24px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #1f2937;
}

/* ── HEADER / CONTROLS ────────────────────────────────────────── */
.rp-header {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.rp-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
}

.rp-header h3::before {
  content: "\f201";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
  color: white;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  flex-shrink: 0;
}

.rp-header p {
  color: #6b7280;
  font-size: 13px;
  margin: 4px 0 0 54px;
  line-height: 1.4;
}

/* ── CONTROLS GROUP ───────────────────────────────────────────── */
.rp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.rp-control-group {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 4px 12px;
  gap: 8px;
  transition: all 0.2s ease;
}

.rp-control-group:focus-within {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
  background: white;
}

.rp-control-group span {
  font-size: 10.5px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.rp-control-group input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  font-size: 13px !important;
  font-weight: 600;
  color: #1f2937;
  width: 140px !important;
  font-family: inherit;
  outline: none !important;
}

.rp-control-group input:focus {
  color: #1f2937 !important;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.rp-btn {
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.rp-btn-filter {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  position: relative;
  overflow: hidden;
}

.rp-btn-filter::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(251, 191, 36, 0.25),
    transparent
  );
  transition: left 0.6s ease;
}

.rp-btn-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.35);
}

.rp-btn-filter:hover::before {
  left: 100%;
}

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

.rp-btn-print {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.rp-btn-print:hover {
  background: #f3f4f6;
  border-color: #2e7d32;
  color: #2e7d32;
}

.rp-btn-print:active {
  transform: scale(0.98);
}

/* ── HERO TOTAL CARD ──────────────────────────────────────────── */
.rp-hero {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  border-radius: 14px;
  padding: 24px 32px;
  color: white;
  box-shadow: 0 10px 30px rgba(46, 125, 50, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.rp-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(251, 191, 36, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.rp-hero::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 250px;
  height: 250px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.rp-hero-text {
  position: relative;
  z-index: 1;
}

.rp-hero-text .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 6px;
}

.rp-hero-text h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -1px;
  line-height: 1;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.rp-hero-text .sub {
  margin-top: 6px;
  opacity: 0.85;
  font-size: 13px;
  font-weight: 400;
}

.rp-hero-icon {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 32px;
  backdrop-filter: blur(10px);
  color: #fbbf24;
  flex-shrink: 0;
}

/* ── STAT TILES ROW ───────────────────────────────────────────── */
.rp-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.rp-stat {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.rp-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.rp-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.rp-stat.resolved .rp-stat-icon {
  background: #e8f5e9;
  color: #2e7d32;
}

.rp-stat.pending .rp-stat-icon {
  background: #fef3c7;
  color: #b45309;
}

.rp-stat.active .rp-stat-icon {
  background: #dbeafe;
  color: #1e40af;
}

.rp-stat.urgent .rp-stat-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.rp-stat.closed .rp-stat-icon {
  background: #f3f4f6;
  color: #4b5563;
}

.rp-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.rp-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
  margin-top: 2px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.rp-stat-trend {
  font-size: 11px;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.rp-stat-trend i {
  font-size: 9px;
}

.rp-stat-trend.up {
  color: #2e7d32;
}

.rp-stat-trend.down {
  color: #dc2626;
}

/* ── CARDS (Chart Containers) ─────────────────────────────────── */
.rp-card {
  background: white;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.rp-card:hover {
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.06),
    0 8px 30px rgba(0, 0, 0, 0.04);
}

.rp-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.rp-card-header h6 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.rp-card-header .rp-tag {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.rp-card-header .rp-tag i {
  font-size: 9px;
}

.rp-card-body {
  padding: 20px;
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.rp-canvas-wrap {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}

.rp-canvas-wrap canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* ── TREND CARD (Wider chart) ─────────────────────────────────── */
.rp-trend-card .rp-card-body {
  padding: 24px;
}

.rp-trend-card .rp-canvas-wrap {
  min-height: 280px;
}

/* ── TOP CATEGORIES LIST ──────────────────────────────────────── */
.rp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rp-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.rp-list-item:hover {
  background: #fafbfc;
  margin: 0 -10px;
  padding: 14px 10px;
  border-radius: 8px;
}

.rp-list-item:last-child {
  border-bottom: none;
}

.rp-list-rank {
  width: 28px;
  height: 28px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.rp-list-item:nth-child(1) .rp-list-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.rp-list-item:nth-child(2) .rp-list-rank {
  background: #e5e7eb;
  color: #4b5563;
}

.rp-list-item:nth-child(3) .rp-list-rank {
  background: #fed7aa;
  color: #c2410c;
}

.rp-list-info {
  flex: 1;
  min-width: 0;
}

.rp-list-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.rp-list-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.rp-list-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2e7d32, #4caf50);
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.rp-list-value {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  flex-shrink: 0;
}

/* ── ACTIVITY FEED ────────────────────────────────────────────── */
.rp-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.rp-activity::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, #e8f5e9 0%, transparent 100%);
}

.rp-activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  position: relative;
  transition: background 0.15s ease;
}

.rp-activity-item:hover {
  background: #fafbfc;
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 8px;
}

.rp-activity-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #e8f5e9;
}

.rp-activity-item:nth-child(1) .rp-activity-dot {
  background: #dbeafe;
  color: #1e40af;
  box-shadow: 0 0 0 2px #dbeafe;
}

.rp-activity-item:nth-child(2) .rp-activity-dot {
  background: #e8f5e9;
  color: #2e7d32;
  box-shadow: 0 0 0 2px #e8f5e9;
}

.rp-activity-item:nth-child(3) .rp-activity-dot {
  background: #fef3c7;
  color: #b45309;
  box-shadow: 0 0 0 2px #fef3c7;
}

.rp-activity-item:nth-child(4) .rp-activity-dot {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 2px #fee2e2;
}

.rp-activity-item:nth-child(5) .rp-activity-dot {
  background: #ede9fe;
  color: #6d28d9;
  box-shadow: 0 0 0 2px #ede9fe;
}

.rp-activity-content {
  flex: 1;
  min-width: 0;
}

.rp-activity-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
  line-height: 1.4;
}

.rp-activity-title b {
  color: #2e7d32;
  font-weight: 700;
}

.rp-activity-time {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

/* ── PRINT STYLES ─────────────────────────────────────────────── */
.print-only-header {
  display: none;
}

@media print {
  .no-print,
  .rp-controls,
  .rp-trend-card,
  .rp-hero {
    display: none !important;
  }

  .print-only-header {
    display: block !important;
  }

  .rp-page {
    background: white !important;
    padding: 0 !important;
  }

  .rp-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }

  .rp-card-header {
    background: #f9fafb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .rp-stat-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    page-break-inside: avoid;
  }

  .rp-stat {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 992px) {
  .rp-page {
    padding: 16px;
  }

  .rp-header h3 {
    font-size: 1.35rem;
  }

  .rp-hero-text h1 {
    font-size: 2.5rem;
  }

  .rp-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .rp-page {
    padding: 12px;
  }

  /* ── HEADER ─────────────────────────────────────────────── */
  .rp-header {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
  }

  .rp-header h3 {
    font-size: 1.2rem;
    gap: 10px;
  }

  .rp-header h3::before {
    width: 38px;
    height: 38px;
    font-size: 14px;
    border-radius: 10px;
  }

  .rp-header p {
    font-size: 12px;
    margin-left: 48px;
    margin-top: 2px;
  }

  /* ── CONTROLS — 2x2 grid ────────────────────────────────── */
  .rp-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .rp-control-group {
    padding: 4px 10px;
    gap: 6px;
  }

  .rp-control-group span {
    font-size: 9.5px;
  }

  .rp-control-group input {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 12px !important;
  }

  .rp-btn {
    padding: 9px 14px;
    font-size: 12.5px;
    justify-content: center;
  }

  .rp-btn-filter,
  .rp-btn-print {
    grid-column: span 1;
  }

  /* Make filter & print buttons span full width */
  .rp-btn-filter,
  .rp-btn-print {
    grid-column: 1 / -1;
  }

  /* ── HERO TOTAL ─────────────────────────────────────────── */
  .rp-hero {
    padding: 20px;
    flex-direction: row;
    gap: 16px;
    margin-bottom: 16px;
  }

  .rp-hero-text .label {
    font-size: 10px;
  }

  .rp-hero-text h1 {
    font-size: 2.25rem;
  }

  .rp-hero-text .sub {
    font-size: 12px;
  }

  .rp-hero-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
    border-radius: 16px;
  }

  /* ── STAT TILES — 2x2 grid ──────────────────────────────── */
  .rp-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .rp-stat {
    padding: 14px;
    gap: 10px;
  }

  .rp-stat-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 10px;
  }

  .rp-stat-value {
    font-size: 18px;
  }

  .rp-stat-label {
    font-size: 9.5px;
  }

  .rp-stat-trend {
    font-size: 10px;
  }

  /* ── CARDS ──────────────────────────────────────────────── */
  .rp-card-header {
    padding: 14px 16px;
    gap: 8px;
  }

  .rp-card-header h6 {
    font-size: 10.5px;
  }

  .rp-card-header .rp-tag {
    font-size: 9.5px;
    padding: 2px 8px;
  }

  .rp-card-body {
    padding: 14px;
  }

  .rp-canvas-wrap {
    min-height: 200px;
  }

  .rp-trend-card .rp-card-body {
    padding: 16px;
  }

  .rp-trend-card .rp-canvas-wrap {
    min-height: 240px;
  }

  /* ── TOP CATEGORIES LIST ────────────────────────────────── */
  .rp-list-item {
    padding: 12px 0;
    gap: 10px;
  }

  .rp-list-rank {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .rp-list-name {
    font-size: 12.5px;
  }

  .rp-list-value {
    font-size: 12.5px;
  }

  /* ── ACTIVITY FEED ──────────────────────────────────────── */
  .rp-activity::before {
    left: 13px;
  }

  .rp-activity-item {
    padding: 10px 0;
    gap: 12px;
  }

  .rp-activity-dot {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }

  .rp-activity-title {
    font-size: 12.5px;
  }

  .rp-activity-time {
    font-size: 10.5px;
  }
}

/* Small phones */
@media (max-width: 576px) {
  .rp-page {
    padding: 10px;
  }

  .rp-header {
    padding: 14px;
    border-radius: 12px;
  }

  .rp-header h3 {
    font-size: 1.1rem;
  }

  .rp-header h3::before {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .rp-header p {
    font-size: 11.5px;
    margin-left: 44px;
  }

  .rp-controls {
    grid-template-columns: 1fr;
  }

  .rp-control-group {
    width: 100%;
  }

  .rp-btn-filter,
  .rp-btn-print {
    width: 100%;
    padding: 10px 14px;
  }

  /* ── HERO — Stack on very small ─────────────────────────── */
  .rp-hero {
    flex-direction: column;
    text-align: center;
    padding: 18px;
  }

  .rp-hero-text {
    text-align: center;
  }

  .rp-hero-text h1 {
    font-size: 2rem;
  }

  .rp-hero-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  /* ── STATS — Stay 2x2 ───────────────────────────────────── */
  .rp-stat {
    padding: 12px;
  }

  .rp-stat-icon {
    width: 36px;
    height: 36px;
  }

  .rp-stat-value {
    font-size: 17px;
  }

  /* ── CARDS ──────────────────────────────────────────────── */
  .rp-card {
    border-radius: 12px;
  }

  .rp-card-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .rp-canvas-wrap {
    min-height: 180px;
  }
}

/* Very tiny phones */
@media (max-width: 380px) {
  .rp-page {
    padding: 8px;
  }

  .rp-stat-row {
    gap: 8px;
  }

  .rp-stat {
    padding: 10px;
    gap: 8px;
  }

  .rp-stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .rp-stat-value {
    font-size: 16px;
  }

  .rp-stat-label {
    font-size: 9px;
  }
}

/* ── BOOTSTRAP OVERRIDES (since you're using Bootstrap grid) ──── */
.rp-page .row {
  margin: 0 -8px;
}

.rp-page .row > [class*="col-"] {
  padding: 0 8px;
}

@media (max-width: 768px) {
  .rp-page .row.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }

  .rp-page .row.g-3.mb-3 {
    margin-bottom: 0.75rem !important;
  }
}

/* ── LOADING / EMPTY STATES ───────────────────────────────────── */
.rp-card-body .fa-spinner {
  color: #2e7d32;
}

/* ── SMOOTH SCROLLBARS ────────────────────────────────────────── */
.rp-card-body::-webkit-scrollbar {
  width: 6px;
}

.rp-card-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.rp-card-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.rp-card-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── REDUCED MOTION ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .rp-list-bar-fill {
    transition: none !important;
  }
}
/* End of ticket report */

.container-fluid.py-3 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* ── HERO HEADER ──────────────────────────────────────────────── */
.users-hero {
  background: linear-gradient(135deg, #115e59 0%, #0f4c47 100%);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(17, 94, 89, 0.15);
}

.users-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(212, 175, 55, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.users-hero::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.users-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.users-hero h1 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  color: #ffffff;
  font-size: 1.85rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.2;
}

.users-hero h1 i {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 1.3rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fbbf24;
}

.users-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.users-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.users-hero-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.users-hero-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.users-hero-btn.primary {
  background: #ffffff;
  color: #115e59;
  border-color: #ffffff;
}

.users-hero-btn.primary:hover {
  background: #d4af37;
  color: #1e293b;
  border-color: #d4af37;
}

/* ── STATS CARDS ──────────────────────────────────────────────── */
.users-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.users-stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 28, 25, 0.03);
}

.users-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, #115e59);
}

.users-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 28, 25, 0.08);
}

.users-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: var(--stat-bg, rgba(17, 94, 89, 0.1));
  color: var(--stat-color, #115e59);
}

.users-stat-info {
  flex: 1;
  min-width: 0;
}

.users-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.users-stat-value {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}

/* Stat Color Variants */
.users-stat-card.blue {
  --stat-color: #3b82f6;
  --stat-bg: rgba(59, 130, 246, 0.1);
}
.users-stat-card.green {
  --stat-color: #10b981;
  --stat-bg: rgba(16, 185, 129, 0.1);
}
.users-stat-card.amber {
  --stat-color: #f59e0b;
  --stat-bg: rgba(245, 158, 11, 0.1);
}
.users-stat-card.purple {
  --stat-color: #8b5cf6;
  --stat-bg: rgba(139, 92, 246, 0.1);
}

/* ── FILTERS BAR ──────────────────────────────────────────────── */
.users-filters-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 12px rgba(15, 28, 25, 0.04);
}

.users-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.users-filter-label i {
  color: #115e59;
  font-size: 0.75rem;
}

.users-checkbox-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.users-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  padding: 0.4rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.users-checkbox-item:hover {
  border-color: #115e59;
  background: rgba(17, 94, 89, 0.02);
}

.users-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #115e59;
}

.users-checkbox-item label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0;
  cursor: pointer;
  line-height: 1;
}

.users-checkbox-item input[type="checkbox"]:checked ~ label {
  color: #115e59;
}

/* ── INPUT GROUPS ──────────────────────────────────────────────── */
.users-input-group {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.users-input-group:focus-within {
  border-color: #115e59;
  box-shadow: 0 0 0 3px rgba(17, 94, 89, 0.12);
}

.users-input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: #94a3b8;
  font-size: 0.85rem;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.users-input-group:focus-within .users-input-icon {
  background: rgba(17, 94, 89, 0.05);
  color: #115e59;
}

.users-input-group input,
.users-input-group select {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  background: transparent;
  font-family: inherit;
  min-width: 0;
}

.users-input-group input::placeholder {
  color: #94a3b8;
}

.users-input-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2rem;
}

.users-input-clear {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  background: #ffffff;
  border: none;
  border-left: 1px solid #e2e8f0;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.users-input-clear:hover {
  color: #ef4444;
}

.users-input-clear.visible {
  display: flex;
}

/* ── TABLE CARD ───────────────────────────────────────────────── */
.users-table-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 28, 25, 0.04);
}

/* ── TABLE TOOLBAR ────────────────────────────────────────────── */
.users-table-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.users-table-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.users-table-title i {
  color: #115e59;
}

.users-table-meta {
  font-size: 0.78rem;
  color: #64748b;
}

.users-table-meta strong {
  color: #115e59;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════
   THE MAIN TABLE — STAYS SIDE-BY-SIDE ON MOBILE
   ════════════════════════════════════════════════════════════════ */
.users-table-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fade gradient hint on the right edge */
.users-table-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.95)
  );
  pointer-events: none;
  z-index: 1;
}

.users-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.users-table thead {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.users-table thead th {
  padding: 0.75rem 1rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  background: inherit;
}

.users-table thead th.text-center {
  text-align: center;
}

.users-table thead th i {
  color: #115e59;
  margin-right: 0.25rem;
  font-size: 0.7rem;
  opacity: 0.8;
}

.users-table tbody tr {
  transition: all 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}

.users-table tbody tr:last-child {
  border-bottom: none;
}

.users-table tbody tr:hover {
  background: #f8fafc;
  transform: scale(1.001);
  box-shadow: 0 2px 8px rgba(15, 28, 25, 0.04);
}

.users-table tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  vertical-align: middle;
  border: none;
  white-space: nowrap;
}

.users-table tbody td.text-center {
  text-align: center;
}

/* ── NAME CELL WITH AVATAR ────────────────────────────────────── */
.users-table .name-cell {
  color: #1e293b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 180px;
}

.users-table .name-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #115e59 0%, #0f4c47 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(17, 94, 89, 0.2);
}

.users-table .email-cell {
  color: #115e59;
  font-weight: 600;
  font-size: 0.8rem;
}

.users-table .department-cell,
.users-table .branch-cell {
  color: #475569;
  font-size: 0.8rem;
}

.users-table .contact-cell {
  color: #475569;
  font-size: 0.8rem;
  font-family: "JetBrains Mono", monospace;
}

.users-table .type-cell {
  background: #f1f5f9;
  color: #475569;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.users-table .date-cell {
  color: #64748b;
  font-size: 0.78rem;
}

/* ── STATE BADGES ─────────────────────────────────────────────── */
.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.state-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state-badge.approved {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

.state-badge.pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
}

.state-badge.pending i {
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ── ACTION BUTTONS ───────────────────────────────────────────── */
.users-table .action-buttons {
  display: inline-flex;
  gap: 0.3rem;
  justify-content: center;
  align-items: center;
}

.users-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #ffffff;
  flex-shrink: 0;
  font-family: inherit;
}

.users-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.users-action-btn.edit {
  background: linear-gradient(135deg, #115e59 0%, #0f4c47 100%);
}

.users-action-btn.edit:hover {
  box-shadow: 0 4px 8px rgba(17, 94, 89, 0.3);
}

.users-action-btn.delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.users-action-btn.delete:hover {
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.users-action-btn.approve {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.users-action-btn.approve:hover {
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.users-table th:last-child,
.users-table td:last-child {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* ── EMPTY / LOADING / SKELETON ───────────────────────────────── */
.users-empty-state,
.users-loading-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.users-loading-state {
  padding: 1.5rem;
}

.users-empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #94a3b8;
}

.users-empty-state h5 {
  color: #1e293b;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.users-empty-state p {
  font-size: 0.85rem;
  margin: 0;
  color: #64748b;
}

/* Skeleton Loading */
.skeleton-row {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.skeleton-box {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 16px;
}

.skeleton-row .skeleton-box {
  flex: 1;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

/* ── REDUCED MOTION ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .users-table tr:hover {
    transform: none !important;
  }
}
.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 100px;
}

.action-buttons .btn {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-buttons .btn i {
  font-size: 12px;
}

/* Tablet */
@media (max-width: 992px) {
  .action-buttons {
    gap: 4px;
  }

  .action-buttons .btn {
    padding: 3px 8px;
    font-size: 11px;
  }
}

@page {
    size: A4;
    margin: 12mm 10mm 20mm 10mm; /* reserve bottom margin for footer */
}

@media print {
    /* ── Hide all UI ── */
    body * {
        visibility: hidden;
    }
    #printableArea,
    #printableArea * {
        visibility: visible;
    }
    #printableArea {
        position: relative;
        display: block;
        width: 100%;
        padding: 6px 10px 40px 10px;
        background: white;
        font-size: 15px;   /* base size – adjust as needed */
        line-height: 1.4;
        box-sizing: border-box;
    }

    /* ── HEADER ── */
    .print-header {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border-bottom: 2px solid #333;
        padding: 0 0 8px 0;
        margin: 0 0 10px 0;
        page-break-after: avoid;
    }
    .print-header img {
        max-height: 40px;
        width: auto;
    }
    .print-header .title {
        font-size: 22px;
        font-weight: bold;
        color: #000;
    }
    .print-header .subtitle {
        font-size: 14px;
        color: #555;
    }

    /* ── GRIDS ── */
    .grid-3 {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px 12px;
        margin-bottom: 8px;
        page-break-inside: avoid;
    }
    .grid-2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px 12px;
        margin-bottom: 8px;
        page-break-inside: avoid;
    }
    label {
        font-size: 10px !important;
        color: #555;
        display: block;
        font-weight: bold;
        margin-bottom: 2px;
    }
    .field-value {
        font-weight: bold;
        border-bottom: 1px solid #000;
        padding: 3px 0;
        font-size: 12px;
        min-height: 18px;
    }
    #p_description {
        padding: 5px 8px;
        border: 1px solid #ccc;
        border-radius: 3px;
        font-size: 12px;
        min-height: 25px;
        background: #fafafa;
        page-break-inside: avoid;
    }
    h4 {
        border-bottom: 2px solid #333 !important;
        padding-bottom: 3px;
        font-size: 14px !important;
        margin: 8px 0 5px 0 !important;
        page-break-after: avoid;
    }

    /* ── CONVERSATION ── */
    #p_chat {
        padding: 5px 8px;
        border: 1px solid #ddd;
        border-radius: 3px;
        min-height: 45px;
        background: #fafafa;
        font-size: 11px;
        page-break-inside: avoid;
    }

    /* ── ATTACHMENT PAGE ── */
    .attachment-page {
        page-break-before: always;
        break-before: page;
        page-break-after: avoid;
        margin-top: 0;
        padding-top: 4px;
        border-top: none;
        display: flex;
        flex-direction: column;
        height: 90vh;
        max-height: 90vh;
        box-sizing: border-box;
    }
    #p_attachment_content {
        flex: 1 1 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px;
        overflow: hidden;
        min-height: 50px;
    }
    #p_attachment_content img {
        max-width: 90%;
        max-height: 75vh;
        width: auto;
        height: auto;
        object-fit: contain;
        border: 1px solid #ddd;
        padding: 4px;
    }
    #p_attachment_chat {
        flex: 0 1 auto;
        max-height: 25vh;
        overflow-y: auto;
        padding: 5px 8px;
        border-top: 1px solid #ccc;
        font-size: 10px;
        background: #fafafa;
        margin-top: 5px;
    }

    /* ── SIGNATURES ── */
    .signature-section {
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #ddd;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
        text-align: center;
        page-break-inside: avoid;
    }
    .signature-line {
        font-weight: bold;
        border-bottom: 1px solid #000;
        padding: 3px 0;
        font-size: 12px;
        margin-top: 4px;
    }

    /* ── FOOTER – ON EVERY PAGE ── */
    .print-footer {
        position: running(footer); /* CSS Paged Media – works in modern browsers */
        display: block;
        width: 100%;
        background: white;
        border-top: 1px solid #ccc;
        padding: 4px 10px;
        font-size: 30px;
        text-align: center;
        line-height: 1.3;
        color: #555;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* If your browser doesn't support `running()`, fallback to fixed */
    @supports not (position: running(footer)) {
        .print-footer {
            position: fixed !important;
            bottom: 0 !important;
            left: 0 !important;
            right: 0 !important;
            z-index: 9999;
        }
    }

    /* ── HIDE UI ── */
    .btn, button, .no-print, .d-print-none,
    .modal, .modal-backdrop, .filter-section,
    .table-container, .card-footer, .navbar,
    .tk-modal, .tk-toolbar, .tk-stats {
        display: none !important;
    }

    /* ── AVOID PAGE BREAKS ── */
    .row, .col-md-4, .col-md-6, .col-lg-6,
    .grid-3, .grid-2, .signature-section,
    .print-header {
        page-break-inside: avoid;
    }

    /* ── Ensure footer appears on every page ── */
    @page {
        @bottom-center {
            content: element(footer);
        }
    }
}